create-jay 0.25.4 → 0.26.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/dist/index.js +42 -5
- package/package.json +6 -4
- package/skills/jay/SKILL.md +47 -0
- package/templates/CLAUDE.md +11 -0
package/dist/index.js
CHANGED
|
@@ -90,6 +90,14 @@ var PLUGINS = [
|
|
|
90
90
|
checked: false,
|
|
91
91
|
isDep: true
|
|
92
92
|
},
|
|
93
|
+
{
|
|
94
|
+
name: "@jay-framework/wix-forms",
|
|
95
|
+
label: "Wix Forms",
|
|
96
|
+
description: "Forms: dynamic schemas from Wix, form rendering, validation, submissions",
|
|
97
|
+
group: "Wix",
|
|
98
|
+
checked: false,
|
|
99
|
+
isDep: true
|
|
100
|
+
},
|
|
93
101
|
{
|
|
94
102
|
name: "@jay-framework/wix-deploy",
|
|
95
103
|
label: "Wix Deploy",
|
|
@@ -264,7 +272,9 @@ async function scaffoldProject(projectDir, name, selectedPlugins) {
|
|
|
264
272
|
writeFile(projectDir, ".jay", readTemplate("jay-config.yaml"));
|
|
265
273
|
writeFile(projectDir, "vite.config.ts", readTemplate("vite.config.ts"));
|
|
266
274
|
writeFile(projectDir, "tsconfig.json", readTemplate("tsconfig.json"));
|
|
267
|
-
|
|
275
|
+
const agentGuidance = readTemplate("CLAUDE.md");
|
|
276
|
+
writeFile(projectDir, "CLAUDE.md", agentGuidance);
|
|
277
|
+
writeFile(projectDir, "agents.md", agentGuidance);
|
|
268
278
|
const hasDesignValidator = selectedPlugins.some(
|
|
269
279
|
(p) => p.name === "@jay-framework/design-system-validator"
|
|
270
280
|
);
|
|
@@ -281,6 +291,27 @@ async function scaffoldProject(projectDir, name, selectedPlugins) {
|
|
|
281
291
|
}
|
|
282
292
|
}
|
|
283
293
|
|
|
294
|
+
// lib/match-plugins.ts
|
|
295
|
+
var PACKAGE_SCOPE = "@jay-framework/";
|
|
296
|
+
var normalize = (token) => token.trim().toLowerCase();
|
|
297
|
+
var PLUGIN_BY_TOKEN = new Map(
|
|
298
|
+
PLUGINS.flatMap(
|
|
299
|
+
(plugin) => [plugin.name, plugin.name.replace(PACKAGE_SCOPE, ""), plugin.label].map(
|
|
300
|
+
(alias) => [normalize(alias), plugin]
|
|
301
|
+
)
|
|
302
|
+
)
|
|
303
|
+
);
|
|
304
|
+
function selectPluginsByRequest(requested) {
|
|
305
|
+
const matched = /* @__PURE__ */ new Set();
|
|
306
|
+
const unknown = [];
|
|
307
|
+
for (const token of requested) {
|
|
308
|
+
const plugin = PLUGIN_BY_TOKEN.get(normalize(token));
|
|
309
|
+
if (plugin) matched.add(plugin);
|
|
310
|
+
else unknown.push(token);
|
|
311
|
+
}
|
|
312
|
+
return { selected: PLUGINS.filter((plugin) => matched.has(plugin)), unknown };
|
|
313
|
+
}
|
|
314
|
+
|
|
284
315
|
// lib/index.ts
|
|
285
316
|
function detectPackageManager() {
|
|
286
317
|
const agent = process.env.npm_config_user_agent || "";
|
|
@@ -318,10 +349,16 @@ async function main() {
|
|
|
318
349
|
console.error(chalk.red(` Error: ${nameError}`));
|
|
319
350
|
process.exit(1);
|
|
320
351
|
}
|
|
321
|
-
const requested = cliArgs.plugins ? cliArgs.plugins.split(",").map((s) => s.trim()) : [];
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
)
|
|
352
|
+
const requested = cliArgs.plugins ? cliArgs.plugins.split(",").map((s) => s.trim()).filter(Boolean) : [];
|
|
353
|
+
const { selected, unknown } = selectPluginsByRequest(requested);
|
|
354
|
+
selectedPlugins = selected;
|
|
355
|
+
if (unknown.length > 0) {
|
|
356
|
+
console.error(chalk.red(` Error: unknown plugin(s): ${unknown.join(", ")}`));
|
|
357
|
+
console.error(
|
|
358
|
+
chalk.dim(` Available plugins: ${PLUGINS.map((p) => p.label).join(", ")}`)
|
|
359
|
+
);
|
|
360
|
+
process.exit(1);
|
|
361
|
+
}
|
|
325
362
|
} else {
|
|
326
363
|
const config = await runPrompts();
|
|
327
364
|
name = config.name;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-jay",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.26.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Create a new Jay Stack project",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -13,8 +13,9 @@
|
|
|
13
13
|
"scripts": {
|
|
14
14
|
"build": "tsup",
|
|
15
15
|
"clean": "rimraf dist",
|
|
16
|
-
"confirm": "npm run clean && npm run build",
|
|
17
|
-
"test": "
|
|
16
|
+
"confirm": "npm run clean && npm run build && npm run test",
|
|
17
|
+
"test": "vitest run",
|
|
18
|
+
"test:watch": "vitest"
|
|
18
19
|
},
|
|
19
20
|
"dependencies": {
|
|
20
21
|
"@inquirer/prompts": "^7.0.0",
|
|
@@ -24,6 +25,7 @@
|
|
|
24
25
|
"@types/node": "^22.15.21",
|
|
25
26
|
"rimraf": "^5.0.5",
|
|
26
27
|
"tsup": "^8.0.1",
|
|
27
|
-
"typescript": "^5.3.3"
|
|
28
|
+
"typescript": "^5.3.3",
|
|
29
|
+
"vitest": "^1.2.1"
|
|
28
30
|
}
|
|
29
31
|
}
|
package/skills/jay/SKILL.md
CHANGED
|
@@ -23,6 +23,21 @@ guides). After scaffolding, read those.
|
|
|
23
23
|
server-side via the Claude Agent SDK. Its authentication matches Claude Code: install the `claude`
|
|
24
24
|
CLI, then either set `ANTHROPIC_API_KEY` in the environment **or** run `claude login`. Without this
|
|
25
25
|
the project still scaffolds, builds, and runs — only the `/aiditor` route's agent won't run.
|
|
26
|
+
- **For any Wix plugin (`wix-stores` / `wix-members` / `wix-media` / `wix-data` / `wix-deploy`): a Wix
|
|
27
|
+
account + a browser login.** All Wix plugins share one credential owner,
|
|
28
|
+
`@jay-framework/wix-server-client`, which is pulled in automatically when you select any `wix-*`
|
|
29
|
+
plugin. Its setup is **interactive** — during `setup` it shells out to the Wix CLI
|
|
30
|
+
(`npx @wix/cli login`, opening a browser for OAuth) and, if the project isn't connected to a site yet,
|
|
31
|
+
runs `npm create @wix/new init` to connect one. From there it fetches the app secret and writes
|
|
32
|
+
`config/.wix.yaml` for you — you are **not** prompted for an API key, site ID, or client ID (those are
|
|
33
|
+
derived or fetched). Notes:
|
|
34
|
+
- This step **requires interactive mode.** In non-interactive / CI runs it is skipped with a
|
|
35
|
+
`needs-config` note; re-run `yarn setup` in a terminal to complete it.
|
|
36
|
+
- **`wix-deploy` additionally needs a live Wix login at deploy time** (`yarn wix:deploy`) — it uses
|
|
37
|
+
the Wix CLI session in `~/.wix`. If that session is missing it errors with "Run `wix login` first";
|
|
38
|
+
just run `npx @wix/cli login` again.
|
|
39
|
+
- **API key is optional / manual.** The default flow uses the auto-fetched app secret; only hand-edit
|
|
40
|
+
an `apiKey` into `config/.wix.yaml` if you deliberately choose the API-key strategy.
|
|
26
41
|
|
|
27
42
|
## 1 · Scaffold the project
|
|
28
43
|
|
|
@@ -54,6 +69,38 @@ The scaffolder then, in order: creates `./<name>/`, installs dependencies, gener
|
|
|
54
69
|
complete non-interactively (e.g. a plugin needing credentials) is skipped with a note and can be re-run
|
|
55
70
|
later with `yarn setup`.
|
|
56
71
|
|
|
72
|
+
### Completing setup non-interactively (agents / CI)
|
|
73
|
+
|
|
74
|
+
`jay-stack-cli setup` has three input modes:
|
|
75
|
+
|
|
76
|
+
- `--interactive` — prompts a human in the terminal.
|
|
77
|
+
- `--answers <file>` — reads answers from a YAML file (for agents).
|
|
78
|
+
- _(neither)_ — surfaces every needed answer instead of prompting.
|
|
79
|
+
|
|
80
|
+
When a plugin needs a value it can't get, setup does **not** hang or guess — it prints a structured,
|
|
81
|
+
machine-readable block and exits that plugin:
|
|
82
|
+
|
|
83
|
+
```
|
|
84
|
+
setup-needs-answer:
|
|
85
|
+
plugin: @jay-framework/some-plugin
|
|
86
|
+
key: apiKey
|
|
87
|
+
type: input
|
|
88
|
+
message: "Enter your API key"
|
|
89
|
+
choices: # only present for select-type questions
|
|
90
|
+
- us: United States
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
**The loop for an agent:** run `yarn setup` → for each `setup-needs-answer:` block, add a line
|
|
94
|
+
`<key>: "<value>"` to an `answers.yaml` → re-run `jay-stack-cli setup --answers answers.yaml`. Any value
|
|
95
|
+
still missing surfaces again as another `setup-needs-answer:`; repeat until none remain. The `key` is the
|
|
96
|
+
stable join field between the question and your answer.
|
|
97
|
+
|
|
98
|
+
**Exception — Wix login is not answerable via file.** The Wix plugins' credential setup shells out to
|
|
99
|
+
the Wix CLI for a browser-based OAuth login (`npx @wix/cli login`). In non-interactive mode it returns a
|
|
100
|
+
`needs-config` note ("requires interactive mode"), **not** a `setup-needs-answer:` — there is no key you
|
|
101
|
+
can put in `answers.yaml` for it. A human must run `yarn setup` in a real terminal once to complete the
|
|
102
|
+
Wix login; everything else (app secret, client ID, site ID) is fetched/derived automatically after that.
|
|
103
|
+
|
|
57
104
|
## 2 · What you get
|
|
58
105
|
|
|
59
106
|
```
|
package/templates/CLAUDE.md
CHANGED
|
@@ -6,6 +6,17 @@ This is a Jay Stack project.
|
|
|
6
6
|
|
|
7
7
|
Run `yarn setup` then `yarn agent-kit` to generate the agent kit.
|
|
8
8
|
|
|
9
|
+
### Plugin setup (credentials)
|
|
10
|
+
|
|
11
|
+
`yarn setup` configures each installed plugin. For agents/CI it is non-interactive: a plugin that needs
|
|
12
|
+
a value exits with a structured `setup-needs-answer:` block (`plugin`/`key`/`type`/`message`/`choices`).
|
|
13
|
+
Put each `<key>: "<value>"` into `answers.yaml` and re-run `jay-stack-cli setup --answers answers.yaml`;
|
|
14
|
+
repeat until every plugin reports `configured`. See `agent-kit/devops/INSTRUCTIONS.md` for the full loop.
|
|
15
|
+
|
|
16
|
+
**Wix plugins are the exception:** their login is a browser OAuth via the Wix CLI, so it can't be
|
|
17
|
+
answered from a file — run `yarn setup` once in a real terminal to complete it. Everything else (app
|
|
18
|
+
secret, client ID, site ID) is fetched automatically afterward.
|
|
19
|
+
|
|
9
20
|
Read `agent-kit/` for contracts, plugin references, and role guides — this is the authoritative
|
|
10
21
|
guidance for the agent kit structure, CLI commands, and project organization.
|
|
11
22
|
|