@jskit-ai/shell-web 0.1.251 → 0.1.253

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 (49) hide show
  1. package/README.md +5 -79
  2. package/fixtures/adaptive-shell/src/main.js +6 -3
  3. package/package.json +6 -7
  4. package/patterns/application-shell/example/src/pages/home/index.vue +15 -5
  5. package/patterns/application-shell/example/tests/e2e/adaptive-shell.spec.ts +1 -1
  6. package/src/architecture/cli.js +1 -33
  7. package/src/architecture/inspectVueArchitecture.js +1 -400
  8. package/src/client/asyncModuleRecovery/runtime.js +116 -0
  9. package/src/client/components/ShellLayout.vue +18 -288
  10. package/src/client/components/ShellMenuLinkItem.vue +3 -21
  11. package/src/client/components/ShellOutlet.vue +2 -24
  12. package/src/client/components/ShellRouteTransition.vue +16 -114
  13. package/src/client/components/ShellSurfaceAwareMenuLinkItem.vue +5 -100
  14. package/src/client/components/ShellTabLinkItem.vue +5 -101
  15. package/src/client/composables/useShellNavigationLink.js +85 -0
  16. package/src/client/composables/useShellPullToRefresh.js +260 -0
  17. package/src/client/error/index.js +1 -1
  18. package/src/client/error/inject.js +4 -1
  19. package/src/client/error/policy.js +4 -13
  20. package/src/client/error/presenters.js +4 -9
  21. package/src/client/error/store.js +1 -1
  22. package/src/client/navigation/linkResolver.js +5 -27
  23. package/src/client/navigation/usePaths.js +1 -21
  24. package/src/client/placement/index.js +2 -0
  25. package/src/client/placement/inject.js +4 -1
  26. package/src/client/placement/runtime.js +2 -4
  27. package/src/client/placement/surfaceContext.js +11 -8
  28. package/src/client/placement/validators.js +18 -65
  29. package/src/client/providers/ShellWebClientProvider.js +100 -356
  30. package/src/client/requestRecovery/runtime.js +29 -77
  31. package/src/client/runtime/bootstrapRuntime.js +5 -4
  32. package/src/client/runtime/refreshRuntime.js +122 -0
  33. package/src/client/support/gestureTargets.js +26 -0
  34. package/src/client/support/menuLinkTarget.js +35 -19
  35. package/src/client/support/routeParams.js +26 -0
  36. package/src/client/support/routeSwipeGesture.js +88 -0
  37. package/src/client/support/routeTransitionKey.js +1 -3
  38. package/src/client/support/shellLayoutClass.js +32 -0
  39. package/test/bootstrapRuntime.test.js +98 -0
  40. package/test/errorActions.test.js +2 -1
  41. package/test/errorRuntime.test.js +30 -0
  42. package/test/linkResolver.test.js +23 -1
  43. package/test/menuLinkTarget.test.js +77 -0
  44. package/test/routeSwipeGesture.test.js +49 -0
  45. package/test/settingsPlacementContract.test.js +16 -6
  46. package/test/shellGestureSupport.test.js +46 -0
  47. package/test/surfaceContext.test.js +53 -0
  48. package/test/useShellPullToRefresh.test.js +123 -0
  49. package/test/architecture.test.js +0 -154
package/README.md CHANGED
@@ -1,85 +1,11 @@
1
1
  # Shell Web
2
2
 
3
3
  The existing client exports provide the JSKIT web shell, navigation and outlet
4
- placements. `@jskit-ai/shell-web/architecture` also exports
5
- `inspectVueArchitecture({ projectRoot, input, aliases, httpScope, apiBasePath })`
6
- for finite static architecture inspection.
4
+ placements.
7
5
 
8
6
  ## Architecture inspection
9
7
 
