@jasonshimmy/vite-plugin-cer-app 0.4.0 → 0.4.2

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 (31) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/commits.txt +1 -1
  3. package/dist/cli/create/index.js +5 -5
  4. package/dist/cli/create/templates/spa/index.html.tpl +1 -1
  5. package/dist/cli/create/templates/spa/package.json.tpl +4 -4
  6. package/dist/cli/create/templates/ssg/index.html.tpl +1 -1
  7. package/dist/cli/create/templates/ssg/package.json.tpl +4 -4
  8. package/dist/cli/create/templates/ssr/index.html.tpl +1 -1
  9. package/dist/cli/create/templates/ssr/package.json.tpl +4 -4
  10. package/dist/plugin/generated-dir.d.ts +1 -1
  11. package/dist/plugin/generated-dir.js +2 -2
  12. package/dist/plugin/index.d.ts.map +1 -1
  13. package/dist/plugin/index.js +15 -3
  14. package/dist/plugin/index.js.map +1 -1
  15. package/dist/runtime/app-template.d.ts +1 -1
  16. package/dist/runtime/app-template.d.ts.map +1 -1
  17. package/dist/runtime/app-template.js +10 -10
  18. package/e2e/cypress/e2e/interactive.cy.ts +15 -0
  19. package/package.json +1 -1
  20. package/src/__tests__/plugin/cer-app-plugin.test.ts +42 -4
  21. package/src/__tests__/plugin/generated-dir.test.ts +2 -2
  22. package/src/cli/create/index.ts +5 -5
  23. package/src/cli/create/templates/spa/index.html.tpl +1 -1
  24. package/src/cli/create/templates/spa/package.json.tpl +4 -4
  25. package/src/cli/create/templates/ssg/index.html.tpl +1 -1
  26. package/src/cli/create/templates/ssg/package.json.tpl +4 -4
  27. package/src/cli/create/templates/ssr/index.html.tpl +1 -1
  28. package/src/cli/create/templates/ssr/package.json.tpl +4 -4
  29. package/src/plugin/generated-dir.ts +2 -2
  30. package/src/plugin/index.ts +16 -3
  31. package/src/runtime/app-template.ts +10 -10
package/CHANGELOG.md CHANGED
@@ -1,6 +1,14 @@
1
1
  # Changelog
2
2
 
3
3
  All notable changes to this project will be documented in this file.
4
+ ## [v0.4.2] - 2026-03-21
5
+
6
+ - fix: update dependencies in project templates to latest versions (1390724)
7
+
8
+ ## [v0.4.1] - 2026-03-21
9
+
10
+ - fix: update app entry point to use virtual module path /@cer/app.ts across templates and tests (139abaf)
11
+
4
12
  ## [v0.4.0] - 2026-03-20
5
13
 
6
14
  - feat: implement useInject composable for consistent value injection across SPA, SSR, and SSG fix: cer app hidden directory issue (f614e92)
package/commits.txt CHANGED
@@ -1 +1 @@
1
- - feat: implement useInject composable for consistent value injection across SPA, SSR, and SSG fix: cer app hidden directory issue (f614e92)
1
+ - fix: update dependencies in project templates to latest versions (1390724)
@@ -162,12 +162,12 @@ async function generateInlineTemplate(targetDir, projectName, mode) {
162
162
  preview: 'cer-app preview',
163
163
  },
164
164
  dependencies: {
165
- '@jasonshimmy/custom-elements-runtime': '^3.1.1',
165
+ '@jasonshimmy/custom-elements-runtime': '^3.2.0',
166
166
  },
167
167
  devDependencies: {
168
- vite: '^5.0.0',
169
- '@jasonshimmy/vite-plugin-cer-app': '^0.1.0',
170
- typescript: '^5.4.0',
168
+ vite: '^8.0.1',
169
+ '@jasonshimmy/vite-plugin-cer-app': '^0.4.1',
170
+ typescript: '^5.9.3',
171
171
  },
172
172
  }, null, 2), 'utf-8');
173
173
  // cer.config.ts
@@ -179,7 +179,7 @@ async function generateInlineTemplate(targetDir, projectName, mode) {
179
179
  // .gitignore
180
180
  await writeFile(join(targetDir, '.gitignore'), `# Dependencies\nnode_modules/\n\n# Build output\ndist/\n\n# CER App generated directory\n.cer/\n\n# Environment variables\n.env.local\n.env.*.local\n\n# Editor\n.vscode/\n.idea/\n*.suo\n*.sw?\n\n# OS\n.DS_Store\nThumbs.db\n\n# Logs\n*.log\n`, 'utf-8');
181
181
  // index.html
182
- await writeFile(join(targetDir, 'index.html'), `<!DOCTYPE html>\n<html lang="en">\n <head>\n <meta charset="UTF-8">\n <meta name="viewport" content="width=device-width, initial-scale=1.0">\n <title>${projectName}</title>\n </head>\n <body>\n <cer-layout-view></cer-layout-view>\n <script type="module" src="/.cer/app.ts"></script>\n </body>\n</html>\n`, 'utf-8');
182
+ await writeFile(join(targetDir, 'index.html'), `<!DOCTYPE html>\n<html lang="en">\n <head>\n <meta charset="UTF-8">\n <meta name="viewport" content="width=device-width, initial-scale=1.0">\n <title>${projectName}</title>\n </head>\n <body>\n <cer-layout-view></cer-layout-view>\n <script type="module" src="/@cer/app.ts"></script>\n </body>\n</html>\n`, 'utf-8');
183
183
  }
