create-jay 0.25.5 → 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.
Files changed (2) hide show
  1. package/dist/index.js +39 -4
  2. package/package.json +6 -4
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",
@@ -283,6 +291,27 @@ async function scaffoldProject(projectDir, name, selectedPlugins) {
283
291
  }
284
292
  }
285
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
+
286
315
  // lib/index.ts
287
316
  function detectPackageManager() {
288
317
  const agent = process.env.npm_config_user_agent || "";
@@ -320,10 +349,16 @@ async function main() {
320
349
  console.error(chalk.red(` Error: ${nameError}`));
321
350
  process.exit(1);
322
351
  }
323
- const requested = cliArgs.plugins ? cliArgs.plugins.split(",").map((s) => s.trim()) : [];
324
- selectedPlugins = PLUGINS.filter(
325
- (p) => requested.includes(p.name) || requested.includes(p.label.toLowerCase())
326
- );
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
+ }
327
362
  } else {
328
363
  const config = await runPrompts();
329
364
  name = config.name;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-jay",
3
- "version": "0.25.5",
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
  }