@jskit-ai/ui-generator 0.1.20 → 0.1.22

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.
@@ -1,7 +1,7 @@
1
1
  export default Object.freeze({
2
2
  packageVersion: 1,
3
3
  packageId: "@jskit-ai/ui-generator",
4
- version: "0.1.20",
4
+ version: "0.1.22",
5
5
  kind: "generator",
6
6
  description: "Create non-CRUD pages, reusable UI elements, and subpage hosts.",
7
7
  options: {
@@ -278,7 +278,7 @@ export default Object.freeze({
278
278
  mutations: {
279
279
  dependencies: {
280
280
  runtime: {
281
- "@jskit-ai/users-web": "0.1.52"
281
+ "@jskit-ai/users-web": "0.1.54"
282
282
  },
283
283
  dev: {}
284
284
  },
package/package.json CHANGED
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "name": "@jskit-ai/ui-generator",
3
- "version": "0.1.20",
3
+ "version": "0.1.22",
4
4
  "type": "module",
5
5
  "scripts": {
6
6
  "test": "node --test"
7
7
  },
8
8
  "dependencies": {
9
- "@jskit-ai/kernel": "0.1.37",
10
- "@jskit-ai/shell-web": "0.1.36"
9
+ "@jskit-ai/kernel": "0.1.39",
10
+ "@jskit-ai/shell-web": "0.1.38"
11
11
  },
12
12
  "exports": {
13
13
  "./server/buildTemplateContext": "./src/server/buildTemplateContext.js"
@@ -32,8 +32,8 @@ function renderPageLinkPlacementBlock({
32
32
  " props: {\n" +
33
33
  ` label: "${label}",\n` +
34
34
  ` surface: "${surface}",\n` +
35
- ` workspaceSuffix: "${context.__JSKIT_UI_LINK_WORKSPACE_SUFFIX__}",\n` +
36
- ` nonWorkspaceSuffix: "${context.__JSKIT_UI_LINK_NON_WORKSPACE_SUFFIX__}",\n` +
35
+ ` scopedSuffix: "${context.__JSKIT_UI_LINK_WORKSPACE_SUFFIX__}",\n` +
36
+ ` unscopedSuffix: "${context.__JSKIT_UI_LINK_NON_WORKSPACE_SUFFIX__}",\n` +
37
37
  `${context.__JSKIT_UI_LINK_TO_PROP_LINE__} },\n` +
38
38
  `${String(context.__JSKIT_UI_LINK_WHEN_LINE__ || "")}` +
39
39
  " });\n" +
@@ -313,18 +313,27 @@ test("ui-generator add-subpages validates target format", async () => {
313
313
  });
314
314
  });
315
315
 
316
- test("ui-generator add-subpages rejects target files with a src/pages prefix", async () => {
316
+ test("ui-generator add-subpages accepts target files with a src/pages prefix", async () => {
317
317
  await withTempApp(async (appRoot) => {
318
318
  await writeAppFixture(appRoot);
319
319
 
320
- await assert.rejects(
321
- runGeneratorSubcommand({
322
- appRoot,
323
- subcommand: "add-subpages",
324
- args: ["src/pages/w/[workspaceSlug]/admin/practice/index.vue"],
325
- options: {}
326
- }),
327
- /must be relative to src\/pages\/, without the src\/pages\/ prefix/
320
+ const bareTargetFile = "w/[workspaceSlug]/admin/practice/index.vue";
321
+ const targetFile = `src/pages/${bareTargetFile}`;
322
+ await writePageFile(appRoot, bareTargetFile);
323
+
324
+ const result = await runGeneratorSubcommand({
325
+ appRoot,
326
+ subcommand: "add-subpages",
327
+ args: [targetFile],
328
+ options: {}
329
+ });
330
+
331
+ assert.ok(result.touchedFiles.includes(targetFile));
332
+ const pageSource = await readFile(path.join(appRoot, targetFile), "utf8");
333
+ assert.match(
334
+ pageSource,
335
+ /<ShellOutlet target="practice:sub-pages" default-link-component-token="local\.main\.ui\.tab-link-item" \/>/
328
336
  );
337
+ assert.match(pageSource, /<RouterView \/>/);
329
338
  });
330
339
  });
@@ -84,7 +84,7 @@ test("ui-generator page subcommand creates an index page from an explicit target
84
84
 
85
85
  const placementSource = await readFile(path.join(appRoot, "src", "placement.js"), "utf8");
86
86
  assert.match(placementSource, /id: "ui-generator\.page\.admin\.practice\.link"/);
87
- assert.match(placementSource, /workspaceSuffix: "\/practice"/);
87
+ assert.match(placementSource, /scopedSuffix: "\/practice"/);
88
88
  assert.match(placementSource, /label: "Practice"/);
89
89
  });
90
90
  });
@@ -107,7 +107,7 @@ test("ui-generator page subcommand creates a file route and derives label from t
107
107
  assert.match(pageSource, /<h1 class="text-h5 mb-2">Contact Id<\/h1>/);
108
108
 
109
109
  const placementSource = await readFile(path.join(appRoot, "src", "placement.js"), "utf8");
110
- assert.match(placementSource, /workspaceSuffix: "\/contacts\/\[contactId\]"/);
110
+ assert.match(placementSource, /scopedSuffix: "\/contacts\/\[contactId\]"/);
111
111
  assert.match(placementSource, /id: "ui-generator\.page\.admin\.contacts\.contact-id\.link"/);
112
112
  assert.match(placementSource, /label: "Contact Id"/);
113
113
  });
@@ -275,7 +275,7 @@ test("ui-generator page subcommand chooses the most specific matching surface pa
275
275
 
276
276
  const placementSource = await readFile(path.join(appRoot, "src", "placement.js"), "utf8");
277
277
  assert.match(placementSource, /id: "ui-generator\.page\.admin\.practice\.link"/);
278
- assert.match(placementSource, /workspaceSuffix: "\/practice"/);
278
+ assert.match(placementSource, /scopedSuffix: "\/practice"/);
279
279
  });
280
280
  });
281
281
 
@@ -314,7 +314,7 @@ test("ui-generator page subcommand accepts target files with a src/pages prefix"
314
314
  assert.match(pageSource, /Practice/);
315
315
  const placementSource = await readFile(path.join(appRoot, "src", "placement.js"), "utf8");
316
316
  assert.match(placementSource, /id: "ui-generator\.page\.admin\.practice\.link"/);
317
- assert.match(placementSource, /workspaceSuffix: "\/practice"/);
317
+ assert.match(placementSource, /scopedSuffix: "\/practice"/);
318
318
  });
319
319
  });
320
320