@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.
- package/package.json +1 -1
- package/src/release.mjs +11 -3
package/package.json
CHANGED
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
|
|
136
|
-
// dependency directories inside the
|
|
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
|
|
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
|
}
|