@stacksjs/actions 0.75.289 → 0.75.290
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 +2 -0
- package/dist/upgrade/packages.js +1 -1
- package/package.json +41 -41
|
@@ -12,6 +12,8 @@ export declare function installedStacksVersion(projectRoot: string): string | nu
|
|
|
12
12
|
export declare function needsFrameworkInstall(projectRoot: string, target: string): boolean;
|
|
13
13
|
/** Independently versioned frontend packages paired with a published framework. */
|
|
14
14
|
export declare function publishedRuntimePins(dependencies: Record<string, string>): Record<string, string>;
|
|
15
|
+
/** Read the exact STX release's nested runtime pins before changing an app. */
|
|
16
|
+
export declare function resolvePublishedRuntimePins(dependencies: Record<string, string>, read?: typeof fetch): Promise<Record<string, string>>;
|
|
15
17
|
/** Align existing direct declarations and flat installer rules; never add dependencies. */
|
|
16
18
|
export declare function applyRuntimePins(pkg: PkgJson, pins: Record<string, string>): Array<{ name: string, from: string, to: string, field?: 'overrides' | 'resolutions' }>;
|
|
17
19
|
/** Strip a range operator (`^`, `~`, `>=`, …) so a declared range compares to a bare version. */
|
package/dist/upgrade/packages.js
CHANGED
|
@@ -2,7 +2,7 @@ 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??{},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:
|
|
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:await resolvePublishedRuntimePins(manifest.dependencies??{})}}export function publishedRuntimePins(dependencies){const pins={};for(const name of["@stacksjs/stx","@stacksjs/components","bun-plugin-stx","@stacksjs/desktop","@stacksjs/sanitizer","stx-router"]){const version=dependencies[name];if(version&&/^\d+\.\d+\.\d+(?:-[\w.-]+)?$/.test(version))pins[name]=version}return pins}export async function resolvePublishedRuntimePins(dependencies,read=fetch){const pins=publishedRuntimePins(dependencies),version=pins["@stacksjs/stx"];if(!version)return pins;const response=await read(`https://registry.npmjs.org/@stacksjs%2fstx/${version}`);if(!response.ok)throw Error(`Could not resolve the runtime dependencies shipped by @stacksjs/stx@${version}.`);const manifest=await response.json();if(manifest.name!=="@stacksjs/stx"||manifest.version!==version)throw Error("The published STX manifest does not match the requested runtime release.");for(const[name,target]of Object.entries(publishedRuntimePins(manifest.dependencies??{}))){if(pins[name]&&pins[name]!==target)throw Error(`The published framework and STX manifests disagree on ${name}.`);pins[name]=target}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
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
|
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.290",
|
|
6
6
|
"description": "The Stacks actions.",
|
|
7
7
|
"author": "Chris Breuer",
|
|
8
8
|
"contributors": [
|
|
@@ -66,58 +66,58 @@
|
|
|
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.290",
|
|
70
|
+
"@stacksjs/ai": "0.75.290",
|
|
71
|
+
"@stacksjs/analytics": "0.75.290",
|
|
72
|
+
"@stacksjs/api": "0.75.290",
|
|
73
|
+
"@stacksjs/auth": "0.75.290",
|
|
74
|
+
"@stacksjs/build": "0.75.290",
|
|
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.290",
|
|
78
|
+
"@stacksjs/cloud": "0.75.290",
|
|
79
|
+
"@stacksjs/cms": "0.75.290",
|
|
80
80
|
"@stacksjs/components": "0.2.682",
|
|
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.290",
|
|
82
|
+
"@stacksjs/database": "0.75.290",
|
|
83
|
+
"@stacksjs/desktop-build": "0.75.290",
|
|
84
|
+
"@stacksjs/dns": "0.75.290",
|
|
85
|
+
"@stacksjs/enums": "0.75.290",
|
|
86
|
+
"@stacksjs/env": "0.75.290",
|
|
87
|
+
"@stacksjs/error-handling": "0.75.290",
|
|
88
|
+
"@stacksjs/github": "0.75.290",
|
|
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.290",
|
|
91
|
+
"@stacksjs/image": "0.75.290",
|
|
92
|
+
"@stacksjs/logging": "0.75.290",
|
|
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.290",
|
|
95
|
+
"@stacksjs/orm": "0.75.290",
|
|
96
|
+
"@stacksjs/path": "0.75.290",
|
|
97
|
+
"@stacksjs/payments": "0.75.290",
|
|
98
|
+
"@stacksjs/queue": "0.75.290",
|
|
99
|
+
"@stacksjs/registry": "0.75.290",
|
|
100
|
+
"@stacksjs/router": "0.75.290",
|
|
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.290",
|
|
103
|
+
"@stacksjs/search-engine": "0.75.290",
|
|
104
|
+
"@stacksjs/security": "0.75.290",
|
|
105
|
+
"@stacksjs/server": "0.75.290",
|
|
106
|
+
"@stacksjs/sites": "0.75.290",
|
|
107
|
+
"@stacksjs/storage": "0.75.290",
|
|
108
|
+
"@stacksjs/strings": "0.75.290",
|
|
109
109
|
"@stacksjs/stx": "0.2.682",
|
|
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.290",
|
|
114
|
+
"@stacksjs/types": "0.75.290",
|
|
115
|
+
"@stacksjs/utils": "0.75.290",
|
|
116
|
+
"@stacksjs/whois": "0.75.290",
|
|
117
117
|
"bun-plugin-stx": "0.2.682"
|
|
118
118
|
},
|
|
119
119
|
"peerDependencies": {
|
|
120
|
-
"craft-native": ">=0.0.
|
|
120
|
+
"craft-native": ">=0.0.329",
|
|
121
121
|
"pickier": "^0.1.75"
|
|
122
122
|
},
|
|
123
123
|
"peerDependenciesMeta": {
|
|
@@ -129,7 +129,7 @@
|
|
|
129
129
|
}
|
|
130
130
|
},
|
|
131
131
|
"devDependencies": {
|
|
132
|
-
"@stacksjs/validation": "0.75.
|
|
132
|
+
"@stacksjs/validation": "0.75.290",
|
|
133
133
|
"better-dx": "^0.2.24"
|
|
134
134
|
}
|
|
135
135
|
}
|