184
184
  main().catch((err) => {
185
185
  console.error('[create-cer-app] Fatal error:', err);
@@ -7,6 +7,6 @@
7
7
  </head>
8
8
  <body>
9
9
  <cer-layout-view></cer-layout-view>
10
- <script type="module" src="/.cer/app.ts"></script>
10
+ <script type="module" src="/@cer/app.ts"></script>
11
11
  </body>
12
12
  </html>
@@ -8,11 +8,11 @@
8
8
  "preview": "cer-app preview"
9
9
  },
10
10
  "dependencies": {
11
- "@jasonshimmy/custom-elements-runtime": "^3.1.1"
11
+ "@jasonshimmy/custom-elements-runtime": "^3.2.0"
12
12
  },
13
13
  "devDependencies": {
14
- "vite": "^5.0.0",
15
- "@jasonshimmy/vite-plugin-cer-app": "^0.1.0",
16
- "typescript": "^5.4.0"
14
+ "vite": "^8.0.1",
15
+ "@jasonshimmy/vite-plugin-cer-app": "^0.4.1",
16
+ "typescript": "^5.9.3"
17
17
  }
18
18
  }
@@ -7,6 +7,6 @@
7
7
  </head>
8
8
  <body>
9
9
  <cer-layout-view></cer-layout-view>
10
- <script type="module" src="/.cer/app.ts"></script>
10
+ <script type="module" src="/@cer/app.ts"></script>
11
11
  </body>
12
12
  </html>
@@ -9,11 +9,11 @@
9
9
  "preview": "cer-app preview"
10
10
  },
11
11
  "dependencies": {
12
- "@jasonshimmy/custom-elements-runtime": "^3.1.1"
12
+ "@jasonshimmy/custom-elements-runtime": "^3.2.0"
13
13
  },
14
14
  "devDependencies": {
15
- "vite": "^5.0.0",
16
- "@jasonshimmy/vite-plugin-cer-app": "^0.1.0",
17
- "typescript": "^5.4.0"
15
+ "vite": "^8.0.1",
16
+ "@jasonshimmy/vite-plugin-cer-app": "^0.4.1",
17
+ "typescript": "^5.9.3"
18
18
  }
19
19
  }
@@ -7,6 +7,6 @@
7
7
  </head>
8
8
  <body>
9
9
  <cer-layout-view></cer-layout-view>
10
- <script type="module" src="/.cer/app.ts"></script>
10
+ <script type="module" src="/@cer/app.ts"></script>
11
11
  </body>
12
12
  </html>
@@ -8,11 +8,11 @@
8
8
  "preview": "cer-app preview --ssr"
9
9
  },
10
10
  "dependencies": {
11
- "@jasonshimmy/custom-elements-runtime": "^3.1.1"
11
+ "@jasonshimmy/custom-elements-runtime": "^3.2.0"
12
12
  },
13
13
  "devDependencies": {
14
- "vite": "^5.0.0",
15
- "@jasonshimmy/vite-plugin-cer-app": "^0.1.0",
16
- "typescript": "^5.4.0"
14
+ "vite": "^8.0.1",
15
+ "@jasonshimmy/vite-plugin-cer-app": "^0.4.1",
16
+ "typescript": "^5.9.3"
17
17
  }
18
18
  }
@@ -13,7 +13,7 @@ export declare function getGeneratedDir(root: string): string;
13
13
  export declare function resolveHtmlEntry(config: ResolvedCerConfig): string;
14
14
  /**
15
15
  * Generates the content for the default `.cer/index.html`.
16
- * Always points to the generated `/.cer/app.ts` entry.
16
+ * Always points to the virtual `/@cer/app.ts` entry.
17
17
  */
18
18
  export declare function generateDefaultHtml(): string;
19
19
  /**
@@ -22,7 +22,7 @@ export function resolveHtmlEntry(config) {
22
22
  }
23
23
  /**
24
24
  * Generates the content for the default `.cer/index.html`.
25
- * Always points to the generated `/.cer/app.ts` entry.
25
+ * Always points to the virtual `/@cer/app.ts` entry.
26
26
  */
27
27
  export function generateDefaultHtml() {
28
28
  return `<!DOCTYPE html>
@@ -34,7 +34,7 @@ export function generateDefaultHtml() {
34
34
  </head>
35
35
  <body>
36
36
  <cer-layout-view></cer-layout-view>
37
- <script type="module" src="/.cer/app.ts"></script>
37
+ <script type="module" src="/@cer/app.ts"></script>
38
38
  </body>
39
39
  </html>
40
40
  `;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/plugin/index.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,MAAM,EAAiB,MAAM,MAAM,CAAA;AACjD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAA;AACtD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAA;AA4CxD;;GAEG;AACH,wBAAgB,aAAa,CAAC,UAAU,EAAE,YAAY,EAAE,IAAI,GAAE,MAAsB,GAAG,iBAAiB,CA4CvG;AAqFD;;;GAGG;AACH,wBAAgB,MAAM,CAAC,UAAU,GAAE,YAAiB,GAAG,MAAM,EAAE,CA4L9D"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/plugin/index.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,MAAM,EAAiB,MAAM,MAAM,CAAA;AACjD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAA;AACtD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAA;AA+CxD;;GAEG;AACH,wBAAgB,aAAa,CAAC,UAAU,EAAE,YAAY,EAAE,IAAI,GAAE,MAAsB,GAAG,iBAAiB,CA4CvG;AAqFD;;;GAGG;AACH,wBAAgB,MAAM,CAAC,UAAU,GAAE,YAAiB,GAAG,MAAM,EAAE,CAsM9D"}
@@ -33,9 +33,12 @@ const VIRTUAL_IDS = {
33
33
  };
34
34
  // Resolved virtual module IDs (prefixed with \0)
35
35
  const RESOLVED_IDS = Object.fromEntries(Object.entries(VIRTUAL_IDS).map(([k, v]) => [k, `\0${v}`]));
36
- // The generated app entry is served as a virtual module so Vite doesn't need
37
- // to find it on disk (Vite's fs security policy blocks paths starting with `/.`).
38
- const APP_ENTRY_URL = '/.cer/app.ts';
36
+ // The app entry is served via a virtual module at /@cer/app.ts.
37
+ // Using /@ avoids Vite's dot-directory fs security restriction that blocks /.cer/
38
+ // from being served through the transform middleware. The physical .cer/app.ts
39
+ // is still written to disk for IDE/TypeScript support, but the browser fetches
40
+ // /@cer/app.ts which resolves to this virtual module.
41
+ const APP_ENTRY_URL = '/@cer/app.ts';
39
42
  const RESOLVED_APP_ENTRY = '\0cer-app-entry';
