@jskit-ai/release 0.1.1 → 0.1.3

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/release.mjs +11 -3
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jskit-ai/release",
3
- "version": "0.1.1",
3
+ "version": "0.1.3",
4
4
  "description": "Selective npm release preparation, publication and dependency pinning for package repositories.",
5
5
  "type": "module",
6
6
  "files": [
package/src/release.mjs CHANGED
@@ -10,6 +10,8 @@ import { createPublicationInspection, planPublication, snapshotFiles } from "./n
10
10
  // declared in the root package.json `jskitRelease` field:
11
11
  // prepare command that regenerates derived files during preparation
12
12
  // nestedManifests package subdirectories whose package.json pins follow the release
13
+ // manifests further package directories (or `*` patterns) the repository owns
14
+ // without declaring them as npm workspaces
13
15
  // and per package in its own `jskitRelease` field:
14
16
  // pack command printing a custom tarball path (see npm-publication.mjs)
15
17
  // versionFiles JSON files whose `version` must equal the package version
@@ -132,12 +134,15 @@ async function expandWorkspacePattern(repoRoot, pattern) {
132
134
  return directories;
133
135
  }
134
136
 
135
- // Every manifest the repository owns: the root, its workspaces and `file:`
136
- // dependency directories inside the repository (followed transitively).
137
+ // Every manifest the repository owns: the root, its workspaces, its declared
138
+ // `jskitRelease.manifests` and `file:` dependency directories inside the
139
+ // repository (followed transitively).
137
140
  async function discoverManifests(repoRoot) {
138
141
  const root = path.resolve(repoRoot);
139
142
  const rootJson = await readJsonFile(path.join(root, "package.json"));
140
- const patterns = Array.isArray(rootJson.workspaces) ? rootJson.workspaces : rootJson.workspaces?.packages || [];
143
+ const workspaces = Array.isArray(rootJson.workspaces) ? rootJson.workspaces : rootJson.workspaces?.packages || [];
144
+ const declared = Array.isArray(rootJson.jskitRelease?.manifests) ? rootJson.jskitRelease.manifests : [];
145
+ const patterns = [...workspaces, ...declared];
141
146
  const queue = [root];
142
147
  for (const pattern of patterns) {
143
148
  if (!String(pattern).startsWith("!")) queue.push(...(await expandWorkspacePattern(root, pattern)).sort());
@@ -715,6 +720,9 @@ async function installReleasedPins(repoRoot, { attempts = 20, delayMs = Number(p
715
720
  throw new Error(`npm install failed in ${repoRoot}.`);
716
721
  }
717
722
  process.stdout.write(`npm does not serve the new versions yet; retrying in ${Math.round(delayMs / 1000)} s (${attempt}/${attempts})\n`);
723
+ // --prefer-online still reuses a cached package list that predates the
724
+ // release; observed in a real deploy. Drop it so the retry sees the registry.
725
+ spawnSync("npm", ["cache", "clean", "--force"], { cwd: repoRoot, stdio: "ignore" });
718
726
  await new Promise(resolve => setTimeout(resolve, delayMs));
719
727
  }
720
728
  }