create-cordisx-plugin 0.1.0-beta.0 → 0.1.0-beta.10

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  # create-cordisx-plugin
2
2
 
3
- Create a minimal trusted-local CordisX plugin project.
3
+ Create trusted-local CordisX plugins in the project shape that fits their use.
4
4
 
5
5
  ```bash
6
6
  npm create cordisx-plugin@beta my-plugin
@@ -11,10 +11,76 @@ npx create-cordisx-plugin@beta my-plugin
11
11
  The `@beta` qualifier is required while npm `latest` remains the non-functional
12
12
  `0.0.0` package-name reservation.
13
13
 
14
- The generated project includes a version-1 manifest exported from its entry,
15
- structured UI contribution, TypeScript build, manifest test, and
16
- `cordisx dev --dry-run` script. It does not install to a marketplace, sign the
17
- plugin, provide a permission sandbox, or promise hot reload.
14
+ The positional command remains the short path for one standalone plugin. Two
15
+ explicit modes cover larger project shapes:
16
+
17
+ ```bash
18
+ # A dedicated repository containing several independent plugin packages.
19
+ npx create-cordisx-plugin@beta --mode workspace my-suite \
20
+ --plugin chatroom --plugin calendar
21
+
22
+ # Add a CordisX development package to an existing business project.
23
+ npx create-cordisx-plugin@beta --mode embedded ./my-business-project \
24
+ --plugin incident-room
25
+ ```
26
+
27
+ `workspace` creates one `cordisx.config.json`, one development server command,
28
+ and independently addressable packages under `plugins/<id>`. Use
29
+ `--package-manager pnpm` to also create `pnpm-workspace.yaml`; npm, Yarn, and Bun
30
+ can use the generated `package.json#workspaces` declaration.
31
+
32
+ `embedded` creates `.cordisx/config.json`, `.cordisx/package.json`, an
33
+ independent `.cordisx/tsconfig.json`, and `.cordisx/plugins/<id>`. Existing
34
+ business files are not replaced. Repeating the command with a new plugin id
35
+ appends that plugin while preserving the existing CordisX package and config
36
+ fields. The config entries are relative to `.cordisx/config.json`.
37
+
38
+ Embedded mode defaults to `--integration auto`: it joins a detected pnpm,
39
+ npm, Yarn, or Bun workspace, while retaining `.cordisx` as its own package and
40
+ TypeScript boundary. pnpm workspace integration updates the existing
41
+ `pnpm-workspace.yaml`; the other supported workspace shapes update the root
42
+ `package.json#workspaces`. Use `--integration isolated` to keep installation
43
+ inside `.cordisx`, or `--integration workspace` to require an existing
44
+ supported workspace. `--package-manager` makes non-interactive automation
45
+ deterministic. Existing pnpm comments, quoted keys, and block or flow sequence
46
+ styles are preserved. If the workspace YAML cannot be parsed or its `packages`
47
+ value cannot be updated without changing its meaning, creation stops and rolls
48
+ back without changing the business project.
49
+
50
+ Every generated plugin includes a version-1 manifest, a structured toolbar
51
+ route, and a component-only React page module. Its standalone, workspace, or
52
+ embedded environment supplies typecheck, production Vite build, manifest test,
53
+ and `cordisx dev --dry-run` commands. Production output uses a stable
54
+ `dist/runtime/module.js` entry plus content-addressed `chunks/`, `assets/`, and formal
55
+ `artifact.json`. Declarations remain outside that closed graph in `dist/types/`.
56
+ CSS and static assets remain external files, and dynamic
57
+ imports load their graph only when reached. Workspaces and embedded projects
58
+ build each plugin separately so independently replaceable generations never
59
+ share output chunks.
60
+
61
+ Every generated production config calls the public
62
+ `cordisx/vite` `cordisXPluginViteConfig()` helper. That reusable author/Host
63
+ pipeline owns the deterministic output rules, virtualizes only the closed Host
64
+ singleton imports, and emits the formal `dist/runtime/artifact.json`. A portable
65
+ CordisX package manifest points its browser entry at the adjacent prebuilt
66
+ `dist/runtime/module.js`; the Host validates and retains that complete indexed graph.
67
+
68
+ Development remains one CordisX-owned Vite server and HMR graph using the
69
+ original source entries. The environment installs no private React runtime:
70
+ React, React DOM, their types, JSX runtimes, and the initial CordisX component
71
+ set are provided by the Host through `cordisx/react` and `cordisx/ui`. Plugin
72
+ artifacts that bundle a private React copy are rejected.
73
+
74
+ The generated route and page use closed route-v2/page-v3 documents with real
75
+ localized title and description dictionaries. Canonical ids, path, outlet,
76
+ params, and chrome remain untranslated machine fields. CordisX owns route and
77
+ page chrome, the React root, theme, error boundary, and lifecycle cleanup; the
78
+ plugin owns only the controlled body component. Local component modules are
79
+ laid out as Vite React Fast Refresh boundaries; plugin entry, manifest, and
80
+ `apply()` changes use Cordis lifecycle replacement. Installed production
81
+ packages update through normal package lifecycle rather than development HMR.
82
+ The generator does not install to a marketplace, sign the plugin, or provide a
83
+ permission sandbox.
18
84
 
19
85
  The `create-cordisx-plugin` tool itself is licensed under
20
86
  `AGPL-3.0-or-later`. Files under its marked `template` directory and projects
@@ -23,3 +89,12 @@ An independent plugin using only public, versioned CordisX plugin interfaces
23
89
  may be commercial, sold, distributed through a marketplace, and licensed under
24
90
  terms chosen by its author. The custom Exception is not a standard SPDX
25
91
  exception and should receive legal review before stable.
92
+
93
+ ## CSS authoring
94
+
95
+ All three modes generate `src/vite-env.d.ts` in each plugin source tree.
96
+ Use side-effect CSS imports in the owning component and keep the complete
97
+ Vite output graph. Explicit `?inline` imports produce text; CSS Modules produce
98
+ class maps only with a compatible Host development transform. Consult the
99
+ [maintained CSS guidance](https://github.com/cordisx/cordisx/blob/main/skills/cordisx-plugin-development/references/css-and-lifecycle.md)
100
+ for ownership, current limitations, and separate HMR/unload verification.