40
43
  /**
41
44
  * Fills in default values for all config fields and resolves absolute paths.
@@ -192,6 +195,15 @@ export function cerApp(userConfig = {}) {
192
195
  configResolved(resolvedConfig) {
193
196
  // Re-resolve with the final root
194
197
  config = resolveConfig(userConfig, resolvedConfig.root);
198
+ // Write .cer/ immediately after config is resolved so the physical
199
+ // app.ts exists for IDE/TypeScript support before any Vite hooks fire.
200
+ writeGeneratedDir(config);
201
+ },
202
+ transformIndexHtml(html) {
203
+ // Rewrite any existing /.cer/app.ts src reference (older projects or
204
+ // the scaffold template) to /@cer/app.ts so Vite's transform middleware
205
+ // processes it. Vite blocks /.* paths from the transform pipeline.
206
+ return html.replace(/src=["']\/\.cer\/app\.ts["']/g, 'src="/@cer/app.ts"');
195
207
  },
196
208
  resolveId(id) {
197
209
  if (id === APP_ENTRY_URL)
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/plugin/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,OAAO,CAAA;AACrC,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,SAAS,CAAA;AAIlD,OAAO,EAAE,SAAS,EAAE,MAAM,kDAAkD,CAAA;AAC5E,OAAO,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAA;AACjE,OAAO,EAAE,qBAAqB,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAA;AAClG,OAAO,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAA;AACvD,OAAO,EAAE,iBAAiB,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAA;AACvE,O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AI,GAAG,MAAM,qBAAqB,CAAC,UAAU,EAAE,MAAM,CAAC,CAAA;gBAC5D,IAAI,IAAI,KAAK,IAAI,EAAE,CAAC;oBAClB,WAAW,CAAC,GAAG,CAAC,UAAU,EAAE,IAAI,CAAC,CAAA;gBACnC,CAAC;YACH,CAAC;QACH,CAAC;KACF,CAAA;IAED,yDAAyD;IACzD,wEAAwE;IACxE,MAAM,cAAc,GAAG,aAAa,CAAC,UAAU,CAAC,CAAA;IAChD,MAAM,EAAE,GAAG,EAAE,GAAG,cAAc,CAAC,GAAG,CAAA;IAClC,MAAM,EAAE,OAAO,EAAE,GAAG,UAAU,EAAE,GAAG,cAAc,CAAC,MAAM,CAAA;IACxD,MAAM,UAAU,GAAG,SAAS,CAAC;QAC3B,OAAO;QACP,GAAG,UAAU;QACb,GAAG,EAAE;YACH,GAAG;YACH,GAAG,EAAE,UAAU;SAChB;KACF,CAAC,CAAA;IAEF,OAAO,CAAC,YAAY,EAAE,GAAG,UAAU,CAAC,CAAA;AACtC,CAAC"}
@@ -5,5 +5,5 @@
5
5
  * automatically receive the latest bootstrap code on plugin update.
6
6
  * This file is gitignored and should never be edited directly.
7
7
  */