10
- Imported assets remain file-import evidence. The Vue adapter parses only its
11
- supported JavaScript, TypeScript and Vue modules; binary images do not block
12
- route discovery. Asset-to-component transformations require their own adapter
13
- and remain explicitly unsupported here.
14
-
15
- Run `jskit-inspect-vue` in the project directory. It reads one bounded JSON
16
- document from stdin and writes one `genesis.architecture-observations.v1` JSON
17
- document to stdout. Errors use stderr and a failing exit status. It does not
18
- import application code, start a server, generate router declarations or retain
19
- a watcher. The framework package has no Genesis or Vibe64 dependency.
20
-
21
- Input supplies `schema: "vibe64.architecture-inspection-input.v1"`, indexed
22
- `files: [{ path, hash }]` and `uiDiscovery.discoveries`. Optional `packages`
23
- carry `id`, `name`, `manifest`, `declarations`, `root`, `opaque` and public
24
- `entryPoints: [{ importPath, file }]`; `packageIdentity` binds observations to
25
- the same inspected public boundaries. Paths are project-relative
26
- and hashes use `sha256:<hex>`. Only declared, hash-matching UTF-8 files are read;
27
- symlinks and files over 4 MiB are rejected.
28
-
29
- Each discovery supplies `id`, `adapter`, `surface`, `mode`, `registrations`,
30
- `pageRoots` and `componentRoots`. Supported adapters are `jskit`,
31
- `vue-registered-router` and `vue-filesystem-router`.
32
-
33
- - Registered mode reads literal Vue Router `createRouter({ routes })` declarations
34
- from the registration files. Static local arrays and literal child routes work.
35
- - Filesystem mode reads literal `VueRouter(...)` options from the registration
36
- files and uses Vue Router's own scanner with declarations and watchers disabled.
37
- Its actual `routesFolder` determines pages; a directory alone is not proof.
38
- - Template component uses come from actual referenced imports. Shared definitions
39
- retain their source identity. Unused imports create no composition relationship.
40
- - Imported external elements retain the declared package/import-path/symbol owner.
41
- Their implementation files are not read. Project-owned workspace exports can
42
- resolve to indexed source files.
43
- - Static imports from indexed JavaScript, TypeScript and Vue files also provide
44
- optional `imports` observations. The framework resolver owns declared aliases,
45
- root-relative paths and file resolution. Each record retains the source range,
46
- current input hashes, target file and imported names, including aliases,
47
- `default`, namespace `*` and type-only classification. These are import facts,
48
- not evidence of runtime calls. Coverage remains partial; namespace use does
49
- not establish which individual exports are consumed.
50
- - An explicit `--http-scope shop --api-base-path /api` enables scoped literal
51
- `fetch` uses and receivers registered through JSKIT's `defineFeature` setup
52
- `http.router.register`. Use `--alias @=src` for declared project aliases.
53
- - Actual `CrudListScreen` / `CrudAddEditScreen` uses whose bound screen comes from
54
- the matching JSKIT composable can connect to exported `defineCrudJsonApiFeature`
55
- controller declarations. The resource must resolve through indexed imports and
56
- named re-exports to a literal `defineCrudResource` namespace and enabled
57
- operations. Scope includes the explicit HTTP application identity, declared
58
- surface and API suffix; the key uses `jskit.crud` resource operations rather
59
- than claiming a fully expanded runtime URL. Custom clients, transport/resource
60
- overrides, dynamic operations and disabled routes do not create guessed links.
61
- This shows declared entry points; runtime provider activation is not proven.
62
-
63
- Dynamic routing, template component tokens, runtime placement predicates,
64
- application request wrappers and dispatcher conventions require more evidence or
65
- an application-owned inspector. They remain partial or unsupported, never
66
- guessed. This command does not claim complete runtime call analysis. Protocols
67
- other than HTTP can use the same observation contract through their own inspector.
68
-
69
- Example consumer-owned Stack operation:
70
-
71
- ```markdown
72
- ## Architecture inspection
73
-
74
- ### Inspector `vue`: Inspect Vue pages
75
-
76
- - Runtime: `nodejs`
77
- - Directory: `.`
78
- - Command: `node` `node_modules/@jskit-ai/shell-web/src/architecture/cli.js` `--alias` `@=src`
79
- - Timeout seconds: `30`
80
- - Max output bytes: `4194304`
81
- ```
82
-
83
- The consumer owns command admission, runtime selection, cancellation, publication
84
- and validation against the indexed snapshot. It must retain the last valid
85
- snapshot when an inspector fails or source changes.
8
+ The static Vue architecture inspector lives in
9
+ `@jskit-ai/architecture-inspector`; see its README for the command contract.
10
+ `@jskit-ai/shell-web/architecture` and `src/architecture/cli.js` re-export it
11
+ unchanged for existing consumers.
@@ -13,6 +13,9 @@ import ShellSurfaceAwareMenuLinkItem from "@jskit-ai/shell-web/client/components
13
13
  import ShellTabLinkItem from "@jskit-ai/shell-web/client/components/ShellTabLinkItem";
