@jskit-ai/release 0.1.3 → 0.1.4
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 +13 -2
package/package.json
CHANGED
package/src/release.mjs
CHANGED
|
@@ -15,7 +15,7 @@ import { createPublicationInspection, planPublication, snapshotFiles } from "./n
|
|
|
15
15
|
// and per package in its own `jskitRelease` field:
|
|
16
16
|
// pack command printing a custom tarball path (see npm-publication.mjs)
|
|
17
17
|
// versionFiles JSON files whose `version` must equal the package version
|
|
18
|
-
const USAGE = "Usage: jskit-release <prepare|publish|pin> [--cwd <dir>] [--dry-run] [--registry <url>] [--from <repoDir>...]";
|
|
18
|
+
const USAGE = "Usage: jskit-release <prepare|publish|pin> [--cwd <dir>] [--dry-run] [--registry <url>] [--from <repoDir>...] [--no-commit]";
|
|
19
19
|
const DEPENDENCY_FIELDS = Object.freeze([
|
|
20
20
|
"dependencies",
|
|
21
21
|
"devDependencies",
|
|
@@ -35,6 +35,7 @@ function parseArgs(argv = []) {
|
|
|
35
35
|
intent,
|
|
36
36
|
cwd: process.cwd(),
|
|
37
37
|
dryRun: false,
|
|
38
|
+
noCommit: false,
|
|
38
39
|
registry: DEFAULT_REGISTRY,
|
|
39
40
|
from: []
|
|
40
41
|
};
|
|
@@ -45,6 +46,10 @@ function parseArgs(argv = []) {
|
|
|
45
46
|
options.dryRun = true;
|
|
46
47
|
continue;
|
|
47
48
|
}
|
|
49
|
+
if (argument === "--no-commit" && intent === "pin") {
|
|
50
|
+
options.noCommit = true;
|
|
51
|
+
continue;
|
|
52
|
+
}
|
|
48
53
|
const [name, inline] = argument.startsWith("--") && argument.includes("=")
|
|
49
54
|
? [argument.slice(0, argument.indexOf("=")), argument.slice(argument.indexOf("=") + 1)] : [argument, undefined];
|
|
50
55
|
if (name === "--cwd" || (name === "--from" && intent === "pin")) {
|
|
@@ -730,7 +735,9 @@ async function installReleasedPins(repoRoot, { attempts = 20, delayMs = Number(p
|
|
|
730
735
|
// pin: make every dependency on a package published from the given
|
|
731
736
|
// repositories follow that package's current version, keeping ^/~, then
|
|
732
737
|
// install, commit and push. Moved from Vibe64 Online's deploy orchestrator.
|
|
733
|
-
|
|
738
|
+
// --no-commit stops after the install, leaving the edits for the caller to
|
|
739
|
+
// build from and discard (a deploy rehearsal).
|
|
740
|
+
async function pinCommand({ cwd: repoRoot, from, dryRun, noCommit }) {
|
|
734
741
|
const versions = new Map();
|
|
735
742
|
for (const dir of from) {
|
|
736
743
|
for (const record of await discoverReleasePackages(dir)) versions.set(record.name, record.packageJson.version);
|
|
@@ -754,6 +761,10 @@ async function pinCommand({ cwd: repoRoot, from, dryRun }) {
|
|
|
754
761
|
return;
|
|
755
762
|
}
|
|
756
763
|
await installReleasedPins(repoRoot);
|
|
764
|
+
if (noCommit) {
|
|
765
|
+
process.stdout.write(`${path.basename(repoRoot)}: pins installed; not committed\n`);
|
|
766
|
+
return;
|
|
767
|
+
}
|
|
757
768
|
commitAndPush(repoRoot, "Consume released packages");
|
|
758
769
|
}
|
|
759
770
|
|