@designos/compiler-cli 0.1.1 → 0.2.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 +8 -2
- package/dist/cli.js +1439 -34
- package/dist/cli.js.map +1 -1
- package/package.json +8 -2
package/README.md
CHANGED
|
@@ -1,19 +1,25 @@
|
|
|
1
1
|
# DesignOS compiler CLI
|
|
2
2
|
|
|
3
|
-
The package exposes the `designos` command for build-time compilation. It reads either a version-1 IR project or a version-2 file-based TSX project, invokes the registered compiler for one target, writes generated modules and the target registry when one is registered, emits a neutral `manifests.json` map, then copies declared assets beneath a dedicated target directory in `dist`.
|
|
3
|
+
The package exposes the `designos` command for build-time compilation. It reads either a version-1 IR project or a version-2 file-based TSX project, invokes the registered compiler for one target, writes generated modules and the target registry when one is registered, emits a neutral `manifests.json` map, then copies declared component and project-level style/assets beneath a dedicated target directory in `dist`.
|
|
4
4
|
|
|
5
5
|
```bash
|
|
6
6
|
pnpm --filter @designos/compiler-cli exec designos compile --target react
|
|
7
7
|
pnpm --filter @designos/compiler-cli exec designos compile --target vue --config designos.project.json --out-dir dist/designos/vue
|
|
8
|
+
pnpm --filter @designos/compiler-cli exec designos kit validate --root docs/specifications/examples/component-kit
|
|
8
9
|
```
|
|
9
10
|
|
|
11
|
+
`designos kit validate` applies the root Draft 2020-12 kit schema before resolving manifest references, then checks package metadata agreement, SemVer and compatibility ranges, safe file and symlink resolution, normalized and unique output paths (including file/directory conflicts), kit inventory/compiler-project correspondence, component manifests, declared styles/assets and local imports, and editor catalog references. Compatibility-range mismatches for versions available to the validator are reported as warnings; the editor range is parsed but is not compared because this CLI does not resolve an editor version. Schema or semantic errors return a nonzero exit code. The command is read-only: it does not compile targets, write artifacts, publish packages, or claim target semantic parity. The `--root` option defaults to the current directory.
|
|
12
|
+
|
|
10
13
|
The command defaults to `designos.project.json` and `dist/designos/<target>`. `--out-dir` must be a dedicated subdirectory under the project’s `dist` directory. Existing generated files at matching paths are replaced; unrelated output files are left untouched. For version-1 projects, component `outputDirectory` values are relative to the target output root and default to `components`. For version-2 source projects, the default generated module directory follows the source file's relative directory, preserving relative imports. Declared asset `outputPath` values are relative to the target output root and default to their project-relative `source` path.
|
|
11
14
|
|
|
12
|
-
A minimal config has this shape:
|
|
15
|
+
A minimal config has this shape. Project-level `styles` are copied into every target output and are intended for static global/component CSS that consumers manually copy with the generated artifacts:
|
|
13
16
|
|
|
14
17
|
```json
|
|
15
18
|
{
|
|
16
19
|
"schemaVersion": "1",
|
|
20
|
+
"styles": [
|
|
21
|
+
{ "source": "src/styles/designos.css", "outputPath": "styles/designos.css" }
|
|
22
|
+
],
|
|
17
23
|
"components": [
|
|
18
24
|
{
|
|
19
25
|
"manifest": { "type": "hero", "displayName": "Hero", "fields": [] },
|