@stacksjs/actions 0.75.287 → 0.75.288
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/dist/upgrade/packages.d.ts +4 -0
- package/dist/upgrade/packages.js +2 -2
- package/package.json +40 -40
|
@@ -10,6 +10,10 @@ export declare function frameworkPackageUpdateCommand(force?: boolean): string;
|
|
|
10
10
|
export declare function installedStacksVersion(projectRoot: string): string | null;
|
|
11
11
|
/** Whether the declared target still needs to be installed locally. */
|
|
12
12
|
export declare function needsFrameworkInstall(projectRoot: string, target: string): boolean;
|
|
13
|
+
/** Independently versioned frontend packages paired with a published framework. */
|
|
14
|
+
export declare function publishedRuntimePins(dependencies: Record<string, string>): Record<string, string>;
|
|
15
|
+
/** Align existing direct declarations and flat installer rules; never add dependencies. */
|
|
16
|
+
export declare function applyRuntimePins(pkg: PkgJson, pins: Record<string, string>): Array<{ name: string, from: string, to: string, field?: 'overrides' | 'resolutions' }>;
|
|
13
17
|
/** Strip a range operator (`^`, `~`, `>=`, …) so a declared range compares to a bare version. */
|
|
14
18
|
export declare function baseVersion(range: string): string;
|
|
15
19
|
/*` tooling
|
package/dist/upgrade/packages.js
CHANGED
|
@@ -2,9 +2,9 @@ import{existsSync,lstatSync,readdirSync,readFileSync,writeFileSync}from"node:fs"
|
|
|
2
2
|
Standalone package detected. No Stacks framework source is installed.`);if(options.dryRun){console.log(" --dry-run: would refresh the package dependencies with `bun update`. No files were changed.\n");process.exit(0)}if(options.noPostinstall){console.log(" --no-postinstall: skipping the dependency refresh. Run `bun update` when ready.\n");process.exit(0)}console.log(` Refreshing declared dependencies...
|
|
3
3
|
`);if((await runCommand(standalonePackageUpdateCommand(),{cwd:projectRoot})).isErr){console.error("\n\u2717 The dependency refresh failed. Resolve the reported error and re-run `buddy update`.\n");process.exit(1)}console.log(`
|
|
4
4
|
\u2714 Standalone package dependencies are up to date.
|
|
5
|
-
`);process.exit(0)}async function resolveTarget(options){const res=await fetch("https://registry.npmjs.org/stacks").catch(()=>null);if(!res||!res.ok)throw Error("Could not reach the npm registry to resolve the target `stacks` version.");const meta=await res.json(),distTags=meta["dist-tags"]??{},versions=meta.versions??{};let version;if(options.version){if(!versions[options.version])throw Error(`stacks@${options.version} was not found on the npm registry.`);version=options.version}else{const tag=options.canary?"canary":"latest",resolved=distTags[tag];if(!resolved)throw Error(`The \`${tag}\` dist-tag is not published for \`stacks\`.`);version=resolved}const metaDeps=versions[version]?.dependencies??{};return{version,metaDeps}}export function baseVersion(range){return range.replace(/^[\^~>=<\s]+/,"").trim()}export function lockstepPackages(metaDeps,target){const lockstep=new Set(["stacks"]);for(const[name,range]of Object.entries(metaDeps))if(name.startsWith("@stacksjs/")&&baseVersion(range)===target)lockstep.add(name);return lockstep}export function applyBumps(pkg,target,lockstep){const changes=[];for(const field of["dependencies","devDependencies"]){const deps=pkg[field];if(!deps)continue;for(const[name,spec]of Object.entries(deps)){if(!lockstep.has(name))continue;const next=`${/^[\^~]/.test(spec)?spec[0]:/^\d/.test(spec)?"":"^"}${target}`;if(spec!==next){changes.push({name,from:spec,to:next});deps[name]=next}}}for(const field of["overrides","resolutions"]){const rules=pkg[field];if(!rules||typeof rules!=="object"||Array.isArray(rules))continue;for(const[name,spec]of Object.entries(rules)){if(!lockstep.has(name)||typeof spec!=="string"||!/^[\^~]?\d/.test(spec))continue;const next=resolveManifestSpec(name,spec,target);if(!next)continue;changes.push({name,from:spec,to:next,field});rules[name]=next}}return changes}export async function upgradeStacksPackages(projectRoot,options){const pkgPath=join(projectRoot,"package.json");if(!existsSync(pkgPath)){console.error("No package.json found - nothing to upgrade.");process.exit(1)}const raw=readFileSync(pkgPath,"utf-8"),pkg=JSON.parse(raw),current=pkg.dependencies?.stacks??pkg.devDependencies?.stacks;if(!hasStacksDependency(pkg))return updateStandalonePackage(projectRoot,options);const{version:target,metaDeps}=await resolveTarget(options).catch((err)=>{console.error(`\u2717 ${err.message}`);process.exit(1)});console.log(`
|
|
5
|
+
`);process.exit(0)}async function resolveTarget(options){const res=await fetch("https://registry.npmjs.org/stacks").catch(()=>null);if(!res||!res.ok)throw Error("Could not reach the npm registry to resolve the target `stacks` version.");const meta=await res.json(),distTags=meta["dist-tags"]??{},versions=meta.versions??{};let version;if(options.version){if(!versions[options.version])throw Error(`stacks@${options.version} was not found on the npm registry.`);version=options.version}else{const tag=options.canary?"canary":"latest",resolved=distTags[tag];if(!resolved)throw Error(`The \`${tag}\` dist-tag is not published for \`stacks\`.`);version=resolved}const metaDeps=versions[version]?.dependencies??{},actions=await fetch(`https://registry.npmjs.org/@stacksjs%2factions/${version}`);if(!actions.ok)throw Error(`Could not resolve the frontend dependencies shipped by @stacksjs/actions@${version}.`);const manifest=await actions.json();if(manifest.version!==version)throw Error("The published actions manifest does not match the requested framework release.");return{version,metaDeps,runtimePins:publishedRuntimePins(manifest.dependencies??{})}}export function publishedRuntimePins(dependencies){const pins={};for(const name of["@stacksjs/stx","@stacksjs/components","bun-plugin-stx"]){const version=dependencies[name];if(version&&/^\d+\.\d+\.\d+(?:-[\w.-]+)?$/.test(version))pins[name]=version}return pins}export function applyRuntimePins(pkg,pins){const changes=[];for(const field of["dependencies","devDependencies","overrides","resolutions"]){const declarations=pkg[field];if(!declarations||typeof declarations!=="object"||Array.isArray(declarations))continue;for(const[name,target]of Object.entries(pins)){const spec=declarations[name];if(typeof spec!=="string"||!/^[\^~]?\d+\.\d+\.\d+(?:-[\w.-]+)?$/.test(spec))continue;const next=`${/^[\^~]/.test(spec)?spec[0]:""}${target}`;if(next===spec)continue;changes.push({name,from:spec,to:next,...field==="overrides"||field==="resolutions"?{field}:{}});declarations[name]=next}}return changes}export function baseVersion(range){return range.replace(/^[\^~>=<\s]+/,"").trim()}export function lockstepPackages(metaDeps,target){const lockstep=new Set(["stacks"]);for(const[name,range]of Object.entries(metaDeps))if(name.startsWith("@stacksjs/")&&baseVersion(range)===target)lockstep.add(name);return lockstep}export function applyBumps(pkg,target,lockstep){const changes=[];for(const field of["dependencies","devDependencies"]){const deps=pkg[field];if(!deps)continue;for(const[name,spec]of Object.entries(deps)){if(!lockstep.has(name))continue;const next=`${/^[\^~]/.test(spec)?spec[0]:/^\d/.test(spec)?"":"^"}${target}`;if(spec!==next){changes.push({name,from:spec,to:next});deps[name]=next}}}for(const field of["overrides","resolutions"]){const rules=pkg[field];if(!rules||typeof rules!=="object"||Array.isArray(rules))continue;for(const[name,spec]of Object.entries(rules)){if(!lockstep.has(name)||typeof spec!=="string"||!/^[\^~]?\d/.test(spec))continue;const next=resolveManifestSpec(name,spec,target);if(!next)continue;changes.push({name,from:spec,to:next,field});rules[name]=next}}return changes}export async function upgradeStacksPackages(projectRoot,options){const pkgPath=join(projectRoot,"package.json");if(!existsSync(pkgPath)){console.error("No package.json found - nothing to upgrade.");process.exit(1)}const raw=readFileSync(pkgPath,"utf-8"),pkg=JSON.parse(raw),current=pkg.dependencies?.stacks??pkg.devDependencies?.stacks;if(!hasStacksDependency(pkg))return updateStandalonePackage(projectRoot,options);const{version:target,metaDeps,runtimePins}=await resolveTarget(options).catch((err)=>{console.error(`\u2717 ${err.message}`);process.exit(1)});console.log(`
|
|
6
6
|
Upgrading the Stacks framework${options.canary?" (canary)":""} \u2192 ${target}`);if(current)console.log(` current \`stacks\` constraint: ${current}
|
|
7
|
-
`);const lockstep=lockstepPackages(metaDeps,target),changes=applyBumps(pkg,target,lockstep),projectManifestChanges=migratePackageProjectManifest(pkg),manifestChanges=reconcileVendoredManifests(projectRoot,target,{dryRun:options.dryRun,context:{lockstep,metaDeps}});if(changes.length>0){console.log(" The following dependencies will be updated:");const reported=changes.map((change)=>({...change,label:change.field?`${change.name} (${change.field})`:change.name})),width=Math.max(...reported.map((c)=>c.label.length));for(const c of reported)console.log(` ${c.label.padEnd(width)} ${c.from} \u2192 ${c.to}`);console.log("")}if(manifestChanges.length>0){console.log(` Vendored manifests under storage/framework (${manifestChanges.length}):`);const width=Math.max(...manifestChanges.map((c)=>c.name.length));for(const c of manifestChanges)console.log(` ${c.name.padEnd(width)} ${c.from} \u2192 ${c.to} ${c.file}`);console.log("")}if(projectManifestChanges.length>0)console.log(` Project manifest migrations: ${projectManifestChanges.length}
|
|
7
|
+
`);const lockstep=lockstepPackages(metaDeps,target),changes=[...applyBumps(pkg,target,lockstep),...applyRuntimePins(pkg,runtimePins)],projectManifestChanges=migratePackageProjectManifest(pkg),manifestChanges=reconcileVendoredManifests(projectRoot,target,{dryRun:options.dryRun,context:{lockstep,metaDeps}});if(changes.length>0){console.log(" The following dependencies will be updated:");const reported=changes.map((change)=>({...change,label:change.field?`${change.name} (${change.field})`:change.name})),width=Math.max(...reported.map((c)=>c.label.length));for(const c of reported)console.log(` ${c.label.padEnd(width)} ${c.from} \u2192 ${c.to}`);console.log("")}if(manifestChanges.length>0){console.log(` Vendored manifests under storage/framework (${manifestChanges.length}):`);const width=Math.max(...manifestChanges.map((c)=>c.name.length));for(const c of manifestChanges)console.log(` ${c.name.padEnd(width)} ${c.from} \u2192 ${c.to} ${c.file}`);console.log("")}if(projectManifestChanges.length>0)console.log(` Project manifest migrations: ${projectManifestChanges.length}
|
|
8
8
|
`);if(options.dryRun){const pending=measureDefaultsDrift(projectRoot);if(pending&&pending.length>0){const installed=installedDefaultsVersion(projectRoot);console.log(` Managed project files, against the installed @stacksjs/defaults${installed?` (${installed})`:""}:`);console.log(` ${summarizeStructureChanges(pending)} in storage/framework/defaults and project support files
|
|
9
9
|
`)}reportRouteActions(projectRoot,!0);console.log(` --dry-run: no files were written and nothing was installed.
|
|
10
10
|
`);process.exit(0)}if(changes.length>0||projectManifestChanges.length>0){const trailing=raw.endsWith(`
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@stacksjs/actions",
|
|
3
3
|
"type": "module",
|
|
4
4
|
"sideEffects": false,
|
|
5
|
-
"version": "0.75.
|
|
5
|
+
"version": "0.75.288",
|
|
6
6
|
"description": "The Stacks actions.",
|
|
7
7
|
"author": "Chris Breuer",
|
|
8
8
|
"contributors": [
|
|
@@ -66,54 +66,54 @@
|
|
|
66
66
|
"prepublishOnly": "bun run build"
|
|
67
67
|
},
|
|
68
68
|
"dependencies": {
|
|
69
|
-
"@stacksjs/action-runner": "0.75.
|
|
70
|
-
"@stacksjs/ai": "0.75.
|
|
71
|
-
"@stacksjs/analytics": "0.75.
|
|
72
|
-
"@stacksjs/api": "0.75.
|
|
73
|
-
"@stacksjs/auth": "0.75.
|
|
74
|
-
"@stacksjs/build": "0.75.
|
|
69
|
+
"@stacksjs/action-runner": "0.75.288",
|
|
70
|
+
"@stacksjs/ai": "0.75.288",
|
|
71
|
+
"@stacksjs/analytics": "0.75.288",
|
|
72
|
+
"@stacksjs/api": "0.75.288",
|
|
73
|
+
"@stacksjs/auth": "0.75.288",
|
|
74
|
+
"@stacksjs/build": "0.75.288",
|
|
75
75
|
"@stacksjs/bumpx": "^0.2.26",
|
|
76
76
|
"@stacksjs/bunpress": "^0.2.15",
|
|
77
|
-
"@stacksjs/cli": "0.75.
|
|
78
|
-
"@stacksjs/cloud": "0.75.
|
|
79
|
-
"@stacksjs/cms": "0.75.
|
|
77
|
+
"@stacksjs/cli": "0.75.288",
|
|
78
|
+
"@stacksjs/cloud": "0.75.288",
|
|
79
|
+
"@stacksjs/cms": "0.75.288",
|
|
80
80
|
"@stacksjs/components": "0.2.679",
|
|
81
|
-
"@stacksjs/config": "0.75.
|
|
82
|
-
"@stacksjs/database": "0.75.
|
|
83
|
-
"@stacksjs/desktop-build": "0.75.
|
|
84
|
-
"@stacksjs/dns": "0.75.
|
|
85
|
-
"@stacksjs/enums": "0.75.
|
|
86
|
-
"@stacksjs/env": "0.75.
|
|
87
|
-
"@stacksjs/error-handling": "0.75.
|
|
88
|
-
"@stacksjs/github": "0.75.
|
|
81
|
+
"@stacksjs/config": "0.75.288",
|
|
82
|
+
"@stacksjs/database": "0.75.288",
|
|
83
|
+
"@stacksjs/desktop-build": "0.75.288",
|
|
84
|
+
"@stacksjs/dns": "0.75.288",
|
|
85
|
+
"@stacksjs/enums": "0.75.288",
|
|
86
|
+
"@stacksjs/env": "0.75.288",
|
|
87
|
+
"@stacksjs/error-handling": "0.75.288",
|
|
88
|
+
"@stacksjs/github": "0.75.288",
|
|
89
89
|
"@stacksjs/gitit": "^0.2.5",
|
|
90
|
-
"@stacksjs/i18n": "0.75.
|
|
91
|
-
"@stacksjs/image": "0.75.
|
|
92
|
-
"@stacksjs/logging": "0.75.
|
|
90
|
+
"@stacksjs/i18n": "0.75.288",
|
|
91
|
+
"@stacksjs/image": "0.75.288",
|
|
92
|
+
"@stacksjs/logging": "0.75.288",
|
|
93
93
|
"@stacksjs/logsmith": "^0.2.11",
|
|
94
|
-
"@stacksjs/mobile": "0.75.
|
|
95
|
-
"@stacksjs/orm": "0.75.
|
|
96
|
-
"@stacksjs/path": "0.75.
|
|
97
|
-
"@stacksjs/payments": "0.75.
|
|
98
|
-
"@stacksjs/queue": "0.75.
|
|
99
|
-
"@stacksjs/registry": "0.75.
|
|
100
|
-
"@stacksjs/router": "0.75.
|
|
94
|
+
"@stacksjs/mobile": "0.75.288",
|
|
95
|
+
"@stacksjs/orm": "0.75.288",
|
|
96
|
+
"@stacksjs/path": "0.75.288",
|
|
97
|
+
"@stacksjs/payments": "0.75.288",
|
|
98
|
+
"@stacksjs/queue": "0.75.288",
|
|
99
|
+
"@stacksjs/registry": "0.75.288",
|
|
100
|
+
"@stacksjs/router": "0.75.288",
|
|
101
101
|
"@stacksjs/rpx": "^0.11.54",
|
|
102
|
-
"@stacksjs/scheduler": "0.75.
|
|
103
|
-
"@stacksjs/search-engine": "0.75.
|
|
104
|
-
"@stacksjs/security": "0.75.
|
|
105
|
-
"@stacksjs/server": "0.75.
|
|
106
|
-
"@stacksjs/sites": "0.75.
|
|
107
|
-
"@stacksjs/storage": "0.75.
|
|
108
|
-
"@stacksjs/strings": "0.75.
|
|
102
|
+
"@stacksjs/scheduler": "0.75.288",
|
|
103
|
+
"@stacksjs/search-engine": "0.75.288",
|
|
104
|
+
"@stacksjs/security": "0.75.288",
|
|
105
|
+
"@stacksjs/server": "0.75.288",
|
|
106
|
+
"@stacksjs/sites": "0.75.288",
|
|
107
|
+
"@stacksjs/storage": "0.75.288",
|
|
108
|
+
"@stacksjs/strings": "0.75.288",
|
|
109
109
|
"@stacksjs/stx": "0.2.679",
|
|
110
110
|
"@stacksjs/tlsx": "^0.13.19",
|
|
111
111
|
"@stacksjs/ts-cloud": "^0.16.58",
|
|
112
112
|
"@stacksjs/ts-md": "^0.1.1",
|
|
113
|
-
"@stacksjs/tunnel": "0.75.
|
|
114
|
-
"@stacksjs/types": "0.75.
|
|
115
|
-
"@stacksjs/utils": "0.75.
|
|
116
|
-
"@stacksjs/whois": "0.75.
|
|
113
|
+
"@stacksjs/tunnel": "0.75.288",
|
|
114
|
+
"@stacksjs/types": "0.75.288",
|
|
115
|
+
"@stacksjs/utils": "0.75.288",
|
|
116
|
+
"@stacksjs/whois": "0.75.288",
|
|
117
117
|
"bun-plugin-stx": "0.2.679"
|
|
118
118
|
},
|
|
119
119
|
"peerDependencies": {
|
|
@@ -129,7 +129,7 @@
|
|
|
129
129
|
}
|
|
130
130
|
},
|
|
131
131
|
"devDependencies": {
|
|
132
|
-
"@stacksjs/validation": "0.75.
|
|
132
|
+
"@stacksjs/validation": "0.75.288",
|
|
133
133
|
"better-dx": "^0.2.24"
|
|
134
134
|
}
|
|
135
135
|
}
|