@stacksjs/actions 0.75.459 → 0.75.460

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.
@@ -1 +1 @@
1
- import{join}from"node:path";export const CRAFT_GENERATED_SPLASH_FLOOR="0.0.443";export async function resolveMobileSplash(input,outputDir,root,craftVersion,log){const{platform,splash}=input;if(splash===!1)return null;const handMade=platform==="ios"&&Boolean(splash?.image);if(!handMade&&!splash?.logo&&!input.appIcon)return null;if(!handMade&&craftVersion&&!Bun.semver.satisfies(craftVersion,`>=${CRAFT_GENERATED_SPLASH_FLOOR}`)){log.warn(`The generated launch splash needs craft-native >= ${CRAFT_GENERATED_SPLASH_FLOOR} (installed: ${craftVersion}); the launch screen shows only the background colour. Install a newer Craft, or give ${platform}.splash.image.`);return null}const{generateMobileSplash}=await import("@stacksjs/image"),result=await generateMobileSplash(input,outputDir,root);if(result?.generated)log.info(`Generated the ${platform==="ios"?"iOS launch image":"Android launch splash"} from ${splash&&splash.logo?`${platform}.splash.logo`:`${platform}.appIcon`} in ${join(outputDir,platform)}`);return result}
1
+ import{join}from"node:path";export const CRAFT_GENERATED_SPLASH_FLOOR="0.0.443";export async function resolveMobileSplash(input,outputDir,root,craftVersion,log){const{platform,splash}=input;if(splash===!1)return null;const handMade=platform==="ios"&&Boolean(splash?.image);if(!handMade&&!splash?.logo&&!input.appIcon)return null;if(!handMade&&craftVersion&&!Bun.semver.satisfies(craftVersion,`>=${CRAFT_GENERATED_SPLASH_FLOOR}`)){log.warn(`The generated launch splash needs craft-native >= ${CRAFT_GENERATED_SPLASH_FLOOR} (installed: ${craftVersion}); the launch screen shows only the background colour. Run \`buddy upgrade\` to raise it to the framework's floor, or give ${platform}.splash.image.`);return null}const{generateMobileSplash}=await import("@stacksjs/image"),result=await generateMobileSplash(input,outputDir,root);if(result?.generated)log.info(`Generated the ${platform==="ios"?"iOS launch image":"Android launch splash"} from ${splash&&splash.logo?`${platform}.splash.logo`:`${platform}.appIcon`} in ${join(outputDir,platform)}`);return result}
@@ -10,12 +10,61 @@ export declare function frameworkPackageUpdateCommand(target: string, force?: bo
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, runtimePins?: Record<string, string>): boolean;
13
+ /** The plain versions the manifest declares for `names` (direct declarations only). */
14
+ export declare function declaredPins(pkg: PkgJson, names: string[]): Record<string, string>;
13
15
  /** Independently versioned frontend packages paired with a published framework. */
14
16
  export declare function publishedRuntimePins(dependencies: Record<string, string>): Record<string, string>;
15
17
  /** Read the exact STX release's nested runtime pins before changing an app. */
16
18
  export declare function resolvePublishedRuntimePins(dependencies: Record<string, string>, read?: typeof fetch): Promise<Record<string, string>>;
