@stacksjs/actions 0.75.121 → 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.
- package/dist/lint/lint.d.ts +2 -2
- package/dist/lint/lint.js +1 -1
- package/package.json +40 -40
package/dist/lint/lint.d.ts
CHANGED
|
@@ -24,9 +24,9 @@ export declare function lintableFiles(cwd: string): string[];
|
|
|
24
24
|
* pickier auto-discovers its own config (pickier.config.ts, .config/pickier.ts,
|
|
25
25
|
* …), so we don't pass one.
|
|
26
26
|
*/
|
|
27
|
-
export declare function lintProject(options?: { cwd?: string, fix?: boolean }): Promise<{ ok: boolean }>;
|
|
27
|
+
export declare function lintProject(options?: { cwd?: string, fix?: boolean, maxWarnings?: number }): Promise<{ ok: boolean }>;
|
|
28
28
|
/** Auto-fix the project's code style — `lintProject` with fixing enabled. */
|
|
29
|
-
export declare function lintFix(options?: { cwd?: string }): Promise<{ ok: boolean }>;
|
|
29
|
+
export declare function lintFix(options?: { cwd?: string, maxWarnings?: number }): Promise<{ ok: boolean }>;
|
|
30
30
|
/**
|
|
31
31
|
* Format the project via pickier's SDK. `write` applies changes; `check`
|
|
32
32
|
* verifies formatting without writing (fails if anything is unformatted).
|
package/dist/lint/lint.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import process from"node:process";import{log}from"@stacksjs/cli";import{spawnSync}from"node:child_process";import{existsSync}from"node:fs";import{join}from"node:path";import{runFormat,runLint}from"pickier";import{isLintablePath}from"./files";export function lintableFiles(cwd){const listed=spawnSync("git",["ls-files","-z","--cached","--others","--exclude-standard"],{cwd,encoding:"utf8",maxBuffer:268435456});if(listed.status===0)return listed.stdout.split("\x00").filter(isLintablePath);const notInstalled=listed.error?.code==="ENOENT",stderr=(listed.stderr??"").trim();if(notInstalled&&!existsSync(join(cwd,".git"))||/not a git repository/i.test(stderr))return walkLintableFiles(cwd);const reason=listed.error?.message||stderr||`exit code ${listed.status??listed.signal}`;throw Error(`Could not list the files to lint: \`git ls-files\` failed in ${cwd} (${reason})`)}function walkLintableFiles(cwd){return Array.from(new Bun.Glob("**/*").scanSync({cwd,onlyFiles:!0,dot:!0})).map((file)=>file.split("\\").join("/")).filter(isLintablePath).sort()}export async function lintProject(options={}){const cwd=options.cwd??process.cwd();log.info(options.fix?"Ensuring Code Style...":"Checking Code Style...");let files;try{files=lintableFiles(cwd)}catch(error){await log.error(error instanceof Error?error.message:String(error));return{ok:!1}}if(!files.length){log.success("Linted: no lintable files");return{ok:!0}}const ok=await runLint(files,{maxWarnings
|
|
1
|
+
import process from"node:process";import{log}from"@stacksjs/cli";import{spawnSync}from"node:child_process";import{existsSync}from"node:fs";import{join}from"node:path";import{runFormat,runLint}from"pickier";import{isLintablePath}from"./files";export function lintableFiles(cwd){const listed=spawnSync("git",["ls-files","-z","--cached","--others","--exclude-standard"],{cwd,encoding:"utf8",maxBuffer:268435456});if(listed.status===0)return listed.stdout.split("\x00").filter(isLintablePath);const notInstalled=listed.error?.code==="ENOENT",stderr=(listed.stderr??"").trim();if(notInstalled&&!existsSync(join(cwd,".git"))||/not a git repository/i.test(stderr))return walkLintableFiles(cwd);const reason=listed.error?.message||stderr||`exit code ${listed.status??listed.signal}`;throw Error(`Could not list the files to lint: \`git ls-files\` failed in ${cwd} (${reason})`)}function walkLintableFiles(cwd){return Array.from(new Bun.Glob("**/*").scanSync({cwd,onlyFiles:!0,dot:!0})).map((file)=>file.split("\\").join("/")).filter(isLintablePath).sort()}export async function lintProject(options={}){const cwd=options.cwd??process.cwd();log.info(options.fix?"Ensuring Code Style...":"Checking Code Style...");const maxWarnings=options.maxWarnings??9999;if(!Number.isInteger(maxWarnings)||maxWarnings<-1){await log.error("maxWarnings must be an integer of -1 or greater");return{ok:!1}}let files;try{files=lintableFiles(cwd)}catch(error){await log.error(error instanceof Error?error.message:String(error));return{ok:!1}}if(!files.length){log.success("Linted: no lintable files");return{ok:!0}}const ok=await runLint(files,{maxWarnings,fix:options.fix})===0;if(ok)log.success("Linted");return{ok}}export function lintFix(options={}){return lintProject({...options,fix:!0})}export async function formatProject(options={}){const cwd=options.cwd??process.cwd();let files;try{files=lintableFiles(cwd)}catch(error){await log.error(error instanceof Error?error.message:String(error));return{ok:!1}}if(!files.length)return{ok:!0};return{ok:await runFormat(files,{write:options.write,check:options.check})===0}}
|
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.122",
|
|
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.122",
|
|
70
|
+
"@stacksjs/ai": "0.75.122",
|
|
71
|
+
"@stacksjs/analytics": "0.75.122",
|
|
72
|
+
"@stacksjs/api": "0.75.122",
|
|
73
|
+
"@stacksjs/auth": "0.75.122",
|
|
74
|
+
"@stacksjs/build": "0.75.122",
|
|
75
75
|
"@stacksjs/bumpx": "^0.2.20",
|
|
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.122",
|
|
78
|
+
"@stacksjs/cloud": "0.75.122",
|
|
79
|
+
"@stacksjs/cms": "0.75.122",
|
|
80
80
|
"@stacksjs/components": "^0.2.422",
|
|
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.
|
|
81
|
+
"@stacksjs/config": "0.75.122",
|
|
82
|
+
"@stacksjs/database": "0.75.122",
|
|
83
|
+
"@stacksjs/desktop-build": "0.75.122",
|
|
84
|
+
"@stacksjs/dns": "0.75.122",
|
|
85
|
+
"@stacksjs/enums": "0.75.122",
|
|
86
|
+
"@stacksjs/env": "0.75.122",
|
|
87
|
+
"@stacksjs/error-handling": "0.75.122",
|
|
88
88
|
"@stacksjs/gitit": "^0.2.5",
|
|
89
|
-
"@stacksjs/i18n": "0.75.
|
|
90
|
-
"@stacksjs/image": "0.75.
|
|
91
|
-
"@stacksjs/logging": "0.75.
|
|
89
|
+
"@stacksjs/i18n": "0.75.122",
|
|
90
|
+
"@stacksjs/image": "0.75.122",
|
|
91
|
+
"@stacksjs/logging": "0.75.122",
|
|
92
92
|
"@stacksjs/logsmith": "^0.2.11",
|
|
93
|
-
"@stacksjs/mobile": "0.75.
|
|
94
|
-
"@stacksjs/orm": "0.75.
|
|
95
|
-
"@stacksjs/path": "0.75.
|
|
96
|
-
"@stacksjs/payments": "0.75.
|
|
97
|
-
"@stacksjs/queue": "0.75.
|
|
98
|
-
"@stacksjs/registry": "0.75.
|
|
99
|
-
"@stacksjs/router": "0.75.
|
|
93
|
+
"@stacksjs/mobile": "0.75.122",
|
|
94
|
+
"@stacksjs/orm": "0.75.122",
|
|
95
|
+
"@stacksjs/path": "0.75.122",
|
|
96
|
+
"@stacksjs/payments": "0.75.122",
|
|
97
|
+
"@stacksjs/queue": "0.75.122",
|
|
98
|
+
"@stacksjs/registry": "0.75.122",
|
|
99
|
+
"@stacksjs/router": "0.75.122",
|
|
100
100
|
"@stacksjs/rpx": "^0.11.54",
|
|
101
|
-
"@stacksjs/scheduler": "0.75.
|
|
102
|
-
"@stacksjs/search-engine": "0.75.
|
|
103
|
-
"@stacksjs/security": "0.75.
|
|
104
|
-
"@stacksjs/server": "0.75.
|
|
105
|
-
"@stacksjs/sites": "0.75.
|
|
106
|
-
"@stacksjs/storage": "0.75.
|
|
107
|
-
"@stacksjs/strings": "0.75.
|
|
101
|
+
"@stacksjs/scheduler": "0.75.122",
|
|
102
|
+
"@stacksjs/search-engine": "0.75.122",
|
|
103
|
+
"@stacksjs/security": "0.75.122",
|
|
104
|
+
"@stacksjs/server": "0.75.122",
|
|
105
|
+
"@stacksjs/sites": "0.75.122",
|
|
106
|
+
"@stacksjs/storage": "0.75.122",
|
|
107
|
+
"@stacksjs/strings": "0.75.122",
|
|
108
108
|
"@stacksjs/stx": "^0.2.422",
|
|
109
109
|
"@stacksjs/tlsx": "^0.13.19",
|
|
110
110
|
"@stacksjs/ts-cloud": "^0.16.47",
|
|
111
111
|
"@stacksjs/ts-md": "^0.1.1",
|
|
112
|
-
"@stacksjs/tunnel": "0.75.
|
|
113
|
-
"@stacksjs/types": "0.75.
|
|
114
|
-
"@stacksjs/utils": "0.75.
|
|
115
|
-
"@stacksjs/whois": "0.75.
|
|
112
|
+
"@stacksjs/tunnel": "0.75.122",
|
|
113
|
+
"@stacksjs/types": "0.75.122",
|
|
114
|
+
"@stacksjs/utils": "0.75.122",
|
|
115
|
+
"@stacksjs/whois": "0.75.122",
|
|
116
116
|
"bun-plugin-stx": "^0.2.422"
|
|
117
117
|
},
|
|
118
118
|
"peerDependencies": {
|
|
119
119
|
"craft-native": ">=0.0.127",
|
|
120
|
-
"pickier": "^0.1.
|
|
120
|
+
"pickier": "^0.1.70"
|
|
121
121
|
},
|
|
122
122
|
"peerDependenciesMeta": {
|
|
123
123
|
"pickier": {
|
|
@@ -128,7 +128,7 @@
|
|
|
128
128
|
}
|
|
129
129
|
},
|
|
130
130
|
"devDependencies": {
|
|
131
|
-
"@stacksjs/validation": "0.75.
|
|
131
|
+
"@stacksjs/validation": "0.75.122",
|
|
132
132
|
"better-dx": "^0.2.24"
|
|
133
133
|
}
|
|
134
134
|
}
|