@jskit-ai/jskit-catalog 0.2.33 → 0.2.34

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jskit-ai/jskit-catalog",
3
- "version": "0.2.33",
3
+ "version": "0.2.34",
4
4
  "description": "Published metadata catalog for JSKIT package metadata.",
5
5
  "type": "module",
6
6
  "files": [
@@ -117,10 +117,13 @@ function browserTestConfig({
117
117
  // process takes the environment prepare gave that server, such as its DB_NAME, before any test file loads.
118
118
  const workerIndex = managed ? 0 : Number.parseInt(String(environment.TEST_PARALLEL_INDEX || "0"), 10) || 0;
119
119
  const workerEnvironments = path.resolve(cwd, WORKER_ENVIRONMENTS, `workers-${basePort}.json`);
120
- // A login state the host supplies is used as it is; the servers sign in only when there is none.
121
- const signedInStates = signIn && !managed && !String(environment.PLAYWRIGHT_STORAGE_STATE || "").trim()
122
- ? path.resolve(cwd, WORKER_ENVIRONMENTS, `signed-in-${basePort}`)
123
- : "";
120
+ // A login state the host supplies is used as it is; the servers sign in only when there is none. A worker of a
121
+ // project that depends on another (a setup project) inherits the environment that project's workers changed,
122
+ // including the state this harness gave them, so one of this harness's own states is never taken for the host's.
123
+ const ownStates = path.resolve(cwd, WORKER_ENVIRONMENTS, `signed-in-${basePort}`);
124
+ const suppliedState = String(environment.PLAYWRIGHT_STORAGE_STATE || "").trim();
125
+ const hostState = suppliedState.startsWith(`${ownStates}-`) ? "" : suppliedState;
126
+ const signedInStates = signIn && !managed && !hostState ? ownStates : "";
124
127
  if (!managed && environment.TEST_PARALLEL_INDEX !== undefined) {
125
128
  Object.assign(environment, preparedWorkerEnvironment(workerEnvironments, workerIndex));
126
129
  if (signedInStates) environment.PLAYWRIGHT_STORAGE_STATE = `${signedInStates}-${workerIndex}.json`;
@@ -364,9 +364,17 @@ async function preparePackageLockForInstall(projectRoot, manifests, packageLockP
364
364
  const next = structuredClone(packageLock.value);
365
365
  const localPackageNames = collectLocalPackageNames(manifests);
366
366
  if (next.packages && typeof next.packages === "object" && !Array.isArray(next.packages)) {
367
- for (const [packagePath, record] of Object.entries(next.packages)) {
368
- const packageId = resolveLockPackageName(packagePath, record);
369
- if (packageId && record?.link !== true && !localPackageNames.has(packageId)) {
367
+ const removedPaths = Object.entries(next.packages)
368
+ .filter(([packagePath, record]) => {
369
+ const packageId = resolveLockPackageName(packagePath, record);
370
+ return packageId && record?.link !== true && !localPackageNames.has(packageId);
371
+ })
372
+ .map(([packagePath]) => packagePath);
373
+ // A removed package's nested dependencies go with it. Left behind without
374
+ // their parent, npm install drops them from the lock it writes while the
375
+ // new version still needs them nested, and npm ci then refuses that lock.
376
+ for (const packagePath of Object.keys(next.packages)) {
377
+ if (removedPaths.some((removed) => packagePath === removed || packagePath.startsWith(`${removed}/`))) {
370
378
  delete next.packages[packagePath];
371
379
  }
372
380
  }