8
- export declare const APP_ENTRY_TEMPLATE = "// AUTO-GENERATED by @jasonshimmy/vite-plugin-cer-app \u2014 do not edit.\n// Regenerated automatically on every dev server start and build.\n\nimport '@jasonshimmy/custom-elements-runtime/css'\nimport 'virtual:cer-jit-css'\nimport 'virtual:cer-components'\nimport routes from 'virtual:cer-routes'\nimport layouts from 'virtual:cer-layouts'\nimport plugins from 'virtual:cer-plugins'\nimport { hasLoading, loadingTag } from 'virtual:cer-loading'\nimport { hasError, errorTag } from 'virtual:cer-error'\nimport {\n component,\n ref,\n provide,\n useOnConnected,\n useOnDisconnected,\n registerBuiltinComponents,\n} from '@jasonshimmy/custom-elements-runtime'\nimport { initRouter } from '@jasonshimmy/custom-elements-runtime/router'\nimport { enableJITCSS } from '@jasonshimmy/custom-elements-runtime/jit-css'\n\nregisterBuiltinComponents()\nenableJITCSS()\n\nconst router = initRouter({ routes })\n\n// \u2500\u2500\u2500 Navigation state \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n\nconst isNavigating = ref(false)\nconst currentError = ref(null)\n\nconst resetError = (): void => {\n currentError.value = null\n void router.replace(router.getCurrent().path)\n}\n;(globalThis as Record<string, unknown>).resetError = resetError\n\nconst _push = router.push.bind(router)\nconst _replace = router.replace.bind(router)\n\nrouter.push = async (path) => {\n isNavigating.value = true\n currentError.value = null\n try {\n await _push(path)\n } catch (err) {\n currentError.value = err instanceof Error ? err.message : String(err)\n } finally {\n isNavigating.value = false\n }\n}\n\nrouter.replace = async (path) => {\n isNavigating.value = true\n currentError.value = null\n try {\n await _replace(path)\n } catch (err) {\n currentError.value = err instanceof Error ? err.message : String(err)\n } finally {\n isNavigating.value = false\n }\n}\n\n// \u2500\u2500\u2500 Plugins \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n\n// Collect plugin-provided values so cer-layout-view can forward them into\n// the component context tree via the real provide() hook (which inject() walks).\n// Declared BEFORE component('cer-layout-view') to avoid a temporal dead zone\n// ReferenceError: customElements.define() upgrades existing DOM elements\n// synchronously, calling the render function immediately.\nconst _pluginProvides = new Map<string, unknown>()\n// Expose plugin provides globally so page components can read them synchronously\n// regardless of render order.\n;(globalThis as Record<string, unknown>).__cerPluginProvides = _pluginProvides\n\n// \u2500\u2500\u2500 <cer-layout-view> \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n\ncomponent('cer-layout-view', () => {\n // Forward plugin-provided values into the component context so inject() in\n // any descendant component can resolve them by walking up the DOM tree.\n for (const [key, value] of _pluginProvides) {\n provide(key, value)\n }\n\n const current = ref(router.getCurrent())\n let unsub: (() => void) | undefined\n\n useOnConnected(() => {\n unsub = router.subscribe((s: typeof current.value) => { current.value = s })\n })\n useOnDisconnected(() => { unsub?.(); unsub = undefined })\n\n if (currentError.value !== null) {\n if (hasError && errorTag) {\n return { tag: errorTag, props: { attrs: { error: String(currentError.value) } }, children: [] }\n }\n return { tag: 'div', props: { attrs: { style: 'padding:2rem;font-family:monospace' } }, children: String(currentError.value) }\n }\n\n if (isNavigating.value && hasLoading && loadingTag) {\n return { tag: loadingTag, props: {}, children: [] }\n }\n\n const matched = router.matchRoute(current.value.path)\n const routeMeta = matched?.route?.meta as { layout?: string } | undefined\n const layoutName = routeMeta?.layout ?? 'default'\n const layoutTag = (layouts as Record<string, string>)[layoutName]\n const routerView = { tag: 'router-view', props: {}, children: [] }\n\n if (layoutTag) return { tag: layoutTag, props: {}, children: [routerView] }\n return routerView\n})\n\nfor (const plugin of plugins) {\n if (plugin && typeof plugin.setup === 'function') {\n await plugin.setup({\n router,\n provide: (key: string, value: unknown) => { _pluginProvides.set(key, value) },\n config: {},\n })\n }\n}\n\n// \u2500\u2500\u2500 Pre-load initial route \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n// Download the current page's route chunk AFTER plugins run so that\n// cer-layout-view's first render (which calls provide()) completes before\n// page components are defined and their renders are scheduled. This ensures\n// inject() in child components can find values stored by provide().\n\nif (typeof window !== 'undefined') {\n const _initMatch = router.matchRoute(window.location.pathname)\n if (_initMatch?.route?.load) {\n try { await _initMatch.route.load() } catch { /* non-fatal */ }\n }\n}\n\n// \u2500\u2500\u2500 Initial navigation \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n\nif (typeof window !== 'undefined') {\n // Use the original (unwrapped) replace so isNavigating stays false during\n // the initial paint \u2014 the loading component must not flash over pre-rendered content.\n await _replace(window.location.pathname + window.location.search + window.location.hash)\n // Clear SSR loader data after initial navigation so subsequent client-side\n // navigations don't accidentally reuse stale server data.\n delete (globalThis as Record<string, unknown>).__CER_DATA__\n}\n\nexport { router }\n";
8
+ export declare const APP_ENTRY_TEMPLATE = "// AUTO-GENERATED by @jasonshimmy/vite-plugin-cer-app \u2014 do not edit.\n// Regenerated automatically on every dev server start and build.\n\nimport '@jasonshimmy/custom-elements-runtime/css'\nimport 'virtual:cer-jit-css'\nimport 'virtual:cer-components'\nimport routes from 'virtual:cer-routes'\nimport layouts from 'virtual:cer-layouts'\nimport plugins from 'virtual:cer-plugins'\nimport { hasLoading, loadingTag } from 'virtual:cer-loading'\nimport { hasError, errorTag } from 'virtual:cer-error'\nimport {\n component,\n ref,\n provide,\n useOnConnected,\n useOnDisconnected,\n registerBuiltinComponents,\n} from '@jasonshimmy/custom-elements-runtime'\nimport { initRouter } from '@jasonshimmy/custom-elements-runtime/router'\nimport { enableJITCSS } from '@jasonshimmy/custom-elements-runtime/jit-css'\n\nregisterBuiltinComponents()\nenableJITCSS()\n\nconst router = initRouter({ routes })\n\n// \u2500\u2500\u2500 Navigation state \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n\nconst isNavigating = ref(false)\nconst currentError = ref(null)\n\nconst resetError = () => {\n currentError.value = null\n void router.replace(router.getCurrent().path)\n}\n;(globalThis).resetError = resetError\n\nconst _push = router.push.bind(router)\nconst _replace = router.replace.bind(router)\n\nrouter.push = async (path) => {\n isNavigating.value = true\n currentError.value = null\n try {\n await _push(path)\n } catch (err) {\n currentError.value = err instanceof Error ? err.message : String(err)\n } finally {\n isNavigating.value = false\n }\n}\n\nrouter.replace = async (path) => {\n isNavigating.value = true\n currentError.value = null\n try {\n await _replace(path)\n } catch (err) {\n currentError.value = err instanceof Error ? err.message : String(err)\n } finally {\n isNavigating.value = false\n }\n}\n\n// \u2500\u2500\u2500 Plugins \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n\n// Collect plugin-provided values so cer-layout-view can forward them into\n// the component context tree via the real provide() hook (which inject() walks).\n// Declared BEFORE component('cer-layout-view') to avoid a temporal dead zone\n// ReferenceError: customElements.define() upgrades existing DOM elements\n// synchronously, calling the render function immediately.\nconst _pluginProvides = new Map()\n// Expose plugin provides globally so page components can read them synchronously\n// regardless of render order.\n;(globalThis).__cerPluginProvides = _pluginProvides\n\n// \u2500\u2500\u2500 <cer-layout-view> \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n\ncomponent('cer-layout-view', () => {\n // Forward plugin-provided values into the component context so inject() in\n // any descendant component can resolve them by walking up the DOM tree.\n for (const [key, value] of _pluginProvides) {\n provide(key, value)\n }\n\n const current = ref(router.getCurrent())\n let unsub\n\n useOnConnected(() => {\n unsub = router.subscribe((s) => { current.value = s })\n })\n useOnDisconnected(() => { unsub?.(); unsub = undefined })\n\n if (currentError.value !== null) {\n if (hasError && errorTag) {\n return { tag: errorTag, props: { attrs: { error: String(currentError.value) } }, children: [] }\n }\n return { tag: 'div', props: { attrs: { style: 'padding:2rem;font-family:monospace' } }, children: String(currentError.value) }\n }\n\n if (isNavigating.value && hasLoading && loadingTag) {\n return { tag: loadingTag, props: {}, children: [] }\n }\n\n const matched = router.matchRoute(current.value.path)\n const routeMeta = matched?.route?.meta\n const layoutName = routeMeta?.layout ?? 'default'\n const layoutTag = layouts[layoutName]\n const routerView = { tag: 'router-view', props: {}, children: [] }\n\n if (layoutTag) return { tag: layoutTag, props: {}, children: [routerView] }\n return routerView\n})\n\nfor (const plugin of plugins) {\n if (plugin && typeof plugin.setup === 'function') {\n await plugin.setup({\n router,\n provide: (key, value) => { _pluginProvides.set(key, value) },\n config: {},\n })\n }\n}\n\n// \u2500\u2500\u2500 Pre-load initial route \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n// Download the current page's route chunk AFTER plugins run so that\n// cer-layout-view's first render (which calls provide()) completes before\n// page components are defined and their renders are scheduled. This ensures\n// inject() in child components can find values stored by provide().\n\nif (typeof window !== 'undefined') {\n const _initMatch = router.matchRoute(window.location.pathname)\n if (_initMatch?.route?.load) {\n try { await _initMatch.route.load() } catch { /* non-fatal */ }\n }\n}\n\n// \u2500\u2500\u2500 Initial navigation \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n\nif (typeof window !== 'undefined') {\n // Use the original (unwrapped) replace so isNavigating stays false during\n // the initial paint \u2014 the loading component must not flash over pre-rendered content.\n await _replace(window.location.pathname + window.location.search + window.location.hash)\n // Clear SSR loader data after initial navigation so subsequent client-side\n // navigations don't accidentally reuse stale server data.\n delete (globalThis).__CER_DATA__\n}\n\nexport { router }\n";
9
9
  //# sourceMappingURL=app-template.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"app-template.d.ts","sourceRoot":"","sources":["../../src/runtime/app-template.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,eAAO,MAAM,kBAAkB,u3NAsJ9B,CAAA"}