17
- /** Align existing direct declarations and flat installer rules; never add dependencies. */
18
- export declare function applyRuntimePins(pkg: PkgJson, pins: Record<string, string>): Array<{ name: string, from: string, to: string, field?: 'overrides' | 'resolutions' }>;
19
+ /**
20
+ * Whether the app already declares a compatible release at or past `target`:
21
+ * the same minor line for a 0.x package (`^target` in semver terms). STX ships
22
+ * patches ahead of the framework, and an app that took one keeps it rather than
23
+ * being pulled back to the release the framework last pinned.
24
+ */
25
+ export declare function keepsNewerRelease(spec: string, target: string): boolean;
26
+ /**
27
+ * Align existing direct declarations and flat installer rules; never add
28
+ * dependencies. A newer compatible patch the app already declares is kept
29
+ * unless `exact` asks for the framework's own pins (`--allow-downgrade`).
30
+ */
31
+ export declare function applyRuntimePins(pkg: PkgJson, pins: Record<string, string>, options?: { exact?: boolean }): Array<{ name: string, from: string, to: string, field?: 'overrides' | 'resolutions' }>;
32
+ /** Craft's packages: the SDK and its per-platform builders, released together. */
33
+ export declare function isCraftPackage(name: string): boolean;
34
+ /**
35
+ * The Craft release the framework needs, from its published actions manifest:
36
+ * `craft-native: ">=0.0.443"` gives `0.0.443`. Only a plain `>=` floor counts.
37
+ */
38
+ export declare function craftFloor(manifest: { peerDependencies?: Record<string, string>, dependencies?: Record<string, string> }): string | undefined;
39
+ /** Every Craft package the app declares directly or in a flat installer rule. */
40
+ export declare function declaredCraftPackages(pkg: PkgJson): string[];
41
+ /**
42
+ * The Craft pins to raise an app to: the framework's floor for each Craft
43
+ * package the app declares, when that package publishes the floor version.
44
+ * The platform builders share Craft's version, but one that never published
45
+ * it is left alone rather than pinned to a version that cannot install.
46
+ */
47
+ export declare function resolveCraftPins(pkg: PkgJson, floor: string | undefined, read?: typeof fetch): Promise<Record<string, string>>;
48
+ /**
49
+ * Raise Craft declarations below the framework's floor, keeping each spec's
50
+ * operator (`0.0.435` → `0.0.443`, `^0.0.435` → `^0.0.443`, `>=0.0.424` →
51
+ * `>=0.0.443`), in dependencies and in flat overrides/resolutions alike: an
52
+ * override left at the old Craft would win over the raised dependency. Never
53
+ * lowers a declaration and never adds one.
54
+ */
55
+ export declare function applyCraftFloor(pkg: PkgJson, pins: Record<string, string>): Array<{ name: string, from: string, to: string, field?: 'overrides' | 'resolutions' }>;
56
+ /** The `lockfileVersion` of the app's bun.lock, or null without one. */
57
+ export declare function lockfileVersion(projectRoot: string): number | null;
58
+ /**
59
+ * Re-resolve exact pins the upgrade raised without rebuilding bun.lock.
60
+ *
61
+ * Deleting lock entries and installing makes Bun 1.4 write the whole lockfile
62
+ * again in its newer format (lockfileVersion 2), which an app still on v1 and
63
+ * its CI's Bun may not want; HQ hand-edited entries back after that. `bun add
64
+ * --exact --lockfile-only` resolves just the named packages and keeps the
65
+ * existing format. Ranged declarations are left to the framework install.
66
+ */
67
+ export declare function lockfileOnlyAddCommands(pkg: PkgJson, names: Iterable<string>): string[];
19
68
  /** Strip a range operator (`^`, `~`, `>=`, …) so a declared range compares to a bare version. */
20
69
  export declare function baseVersion(range: string): string;
