@stacksjs/actions 0.75.253 → 0.75.254
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/package-project.js +1 -1
- package/package.json +40 -40
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import{chmodSync,existsSync,lstatSync,mkdirSync,readFileSync,readdirSync,rmSync,statSync,writeFileSync}from"node:fs";import{dirname,join,relative}from"node:path";import{DEFAULTS_SYNC_MARKER,defaultsPackagePath,usesVendoredDefaults}from"@stacksjs/path";const DEFAULTS_PACKAGE_IGNORES=new Set(["README.md","build.ts","node_modules","package.json","project","tests"]),LOCAL_DEFAULT_IGNORES=new Set([".DS_Store",".discovered-models.json",DEFAULTS_SYNC_MARKER,"dist","node_modules"]),LEGACY_PACKAGE_PROJECT_FILES=["pantry.lock","storage/framework/types/traits.d.ts"],SUPPORT_FILES=[{source:"project/buddy",target:"buddy",executable:!0},{source:"project/bootstrap",target:"bootstrap",executable:!0},{source:"project/storage/framework/tsconfig.app.json",target:"storage/framework/tsconfig.app.json"},{source:"project/storage/framework/tsconfig.base.json",target:"storage/framework/tsconfig.base.json"},{source:"project/storage/framework/server/tsconfig.docker.json",target:"storage/framework/server/tsconfig.docker.json"}];export const FRAMEWORK_TYPES_SUPPORT_DIRECTORY={source:"project/storage/framework/types",target:"storage/framework/types"},GENERATED_FRAMEWORK_TYPES=["server-auto-imports.d.ts","browser-auto-imports.d.ts"];function copyDirectoryIfChanged(source,target,projectRoot,changes,options,skip){for(const entry of readdirSync(source)){if(skip.has(entry)||LOCAL_DEFAULT_IGNORES.has(entry))continue;const sourcePath=join(source,entry),targetPath=join(target,entry);if(lstatSync(sourcePath).isDirectory())copyDirectoryIfChanged(sourcePath,targetPath,projectRoot,changes,options,skip);else copyFileIfChanged(sourcePath,targetPath,projectRoot,changes,options)}}function sameFile(left,right,shallow=!1){if(!existsSync(left)||!existsSync(right))return!1;const leftStat=statSync(left),rightStat=statSync(right);if(leftStat.size!==rightStat.size)return!1;if(shallow)return!0;return readFileSync(left).equals(readFileSync(right))}function copyFileIfChanged(source,target,projectRoot,changes,options,executable=!1){if(sameFile(source,target,options.shallow&&options.dryRun)){if(executable&&!options.dryRun)chmodSync(target,493);return}changes.push({path:relative(projectRoot,target),action:existsSync(target)?"update":"add"});if(options.dryRun)return;mkdirSync(dirname(target),{recursive:!0});writeFileSync(target,readFileSync(source));if(executable)chmodSync(target,493)}function syncDirectory(source,target,projectRoot,changes,options,isRoot=!1){if(!options.dryRun)mkdirSync(target,{recursive:!0});const sourceEntries=new Set;for(const entry of readdirSync(source)){if(isRoot&&DEFAULTS_PACKAGE_IGNORES.has(entry))continue;sourceEntries.add(entry);const sourcePath=join(source,entry),targetPath=join(target,entry);if(lstatSync(sourcePath).isDirectory()){syncDirectory(sourcePath,targetPath,projectRoot,changes,options);continue}copyFileIfChanged(sourcePath,targetPath,projectRoot,changes,options)}if(!existsSync(target))return;for(const entry of readdirSync(target)){if(LOCAL_DEFAULT_IGNORES.has(entry)||sourceEntries.has(entry))continue;const targetPath=join(target,entry);changes.push({path:relative(projectRoot,targetPath),action:"remove"});if(!options.dryRun)rmSync(targetPath,{recursive:!0,force:!0})}}export function vendorDefaultsTree(projectRoot,defaultsPackageRoot,options={}){const changes=[],targetDefaults=join(projectRoot,"storage/framework/defaults");syncDirectory(defaultsPackageRoot,targetDefaults,projectRoot,changes,options,!0);if(!options.dryRun)stampDefaultsSync(targetDefaults,defaultsPackageRoot);return changes}export function syncPackageProjectFiles(projectRoot,defaultsPackageRoot,options={}){const changes=[],targetDefaults=join(projectRoot,"storage/framework/defaults"),vendorDefaults=options.vendorDefaults??usesVendoredDefaults(projectRoot);if(vendorDefaults)syncDirectory(defaultsPackageRoot,targetDefaults,projectRoot,changes,options,!0);for(const file of SUPPORT_FILES){const source=join(defaultsPackageRoot,file.source);if(!existsSync(source))continue;copyFileIfChanged(source,join(projectRoot,file.target),projectRoot,changes,options,file.executable)}const typesSource=join(defaultsPackageRoot,FRAMEWORK_TYPES_SUPPORT_DIRECTORY.source);if(existsSync(typesSource))copyDirectoryIfChanged(typesSource,join(projectRoot,FRAMEWORK_TYPES_SUPPORT_DIRECTORY.target),projectRoot,changes,options,new Set(GENERATED_FRAMEWORK_TYPES));const bunVersion=shippedBunVersion(defaultsPackageRoot);if(bunVersion)alignBunPins(projectRoot,bunVersion,changes,options);for(const legacyFile of LEGACY_PACKAGE_PROJECT_FILES){const target=join(projectRoot,legacyFile);if(!existsSync(target))continue;changes.push({path:legacyFile,action:"remove"});if(!options.dryRun)rmSync(target,{force:!0})}if(!options.dryRun&&vendorDefaults)stampDefaultsSync(targetDefaults,defaultsPackageRoot);return changes}export const BUN_VERSION_FILE="project/bun-version";function shippedBunVersion(defaultsPackageRoot){try{const version=readFileSync(join(defaultsPackageRoot,BUN_VERSION_FILE),"utf8").trim();return/^\d+\.\d+\.\d+$/.test(version)?version:null}catch{return null}}function olderVersion(candidate,than){const left=candidate.split(".").map(Number),right=than.split(".").map(Number);for(let i=0;i<3;i++)if(left[i]!==right[i])return(left[i]??0)<(right[i]??0);return!1}const VERSION="(\\d+\\.\\d+\\.\\d+)",BUN_PINS=[new RegExp(`^(\\s*BUN_VERSION:\\s*['"]?)${VERSION}`,"gm"),new RegExp(`^(\\s*bun-version:\\s*['"]?)${VERSION}`,"gm"),new RegExp(`((?:^|[\\s'"])bun(?:\\.sh|\\.com)?@)${VERSION}`,"gm"),new RegExp(`(oven/bun:)${VERSION}`,"g"),new RegExp(`^(\\s*ARG\\s+BUN_VERSION=)${VERSION}`,"gm")];export function raiseBunPins(text,version){let next=text;for(const pattern of BUN_PINS)next=next.replace(pattern,(match,prefix,pinned)=>olderVersion(pinned,version)?`${prefix}${version}`:match);return next}function bunPinFiles(projectRoot){const files=[],workflows=join(projectRoot,".github/workflows");if(existsSync(workflows)){for(const entry of readdirSync(workflows))if(/\.ya?ml$/.test(entry))files.push(join(workflows,entry))}for(const entry of readdirSync(projectRoot))if(/^Dockerfile/.test(entry))files.push(join(projectRoot,entry));for(const path of["storage/framework/Dockerfile","storage/framework/server/Dockerfile"])if(existsSync(join(projectRoot,path)))files.push(join(projectRoot,path));return files}export function alignBunPins(projectRoot,version,changes=[],options={}){for(const file of bunPinFiles(projectRoot)){const text=readFileSync(file,"utf8"),next=raiseBunPins(text,version);if(next===text)continue;changes.push({path:relative(projectRoot,file),action:"update"});if(!options.dryRun)writeFileSync(file,next)}return changes}function stampDefaultsSync(targetDefaults,defaultsPackageRoot){const version=manifestVersion(defaultsPackageRoot);if(!version)return;const marker={version,syncedAt:new Date().toISOString()};mkdirSync(targetDefaults,{recursive:!0});writeFileSync(join(targetDefaults,DEFAULTS_SYNC_MARKER),`${JSON.stringify(marker,null,2)}
|
|
2
|
-
`)}function manifestVersion(packageRoot){try{const version=JSON.parse(readFileSync(join(packageRoot,"package.json"),"utf8"))?.version;return typeof version==="string"?version:null}catch{return null}}export function measureDefaultsDrift(projectRoot,options={}){const packageRoot=defaultsPackagePath(projectRoot);if(!existsSync(join(packageRoot,"package.json")))return null;return syncPackageProjectFiles(projectRoot,packageRoot,{dryRun:!0,shallow:options.shallow})}export function summarizeStructureChanges(changes){const added=changes.filter((change)=>change.action==="add").length,updated=changes.filter((change)=>change.action==="update").length,removed=changes.filter((change)=>change.action==="remove").length;return`+${added} ~${updated} -${removed}`}export function migratePackageProjectManifest(pkg){const changes=[],scripts=pkg.scripts??{},setScript=(name,value)=>{if(scripts[name]===value)return;scripts[name]=value;changes.push({path:`package.json#scripts.${name}`,action:"update"})};setScript("buddy","./buddy");
|
|
2
|
+
`)}function manifestVersion(packageRoot){try{const version=JSON.parse(readFileSync(join(packageRoot,"package.json"),"utf8"))?.version;return typeof version==="string"?version:null}catch{return null}}export function measureDefaultsDrift(projectRoot,options={}){const packageRoot=defaultsPackagePath(projectRoot);if(!existsSync(join(packageRoot,"package.json")))return null;return syncPackageProjectFiles(projectRoot,packageRoot,{dryRun:!0,shallow:options.shallow})}export function summarizeStructureChanges(changes){const added=changes.filter((change)=>change.action==="add").length,updated=changes.filter((change)=>change.action==="update").length,removed=changes.filter((change)=>change.action==="remove").length;return`+${added} ~${updated} -${removed}`}export function migratePackageProjectManifest(pkg){const changes=[],scripts=pkg.scripts??{},setScript=(name,value)=>{if(scripts[name]===value)return;scripts[name]=value;changes.push({path:`package.json#scripts.${name}`,action:"update"})};setScript("buddy","./buddy");const appCheck="bun x --bun tsc --noEmit -p tsconfig.json --pretty false";for(const[name,replacement]of Object.entries({typecheck:appCheck,"typecheck:app":appCheck,"types:check":"bun run typecheck"})){const current=scripts[name];if(!current){setScript(name,replacement);continue}const steps=current.match(/(?:[^&"'`]|"[^"\\]*(?:\\.[^"\\]*)*"|'[^']*')+/g);if(!steps||steps.join("&&")!==current||/[;|`$()<>#\\\n]/.test(current))continue;let changed=!1;const migrated=steps.flatMap((step)=>{const command=step.trim();if(/^(?:bun|npm|pnpm) run build:framework-types$/.test(command)){changed=!0;return[]}if(/^(?:(?:bun(?: x|x)?(?: --bun)?|npx) )?(?:tsc|tsgo)\b/.test(command)&&/storage\/framework\/(?:core(?:\/|['"\s]|$)|tsconfig\.(?:framework|defaults|type-tests)\.json)/.test(command)){changed=!0;return[appCheck]}return[command]});if(changed)setScript(name,migrated.length?migrated.join(" && "):replacement)}if(scripts["build:reset"]?.includes("storage/framework"))setScript("build:reset","rm -rf node_modules pantry.lock && bun install && ./buddy generate:types && ./buddy lint:fix");if(scripts["build:framework-types"]&&!Object.entries(scripts).some(([name,command])=>name!=="build:framework-types"&&command.includes("build:framework-types"))){delete scripts["build:framework-types"];changes.push({path:"package.json#scripts.build:framework-types",action:"remove"})}pkg.scripts=scripts;if(Array.isArray(pkg.workspaces)){const next=pkg.workspaces.filter((workspace)=>workspace!=="storage/framework/core"&&!workspace.startsWith("storage/framework/core/"));if(next.length!==pkg.workspaces.length){pkg.workspaces=next;changes.push({path:"package.json#workspaces",action:"update"})}}return changes}export function migratePackageProjectTsconfig(projectRoot,options={}){const path=join(projectRoot,"tsconfig.json");if(!existsSync(path))return[];const raw=readFileSync(path,"utf8"),next=raw.replace(/"extends"\s*:\s*"\.\/storage\/framework\/core\/tsconfig\.json"/,'"extends": "./storage/framework/tsconfig.app.json"');if(next===raw)return[];if(!options.dryRun)writeFileSync(path,next);return[{path:"tsconfig.json",action:"update"}]}export function detectProjectAiProviders(projectRoot){const providers=new Set(["codex"]);if(existsSync(join(projectRoot,"CLAUDE.md"))||existsSync(join(projectRoot,".claude")))providers.add("claude");if(existsSync(join(projectRoot,".cursor")))providers.add("cursor");if(existsSync(join(projectRoot,".github/copilot-instructions.md")))providers.add("copilot");if(existsSync(join(projectRoot,"GEMINI.md")))providers.add("gemini");return[...providers]}
|
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.254",
|
|
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.254",
|
|
70
|
+
"@stacksjs/ai": "0.75.254",
|
|
71
|
+
"@stacksjs/analytics": "0.75.254",
|
|
72
|
+
"@stacksjs/api": "0.75.254",
|
|
73
|
+
"@stacksjs/auth": "0.75.254",
|
|
74
|
+
"@stacksjs/build": "0.75.254",
|
|
75
75
|
"@stacksjs/bumpx": "^0.2.25",
|
|
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.254",
|
|
78
|
+
"@stacksjs/cloud": "0.75.254",
|
|
79
|
+
"@stacksjs/cms": "0.75.254",
|
|
80
80
|
"@stacksjs/components": "^0.2.631",
|
|
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.254",
|
|
82
|
+
"@stacksjs/database": "0.75.254",
|
|
83
|
+
"@stacksjs/desktop-build": "0.75.254",
|
|
84
|
+
"@stacksjs/dns": "0.75.254",
|
|
85
|
+
"@stacksjs/enums": "0.75.254",
|
|
86
|
+
"@stacksjs/env": "0.75.254",
|
|
87
|
+
"@stacksjs/error-handling": "0.75.254",
|
|
88
|
+
"@stacksjs/github": "0.75.254",
|
|
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.254",
|
|
91
|
+
"@stacksjs/image": "0.75.254",
|
|
92
|
+
"@stacksjs/logging": "0.75.254",
|
|
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.254",
|
|
95
|
+
"@stacksjs/orm": "0.75.254",
|
|
96
|
+
"@stacksjs/path": "0.75.254",
|
|
97
|
+
"@stacksjs/payments": "0.75.254",
|
|
98
|
+
"@stacksjs/queue": "0.75.254",
|
|
99
|
+
"@stacksjs/registry": "0.75.254",
|
|
100
|
+
"@stacksjs/router": "0.75.254",
|
|
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.254",
|
|
103
|
+
"@stacksjs/search-engine": "0.75.254",
|
|
104
|
+
"@stacksjs/security": "0.75.254",
|
|
105
|
+
"@stacksjs/server": "0.75.254",
|
|
106
|
+
"@stacksjs/sites": "0.75.254",
|
|
107
|
+
"@stacksjs/storage": "0.75.254",
|
|
108
|
+
"@stacksjs/strings": "0.75.254",
|
|
109
109
|
"@stacksjs/stx": "^0.2.631",
|
|
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.254",
|
|
114
|
+
"@stacksjs/types": "0.75.254",
|
|
115
|
+
"@stacksjs/utils": "0.75.254",
|
|
116
|
+
"@stacksjs/whois": "0.75.254",
|
|
117
117
|
"bun-plugin-stx": "^0.2.631"
|
|
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.254",
|
|
133
133
|
"better-dx": "^0.2.24"
|
|
134
134
|
}
|
|
135
135
|
}
|