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>
This commit is contained in:
chrnx committed 2026-09-24 13:11:55 -05:00
1 parent e4a350fcbf
commit 4358091d07
6 files changed
+163 -29

No files matched your search

+3 -2
View File
@@ -100,7 +100,7 @@ fn deno_json(p: &Package) -> String {
}
const ENGINES: &str = r#" "engines": {
"node": ">=22",
"node": ">=22.18",
"deno": ">=2",
"bun": ">=1.3"
},"#;
@@ -179,9 +179,10 @@ import {{ createApp }} from '@green-tea/core';
import {{ {fun} }} from '../src/index.ts';
test('mounts into an app, and the app boots', async () => {{
test('mounts, boots, and puts its token in the graph', async () => {{
const app = createApp({{ modules: [], plugins: [{fun}()] }});
await app.boot();
assert.ok(app.graph().nodes.some((node) => node.provides.includes('{slug}')));
}});
test('two instances mount side by side under different tokens', async () => {{