Commit Graph
6 Commits
Author SHA1 Message Date
chrnx ecdc46cac3 fix(plugin): the review's smaller findings
CI / installer (macos-14) (pull_request) Successful in 4s
CI / check (pull_request) Failing after 29s
CI / starter (bun) (pull_request) Successful in 32s
CI / starter (deno) (pull_request) Successful in 33s
CI / starter (edge) (pull_request) Successful in 37s
CI / core-freshness (pull_request) Has been skipped
CI / installer (ubuntu-latest) (pull_request) Successful in 11s
CI / starter (node) (pull_request) Successful in 34s
- `--package` takes a directory only as `--package=DIR`, so
  `create plugin --package algo` names the plugin instead of writing
  into ./algo.
- A NAME passed on the command line is checked before any question.
- The package directory is named in its errors, a file there is
  reported as a file, and a failed write lists what was already written.
- An in-app plugin folder is removed again if the entry cannot be
  written, so the rerun does not stop on "already exists".
- `--folder .` and `./plugins/` give clean import paths.
- Flags for the other mode are named as ignored; plugin flags on
  another create kind are an error.
- Array elements are read from the parse tree, so `algo({ a, b })` is
  one element when checking for a duplicate.
- Scopes follow JSR's rule: 2 to 20 characters, no leading hyphen.
- Packages ship a LICENSE (MIT, which the README says to change), the
  license field in both manifests, and @types/node for the test file.

Signed-off-by: Diego Resendez <diego.resendez@zero-oneit.com>
2026-09-24 13:26:29 -05:00
chrnx 4358091d07 fix(plugin): close the review's gaps in names, prompts and the generated test
The collision check scanned the whole file as text, so every scaffolded
app refused `core`, `tea` or `module` because they appear inside import
strings. It now reads identifiers from the parse tree.

Typing `npm` at the registry question silently produced a JSR-only
package. An answer that is not offered is now asked again.

The generated test only awaited boot(); it now checks the plugin's token
is in app.graph(), and fails if it is not. engines.node moves to
>=22.18, the first Node that runs `node --test` on .ts unflagged.

Signed-off-by: Diego Resendez <diego.resendez@zero-oneit.com>
2026-09-24 13:11:55 -05:00
chrnx e4a350fcbf fix(plugin): refuse names whose factory would not compile
`delete`, `class` or `default` made `export function delete(...)`, which
is not TypeScript. `create app` and `app` made a factory named after
something the entry already binds, so the import broke src/app.ts, and
the command still reported the wiring as a success. Both are now
refused before anything is written.

Signed-off-by: Diego Resendez <diego.resendez@zero-oneit.com>
2026-09-24 13:05:46 -05:00
chrnx 52241cc9a6 fix(plugin): let a generated package run deno test straight away
With a package.json beside deno.json, Deno expects node_modules to be
installed, so deno test failed until a deno install, and then failed
to type-check node:assert without @types/node. nodeModulesDir "auto"
installs on demand, and the package now passes deno test, node --test
and bun test as generated.

Signed-off-by: Diego Resendez <diego.resendez@zero-oneit.com>
2026-09-24 13:00:43 -05:00
chrnx 42c1148903 feat(plugin): --package scaffolds a JSR-first plugin package
The directory must be empty, so a package never mixes into another
project. JSR is the default and the README says why; JSR + npm adds an
ESM-only tsc build, since npm consumers need compiled output, and
suggests the green-tea- name without enforcing it.

Signed-off-by: Diego Resendez <diego.resendez@zero-oneit.com>
2026-09-24 12:57:32 -05:00
chrnx 3c3b7aaf8e feat(plugin): matcha create plugin scaffolds an in-app plugin and wires it
In-app is the default. Each plugin gets its own folder under plugins/
(or --folder), so it can be exported as a package later, and the
factory is registered in createApp({ plugins }). A plugins value that
is not an array literal is left alone with a hint, as modules already
is.

Signed-off-by: Diego Resendez <diego.resendez@zero-oneit.com>
2026-09-24 12:54:51 -05:00