1
+ {"version":3,"file":"app-template.d.ts","sourceRoot":"","sources":["../../src/runtime/app-template.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,eAAO,MAAM,kBAAkB,+oNAsJ9B,CAAA"}
@@ -37,11 +37,11 @@ const router = initRouter({ routes })
37
37
  const isNavigating = ref(false)
38
38
  const currentError = ref(null)
39
39
 
40
- const resetError = (): void => {
40
+ const resetError = () => {
41
41
  currentError.value = null
42
42
  void router.replace(router.getCurrent().path)
43
43
  }
44
- ;(globalThis as Record<string, unknown>).resetError = resetError
44
+ ;(globalThis).resetError = resetError
45
45
 
46
46
  const _push = router.push.bind(router)
47
47
  const _replace = router.replace.bind(router)
@@ -77,10 +77,10 @@ router.replace = async (path) => {
77
77
  // Declared BEFORE component('cer-layout-view') to avoid a temporal dead zone
78
78
  // ReferenceError: customElements.define() upgrades existing DOM elements
79
79
  // synchronously, calling the render function immediately.
80
- const _pluginProvides = new Map<string, unknown>()
80
+ const _pluginProvides = new Map()
81
81
  // Expose plugin provides globally so page components can read them synchronously
82
82
  // regardless of render order.
83
- ;(globalThis as Record<string, unknown>).__cerPluginProvides = _pluginProvides
83
+ ;(globalThis).__cerPluginProvides = _pluginProvides
84
84
 
85
85
  // ─── <cer-layout-view> ───────────────────────────────────────────────────────
86
86
 
@@ -92,10 +92,10 @@ component('cer-layout-view', () => {
92
92
  }
93
93
 
94
94
  const current = ref(router.getCurrent())
95
- let unsub: (() => void) | undefined
95
+ let unsub
96
96
 
97
97
  useOnConnected(() => {
98
- unsub = router.subscribe((s: typeof current.value) => { current.value = s })
98
+ unsub = router.subscribe((s) => { current.value = s })
99
99
  })
100
100
  useOnDisconnected(() => { unsub?.(); unsub = undefined })
101
101
 
@@ -111,9 +111,9 @@ component('cer-layout-view', () => {
111
111
  }
112
112
 
113
113
  const matched = router.matchRoute(current.value.path)
114
- const routeMeta = matched?.route?.meta as { layout?: string } | undefined
114
+ const routeMeta = matched?.route?.meta
115
115
  const layoutName = routeMeta?.layout ?? 'default'
116
- const layoutTag = (layouts as Record<string, string>)[layoutName]
116
+ const layoutTag = layouts[layoutName]
117
117
  const routerView = { tag: 'router-view', props: {}, children: [] }
118
118
 
119
119
  if (layoutTag) return { tag: layoutTag, props: {}, children: [routerView] }
@@ -124,7 +124,7 @@ for (const plugin of plugins) {
124
124
  if (plugin && typeof plugin.setup === 'function') {
125
125
  await plugin.setup({
126
126
  router,
127
- provide: (key: string, value: unknown) => { _pluginProvides.set(key, value) },
127
+ provide: (key, value) => { _pluginProvides.set(key, value) },
128
128
  config: {},
129
129
  })
130
130
  }
@@ -151,7 +151,7 @@ if (typeof window !== 'undefined') {
151
151
  await _replace(window.location.pathname + window.location.search + window.location.hash)
152
152
  // Clear SSR loader data after initial navigation so subsequent client-side
153
153
  // navigations don't accidentally reuse stale server data.
154
- delete (globalThis as Record<string, unknown>).__CER_DATA__
154
+ delete (globalThis).__CER_DATA__
155
155
  }
156
156
 
157
157
  export { router }
@@ -3,6 +3,8 @@
3
3
  * All tests run in every build mode (SPA, SSR, SSG).
4
4
  */
5
5
 
6
+ const mode = Cypress.env('mode') as 'spa' | 'ssr' | 'ssg'
7
+
6
8
  describe('Counter interactivity', () => {
7
9
  beforeEach(() => {
8
10
  cy.visit('/counter')
@@ -120,3 +122,16 @@ describe('Auth middleware', () => {
120
122
  cy.get('cer-layout-view').shadow().find('[data-cy=plugin-greeting]').should('contain', 'Hello from ks-setup plugin!')
121
123
  })
122
124
  })
125
+
126
+ if (mode !== 'spa') {
127
+ describe('Plugin provide/inject — server-side rendering', () => {
128
+ it('plugin greeting is present in the initial server HTML', () => {
129
+ // Auth middleware is client-side only, so the server renders /protected
130
+ // unconditionally. This verifies useInject() reads from __cerPluginProvides
131
+ // during the SSR render pass (before any client JS runs).
132
+ cy.request('/protected').then((resp) => {
133
+ expect(resp.body).to.include('Hello from ks-setup plugin!')
134
+ })
135
+ })
136
+ })
137
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jasonshimmy/vite-plugin-cer-app",
3
- "version": "0.4.0",
3
+ "version": "0.4.2",
4
4
  "description": "Nuxt-style meta-framework for @jasonshimmy/custom-elements-runtime",
5
5
  "type": "module",
6
6
  "keywords": [
@@ -47,6 +47,7 @@ type TestPlugin = {
47
47
  resolveId: (id: string) => string | undefined
48
48
  load: (id: string) => Promise<string | null>
49
49
  transform: (code: string, id: string) => unknown
50
+ transformIndexHtml: (html: string) => string
50
51
  buildStart: () => Promise<void>
51
52
  configureServer: (server: unknown) => Promise<void>
52
53
  }
@@ -143,10 +144,16 @@ describe('cerApp plugin — resolveId hook', () => {
143
144
  expect(plugin.resolveId('virtual:cer-error')).toBe('\0virtual:cer-error')
144
145
  })
145
146
 
146
- it('resolves /.cer/app.ts to \\0cer-app-entry (virtual, bypasses fs security)', () => {
147
+ it('resolves /@cer/app.ts to \\0cer-app-entry (virtual module)', () => {
147
148
  const plugin = getCerPlugin()
148
149
  plugin.config({ root: '/project' }, { command: 'serve', mode: 'development' })
149
- expect(plugin.resolveId('/.cer/app.ts')).toBe('\0cer-app-entry')
150
+ expect(plugin.resolveId('/@cer/app.ts')).toBe('\0cer-app-entry')
151
+ })
152
+
153
+ it('does not resolve /.cer/app.ts (old URL, rewritten by transformIndexHtml)', () => {
154
+ const plugin = getCerPlugin()
155
+ plugin.config({ root: '/project' }, { command: 'serve', mode: 'development' })
156
+ expect(plugin.resolveId('/.cer/app.ts')).toBeUndefined()
150
157
  })
151
158
 
152
159
  it('returns undefined for unknown ids', () => {
@@ -286,6 +293,35 @@ describe('cerApp plugin — transform hook', () => {
286
293
  })
287
294
  })
288
295
 
296
+ describe('cerApp plugin — transformIndexHtml hook', () => {
297
+ it('rewrites /.cer/app.ts src to /@cer/app.ts', () => {
298
+ const plugin = getCerPlugin()
299
+ plugin.config({ root: '/project' }, { command: 'serve', mode: 'development' })
300
+ const input = '<script type="module" src="/.cer/app.ts"></script>'
301
+ const output = plugin.transformIndexHtml(input)
302
+ expect(output).toContain('src="/@cer/app.ts"')
303
+ expect(output).not.toContain('src="/.cer/app.ts"')
304
+ })
305
+
306
+ it('leaves html unchanged when /.cer/app.ts is not present', () => {
307
+ const plugin = getCerPlugin()
308
+ plugin.config({ root: '/project' }, { command: 'serve', mode: 'development' })
309
+ const input = '<script type="module" src="/@cer/app.ts"></script>'
310
+ expect(plugin.transformIndexHtml(input)).toBe(input)
311
+ })
312
+ })
313
+
314
+ describe('cerApp plugin — configResolved hook', () => {
315
+ it('calls writeGeneratedDir during configResolved', async () => {
316
+ const { writeGeneratedDir } = await import('../../plugin/generated-dir.js')
317
+ vi.mocked(writeGeneratedDir).mockClear()
318
+ const plugin = getCerPlugin()
319
+ plugin.config({ root: '/project' }, { command: 'serve', mode: 'development' })
320
+ plugin.configResolved(FAKE_RESOLVED)
321
+ expect(writeGeneratedDir).toHaveBeenCalledTimes(1)
322
+ })
323
+ })
324
+
289
325
  describe('cerApp plugin — buildStart hook', () => {
290
326
  it('calls writeGeneratedDir on build start', async () => {
291
327
  const { writeGeneratedDir } = await import('../../plugin/generated-dir.js')
@@ -294,7 +330,8 @@ describe('cerApp plugin — buildStart hook', () => {
294
330
  plugin.config({ root: '/project' }, { command: 'build', mode: 'production' })
295
331
  plugin.configResolved(FAKE_RESOLVED)
296
332
  await plugin.buildStart()
297
- expect(writeGeneratedDir).toHaveBeenCalledTimes(1)
333
+ // writeGeneratedDir is called once in configResolved and once in buildStart
334
+ expect(writeGeneratedDir).toHaveBeenCalledTimes(2)
298
335
  })
299
336
 
300
337
  it('calls scanComposableExports on build start', async () => {
@@ -342,7 +379,8 @@ describe('cerApp plugin — configureServer hook', () => {
342
379
  middlewares: { use: vi.fn() },
343
380
  }
344
381
  await plugin.configureServer(mockServer)
345
- expect(writeGeneratedDir).toHaveBeenCalledTimes(1)
382
+ // configResolved calls it once, configureServer calls it again
383
+ expect(writeGeneratedDir).toHaveBeenCalledTimes(2)
346
384
  })
347
385
 
348
386
  it('calls scanComposableExports on server configure', async () => {
@@ -61,9 +61,9 @@ describe('resolveHtmlEntry', () => {
61
61
  })
62
62
 
63
63
  describe('generateDefaultHtml', () => {
64
- it('always references /.cer/app.ts', () => {
64
+ it('always references /@cer/app.ts', () => {
65
65
  const html = generateDefaultHtml()
66
- expect(html).toContain('/.cer/app.ts')
66
+ expect(html).toContain('/@cer/app.ts')
67
67
  expect(html).not.toContain('/app/app.ts')
68
68
  })
69
69
 
@@ -198,12 +198,12 @@ async function generateInlineTemplate(
198
198
  preview: 'cer-app preview',
199
199
  },
200
200
  dependencies: {
201
- '@jasonshimmy/custom-elements-runtime': '^3.1.1',
201
+ '@jasonshimmy/custom-elements-runtime': '^3.2.0',
202
202
  },
203
203
  devDependencies: {
204
- vite: '^5.0.0',
205
- '@jasonshimmy/vite-plugin-cer-app': '^0.1.0',
206
- typescript: '^5.4.0',
204
+ vite: '^8.0.1',
205
+ '@jasonshimmy/vite-plugin-cer-app': '^0.4.1',
206
+ typescript: '^5.9.3',
207
207
  },
208
208
  },
209
209
  null,
@@ -243,7 +243,7 @@ async function generateInlineTemplate(
243
243
  // index.html
244
244
  await writeFile(
245
245
  join(targetDir, 'index.html'),
246
- `<!DOCTYPE html>\n<html lang="en">\n <head>\n <meta charset="UTF-8">\n <meta name="viewport" content="width=device-width, initial-scale=1.0">\n <title>${projectName}</title>\n </head>\n <body>\n <cer-layout-view></cer-layout-view>\n <script type="module" src="/.cer/app.ts"></script>\n </body>\n</html>\n`,
246
+ `<!DOCTYPE html>\n<html lang="en">\n <head>\n <meta charset="UTF-8">\n <meta name="viewport" content="width=device-width, initial-scale=1.0">\n <title>${projectName}</title>\n </head>\n <body>\n <cer-layout-view></cer-layout-view>\n <script type="module" src="/@cer/app.ts"></script>\n </body>\n</html>\n`,
247
247
  'utf-8',
248
248
  )
249
249
  }
@@ -7,6 +7,6 @@
7
7
  </head>
8
8
  <body>
9
9
  <cer-layout-view></cer-layout-view>
10
- <script type="module" src="/.cer/app.ts"></script>
10
+ <script type="module" src="/@cer/app.ts"></script>
11
11
  </body>
12
12
  </html>
@@ -8,11 +8,11 @@
8
8
  "preview": "cer-app preview"
9
9
  },
10
10
  "dependencies": {
11
- "@jasonshimmy/custom-elements-runtime": "^3.1.1"
11
+ "@jasonshimmy/custom-elements-runtime": "^3.2.0"
12
12
  },
13
13
  "devDependencies": {
14
- "vite": "^5.0.0",
15
- "@jasonshimmy/vite-plugin-cer-app": "^0.1.0",
16
- "typescript": "^5.4.0"
14
+ "vite": "^8.0.1",
15
+ "@jasonshimmy/vite-plugin-cer-app": "^0.4.1",
16
+ "typescript": "^5.9.3"
17
17
  }
18
18
  }
@@ -7,6 +7,6 @@
7
7
  </head>
8
8
  <body>
9
9
  <cer-layout-view></cer-layout-view>
10
- <script type="module" src="/.cer/app.ts"></script>
10
+ <script type="module" src="/@cer/app.ts"></script>
11
11
  </body>
12
12
  </html>
@@ -9,11 +9,11 @@
9
9
  "preview": "cer-app preview"
10
10
  },
11
11
  "dependencies": {
12
- "@jasonshimmy/custom-elements-runtime": "^3.1.1"
12
+ "@jasonshimmy/custom-elements-runtime": "^3.2.0"
13
13
  },
14
14
  "devDependencies": {
15
- "vite": "^5.0.0",
16
- "@jasonshimmy/vite-plugin-cer-app": "^0.1.0",
17
- "typescript": "^5.4.0"
15
+ "vite": "^8.0.1",
16
+ "@jasonshimmy/vite-plugin-cer-app": "^0.4.1",
17
+ "typescript": "^5.9.3"
18
18
  }
19
19
  }
@@ -7,6 +7,6 @@
7
7
  </head>
8
8
  <body>
9
9
  <cer-layout-view></cer-layout-view>
10
- <script type="module" src="/.cer/app.ts"></script>
10
+ <script type="module" src="/@cer/app.ts"></script>
11
11
  </body>
12
12
  </html>
@@ -8,11 +8,11 @@
8
8
  "preview": "cer-app preview --ssr"
9
9
  },
10
10
  "dependencies": {
11
- "@jasonshimmy/custom-elements-runtime": "^3.1.1"
11
+ "@jasonshimmy/custom-elements-runtime": "^3.2.0"
12
12
  },
13
13
  "devDependencies": {
14
- "vite": "^5.0.0",
15
- "@jasonshimmy/vite-plugin-cer-app": "^0.1.0",
16
- "typescript": "^5.4.0"
14
+ "vite": "^8.0.1",
15
+ "@jasonshimmy/vite-plugin-cer-app": "^0.4.1",
16
+ "typescript": "^5.9.3"
17
17
  }
18
18
  }
@@ -26,7 +26,7 @@ export function resolveHtmlEntry(config: ResolvedCerConfig): string {
26
26
 
27
27
  /**
28
28
  * Generates the content for the default `.cer/index.html`.
29
- * Always points to the generated `/.cer/app.ts` entry.
29
+ * Always points to the virtual `/@cer/app.ts` entry.
30
30
  */
31
31
  export function generateDefaultHtml(): string {
32
32
  return `<!DOCTYPE html>
@@ -38,7 +38,7 @@ export function generateDefaultHtml(): string {
38
38
  </head>
39
39
  <body>
40
40
  <cer-layout-view></cer-layout-view>
41
- <script type="module" src="/.cer/app.ts"></script>
41
+ <script type="module" src="/@cer/app.ts"></script>
42
42
  </body>
43
43
  </html>
44
44
  `
@@ -41,9 +41,12 @@ const RESOLVED_IDS = Object.fromEntries(
41
41
  Object.entries(VIRTUAL_IDS).map(([k, v]) => [k, `\0${v}`]),
42
42
  ) as Record<keyof typeof VIRTUAL_IDS, string>
43
43
 
44
- // The generated app entry is served as a virtual module so Vite doesn't need
45
- // to find it on disk (Vite's fs security policy blocks paths starting with `/.`).
46
- const APP_ENTRY_URL = '/.cer/app.ts'
44
+ // The app entry is served via a virtual module at /@cer/app.ts.
45
+ // Using /@ avoids Vite's dot-directory fs security restriction that blocks /.cer/
46
+ // from being served through the transform middleware. The physical .cer/app.ts
47
+ // is still written to disk for IDE/TypeScript support, but the browser fetches
48
+ // /@cer/app.ts which resolves to this virtual module.
49
+ const APP_ENTRY_URL = '/@cer/app.ts'
47
50
  const RESOLVED_APP_ENTRY = '\0cer-app-entry'
48
51
 
49
52
  /**
@@ -217,6 +220,16 @@ export function cerApp(userConfig: CerAppConfig = {}): Plugin[] {
217
220
  configResolved(resolvedConfig) {
218
221
  // Re-resolve with the final root
219
222
  config = resolveConfig(userConfig, resolvedConfig.root)
223
+ // Write .cer/ immediately after config is resolved so the physical
224
+ // app.ts exists for IDE/TypeScript support before any Vite hooks fire.
225
+ writeGeneratedDir(config)
226
+ },
227
+
228
+ transformIndexHtml(html: string) {
229
+ // Rewrite any existing /.cer/app.ts src reference (older projects or
230
+ // the scaffold template) to /@cer/app.ts so Vite's transform middleware
231
+ // processes it. Vite blocks /.* paths from the transform pipeline.
232
+ return html.replace(/src=["']\/\.cer\/app\.ts["']/g, 'src="/@cer/app.ts"')
220
233
  },
221
234
 
222
235
  resolveId(id: string) {
@@ -37,11 +37,11 @@ const router = initRouter({ routes })
37
37
  const isNavigating = ref(false)
38
38
  const currentError = ref(null)
39
39
 
40
- const resetError = (): void => {
40
+ const resetError = () => {
41
41
  currentError.value = null
42
42
  void router.replace(router.getCurrent().path)
43
43
  }
44
- ;(globalThis as Record<string, unknown>).resetError = resetError
44
+ ;(globalThis).resetError = resetError
45
45
 
46
46
  const _push = router.push.bind(router)
47
47
  const _replace = router.replace.bind(router)
@@ -77,10 +77,10 @@ router.replace = async (path) => {
77
77
  // Declared BEFORE component('cer-layout-view') to avoid a temporal dead zone
78
78
  // ReferenceError: customElements.define() upgrades existing DOM elements
79
79
  // synchronously, calling the render function immediately.
80
- const _pluginProvides = new Map<string, unknown>()
80
+ const _pluginProvides = new Map()
81
81
  // Expose plugin provides globally so page components can read them synchronously
82
82
  // regardless of render order.
83
- ;(globalThis as Record<string, unknown>).__cerPluginProvides = _pluginProvides
83
+ ;(globalThis).__cerPluginProvides = _pluginProvides
84
84
 
85
85
  // ─── <cer-layout-view> ───────────────────────────────────────────────────────
86
86
 
@@ -92,10 +92,10 @@ component('cer-layout-view', () => {
92
92
  }
93
93
 
94
94
  const current = ref(router.getCurrent())
95
- let unsub: (() => void) | undefined
95
+ let unsub
96
96
 
97
97
  useOnConnected(() => {
98
- unsub = router.subscribe((s: typeof current.value) => { current.value = s })
98
+ unsub = router.subscribe((s) => { current.value = s })
99
99
  })
100
100
  useOnDisconnected(() => { unsub?.(); unsub = undefined })
101
101
 
@@ -111,9 +111,9 @@ component('cer-layout-view', () => {
111
111
  }
112
112
 
113
113
  const matched = router.matchRoute(current.value.path)
114
- const routeMeta = matched?.route?.meta as { layout?: string } | undefined
114
+ const routeMeta = matched?.route?.meta
115
115
  const layoutName = routeMeta?.layout ?? 'default'
116
- const layoutTag = (layouts as Record<string, string>)[layoutName]
116
+ const layoutTag = layouts[layoutName]
117
117
  const routerView = { tag: 'router-view', props: {}, children: [] }
118
118
 
119
119
  if (layoutTag) return { tag: layoutTag, props: {}, children: [routerView] }
@@ -124,7 +124,7 @@ for (const plugin of plugins) {
124
124
  if (plugin && typeof plugin.setup === 'function') {
125
125
  await plugin.setup({
126
126
  router,
127
- provide: (key: string, value: unknown) => { _pluginProvides.set(key, value) },
127
+ provide: (key, value) => { _pluginProvides.set(key, value) },
128
128
  config: {},
129
129
  })
130
130
  }
@@ -151,7 +151,7 @@ if (typeof window !== 'undefined') {
151
151
  await _replace(window.location.pathname + window.location.search + window.location.hash)
152
152
  // Clear SSR loader data after initial navigation so subsequent client-side
153
153
  // navigations don't accidentally reuse stale server data.
154
- delete (globalThis as Record<string, unknown>).__CER_DATA__
154
+ delete (globalThis).__CER_DATA__
155
155
  }
156
156
 
157
157
  export { router }