21
70
  /**
@@ -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??{},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 isDowngrade(from,to){const before=baseVersion(from),after=baseVersion(to),plain=/^\d+\.\d+\.\d+(?:-[\w.-]+)?$/;return plain.test(before)&&plain.test(after)&&Bun.semver.order(after,before)<0}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(`
5
+ `);process.exit(0)}export function declaredPins(pkg,names){const declared={...pkg.devDependencies,...pkg.dependencies},pins={};for(const name of names){const spec=declared[name];if(typeof spec==="string"&&/^[\^~]?\d+\.\d+\.\d+(?:-[\w.-]+)?$/.test(spec))pins[name]=baseVersion(spec)}return pins}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??{}),craftFloor:craftFloor(manifest)}}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 keepsNewerRelease(spec,target){const declared=baseVersion(spec),plain=/^\d+\.\d+\.\d+(?:-[\w.-]+)?$/;return plain.test(declared)&&plain.test(target)&&Bun.semver.order(declared,target)>=0&&Bun.semver.satisfies(declared,`^${target}`)}export function applyRuntimePins(pkg,pins,options={}){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;if(!options.exact&&keepsNewerRelease(spec,target))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 isCraftPackage(name){return name==="craft-native"||/^@craft-native\/[a-z0-9][\w.-]*$/.test(name)}export function craftFloor(manifest){return(manifest.peerDependencies?.["craft-native"]??manifest.dependencies?.["craft-native"])?.match(/^>=\s*(\d+\.\d+\.\d+)$/)?.[1]}export function declaredCraftPackages(pkg){const names=new Set;for(const field of["dependencies","devDependencies","overrides","resolutions"]){const declarations=pkg[field];if(declarations&&typeof declarations==="object"&&!Array.isArray(declarations))Object.keys(declarations).filter(isCraftPackage).forEach((name)=>names.add(name))}return[...names].sort()}export async function resolveCraftPins(pkg,floor,read=fetch){const pins={};if(!floor)return pins;for(const name of declaredCraftPackages(pkg)){const response=await read(`https://registry.npmjs.org/${name.replace("/","%2f")}/${floor}`).catch(()=>null),manifest=response?.ok?await response.json().catch(()=>null):null;if(manifest?.name===name&&manifest.version===floor)pins[name]=floor;else console.warn(` ${name}@${floor} is not published; leaving ${name} as declared.`)}return pins}export function applyCraftFloor(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,floor]of Object.entries(pins)){const spec=declarations[name],match=typeof spec==="string"?/^(\^|~|>=\s*)?(\d+\.\d+\.\d+(?:-[\w.-]+)?)$/.exec(spec):null;if(!match||Bun.semver.order(match[2],floor)>=0)continue;const next=`${(match[1]??"").replace(/\s+/,"")}${floor}`;changes.push({name,from:spec,to:next,...field==="overrides"||field==="resolutions"?{field}:{}});declarations[name]=next}}return changes}export function lockfileVersion(projectRoot){const path=join(projectRoot,"bun.lock");if(!existsSync(path))return null;const match=/"lockfileVersion"\s*:\s*(\d+)/.exec(readFileSync(path,"utf8"));return match?Number(match[1]):null}export function lockfileOnlyAddCommands(pkg,names){const wanted=new Set(names),commands=[];for(const[field,flag]of[["dependencies",""],["devDependencies"," --dev"]]){const specs=Object.entries(pkg[field]??{}).filter(([name,spec])=>wanted.has(name)&&/^\d+\.\d+\.\d+(?:-[\w.-]+)?$/.test(spec)&&/^(?:@[a-z0-9][\w.-]*\/)?[a-z0-9][\w.-]*$/.test(name)).map(([name,spec])=>`${name}@${spec}`);if(specs.length)commands.push(`bun add --exact --lockfile-only${flag} ${specs.join(" ")}`)}return commands}export function baseVersion(range){return range.replace(/^[\^~>=<\s]+/,"").trim()}export function isDowngrade(from,to){const before=baseVersion(from),after=baseVersion(to),plain=/^\d+\.\d+\.\d+(?:-[\w.-]+)?$/;return plain.test(before)&&plain.test(after)&&Bun.semver.order(after,before)<0}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,craftFloor:floor}=await resolveTarget(options).catch((err)=>{console.error(`\u2717 ${err.message}`);process.exit(1)}),craftPins=await resolveCraftPins(pkg,floor);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),...applyRuntimePins(pkg,runtimePins)],projectManifestChanges=migratePackageProjectManifest(pkg),manifestContext={lockstep,metaDeps},manifestChanges=reconcileVendoredManifests(projectRoot,target,{dryRun:!0,context:manifestContext}),backwards=(change)=>isDowngrade(change.from,change.to),forwards=changes.filter((change)=>!backwards(change)),downgrades=[...changes.filter(backwards).map((change)=>({...change,label:change.field?`${change.name} (${change.field})`:change.name,where:""})),...manifestChanges.filter(backwards).map((change)=>({...change,label:change.name,where:` ${change.file}`}))];if(forwards.length>0){console.log(" The following dependencies will be updated:");const reported=forwards.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("")}const vendoredForwards=manifestChanges.filter((change)=>!backwards(change));if(vendoredForwards.length>0){console.log(` Vendored manifests under storage/framework (${vendoredForwards.length}):`);const width=Math.max(...vendoredForwards.map((c)=>c.name.length));for(const c of vendoredForwards)console.log(` ${c.name.padEnd(width)} ${c.from} \u2192 ${c.to} ${c.file}`);console.log("")}if(downgrades.length>0){const verb=options.allowDowngrade?"will be downgraded":"would be downgraded";console.log(` The following dependencies ${verb}, because stacks@${target} declares older versions than this app does:`);const width=Math.max(...downgrades.map((c)=>c.label.length));for(const c of downgrades)console.log(` ${c.label.padEnd(width)} ${c.from} \u2192 ${c.to} (downgrade)${c.where}`);console.log("");if(!options.allowDowngrade){const advice=options.version?[` --version ${target} asks for an older release than this app declares. Re-run with --allow-downgrade to confirm it.
7
+ `);const lockstep=lockstepPackages(metaDeps,target),changes=[...applyBumps(pkg,target,lockstep),...applyRuntimePins(pkg,runtimePins,{exact:options.allowDowngrade}),...applyCraftFloor(pkg,craftPins)],installedPins=declaredPins(pkg,[...Object.keys(runtimePins),...Object.keys(craftPins)]),projectManifestChanges=migratePackageProjectManifest(pkg),manifestContext={lockstep,metaDeps},manifestChanges=reconcileVendoredManifests(projectRoot,target,{dryRun:!0,context:manifestContext}),backwards=(change)=>isDowngrade(change.from,change.to),forwards=changes.filter((change)=>!backwards(change)),downgrades=[...changes.filter(backwards).map((change)=>({...change,label:change.field?`${change.name} (${change.field})`:change.name,where:""})),...manifestChanges.filter(backwards).map((change)=>({...change,label:change.name,where:` ${change.file}`}))];if(forwards.length>0){console.log(" The following dependencies will be updated:");const reported=forwards.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("")}const vendoredForwards=manifestChanges.filter((change)=>!backwards(change));if(vendoredForwards.length>0){console.log(` Vendored manifests under storage/framework (${vendoredForwards.length}):`);const width=Math.max(...vendoredForwards.map((c)=>c.name.length));for(const c of vendoredForwards)console.log(` ${c.name.padEnd(width)} ${c.from} \u2192 ${c.to} ${c.file}`);console.log("")}if(downgrades.length>0){const verb=options.allowDowngrade?"will be downgraded":"would be downgraded";console.log(` The following dependencies ${verb}, because stacks@${target} declares older versions than this app does:`);const width=Math.max(...downgrades.map((c)=>c.label.length));for(const c of downgrades)console.log(` ${c.label.padEnd(width)} ${c.from} \u2192 ${c.to} (downgrade)${c.where}`);console.log("");if(!options.allowDowngrade){const advice=options.version?[` --version ${target} asks for an older release than this app declares. Re-run with --allow-downgrade to confirm it.
8
8
  `]:[" Wait for a framework release that declares these versions or newer, or re-run with --allow-downgrade to accept them."," Checking for one: `npm view stacks versions`, then `buddy upgrade --version <version> --dry-run`.\n"];if(options.dryRun){console.log(" A real run refuses this upgrade unless --allow-downgrade is passed.");console.log(advice.join(`
9
9
  `))}else{console.error(`\u2717 Refusing to downgrade ${downgrades.length} ${downgrades.length===1?"dependency":"dependencies"}. Nothing was written or installed.`);console.error(advice.join(`
10
10
  `));process.exit(1)}}}if(!options.dryRun&&manifestChanges.length>0)reconcileVendoredManifests(projectRoot,target,{context:manifestContext});if(projectManifestChanges.length>0)console.log(` Project manifest migrations: ${projectManifestChanges.length}
@@ -13,8 +13,10 @@ import{existsSync,lstatSync,readdirSync,readFileSync,writeFileSync}from"node:fs"
13
13
  `);process.exit(0)}if(changes.length>0||projectManifestChanges.length>0){const trailing=raw.endsWith(`
14
14
  `)?`
15
15
  `:"";writeFileSync(pkgPath,`${JSON.stringify(pkg,null,2)}${trailing}`);console.log("\u2714 Updated package.json")}if(options.noPostinstall){console.log(" --no-postinstall: skipping install. Run this to pull the new versions:");console.log(` ${frameworkPackageUpdateCommand(target)}
16
- `);process.exit(0)}const dependenciesNeedInstall=needsFrameworkInstall(projectRoot,target,runtimePins);if(changes.length>0||manifestChanges.length>0||projectManifestChanges.length>0||dependenciesNeedInstall||options.force){console.log(` Installing\u2026
17
- `);if((await runCommand(frameworkPackageUpdateCommand(target,options.force),{cwd:projectRoot})).isErr){console.error(`
16
+ `);process.exit(0)}const dependenciesNeedInstall=needsFrameworkInstall(projectRoot,target,installedPins);if(changes.length>0||manifestChanges.length>0||projectManifestChanges.length>0||dependenciesNeedInstall||options.force){console.log(` Installing\u2026
17
+ `);const lockBefore=lockfileVersion(projectRoot);if(lockBefore!==null){for(const command of lockfileOnlyAddCommands(pkg,changes.filter((change)=>!change.field&&!lockstep.has(change.name)).map((change)=>change.name)))if((await runCommand(command,{cwd:projectRoot})).isErr){console.error(`
18
+ \u2717 \`${command}\` failed. Your package.json was updated - resolve the error and re-run \`buddy upgrade --version ${target}\`.
19
+ `);process.exit(1)}}const result=await runCommand(frameworkPackageUpdateCommand(target,options.force),{cwd:projectRoot}),lockAfter=lockfileVersion(projectRoot);if(lockBefore!==null&&lockAfter!==null&&lockAfter!==lockBefore)console.warn(` bun.lock moved from lockfileVersion ${lockBefore} to ${lockAfter}. If CI or the server runs an older Bun, restore it (\`git checkout bun.lock\`) and re-resolve only the changed packages with \`bun add --exact --lockfile-only <package>@<version>\`.`);if(result.isErr){console.error(`
18
20
  \u2717 The install step failed. Your package.json was updated - resolve the error and re-run \`buddy upgrade --version ${target}\`.
19
21
  `);process.exit(1)}}const installed=installedStacksVersion(projectRoot);if(installed!==target){console.error(`
20
22
  \u2717 Requested stacks@${target}, but the installed package reports ${installed??"no readable version"}. The installed files are retained for diagnosis; managed defaults were not synchronized.
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.459",
5
+ "version": "0.75.460",
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.459",
70
- "@stacksjs/ai": "0.75.459",
71
- "@stacksjs/analytics": "0.75.459",
72
- "@stacksjs/api": "0.75.459",
73
- "@stacksjs/auth": "0.75.459",
74
- "@stacksjs/build": "0.75.459",
69
+ "@stacksjs/action-runner": "0.75.460",
70
+ "@stacksjs/ai": "0.75.460",
71
+ "@stacksjs/analytics": "0.75.460",
72
+ "@stacksjs/api": "0.75.460",
73
+ "@stacksjs/auth": "0.75.460",
74
+ "@stacksjs/build": "0.75.460",
75
75
  "@stacksjs/bumpx": "^0.2.26",
76
76
  "@stacksjs/bunpress": "^0.2.15",
77
- "@stacksjs/cli": "0.75.459",
78
- "@stacksjs/cloud": "0.75.459",
79
- "@stacksjs/cms": "0.75.459",
80
- "@stacksjs/components": "0.2.794",
81
- "@stacksjs/config": "0.75.459",
82
- "@stacksjs/database": "0.75.459",
83
- "@stacksjs/desktop-build": "0.75.459",
84
- "@stacksjs/dns": "0.75.459",
85
- "@stacksjs/enums": "0.75.459",
86
- "@stacksjs/env": "0.75.459",
87
- "@stacksjs/error-handling": "0.75.459",
88
- "@stacksjs/github": "0.75.459",
77
+ "@stacksjs/cli": "0.75.460",
78
+ "@stacksjs/cloud": "0.75.460",
79
+ "@stacksjs/cms": "0.75.460",
80
+ "@stacksjs/components": "0.2.798",
81
+ "@stacksjs/config": "0.75.460",
82
+ "@stacksjs/database": "0.75.460",
83
+ "@stacksjs/desktop-build": "0.75.460",
84
+ "@stacksjs/dns": "0.75.460",
85
+ "@stacksjs/enums": "0.75.460",
86
+ "@stacksjs/env": "0.75.460",
87
+ "@stacksjs/error-handling": "0.75.460",
88
+ "@stacksjs/github": "0.75.460",
89
89
  "@stacksjs/gitit": "^0.2.5",
90
- "@stacksjs/i18n": "0.75.459",
91
- "@stacksjs/image": "0.75.459",
92
- "@stacksjs/logging": "0.75.459",
90
+ "@stacksjs/i18n": "0.75.460",
91
+ "@stacksjs/image": "0.75.460",
92
+ "@stacksjs/logging": "0.75.460",
93
93
  "@stacksjs/logsmith": "^0.2.11",
94
- "@stacksjs/mobile": "0.75.459",
95
- "@stacksjs/orm": "0.75.459",
96
- "@stacksjs/path": "0.75.459",
97
- "@stacksjs/payments": "0.75.459",
98
- "@stacksjs/queue": "0.75.459",
99
- "@stacksjs/registry": "0.75.459",
100
- "@stacksjs/router": "0.75.459",
94
+ "@stacksjs/mobile": "0.75.460",
95
+ "@stacksjs/orm": "0.75.460",
96
+ "@stacksjs/path": "0.75.460",
97
+ "@stacksjs/payments": "0.75.460",
98
+ "@stacksjs/queue": "0.75.460",
99
+ "@stacksjs/registry": "0.75.460",
100
+ "@stacksjs/router": "0.75.460",
101
101
  "@stacksjs/rpx": "^0.11.54",
102
- "@stacksjs/scheduler": "0.75.459",
103
- "@stacksjs/search-engine": "0.75.459",
104
- "@stacksjs/security": "0.75.459",
105
- "@stacksjs/server": "0.75.459",
106
- "@stacksjs/sites": "0.75.459",
107
- "@stacksjs/storage": "0.75.459",
108
- "@stacksjs/strings": "0.75.459",
109
- "@stacksjs/stx": "0.2.794",
102
+ "@stacksjs/scheduler": "0.75.460",
103
+ "@stacksjs/search-engine": "0.75.460",
104
+ "@stacksjs/security": "0.75.460",
105
+ "@stacksjs/server": "0.75.460",
106
+ "@stacksjs/sites": "0.75.460",
107
+ "@stacksjs/storage": "0.75.460",
108
+ "@stacksjs/strings": "0.75.460",
109
+ "@stacksjs/stx": "0.2.798",
110
110
  "@stacksjs/tlsx": "^0.13.19",
111
111
  "@stacksjs/ts-cloud": "^0.16.91",
112
112
  "@stacksjs/ts-md": "^0.1.1",
113
- "@stacksjs/tunnel": "0.75.459",
114
- "@stacksjs/types": "0.75.459",
115
- "@stacksjs/utils": "0.75.459",
116
- "@stacksjs/whois": "0.75.459",
117
- "bun-plugin-stx": "0.2.794"
113
+ "@stacksjs/tunnel": "0.75.460",
114
+ "@stacksjs/types": "0.75.460",
115
+ "@stacksjs/utils": "0.75.460",
116
+ "@stacksjs/whois": "0.75.460",
117
+ "bun-plugin-stx": "0.2.798"
118
118
  },
119
119
  "peerDependencies": {
120
- "craft-native": ">=0.0.424",
120
+ "craft-native": ">=0.0.443",
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.459",
132
+ "@stacksjs/validation": "0.75.460",
133
133
  "better-dx": "^0.2.24"
134
134
  }
135
135
  }