@stacksjs/buddy 0.75.606 → 0.75.608

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.
@@ -2,7 +2,7 @@ import{appendFileSync,cpSync,existsSync,lstatSync,readdirSync,readFileSync,rmSyn
2
2
  `)}const frameworkFile=join(root,"storage/framework/package.json");if(existsSync(frameworkFile)){const framework=JSON.parse(readFileSync(frameworkFile,"utf8"));let touched=false;for(const[name,command]of Object.entries(framework.scripts??{})){if(!/\.\/scripts\/publish|\.\/core\b/.test(command))continue;delete framework.scripts[name];touched=true}if(touched)writeFileSync(frameworkFile,`${JSON.stringify(framework,null,2)}
3
3
  `)}return changes}export const STX_RUNTIME_PACKAGES=["@stacksjs/stx","@stacksjs/components","bun-plugin-stx","@stacksjs/desktop","@stacksjs/sanitizer","stx-router"];export function appPackageOverrides(overrides){const next={};const removed=[];for(const[name,rule]of Object.entries(overrides)){if(STX_RUNTIME_PACKAGES.includes(name))removed.push(name);else next[name]=rule}return{overrides:next,removed}}export function applyAppPackageOverrides(root){const file=join(root,"package.json");if(!existsSync(file))return[];const pkg=JSON.parse(readFileSync(file,"utf8"));if(!pkg.overrides||typeof pkg.overrides!=="object"||Array.isArray(pkg.overrides))return[];const{overrides,removed}=appPackageOverrides(pkg.overrides);if(removed.length===0)return[];if(Object.keys(overrides).length>0)pkg.overrides=overrides;else delete pkg.overrides;writeFileSync(file,`${JSON.stringify(pkg,null,2)}
4
4
  `);return removed}const FRAMEWORK_CREDIT_KEYS=["author","contributors","funding","homepage","repository","bugs"];export function stripFrameworkManifestCredits(root){const framework=join(root,"storage/framework");const manifests=[];const walk=(dir)=>{let entries;try{entries=readdirSync(dir,{withFileTypes:true})}catch{return}for(const entry of entries){const full=join(dir,entry.name);if(entry.isDirectory()&&!["core","defaults","node_modules","dist"].includes(entry.name))walk(full);else if(entry.isFile()&&entry.name==="package.json")manifests.push(full)}};walk(framework);const touched=[];for(const file of manifests){const pkg=JSON.parse(readFileSync(file,"utf8"));const present=FRAMEWORK_CREDIT_KEYS.filter((key)=>(key in pkg));if(present.length===0)continue;for(const key of present)delete pkg[key];writeFileSync(file,`${JSON.stringify(pkg,null,2)}
5
- `);touched.push(relative(root,file))}return touched}const CORE_CONTENT_PATHS=[{file:"config/css.ts",from:"'./storage/framework/core/error-handling/src/views/**/*.{stx,html}'",to:"'./node_modules/@stacksjs/error-handling/dist/views/**/*.{stx,html}'"}];export function rewriteCoreContentPaths(root){const touched=[];for(const{file,from,to}of CORE_CONTENT_PATHS){const full=join(root,file);if(!existsSync(full))continue;const raw=readFileSync(full,"utf8");if(!raw.includes(from))continue;writeFileSync(full,raw.replaceAll(from,to));touched.push(file)}return touched}export function applyPackageAppTsconfig(root){const source=join(root,"storage/framework/tsconfig.package-app.json");if(!existsSync(source))return false;cpSync(source,join(root,"storage/framework/tsconfig.app.json"));rmSync(source);return true}const SKIPPED_DIRECTORIES=new Set(["node_modules","pantry","dist","storage","public",".git",".cache",".stx","coverage"]);const SCANNED_EXTENSIONS=new Set([".ts",".tsx",".js",".mjs",".cjs",".stx"]);function projectSources(dir){let entries;try{entries=readdirSync(dir,{withFileTypes:true})}catch{return[]}return entries.flatMap((entry)=>{const full=join(dir,entry.name);if(entry.isDirectory())return SKIPPED_DIRECTORIES.has(entry.name)?[]:projectSources(full);return entry.isFile()&&SCANNED_EXTENSIONS.has(extname(entry.name))?[full]:[]})}const DEFAULTS_IMPORT=/(\bfrom\s+|\bimport\s*\(\s*|\brequire\s*\(\s*|^\s*import\s+)(['"])(?:~\/|(?:\.{1,2}\/)+)storage\/framework\/defaults\/([^'"]+)\2/gm;export function defaultsSpecifier(rest,hasFile=()=>false){if(!extname(rest)&&hasFile(`${rest}.ts`))return`@stacksjs/defaults/${rest}.ts`;return`@stacksjs/defaults/${rest}`}export function rewriteDefaultsImports(root,hasFile){const touched=[];for(const file of projectSources(root)){const raw=readFileSync(file,"utf8");if(!raw.includes("storage/framework/defaults/"))continue;const fileExists=file.endsWith(".stx")?()=>false:hasFile;const next=raw.replace(DEFAULTS_IMPORT,(_match,lead,quote,rest)=>`${lead}${quote}${defaultsSpecifier(rest,fileExists)}${quote}`);if(next!==raw){writeFileSync(file,next);touched.push(relative(root,file))}}return touched}const TS=".ts";const DEFAULTS_MODULE_PATHS=[{file:"bunfig.toml",from:`"./storage/framework/defaults/resources/plugins/preloader${TS}"`,to:'"@stacksjs/defaults/resources/plugins/preloader"'},{file:"config/ui.ts",from:`'./storage/framework/defaults/stx-components-plugin${TS}'`,to:`'@stacksjs/defaults/stx-components-plugin${TS}'`}];export function rewriteDefaultsModulePaths(root){const touched=[];for(const{file,from,to}of DEFAULTS_MODULE_PATHS){const full=join(root,file);if(!existsSync(full))continue;const raw=readFileSync(full,"utf8");if(!raw.includes(from))continue;writeFileSync(full,raw.replaceAll(from,to));touched.push(file)}return touched}const GITIGNORE_ENTRY=`/${VENDORED_DEFAULTS}`;const GITIGNORE_BLOCK=`
5
+ `);touched.push(relative(root,file))}return touched}const CORE_CONTENT_PATHS=[{file:"config/css.ts",from:"'./storage/framework/core/error-handling/src/views/**/*.{stx,html}'",to:"'./node_modules/@stacksjs/error-handling/dist/views/**/*.{stx,html}'"}];export function rewriteCoreContentPaths(root){const touched=[];for(const{file,from,to}of CORE_CONTENT_PATHS){const full=join(root,file);if(!existsSync(full))continue;const raw=readFileSync(full,"utf8");if(!raw.includes(from))continue;writeFileSync(full,raw.replaceAll(from,to));touched.push(file)}return touched}export function applyPackageAppTsconfig(root){const source=join(root,"storage/framework/tsconfig.package-app.json");if(!existsSync(source))return false;cpSync(source,join(root,"storage/framework/tsconfig.app.json"));rmSync(source);return true}const SKIPPED_DIRECTORIES=new Set(["node_modules","pantry","dist","storage","public",".git",".cache",".stx","coverage"]);const SCANNED_EXTENSIONS=new Set([".ts",".tsx",".js",".mjs",".cjs",".stx"]);function projectSources(dir){let entries;try{entries=readdirSync(dir,{withFileTypes:true})}catch{return[]}return entries.flatMap((entry)=>{const full=join(dir,entry.name);if(entry.isDirectory())return SKIPPED_DIRECTORIES.has(entry.name)||existsSync(join(full,".git"))?[]:projectSources(full);return entry.isFile()&&SCANNED_EXTENSIONS.has(extname(entry.name))?[full]:[]})}const DEFAULTS_IMPORT=/(\bfrom\s+|\bimport\s*\(\s*|\brequire\s*\(\s*|^\s*import\s+)(['"])(?:~\/|(?:\.{1,2}\/)+)storage\/framework\/defaults\/([^'"]+)\2/gm;export function defaultsSpecifier(rest,hasFile=()=>false){if(!extname(rest)&&hasFile(`${rest}.ts`))return`@stacksjs/defaults/${rest}.ts`;return`@stacksjs/defaults/${rest}`}export function rewriteDefaultsImports(root,hasFile){const touched=[];for(const file of projectSources(root)){const raw=readFileSync(file,"utf8");if(!raw.includes("storage/framework/defaults/"))continue;const fileExists=file.endsWith(".stx")?()=>false:hasFile;const next=raw.replace(DEFAULTS_IMPORT,(_match,lead,quote,rest)=>`${lead}${quote}${defaultsSpecifier(rest,fileExists)}${quote}`);if(next!==raw){writeFileSync(file,next);touched.push(relative(root,file))}}return touched}const TS=".ts";const DEFAULTS_MODULE_PATHS=[{file:"bunfig.toml",from:`"./storage/framework/defaults/resources/plugins/preloader${TS}"`,to:'"@stacksjs/defaults/resources/plugins/preloader"'},{file:"config/ui.ts",from:`'./storage/framework/defaults/stx-components-plugin${TS}'`,to:`'@stacksjs/defaults/stx-components-plugin${TS}'`}];export function rewriteDefaultsModulePaths(root){const touched=[];for(const{file,from,to}of DEFAULTS_MODULE_PATHS){const full=join(root,file);if(!existsSync(full))continue;const raw=readFileSync(full,"utf8");if(!raw.includes(from))continue;writeFileSync(full,raw.replaceAll(from,to));touched.push(file)}return touched}const GITIGNORE_ENTRY=`/${VENDORED_DEFAULTS}`;const GITIGNORE_BLOCK=`
6
6
  # The framework defaults: a link to node_modules/@stacksjs/defaults, made on
7
7
  # boot. \`buddy publish:defaults\` replaces it with a copy you commit instead.
8
8
  ${GITIGNORE_ENTRY}
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@stacksjs/buddy",
3
3
  "type": "module",
4
4
  "sideEffects": false,
5
- "version": "0.75.606",
5
+ "version": "0.75.608",
6
6
  "description": "Meet Buddy. The Stacks runtime.",
7
7
  "author": "Chris Breuer",
8
8
  "contributors": [
@@ -95,71 +95,71 @@
95
95
  "prepublishOnly": "bun run build"
96
96
  },
97
97
  "dependencies": {
98
- "@stacksjs/actions": "0.75.606",
99
- "@stacksjs/docs": "0.75.606",
100
- "@stacksjs/ai": "0.75.606",
101
- "@stacksjs/alias": "0.75.606",
102
- "@stacksjs/analytics": "0.75.606",
103
- "@stacksjs/api": "0.75.606",
104
- "@stacksjs/arrays": "0.75.606",
105
- "@stacksjs/auth": "0.75.606",
106
- "@stacksjs/browser-extension": "0.75.606",
107
- "@stacksjs/build": "0.75.606",
98
+ "@stacksjs/actions": "0.75.608",
99
+ "@stacksjs/docs": "0.75.608",
100
+ "@stacksjs/ai": "0.75.608",
101
+ "@stacksjs/alias": "0.75.608",
102
+ "@stacksjs/analytics": "0.75.608",
103
+ "@stacksjs/api": "0.75.608",
104
+ "@stacksjs/arrays": "0.75.608",
105
+ "@stacksjs/auth": "0.75.608",
106
+ "@stacksjs/browser-extension": "0.75.608",
107
+ "@stacksjs/build": "0.75.608",
108
108
  "@stacksjs/bumpx": "^0.2.32",
109
- "@stacksjs/cache": "0.75.606",
110
- "@stacksjs/chat": "0.75.606",
109
+ "@stacksjs/cache": "0.75.608",
110
+ "@stacksjs/chat": "0.75.608",
111
111
  "@stacksjs/clapp": "^0.2.17",
112
- "@stacksjs/cli": "0.75.606",
113
- "@stacksjs/cloud": "0.75.606",
114
- "@stacksjs/cms": "0.75.606",
115
- "@stacksjs/collections": "0.75.606",
116
- "@stacksjs/commerce": "0.75.606",
117
- "@stacksjs/config": "0.75.606",
118
- "@stacksjs/database": "0.75.606",
119
- "@stacksjs/desktop-build": "0.75.606",
120
- "@stacksjs/dns": "0.75.606",
112
+ "@stacksjs/cli": "0.75.608",
113
+ "@stacksjs/cloud": "0.75.608",
114
+ "@stacksjs/cms": "0.75.608",
115
+ "@stacksjs/collections": "0.75.608",
116
+ "@stacksjs/commerce": "0.75.608",
117
+ "@stacksjs/config": "0.75.608",
118
+ "@stacksjs/database": "0.75.608",
119
+ "@stacksjs/desktop-build": "0.75.608",
120
+ "@stacksjs/dns": "0.75.608",
121
121
  "@stacksjs/dnsx": "^0.2.3",
122
- "@stacksjs/email": "0.75.606",
123
- "@stacksjs/enums": "0.75.606",
124
- "@stacksjs/env": "0.75.606",
125
- "@stacksjs/error-handling": "0.75.606",
126
- "@stacksjs/events": "0.75.606",
127
- "@stacksjs/features": "0.75.606",
128
- "@stacksjs/git": "0.75.606",
122
+ "@stacksjs/email": "0.75.608",
123
+ "@stacksjs/enums": "0.75.608",
124
+ "@stacksjs/env": "0.75.608",
125
+ "@stacksjs/error-handling": "0.75.608",
126
+ "@stacksjs/events": "0.75.608",
127
+ "@stacksjs/features": "0.75.608",
128
+ "@stacksjs/git": "0.75.608",
129
129
  "@stacksjs/gitit": "^0.2.5",
130
- "@stacksjs/health": "0.75.606",
131
- "@stacksjs/hq": "0.75.606",
130
+ "@stacksjs/health": "0.75.608",
131
+ "@stacksjs/hq": "0.75.608",
132
132
  "@stacksjs/httx": "^0.1.10",
133
- "@stacksjs/image": "0.75.606",
134
- "@stacksjs/lint": "0.75.606",
135
- "@stacksjs/logging": "0.75.606",
136
- "@stacksjs/notifications": "0.75.606",
137
- "@stacksjs/objects": "0.75.606",
138
- "@stacksjs/orm": "0.75.606",
139
- "@stacksjs/path": "0.75.606",
140
- "@stacksjs/payments": "0.75.606",
141
- "@stacksjs/realtime": "0.75.606",
142
- "@stacksjs/router": "0.75.606",
133
+ "@stacksjs/image": "0.75.608",
134
+ "@stacksjs/lint": "0.75.608",
135
+ "@stacksjs/logging": "0.75.608",
136
+ "@stacksjs/notifications": "0.75.608",
137
+ "@stacksjs/objects": "0.75.608",
138
+ "@stacksjs/orm": "0.75.608",
139
+ "@stacksjs/path": "0.75.608",
140
+ "@stacksjs/payments": "0.75.608",
141
+ "@stacksjs/realtime": "0.75.608",
142
+ "@stacksjs/router": "0.75.608",
143
143
  "@stacksjs/rpx": "^0.11.54",
144
- "@stacksjs/scheduler": "0.75.606",
145
- "@stacksjs/search-engine": "0.75.606",
146
- "@stacksjs/security": "0.75.606",
147
- "@stacksjs/server": "0.75.606",
148
- "@stacksjs/sites": "0.75.606",
149
- "@stacksjs/skills": "0.75.606",
150
- "@stacksjs/socials": "0.75.606",
151
- "@stacksjs/storage": "0.75.606",
152
- "@stacksjs/strings": "0.75.606",
144
+ "@stacksjs/scheduler": "0.75.608",
145
+ "@stacksjs/search-engine": "0.75.608",
146
+ "@stacksjs/security": "0.75.608",
147
+ "@stacksjs/server": "0.75.608",
148
+ "@stacksjs/sites": "0.75.608",
149
+ "@stacksjs/skills": "0.75.608",
150
+ "@stacksjs/socials": "0.75.608",
151
+ "@stacksjs/storage": "0.75.608",
152
+ "@stacksjs/strings": "0.75.608",
153
153
  "@stacksjs/stx": "^0.2.889",
154
- "@stacksjs/testing": "0.75.606",
155
- "@stacksjs/tinker": "0.75.606",
154
+ "@stacksjs/testing": "0.75.608",
155
+ "@stacksjs/tinker": "0.75.608",
156
156
  "@stacksjs/tlsx": "^0.13.19",
157
157
  "@stacksjs/ts-cloud": "^0.16.136",
158
- "@stacksjs/tunnel": "0.75.606",
159
- "@stacksjs/types": "0.75.606",
160
- "@stacksjs/ui": "0.75.606",
161
- "@stacksjs/utils": "0.75.606",
162
- "@stacksjs/validation": "0.75.606",
158
+ "@stacksjs/tunnel": "0.75.608",
159
+ "@stacksjs/types": "0.75.608",
160
+ "@stacksjs/ui": "0.75.608",
161
+ "@stacksjs/utils": "0.75.608",
162
+ "@stacksjs/validation": "0.75.608",
163
163
  "ajv": "^8.20.0",
164
164
  "ajv-formats": "^3.0.1",
165
165
  "bun-plugin-stx": "^0.2.889",