@stacksjs/actions 0.70.154 → 0.70.155
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.
|
@@ -43,6 +43,14 @@ export declare function readSyncedVersion(versionFilePath: string): SyncedVersio
|
|
|
43
43
|
* Persist the last-synced channel + sha to `.stacks-version`.
|
|
44
44
|
*/
|
|
45
45
|
export declare function writeSyncedVersion(versionFilePath: string, ch: 'stable' | 'canary', sha: string): void;
|
|
46
|
+
/**
|
|
47
|
+
* Decide whether the upgrade must protect framework-managed paths from local
|
|
48
|
+
* edits. The initial process always owns this preflight unless the user passed
|
|
49
|
+
* `--force`. An internal restart runs only after that validated parent has
|
|
50
|
+
* intentionally replaced those paths, so checking again would reject the
|
|
51
|
+
* upgrade's own writes as if they belonged to the user.
|
|
52
|
+
*/
|
|
53
|
+
export declare function shouldCheckDirtyManagedPaths(args: { force: boolean, alreadyRestarted: boolean }): boolean;
|
|
46
54
|
/**
|
|
47
55
|
* Pure decision for the "already up to date" short-circuit. Returns true only
|
|
48
56
|
* when a sync can be safely skipped: no override flags, not a pinned version,
|
|
@@ -53,6 +53,9 @@ export function writeSyncedVersion(versionFilePath, ch, sha) {
|
|
|
53
53
|
writeFileSync(versionFilePath, `${ch} ${sha}`, "utf-8");
|
|
54
54
|
} catch {}
|
|
55
55
|
}
|
|
56
|
+
export function shouldCheckDirtyManagedPaths(args) {
|
|
57
|
+
return !args.force && !args.alreadyRestarted;
|
|
58
|
+
}
|
|
56
59
|
export function shouldShortCircuit(args) {
|
|
57
60
|
const { force, targetVersion, remoteSha, synced, channel } = args;
|
|
58
61
|
if (force || targetVersion)
|
|
@@ -19,6 +19,7 @@ import {
|
|
|
19
19
|
resolveUpgradeContext,
|
|
20
20
|
resolveUpgradeMessage,
|
|
21
21
|
shouldAutoDetectLocalStacks,
|
|
22
|
+
shouldCheckDirtyManagedPaths,
|
|
22
23
|
shouldShortCircuit,
|
|
23
24
|
snapshotTree,
|
|
24
25
|
writeChannel,
|
|
@@ -44,7 +45,8 @@ if (options.dryRun) {
|
|
|
44
45
|
await runDryRunPreview();
|
|
45
46
|
process.exit(ExitCode.Success);
|
|
46
47
|
}
|
|
47
|
-
|
|
48
|
+
const alreadyRestarted = process.argv.includes("--__restarted");
|
|
49
|
+
if (shouldCheckDirtyManagedPaths({ force: !!options.force, alreadyRestarted })) {
|
|
48
50
|
const dirty = await detectDirtyManagedPaths(projectRoot);
|
|
49
51
|
if (dirty.length > 0) {
|
|
50
52
|
console.warn(`
|
|
@@ -91,7 +93,7 @@ try {
|
|
|
91
93
|
console.error("\u2718 Failed to upgrade Stacks framework:", err?.message || err);
|
|
92
94
|
process.exit(ExitCode.FatalError);
|
|
93
95
|
}
|
|
94
|
-
const newVersion = readVersion(corePkgPath), ownHashAfter = await hashFileOrZero(ownPath)
|
|
96
|
+
const newVersion = readVersion(corePkgPath), ownHashAfter = await hashFileOrZero(ownPath);
|
|
95
97
|
if (ownHashBefore !== 0n && ownHashAfter !== 0n && ownHashBefore !== ownHashAfter && !alreadyRestarted) {
|
|
96
98
|
console.log(`Upgrade pulled a newer version of the upgrade action \u2014 re-running once to pick up new sync paths and hooks.
|
|
97
99
|
`);
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@stacksjs/actions",
|
|
3
3
|
"type": "module",
|
|
4
4
|
"sideEffects": false,
|
|
5
|
-
"version": "0.70.
|
|
5
|
+
"version": "0.70.155",
|
|
6
6
|
"description": "The Stacks actions.",
|
|
7
7
|
"author": "Chris Breuer",
|
|
8
8
|
"contributors": [
|
|
@@ -62,7 +62,7 @@
|
|
|
62
62
|
"prepublishOnly": "bun run build"
|
|
63
63
|
},
|
|
64
64
|
"dependencies": {
|
|
65
|
-
"@stacksjs/config": "0.70.
|
|
65
|
+
"@stacksjs/config": "0.70.155",
|
|
66
66
|
"@stacksjs/bumpx": "^0.2.6",
|
|
67
67
|
"@stacksjs/bunpress": "^0.1.12",
|
|
68
68
|
"@stacksjs/logsmith": "^0.2.3",
|
|
@@ -70,23 +70,23 @@
|
|
|
70
70
|
"@stacksjs/ts-md": "^0.1.1"
|
|
71
71
|
},
|
|
72
72
|
"devDependencies": {
|
|
73
|
-
"@stacksjs/api": "0.70.
|
|
74
|
-
"@stacksjs/cli": "0.70.
|
|
75
|
-
"@stacksjs/config": "0.70.
|
|
76
|
-
"@stacksjs/database": "0.70.
|
|
73
|
+
"@stacksjs/api": "0.70.155",
|
|
74
|
+
"@stacksjs/cli": "0.70.155",
|
|
75
|
+
"@stacksjs/config": "0.70.155",
|
|
76
|
+
"@stacksjs/database": "0.70.155",
|
|
77
77
|
"@stacksjs/tlsx": "^0.13.2",
|
|
78
78
|
"better-dx": "^0.2.17",
|
|
79
|
-
"@stacksjs/dns": "0.70.
|
|
80
|
-
"@stacksjs/enums": "0.70.
|
|
81
|
-
"@stacksjs/env": "0.70.
|
|
82
|
-
"@stacksjs/error-handling": "0.70.
|
|
83
|
-
"@stacksjs/logging": "0.70.
|
|
84
|
-
"@stacksjs/path": "0.70.
|
|
85
|
-
"@stacksjs/security": "0.70.
|
|
86
|
-
"@stacksjs/storage": "0.70.
|
|
87
|
-
"@stacksjs/strings": "0.70.
|
|
88
|
-
"@stacksjs/utils": "0.70.
|
|
89
|
-
"@stacksjs/validation": "0.70.
|
|
79
|
+
"@stacksjs/dns": "0.70.155",
|
|
80
|
+
"@stacksjs/enums": "0.70.155",
|
|
81
|
+
"@stacksjs/env": "0.70.155",
|
|
82
|
+
"@stacksjs/error-handling": "0.70.155",
|
|
83
|
+
"@stacksjs/logging": "0.70.155",
|
|
84
|
+
"@stacksjs/path": "0.70.155",
|
|
85
|
+
"@stacksjs/security": "0.70.155",
|
|
86
|
+
"@stacksjs/storage": "0.70.155",
|
|
87
|
+
"@stacksjs/strings": "0.70.155",
|
|
88
|
+
"@stacksjs/utils": "0.70.155",
|
|
89
|
+
"@stacksjs/validation": "0.70.155"
|
|
90
90
|
},
|
|
91
91
|
"peerDependencies": {
|
|
92
92
|
"pickier": "^0.1.35"
|