@nuasite/cli 0.52.0 → 0.54.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.
@@ -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"}
@@ -3,7 +3,18 @@ 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;
8
+ /** Validate against the project's real schemas, which means importing and running its content config. */
9
+ live: boolean;
6
10
  }
11
+ /**
12
+ * `nua check`'s argv, as options.
13
+ *
14
+ * Pure and exported so the flag combinations are testable: `index.ts` is a top-level-await
15
+ * script that reads `process.argv` and calls `process.exit`, so a test cannot import it.
16
+ */
17
+ export declare function parseCheckArgs(args: string[], cwd: string): CheckOptions;
7
18
  /**
8
19
  * The Astro apps to check, relative to `cwd`.
9
20
  *
@@ -1 +1 @@
1
- {"version":3,"file":"check.d.ts","sourceRoot":"","sources":["../../src/check.ts"],"names":[],"mappings":"AAIA,MAAM,WAAW,YAAY;IAC5B,GAAG,EAAE,MAAM,CAAA;IACX,IAAI,EAAE,OAAO,CAAA;IACb,wFAAwF;IACxF,MAAM,EAAE,OAAO,CAAA;CACf;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,CAgClE"}
1
+ {"version":3,"file":"check.d.ts","sourceRoot":"","sources":["../../src/check.ts"],"names":[],"mappings":"AAMA,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;IACpB,yGAAyG;IACzG,IAAI,EAAE,OAAO,CAAA;CACb;AAED;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,GAAG,YAAY,CAUxE;AAMD;;;;;;;GAOG;AACH,wBAAgB,UAAU,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,EAAE,CAYhD;AA8BD,yEAAyE;AACzE,wBAAsB,KAAK,CAAC,OAAO,EAAE,YAAY,GAAG,OAAO,CAAC,MAAM,CAAC,CAgDlE"}
@@ -0,0 +1,20 @@
1
+ /**
2
+ * Load a project's real collection schemas so `nua check` can validate against them.
3
+ *
4
+ * Getting a live schema means importing the project's `content.config.ts`, which executes
5
+ * project code, needs an `astro:content` stub installed process-wide, and caches the module
6
+ * for the life of the process. That is fine here — the CLI is one-shot — and unacceptable in
7
+ * the dev server and sidecar, which is why `cms-core` takes the result through a port instead
8
+ * of loading it itself (see `@nuasite/cms-core`'s `schema-port.ts`).
9
+ *
10
+ * Nothing here throws: a project that cannot be loaded returns a `skipped` sentence and the
11
+ * caller falls back to the static rules. A check that cannot run is not a check that fails.
12
+ */
13
+ import type { LiveSchemas } from '@nuasite/cms-core';
14
+ export type LoadSchemasResult = {
15
+ schemas: LiveSchemas;
16
+ } | {
17
+ skipped: string;
18
+ };
19
+ export declare function loadLiveSchemas(projectRoot: string): Promise<LoadSchemasResult>;
20
+ //# sourceMappingURL=live-schema.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"live-schema.d.ts","sourceRoot":"","sources":["../../src/live-schema.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,KAAK,EAA0C,WAAW,EAAE,MAAM,mBAAmB,CAAA;AAI5F,MAAM,MAAM,iBAAiB,GAAG;IAAE,OAAO,EAAE,WAAW,CAAA;CAAE,GAAG;IAAE,OAAO,EAAE,MAAM,CAAA;CAAE,CAAA;AA+N9E,wBAAsB,eAAe,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAoErF"}