@nuasite/cli 0.53.0 → 0.55.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 +51 -1
- package/dist/index.js +1263 -228
- package/dist/types/check.d.ts +9 -0
- package/dist/types/check.d.ts.map +1 -1
- package/dist/types/live-schema.d.ts +20 -0
- package/dist/types/live-schema.d.ts.map +1 -0
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +3 -3
- package/src/check.ts +49 -3
- package/src/index.ts +3 -10
- package/src/live-schema.ts +0 -0
package/dist/types/check.d.ts
CHANGED
|
@@ -5,7 +5,16 @@ export interface CheckOptions {
|
|
|
5
5
|
strict: boolean;
|
|
6
6
|
/** Skip the code syntax pass — content only. */
|
|
7
7
|
contentOnly: boolean;
|
|
8
|
+
/** Validate against the project's real schemas, which means importing and running its content config. */
|
|
9
|
+
live: boolean;
|
|
8
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;
|
|
9
18
|
/**
|
|
10
19
|
* The Astro apps to check, relative to `cwd`.
|
|
11
20
|
*
|
|
@@ -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":"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"}
|