@designos/compiler-cli 0.3.0 → 0.3.1

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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 relacloud
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -2,10 +2,15 @@
2
2
 
3
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
+ ## Using a repository checkout
6
+
7
+ From the repository root, build the CLI and its transitive workspace dependencies. In this checkout, the package does not expose its own `designos` bin through `pnpm --filter @designos/compiler-cli exec`, so run the built entry point with Node:
8
+
5
9
  ```bash
6
- pnpm --filter @designos/compiler-cli exec designos compile --target react
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
10
+ pnpm exec turbo run build --filter=@designos/compiler-cli...
11
+ node packages/compiler-cli/dist/cli.js compile --target react --project-root docs/specifications/examples/component-kit --config designos.project.json
12
+ node packages/compiler-cli/dist/cli.js compile --target vue --project-root docs/specifications/examples/component-kit --config designos.project.json --out-dir dist/designos/vue
13
+ node packages/compiler-cli/dist/cli.js kit validate --root docs/specifications/examples/component-kit
9
14
  ```
10
15
 
11
16
  Component-kit validation supports schema versions 1 and 2. Schema v2 also validates the referenced kit-owned design manifest, including its tokens and presets.
@@ -38,7 +43,10 @@ A minimal config has this shape. Project-level `styles` are copied into every ta
38
43
  },
39
44
  "outputDirectory": "src/components",
40
45
  "assets": [
41
- { "source": "src/assets/hero-glow.png", "outputPath": "src/assets/hero-glow.png" }
46
+ {
47
+ "source": "src/assets/hero-glow.png",
48
+ "outputPath": "src/assets/hero-glow.png"
49
+ }
42
50
  ]
43
51
  }
44
52
  ]
@@ -68,10 +76,10 @@ Example `designos.project.json`:
68
76
  }
69
77
  ```
70
78
 
71
- The manifest path contains the DesignOS editor manifest (`type`, `displayName`, `fields`, `slots` and optional capabilities). The CLI emits these separately in `manifests.json`, keyed by stable component `type`; the target component registry remains a separate build-time module. TSX and Mitosis runtime behavior remain in the component source; neither is written into `PageDocument`. Paths are project-relative and the CLI rejects paths that escape the project root. Declared `styles` are copied and imported by the generated component entry module; `assets` are copied without automatic bundling or reference rewriting. Declare CSS under `styles` even when it is imported in source, because Mitosis does not necessarily retain stylesheet imports in generated targets. The consuming build environment remains responsible for installing third-party packages. Run the same command, for example `pnpm --filter @designos/compiler-cli exec designos compile --target react`, from the source-project root. A complete source-project sample is in [`examples/designos-source`](./examples/designos-source/). React is the editor's initial preview target; this does not imply that all targets preserve all Mitosis semantics.
79
+ The manifest path contains the DesignOS editor manifest (`type`, `displayName`, `fields`, `slots` and optional capabilities). The CLI emits these separately in `manifests.json`, keyed by stable component `type`; the target component registry remains a separate build-time module. TSX and Mitosis runtime behavior remain in the component source; neither is written into `PageDocument`. Paths are project-relative and the CLI rejects paths that escape the project root. Declared `styles` are copied and imported by the generated component entry module; `assets` are copied without automatic bundling or reference rewriting. Declare CSS under `styles` even when it is imported in source, because Mitosis does not necessarily retain stylesheet imports in generated targets. The consuming build environment remains responsible for installing third-party packages. From the repository root, compile the included source-project sample with `node packages/compiler-cli/dist/cli.js compile --target react --project-root packages/compiler-cli/examples/designos-source --config designos.project.json`. In a consuming project with the CLI installed as a dependency, run `pnpm exec designos compile --target react` from that project root. A complete source-project sample is in [`examples/designos-source`](./examples/designos-source/). React is the editor's initial preview target; this does not imply that all targets preserve all Mitosis semantics.
72
80
 
73
81
  The React and Vue renderer examples use `apps/shared-designos/designos.project.json` to compile their framework-specific maps, and import the same `apps/shared-designos/openpage-page.json` neutral page document. Their app scripts run `compile:designos` before typecheck/build/dev. Generated compiler modules stay in `dist/designos/<target>`; Vite writes the deployable app bundle separately to `dist/site`. Current Mitosis React TSX output is marked `@ts-nocheck` because the bridge does not yet preserve all prop and inferred callback types; the CLI diagnostics remain visible and this must not be read as semantic parity or a substitute for the remaining target audits.
74
82
 
75
83
  The editor app demos use the `PagePublisher` interface through a localStorage-backed adapter for demonstration only. Production SaaS integrations should inject their own adapter; the editor does not call the component compiler at publish time, and publishing a page JSON snapshot does not itself compile or deploy framework code.
76
84
 
77
- For local workspace use from a clean checkout, build the CLI and its transitive workspace dependencies with `pnpm exec turbo run build --filter=@designos/compiler-cli...`. Then run `pnpm --filter @designos/compiler-cli exec designos compile --target react` (or invoke the app-level `compile:designos` scripts). After the package is published, install it globally with `pnpm add --global @designos/compiler-cli`; its bin name is `designos`.
85
+ For clean monorepo checkouts, use the built Node entry point shown above. In a consuming project with `@designos/compiler-cli` installed as a dependency, `pnpm exec designos` resolves the package's bin from that project. After the package is published, it can also be installed globally with `pnpm add --global @designos/compiler-cli`; its bin name is `designos`.
package/dist/cli.js CHANGED
@@ -1886,7 +1886,8 @@ var designos_design_schema_default = {
1886
1886
  // ../core/package.json
1887
1887
  var package_default = {
1888
1888
  name: "@designos/core",
1889
- version: "0.2.0",
1889
+ version: "0.2.1",
1890
+ license: "MIT",
1890
1891
  private: false,
1891
1892
  type: "module",
1892
1893
  exports: {
@@ -1929,7 +1930,8 @@ var package_default = {
1929
1930
  // package.json
1930
1931
  var package_default2 = {
1931
1932
  name: "@designos/compiler-cli",
1932
- version: "0.3.0",
1933
+ version: "0.3.1",
1934
+ license: "MIT",
1933
1935
  private: false,
1934
1936
  type: "module",
1935
1937
  bin: {