@nuasite/cli 0.52.0 → 0.53.0
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/README.md +11 -3
- package/dist/index.js +1251 -464
- package/dist/types/check-code.d.ts +19 -0
- package/dist/types/check-code.d.ts.map +1 -0
- package/dist/types/check.d.ts +2 -0
- package/dist/types/check.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +5 -3
- package/src/check-code.ts +133 -0
- package/src/check.ts +17 -4
- package/src/index.ts +2 -1
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Syntax check for the project's own code.
|
|
3
|
+
*
|
|
4
|
+
* A full build catches these, but it renders every page to get there. What actually fails is the
|
|
5
|
+
* parse: Astro compiles a `.astro` file to TypeScript and the bundler parses that, so compiling
|
|
6
|
+
* and parsing — without rendering anything — reproduces the same class of error in about a second.
|
|
7
|
+
*
|
|
8
|
+
* This is a *syntax* check, not a type check. A wrong prop type or a missing export still needs
|
|
9
|
+
* `astro check` or a build. What it does catch is the error that stops a build dead before a single
|
|
10
|
+
* page renders — an unescaped quote inside a Czech string being the one that prompted it.
|
|
11
|
+
*/
|
|
12
|
+
import type { CheckFinding } from '@nuasite/cms-core';
|
|
13
|
+
export interface CodeCheckResult {
|
|
14
|
+
findings: CheckFinding[];
|
|
15
|
+
files: number;
|
|
16
|
+
}
|
|
17
|
+
/** Parse every `.astro`/`.ts`/`.tsx` under `root`, newest failure first is not meaningful here — order is by path. */
|
|
18
|
+
export declare function checkCode(root: string): Promise<CodeCheckResult>;
|
|
19
|
+
//# sourceMappingURL=check-code.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"check-code.d.ts","sourceRoot":"","sources":["../../src/check-code.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAIH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;AA2FrD,MAAM,WAAW,eAAe;IAC/B,QAAQ,EAAE,YAAY,EAAE,CAAA;IACxB,KAAK,EAAE,MAAM,CAAA;CACb;AAED,sHAAsH;AACtH,wBAAsB,SAAS,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,eAAe,CAAC,CAqBtE"}
|
package/dist/types/check.d.ts
CHANGED
|
@@ -3,6 +3,8 @@ export interface CheckOptions {
|
|
|
3
3
|
json: boolean;
|
|
4
4
|
/** Treat warnings as failures too. Off by default: a dangling reference builds fine. */
|
|
5
5
|
strict: boolean;
|
|
6
|
+
/** Skip the code syntax pass — content only. */
|
|
7
|
+
contentOnly: boolean;
|
|
6
8
|
}
|
|
7
9
|
/**
|
|
8
10
|
* The Astro apps to check, relative to `cwd`.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"check.d.ts","sourceRoot":"","sources":["../../src/check.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"check.d.ts","sourceRoot":"","sources":["../../src/check.ts"],"names":[],"mappings":"AAKA,MAAM,WAAW,YAAY;IAC5B,GAAG,EAAE,MAAM,CAAA;IACX,IAAI,EAAE,OAAO,CAAA;IACb,wFAAwF;IACxF,MAAM,EAAE,OAAO,CAAA;IACf,gDAAgD;IAChD,WAAW,EAAE,OAAO,CAAA;CACpB;AAMD;;;;;;;GAOG;AACH,wBAAgB,UAAU,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,EAAE,CAYhD;AAWD,yEAAyE;AACzE,wBAAsB,KAAK,CAAC,OAAO,EAAE,YAAY,GAAG,OAAO,CAAC,MAAM,CAAC,CA0ClE"}
|