mirror of
https://github.com/trailbaseio/trailbase.git
synced 2026-01-08 10:50:15 -06:00
Use --prefer-offline over plain --offline for installing JS deps.
This commit is contained in:
1955
examples/collab-clicker-ssr/pnpm-lock.yaml
generated
1955
examples/collab-clicker-ssr/pnpm-lock.yaml
generated
File diff suppressed because it is too large
Load Diff
@@ -9,8 +9,11 @@ packages:
|
||||
- 'trailbase-assets/js/auth'
|
||||
- 'trailbase-assets/js/client'
|
||||
- 'trailbase-js/assets/runtime'
|
||||
options:
|
||||
link-workspace-packages: true
|
||||
prefer-workspace-packages: true
|
||||
strict-peer-dependencies: true
|
||||
# shared-workspace-lockfile: false
|
||||
|
||||
sharedWorkspaceLockfile: true
|
||||
linkWorkspacePackages: true
|
||||
preferWorkspacePackages: true
|
||||
preferOffline: true
|
||||
preferFrozenLockfile: true
|
||||
# strictPeerDependencies: false
|
||||
disallowWorkspaceCycles: true
|
||||
|
||||
@@ -91,10 +91,17 @@ pub fn build_js(path: impl AsRef<Path>) -> Result<()> {
|
||||
// When we build cargo packages, we cannot rely on the workspace and prior installs.
|
||||
pnpm_run(&["--dir", &path, "install", "--ignore-workspace"])
|
||||
} else {
|
||||
// `trailbase-asstes` and `trailbase-js` both build JS packages. We've seen issues with
|
||||
// parallel installs in the past. We thus require all JS depdencies to be installed once
|
||||
// upfront centrally into the workspace, i.e. `<trailbase>/node_modules`.
|
||||
let args = ["--dir", &path, "install", "--frozen-lockfile", "--offline"];
|
||||
// `trailbase-assets` and `trailbase-js` both build JS packages. We've seen issues with
|
||||
// parallel installs in the past. Our current approach is to recommend installing workspace
|
||||
// JS deps upfront in combination with `--prefer-offline`. We used to use plain `--offline`,
|
||||
// however this adds an extra mandatory step when vendoring trailbase for framework use-cases.
|
||||
let args = [
|
||||
"--dir",
|
||||
&path,
|
||||
"install",
|
||||
"--prefer-frozen-lockfile",
|
||||
"--prefer-offline",
|
||||
];
|
||||
let build_result = pnpm_run(&args);
|
||||
if build_result.is_err() {
|
||||
error!(
|
||||
|
||||
Reference in New Issue
Block a user