@stacksjs/buddy 0.75.120 → 0.75.122

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,2 +1,2 @@
1
1
  import process from"node:process";import{intro,log,onUnknownSubcommand,outro}from"@stacksjs/cli";import{ExitCode}from"@stacksjs/types";async function runStyleAction(entry,label,options){const actions=await import("@stacksjs/actions"),{ok}=await actions[entry](options);if(!ok){await log.error(`${label} reported failure`);process.exit(ExitCode.FatalError)}}async function runStxChecks(startTime){const{runStxLint}=await import("@stacksjs/actions"),report=await runStxLint(),out=[""];for(const r of report.results)if(r.status==="fail"){out.push(` FAIL ${r.label}`);out.push(` ${r.count} found, baseline ${r.baseline}${r.why?` (${r.why})`:""}`);for(const line of r.detail.slice(0,8))out.push(` ${line}`)}else if(r.status==="loosened")out.push(` DROP ${r.label}: ${r.count} < baseline ${r.baseline} - lower it in config/lint.ts`);else out.push(` ok ${r.label}${r.baseline>0?` (${r.count}, held)`:""}`);if(report.distMissing)out.push(""," note: no build output found - the dist checks did not run. Run `./buddy build` first.");if(report.loosened>0){out.push(""," Current counts, for config/lint.ts:");for(const[id,count]of Object.entries(report.counts).sort(([a],[b])=>a.localeCompare(b)))out.push(` '${id}': ${count},`)}console.log(out.join(`
2
- `));if(report.failed>0){await log.error(`${report.failed} stx check(s) failed.`);await outro("stx checks failed",{startTime,useSeconds:!0,type:"error"});process.exit(ExitCode.FatalError)}if(report.loosened>0){log.warn(`No regressions, but ${report.loosened} baseline(s) are now stale.`);await outro("stx baselines stale",{startTime,useSeconds:!0,type:"error"});process.exit(ExitCode.FatalError)}await outro("All stx checks pass",{startTime,useSeconds:!0})}export function lint(buddy){const descriptions={lint:"Automagically lints your project codebase",lintFix:"Automagically fixes all lint errors",format:"Format your project codebase",formatCheck:"Check formatting without making changes",project:"Target a specific project",stx:"Run the stx conformance checks instead of code style",verbose:"Enable verbose output"};buddy.command("lint",descriptions.lint).option("-f, --fix",descriptions.lintFix,{default:!1}).option("--stx",descriptions.stx,{default:!1}).option("--verbose",descriptions.verbose,{default:!1}).action(async(options)=>{log.debug("Running `buddy lint` ...",options);const startTime=await intro("buddy lint");if(options.stx){await runStxChecks(startTime);return}await runStyleAction(options.fix?"lintFix":"lintProject","lint");await outro("Linted your project",{startTime,useSeconds:!0})});buddy.command("lint:fix",descriptions.lintFix).option("--verbose",descriptions.verbose,{default:!1}).action(async(options)=>{log.debug("Running `buddy lint:fix` ...",options);const startTime=await intro("buddy lint:fix");log.info("Fixing lint errors...");await runStyleAction("lintFix","lint:fix");await outro("Fixed lint errors",{startTime,useSeconds:!0})});buddy.command("format",descriptions.format).option("-w, --write","Write changes to files",{default:!1}).option("-c, --check",descriptions.formatCheck,{default:!1}).option("--verbose",descriptions.verbose,{default:!1}).action(async(options)=>{log.debug("Running `buddy format` ...",options);const startTime=await intro("buddy format");await runStyleAction("formatProject","format",options.check?{check:!0}:{write:!0});await outro("Formatted your project",{startTime,useSeconds:!0})});buddy.command("format:check",descriptions.formatCheck).option("--verbose",descriptions.verbose,{default:!1}).action(async(options)=>{log.debug("Running `buddy format:check` ...",options);const startTime=await intro("buddy format:check");await runStyleAction("formatProject","format:check",{check:!0});await outro("Format check complete",{startTime,useSeconds:!0})});onUnknownSubcommand(buddy,"lint")}
2
+ `));if(report.failed>0){await log.error(`${report.failed} stx check(s) failed.`);await outro("stx checks failed",{startTime,useSeconds:!0,type:"error"});process.exit(ExitCode.FatalError)}if(report.loosened>0){log.warn(`No regressions, but ${report.loosened} baseline(s) are now stale.`);await outro("stx baselines stale",{startTime,useSeconds:!0,type:"error"});process.exit(ExitCode.FatalError)}await outro("All stx checks pass",{startTime,useSeconds:!0})}export function lint(buddy){const descriptions={lint:"Automagically lints your project codebase",lintFix:"Automagically fixes all lint errors",format:"Format your project codebase",formatCheck:"Check formatting without making changes",project:"Target a specific project",stx:"Run the stx conformance checks instead of code style",verbose:"Enable verbose output"};buddy.command("lint",descriptions.lint).option("-f, --fix",descriptions.lintFix,{default:!1}).option("--stx",descriptions.stx,{default:!1}).option("--max-warnings <count>","Fail when warnings exceed this count").option("--verbose",descriptions.verbose,{default:!1}).action(async(options)=>{log.debug("Running `buddy lint` ...",options);const startTime=await intro("buddy lint");if(options.stx){await runStxChecks(startTime);return}const budget=options.maxWarnings??options["max-warnings"];await runStyleAction(options.fix?"lintFix":"lintProject","lint",{maxWarnings:budget===void 0?void 0:Number(budget)});await outro("Linted your project",{startTime,useSeconds:!0})});buddy.command("lint:fix",descriptions.lintFix).option("--max-warnings <count>","Fail when warnings exceed this count").option("--verbose",descriptions.verbose,{default:!1}).action(async(options)=>{log.debug("Running `buddy lint:fix` ...",options);const startTime=await intro("buddy lint:fix");log.info("Fixing lint errors...");const budget=options.maxWarnings??options["max-warnings"];await runStyleAction("lintFix","lint:fix",{maxWarnings:budget===void 0?void 0:Number(budget)});await outro("Fixed lint errors",{startTime,useSeconds:!0})});buddy.command("format",descriptions.format).option("-w, --write","Write changes to files",{default:!1}).option("-c, --check",descriptions.formatCheck,{default:!1}).option("--verbose",descriptions.verbose,{default:!1}).action(async(options)=>{log.debug("Running `buddy format` ...",options);const startTime=await intro("buddy format");await runStyleAction("formatProject","format",options.check?{check:!0}:{write:!0});await outro("Formatted your project",{startTime,useSeconds:!0})});buddy.command("format:check",descriptions.formatCheck).option("--verbose",descriptions.verbose,{default:!1}).action(async(options)=>{log.debug("Running `buddy format:check` ...",options);const startTime=await intro("buddy format:check");await runStyleAction("formatProject","format:check",{check:!0});await outro("Format check complete",{startTime,useSeconds:!0})});onUnknownSubcommand(buddy,"lint")}
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.120",
5
+ "version": "0.75.122",
6
6
  "description": "Meet Buddy. The Stacks runtime.",
7
7
  "author": "Chris Breuer",
8
8
  "contributors": [
@@ -96,68 +96,68 @@
96
96
  },
97
97
  "dependencies": {
98
98
  "@stacksjs/bumpx": "^0.2.20",
99
- "@stacksjs/actions": "^0.75.120",
100
- "@stacksjs/ai": "^0.75.120",
101
- "@stacksjs/alias": "^0.75.120",
102
- "@stacksjs/analytics": "^0.75.120",
103
- "@stacksjs/api": "^0.75.120",
104
- "@stacksjs/arrays": "^0.75.120",
105
- "@stacksjs/auth": "^0.75.120",
106
- "@stacksjs/browser-extension": "^0.75.120",
107
- "@stacksjs/build": "^0.75.120",
108
- "@stacksjs/cache": "^0.75.120",
109
- "@stacksjs/chat": "^0.75.120",
99
+ "@stacksjs/actions": "^0.75.122",
100
+ "@stacksjs/ai": "^0.75.122",
101
+ "@stacksjs/alias": "^0.75.122",
102
+ "@stacksjs/analytics": "^0.75.122",
103
+ "@stacksjs/api": "^0.75.122",
104
+ "@stacksjs/arrays": "^0.75.122",
105
+ "@stacksjs/auth": "^0.75.122",
106
+ "@stacksjs/browser-extension": "^0.75.122",
107
+ "@stacksjs/build": "^0.75.122",
108
+ "@stacksjs/cache": "^0.75.122",
109
+ "@stacksjs/chat": "^0.75.122",
110
110
  "@stacksjs/clapp": "^0.2.16",
111
- "@stacksjs/cli": "^0.75.120",
112
- "@stacksjs/cloud": "^0.75.120",
113
- "@stacksjs/cms": "^0.75.120",
114
- "@stacksjs/collections": "^0.75.120",
115
- "@stacksjs/commerce": "^0.75.120",
116
- "@stacksjs/config": "^0.75.120",
117
- "@stacksjs/database": "^0.75.120",
118
- "@stacksjs/desktop-build": "^0.75.120",
119
- "@stacksjs/dns": "^0.75.120",
111
+ "@stacksjs/cli": "^0.75.122",
112
+ "@stacksjs/cloud": "^0.75.122",
113
+ "@stacksjs/cms": "^0.75.122",
114
+ "@stacksjs/collections": "^0.75.122",
115
+ "@stacksjs/commerce": "^0.75.122",
116
+ "@stacksjs/config": "^0.75.122",
117
+ "@stacksjs/database": "^0.75.122",
118
+ "@stacksjs/desktop-build": "^0.75.122",
119
+ "@stacksjs/dns": "^0.75.122",
120
120
  "@stacksjs/dnsx": "^0.2.3",
121
- "@stacksjs/email": "^0.75.120",
122
- "@stacksjs/enums": "^0.75.120",
123
- "@stacksjs/env": "^0.75.120",
124
- "@stacksjs/error-handling": "^0.75.120",
125
- "@stacksjs/events": "^0.75.120",
126
- "@stacksjs/features": "^0.75.120",
127
- "@stacksjs/git": "^0.75.120",
121
+ "@stacksjs/email": "^0.75.122",
122
+ "@stacksjs/enums": "^0.75.122",
123
+ "@stacksjs/env": "^0.75.122",
124
+ "@stacksjs/error-handling": "^0.75.122",
125
+ "@stacksjs/events": "^0.75.122",
126
+ "@stacksjs/features": "^0.75.122",
127
+ "@stacksjs/git": "^0.75.122",
128
128
  "@stacksjs/gitit": "^0.2.5",
129
- "@stacksjs/health": "^0.75.120",
129
+ "@stacksjs/health": "^0.75.122",
130
130
  "@stacksjs/httx": "^0.1.10",
131
- "@stacksjs/image": "^0.75.120",
132
- "@stacksjs/lint": "^0.75.120",
133
- "@stacksjs/logging": "^0.75.120",
134
- "@stacksjs/notifications": "^0.75.120",
135
- "@stacksjs/objects": "^0.75.120",
136
- "@stacksjs/orm": "^0.75.120",
137
- "@stacksjs/path": "^0.75.120",
138
- "@stacksjs/payments": "^0.75.120",
139
- "@stacksjs/realtime": "^0.75.120",
140
- "@stacksjs/router": "^0.75.120",
131
+ "@stacksjs/image": "^0.75.122",
132
+ "@stacksjs/lint": "^0.75.122",
133
+ "@stacksjs/logging": "^0.75.122",
134
+ "@stacksjs/notifications": "^0.75.122",
135
+ "@stacksjs/objects": "^0.75.122",
136
+ "@stacksjs/orm": "^0.75.122",
137
+ "@stacksjs/path": "^0.75.122",
138
+ "@stacksjs/payments": "^0.75.122",
139
+ "@stacksjs/realtime": "^0.75.122",
140
+ "@stacksjs/router": "^0.75.122",
141
141
  "@stacksjs/rpx": "^0.11.54",
142
- "@stacksjs/scheduler": "^0.75.120",
143
- "@stacksjs/search-engine": "^0.75.120",
144
- "@stacksjs/security": "^0.75.120",
145
- "@stacksjs/server": "^0.75.120",
146
- "@stacksjs/sites": "^0.75.120",
147
- "@stacksjs/skills": "^0.75.120",
148
- "@stacksjs/socials": "^0.75.120",
149
- "@stacksjs/storage": "^0.75.120",
150
- "@stacksjs/strings": "^0.75.120",
142
+ "@stacksjs/scheduler": "^0.75.122",
143
+ "@stacksjs/search-engine": "^0.75.122",
144
+ "@stacksjs/security": "^0.75.122",
145
+ "@stacksjs/server": "^0.75.122",
146
+ "@stacksjs/sites": "^0.75.122",
147
+ "@stacksjs/skills": "^0.75.122",
148
+ "@stacksjs/socials": "^0.75.122",
149
+ "@stacksjs/storage": "^0.75.122",
150
+ "@stacksjs/strings": "^0.75.122",
151
151
  "@stacksjs/stx": "^0.2.422",
152
- "@stacksjs/testing": "^0.75.120",
153
- "@stacksjs/tinker": "^0.75.120",
152
+ "@stacksjs/testing": "^0.75.122",
153
+ "@stacksjs/tinker": "^0.75.122",
154
154
  "@stacksjs/tlsx": "^0.13.19",
155
155
  "@stacksjs/ts-cloud": "^0.16.47",
156
- "@stacksjs/tunnel": "^0.75.120",
157
- "@stacksjs/types": "^0.75.120",
158
- "@stacksjs/ui": "^0.75.120",
159
- "@stacksjs/utils": "^0.75.120",
160
- "@stacksjs/validation": "^0.75.120",
156
+ "@stacksjs/tunnel": "^0.75.122",
157
+ "@stacksjs/types": "^0.75.122",
158
+ "@stacksjs/ui": "^0.75.122",
159
+ "@stacksjs/utils": "^0.75.122",
160
+ "@stacksjs/validation": "^0.75.122",
161
161
  "ajv": "^8.20.0",
162
162
  "ajv-formats": "^3.0.1",
163
163
  "bun-plugin-stx": "^0.2.422",