14
14
  import { useShellLayoutStore } from "../../../src/client/stores/useShellLayoutStore.js";
15
15
  import { createWebPlacementRuntime } from "../../../src/client/placement/runtime.js";
16
+ import { SHELL_WEB_PLACEMENT_RUNTIME_KEY } from "../../../src/client/placement/inject.js";
17
+ import { SHELL_WEB_ERROR_RUNTIME_KEY } from "../../../src/client/error/inject.js";
18
+ import { SHELL_WEB_REFRESH_RUNTIME_KEY } from "../../../src/client/runtime/refreshRuntime.js";
16
19
  import { createErrorRuntime } from "../../../src/client/error/runtime.js";
17
20
  import { createDefaultMaterialErrorPresenters } from "../../../src/client/error/presenters.js";
18
21
  import { createErrorPresentationStore } from "../../../src/client/error/store.js";
@@ -183,21 +186,21 @@ const app = createApp(App);
183
186
  app.use(pinia);
184
187
  app.use(router);
185
188
  app.use(vuetify);
186
- app.provide("jskit.shell-web.runtime.web-placement.client", placementRuntime);
189
+ app.provide(SHELL_WEB_PLACEMENT_RUNTIME_KEY, placementRuntime);
187
190
  const errorStore = createErrorPresentationStore();
188
191
  const errorRuntime = createErrorRuntime({
189
192
  presenters: createDefaultMaterialErrorPresenters({ store: errorStore }),
190
193
  defaultPresenterId: "material.snackbar"
191
194
  });
192
195
  useShellErrorPresentationStore(pinia).attachRuntimeStore(errorStore);
193
- app.provide("jskit.shell-web.runtime.web-error.client", errorRuntime);
196
+ app.provide(SHELL_WEB_ERROR_RUNTIME_KEY, errorRuntime);
194
197
  window.__shellFixtureReportBanner = (message) => errorRuntime.report({
195
198
  source: "shell-web.fixture",
196
199
  message,
197
200
  severity: "error",
198
201
  channel: "banner"
199
202
  });
200
- app.provide("jskit.shell-web.runtime.web-refresh.client", {
203
+ app.provide(SHELL_WEB_REFRESH_RUNTIME_KEY, {
201
204
  async refresh() {
202
205
  await fetch("/api/bootstrap?reason=pull-to-refresh");
203
206
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jskit-ai/shell-web",
3
- "version": "0.1.251",
3
+ "version": "0.1.253",
4
4
  "type": "module",
5
5
  "scripts": {
6
6
  "test": "node --test --test-concurrency=1"
@@ -29,12 +29,14 @@
29
29
  "./architecture": "./src/architecture/inspectVueArchitecture.js"
30
30
  },
31
31
  "dependencies": {
32
- "@mdi/js": "^7.4.47",
33
- "@babel/parser": "7.29.9",
32
+ "@jskit-ai/architecture-inspector": "0.1.0",
33
+ "@mdi/js": "^7.4.47"
34
+ },
35
+ "devDependencies": {
34
36
  "@vue/compiler-sfc": "3.5.44"
35
37
  },
36
38
  "peerDependencies": {
37
- "@jskit-ai/kernel": "0.1.245",
39
+ "@jskit-ai/kernel": "0.1.246",
38
40
  "pinia": "^4.0.3",
39
41
  "vue": "^3.5.44",
40
42
  "vue-router": "^5.3.1",
@@ -382,8 +384,5 @@
382
384
  }
383
385
  }
384
386
  }
385
- },
386
- "bin": {
387
- "jskit-inspect-vue": "./src/architecture/cli.js"
388
387
  }
389
388
  }
@@ -15,16 +15,16 @@ const healthQuery = useQuery({
15
15
  });
16
16
 
17
17
  const health = computed(() => {
18
- if (healthQuery.isPending.value || healthQuery.isFetching.value) {
19
- return "loading...";
20
- }
21
-
22
18
  if (healthQuery.error.value) {
23
19
  return "unreachable";
24
20
  }
25
21
 
26
22
  return healthQuery.data.value?.ok ? "ok" : "unhealthy";
27
23
  });
24
+
25
+ const healthPending = computed(
26
+ () => healthQuery.isPending.value || healthQuery.isFetching.value
27
+ );
28
28
  </script>
29
29
 
30
30
  <template>
@@ -36,7 +36,13 @@ const health = computed(() => {
36
36
  <v-sheet rounded="lg" border class="home-surface-screen__panel">
37
37
  <div class="home-surface-screen__status">
38
38
  <span class="text-caption text-medium-emphasis">Service health</span>
39
- <strong>{{ health }}</strong>
39
+ <v-skeleton-loader
40
+ v-if="healthPending"
41
+ aria-label="Loading service health"
42
+ class="home-surface-screen__health-skeleton"
43
+ type="text"
44
+ />
45
+ <strong v-else>{{ health }}</strong>
40
46
  </div>
41
47
  <v-divider vertical class="d-none d-sm-block" />
42
48
  <div class="home-surface-screen__status">
@@ -71,6 +77,10 @@ const health = computed(() => {
71
77
  min-width: 9rem;
72
78
  }
73
79
 
80
+ .home-surface-screen__health-skeleton {
81
+ max-width: 5rem;
82
+ }
83
+
74
84
  @media (max-width: 640px) {
75
85
  .home-surface-screen__actions :deep(.v-btn) {
76
86
  min-height: 48px;
@@ -1,7 +1,7 @@
1
1
  import { expect, test } from "@playwright/test";
2
2
  import { DEFAULT_VIEWPORTS, runAdaptiveShellSmokeCase } from "@jskit-ai/shell-web/test/adaptiveShellSmoke";
3
3
 
4
- test.describe("generated adaptive shell smoke", () => {
4
+ test.describe("adaptive shell smoke", () => {
5
5
  for (const viewport of DEFAULT_VIEWPORTS) {
6
6
  test(`${viewport.name} layout has reachable navigation and no horizontal overflow`, async ({ page }) => {
7
7
  await runAdaptiveShellSmokeCase({ page, expect, viewport });
@@ -1,34 +1,2 @@
1
1
  #!/usr/bin/env node
2
- import { parseArgs } from "node:util";
3
- import { inspectVueArchitecture } from "./inspectVueArchitecture.js";
4
-
5
- try {
6
- const { values } = parseArgs({ options: {
7
- "http-scope": { type: "string", default: "" },
8
- "api-base-path": { type: "string", default: "" },
9
- alias: { type: "string", multiple: true, default: [] }
10
- } });
11
- const chunks = [];
12
- let length = 0;
13
- for await (const chunk of process.stdin) {
14
- length += chunk.length;
15
- if (length > 4 * 1024 * 1024) throw new Error("Architecture inspection input exceeds 4 MiB.");
16
- chunks.push(chunk);
17
- }
18
- const aliases = {};
19
- for (const entry of values.alias) {
20
- const separator = entry.indexOf("=");
21
- if (separator < 1 || separator === entry.length - 1) throw new Error("Use --alias name=project-directory.");
22
- const name = entry.slice(0, separator);
23
- if (Object.hasOwn(aliases, name)) throw new Error("Duplicate architecture alias.");
24
- aliases[name] = entry.slice(separator + 1);
25
- }
26
- const result = await inspectVueArchitecture({
27
- projectRoot: process.cwd(), input: JSON.parse(Buffer.concat(chunks).toString("utf8")),
28
- aliases, httpScope: values["http-scope"], apiBasePath: values["api-base-path"]
29
- });
30
- process.stdout.write(`${JSON.stringify(result)}\n`);
31
- } catch (error) {
32
- process.stderr.write(`${error.message}\n`);
33
- process.exitCode = 1;
34
- }
2
+ import "@jskit-ai/architecture-inspector/cli";