@jasonshimmy/vite-plugin-cer-app 0.14.0 → 0.14.1
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/CHANGELOG.md +5 -0
- package/commits.txt +2 -1
- package/dist/plugin/dts-generator.d.ts.map +1 -1
- package/dist/plugin/dts-generator.js +3 -1
- package/dist/plugin/dts-generator.js.map +1 -1
- package/dist/plugin/index.d.ts.map +1 -1
- package/dist/plugin/index.js +16 -9
- package/dist/plugin/index.js.map +1 -1
- package/dist/runtime/app-template.d.ts +1 -1
- package/dist/runtime/app-template.d.ts.map +1 -1
- package/dist/runtime/app-template.js +6 -0
- package/dist/runtime/app-template.js.map +1 -1
- package/e2e/cypress/e2e/data.cy.ts +31 -8
- package/e2e/cypress/tsconfig.json +1 -1
- package/error.log +237 -22
- package/package.json +7 -7
- package/src/__tests__/plugin/dts-generator.test.ts +25 -0
- package/src/__tests__/runtime/app-template.test.ts +64 -0
- package/src/plugin/dts-generator.ts +3 -1
- package/src/plugin/index.ts +12 -9
- package/src/runtime/app-template.ts +6 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
|
+
## [v0.14.1] - 2026-03-26
|
|
5
|
+
|
|
6
|
+
- fix: downgrade typescript (0278d24)
|
|
7
|
+
- fix: add missing dts definitions for composables chore: update dependencies and improve type declarations (546c99c)
|
|
8
|
+
|
|
4
9
|
## [v0.14.0] - 2026-03-25
|
|
5
10
|
|
|
6
11
|
- feat: add programmatic navigation and route handling (37a583b)
|
package/commits.txt
CHANGED
|
@@ -1 +1,2 @@
|
|
|
1
|
-
-
|
|
1
|
+
- fix: downgrade typescript (0278d24)
|
|
2
|
+
- fix: add missing dts definitions for composables chore: update dependencies and improve type declarations (546c99c)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dts-generator.d.ts","sourceRoot":"","sources":["../../src/plugin/dts-generator.ts"],"names":[],"mappings":"AAMA;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,IAAI,CAgCrE;AAqCD;;;GAGG;AACH,wBAAsB,qBAAqB,CAAC,cAAc,EAAE,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAiBhG;AAED;;;GAGG;AACH,wBAAsB,qBAAqB,CACzC,IAAI,EAAE,MAAM,EACZ,cAAc,EAAE,MAAM,EACtB,iBAAiB,CAAC,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,GACtC,OAAO,CAAC,MAAM,CAAC,CA8CjB;AAED;;;;GAIG;AACH,wBAAsB,wBAAwB,CAC5C,IAAI,EAAE,MAAM,EACZ,cAAc,EAAE,MAAM,EACtB,iBAAiB,CAAC,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,GACtC,OAAO,CAAC,MAAM,CAAC,
|
|
1
|
+
{"version":3,"file":"dts-generator.d.ts","sourceRoot":"","sources":["../../src/plugin/dts-generator.ts"],"names":[],"mappings":"AAMA;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,IAAI,CAgCrE;AAqCD;;;GAGG;AACH,wBAAsB,qBAAqB,CAAC,cAAc,EAAE,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAiBhG;AAED;;;GAGG;AACH,wBAAsB,qBAAqB,CACzC,IAAI,EAAE,MAAM,EACZ,cAAc,EAAE,MAAM,EACtB,iBAAiB,CAAC,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,GACtC,OAAO,CAAC,MAAM,CAAC,CA8CjB;AAED;;;;GAIG;AACH,wBAAsB,wBAAwB,CAC5C,IAAI,EAAE,MAAM,EACZ,cAAc,EAAE,MAAM,EACtB,iBAAiB,CAAC,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,GACtC,OAAO,CAAC,MAAM,CAAC,CAkEjB;AAED;;GAEG;AACH,wBAAsB,kBAAkB,CACtC,IAAI,EAAE,MAAM,EACZ,cAAc,EAAE,MAAM,EACtB,iBAAiB,CAAC,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,GACtC,OAAO,CAAC,IAAI,CAAC,CAWf"}
|
|
@@ -69,7 +69,7 @@ const RUNTIME_GLOBALS = [
|
|
|
69
69
|
'useTeleport',
|
|
70
70
|
];
|
|
71
71
|
const DIRECTIVE_GLOBALS = ['when', 'each', 'match', 'anchorBlock'];
|
|
72
|
-
const FRAMEWORK_GLOBALS = ['useHead', 'usePageData', 'useInject', 'useRuntimeConfig', 'defineMiddleware', 'defineServerMiddleware', 'useSeoMeta', 'useCookie', 'useSession'];
|
|
72
|
+
const FRAMEWORK_GLOBALS = ['useHead', 'usePageData', 'useInject', 'useRuntimeConfig', 'defineMiddleware', 'defineServerMiddleware', 'useSeoMeta', 'useCookie', 'useSession', 'useAuth', 'useFetch', 'useRoute', 'navigateTo'];
|
|
73
73
|
/**
|
|
74
74
|
* Scans a composables directory and returns a map of export name → file path.
|
|
75
75
|
* Uses a simple regex to find exported identifiers.
|
|
@@ -193,6 +193,8 @@ export async function generateVirtualModuleDts(root, composablesDir, composableE
|
|
|
193
193
|
lines.push(` export const runtimeConfig: { public: RuntimePublicConfig }`);
|
|
194
194
|
lines.push(` /** Server-only — present only in the SSR bundle. Always \`undefined\` in the client bundle. */`);
|
|
195
195
|
lines.push(` export const _runtimePrivateDefaults: RuntimePrivateConfig | undefined`);
|
|
196
|
+
lines.push(` /** Cookie/session key for the auth session. Derived from the app name. */`);
|
|
197
|
+
lines.push(` export const _authSessionKey: string`);
|
|
196
198
|
lines.push(` export default appConfig`);
|
|
197
199
|
lines.push(`}`);
|
|
198
200
|
lines.push('');
|
|
@@ -1 +1 @@
|
|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,GAAG;QACf,eAAe,EAAE,EAAE,KAAK,EAAE;QAC1B,OAAO,EAAE;YACP,gBAAgB;YAChB,mBAAmB;YACnB,WAAW;YACX,aAAa;SACd;QACD,OAAO,EAAE,CAAC,iBAAiB,EAAE,SAAS,CAAC;KACxC,CAAA;IAED,MAAM,OAAO,GAAG,IAAI,CAAC,SAAS,CAAC,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAC,GAAG,IAAI,CAAA;IACxD,aAAa,CAAC,IAAI,CAAC,MAAM,EAAE,eAAe,CAAC,EAAE,OAAO,EAAE,OAAO,CAAC,CAAA;AAChE,CAAC;AAED,MAAM,eAAe,GAAG;IACtB,WAAW;IACX,MAAM;IACN,KAAK;IACL,KAAK;IACL,UAAU;IACV,OAAO;IACP,aAAa;IACb,UAAU;IACV,SAAS;IACT,gBAAgB;IAChB,mBAAmB;IACnB,uBAAuB;IACvB,YAAY;IACZ,UAAU;IACV,iBAAiB;IACjB,gBAAgB;IAChB,WAAW;IACX,UAAU;IACV,SAAS;IACT,QAAQ;IACR,kBAAkB;IAClB,UAAU;IACV,aAAa;IACb,4BAA4B;IAC5B,iBAAiB;IACjB,YAAY;IACZ,gBAAgB;IAChB,aAAa;CACd,CAAA;AAED,MAAM,iBAAiB,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,aAAa,CAAC,CAAA;AAElE,MAAM,iBAAiB,GAAG,CAAC,SAAS,EAAE,aAAa,EAAE,WAAW,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,wBAAwB,EAAE,YAAY,EAAE,WAAW,EAAE,YAAY,CAAC,CAAA;
|
|
1
|
+
{"version":3,"file":"dts-generator.js","sourceRoot":"","sources":["../../src/plugin/dts-generator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,SAAS,CAAA;AAC9D,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAA;AACtC,OAAO,EAAE,IAAI,EAA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Ac,EAAE,OAAO,CAAC,CAAA;IAChF,aAAa,CAAC,IAAI,CAAC,MAAM,EAAE,mBAAmB,CAAC,EAAE,kBAAkB,EAAE,OAAO,CAAC,CAAA;IAC7E,aAAa,CAAC,IAAI,CAAC,MAAM,EAAE,UAAU,CAAC,EAAE,UAAU,EAAE,OAAO,CAAC,CAAA;AAC9D,CAAC"}
|
|
@@ -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;AA+CxD;;GAEG;AACH,wBAAgB,aAAa,CAAC,UAAU,EAAE,YAAY,EAAE,IAAI,GAAE,MAAsB,GAAG,iBAAiB,CA8CvG;AAwGD;;;GAGG;AACH,wBAAgB,MAAM,CAAC,UAAU,GAAE,YAAiB,GAAG,MAAM,EAAE,
|
|
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,CA8CvG;AAwGD;;;GAGG;AACH,wBAAgB,MAAM,CAAC,UAAU,GAAE,YAAiB,GAAG,MAAM,EAAE,CAoN9D"}
|
package/dist/plugin/index.js
CHANGED
|
@@ -345,16 +345,23 @@ export function cerApp(userConfig = {}) {
|
|
|
345
345
|
await writeAutoImportDts(config.root, config.composablesDir, composableExports);
|
|
346
346
|
writeTsconfigPaths(config.root, config.srcDir);
|
|
347
347
|
// Warm the virtual module cache.
|
|
348
|
-
// virtual:cer-app-config is cached under separate :client/:ssr keys
|
|
349
|
-
//
|
|
350
|
-
//
|
|
348
|
+
// virtual:cer-app-config is cached under separate :client/:ssr keys because
|
|
349
|
+
// the SSR variant includes _runtimePrivateDefaults (private env var defaults)
|
|
350
|
+
// that must never appear in the client bundle. Warm both variants here so
|
|
351
|
+
// neither the client build nor the SSR build incurs a cache miss on first load.
|
|
351
352
|
for (const resolvedId of Object.values(RESOLVED_IDS)) {
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
353
|
+
if (resolvedId === RESOLVED_IDS.appConfig) {
|
|
354
|
+
const clientCode = await generateVirtualModule(resolvedId, config, false);
|
|
355
|
+
if (clientCode !== null)
|
|
356
|
+
moduleCache.set(`${resolvedId}:client`, clientCode);
|
|
357
|
+
const ssrCode = await generateVirtualModule(resolvedId, config, true);
|
|
358
|
+
if (ssrCode !== null)
|
|
359
|
+
moduleCache.set(`${resolvedId}:ssr`, ssrCode);
|
|
360
|
+
}
|
|
361
|
+
else {
|
|
362
|
+
const code = await generateVirtualModule(resolvedId, config);
|
|
363
|
+
if (code !== null)
|
|
364
|
+
moduleCache.set(resolvedId, code);
|
|
358
365
|
}
|
|
359
366
|
}
|
|
360
367
|
},
|
package/dist/plugin/index.js.map
CHANGED
|
@@ -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,6BAA6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,yDAAyD;IACzD,wEAAwE;IACxE,MAAM,cAAc,GAAG,aAAa,CAAC,UAAU,CAAC,CAAA;IAChD,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,EAAE,IAAI;YACT,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 { runtimeConfig } from 'virtual:cer-app-config'\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'\nimport { initRuntimeConfig } from '@jasonshimmy/vite-plugin-cer-app/composables'\n\nregisterBuiltinComponents()\nenableJITCSS()\ninitRuntimeConfig(runtimeConfig)\n\nconst router = initRouter({ routes })\n\n// Expose the router globally so useRoute() and navigateTo() can access it\n// from any composable without circular imports.\n;(globalThis).__cerRouter = router\n\n// \u2500\u2500\u2500 Page loader 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\n\n// Holds the pre-loaded page tag and loader-derived attrs for the current route.\n// Set by _loadPageForPath before every navigation so cer-layout-view can render\n// the page element directly with the correct attributes (enabling useProps()).\nlet _currentPageTag = null\nlet _currentPageAttrs = {}\n// The pathname this tag was loaded for \u2014 used to detect router-internal\n// redirects (e.g. middleware returning '/login') so cer-layout-view falls\n// back to <router-view> when the current route differs from what was pre-loaded.\nlet _currentPagePath = null\n\n// Pre-loads the page module for `path`, calls its loader if present, and\n// stores the results so cer-layout-view can pass them as element attributes.\nasync function _loadPageForPath(path) {\n try {\n const url = new URL(path, 'http://x')\n const query = Object.fromEntries(url.searchParams)\n const matched = router.matchRoute(url.pathname)\n const route = matched?.route\n if (!route?.load) {\n _currentPageTag = null\n _currentPageAttrs = {}\n _currentPagePath = url.pathname\n return\n }\n const mod = await route.load()\n _currentPageTag = mod.default ?? null\n _currentPagePath = url.pathname\n const params = matched.params ?? {}\n let loaderAttrs = { ...params }\n if (typeof mod.loader === 'function') {\n try {\n const data = await mod.loader({ params, query })\n if (data !== undefined && data !== null) {\n // Make loader data available via usePageData() for this navigation.\n ;(globalThis).__CER_DATA__ = data\n // Merge primitive values as element attributes so useProps() works.\n const primitives = Object.fromEntries(\n Object.entries(data).filter(([, v]) => v !== null && v !== undefined && typeof v !== 'object' && typeof v !== 'function')\n )\n loaderAttrs = { ...loaderAttrs, ...primitives }\n }\n } catch { /* loader errors are non-fatal client-side */ }\n }\n _currentPageAttrs = loaderAttrs\n } catch {\n _currentPageTag = null\n _currentPageAttrs = {}\n _currentPagePath = null\n }\n}\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 _loadPageForPath(path)\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 _loadPageForPath(path)\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\n // Render the page component directly when a pre-loaded tag is available AND\n // the loaded path matches the current route. The path guard detects\n // router-internal redirects (e.g. middleware returning '/login'): when the\n // router redirects to a different path, _currentPagePath won't match\n // current.value.path and we fall back to <router-view> so the correct page\n // is rendered without stale pre-loaded state.\n const _useDirectRender = _currentPageTag && _currentPagePath === current.value.path\n const pageVnode = _useDirectRender\n ? { tag: _currentPageTag, props: { attrs: _currentPageAttrs }, children: [] }\n : { tag: 'router-view', props: {}, children: [] }\n\n // Support nested layout chains: meta.layoutChain = ['default', 'admin']\n // renders <layout-default><layout-admin><page/></layout-admin></layout-default>\n const chain = routeMeta?.layoutChain\n ? routeMeta.layoutChain\n : [routeMeta?.layout ?? 'default']\n\n // Build nested vnodes from innermost to outermost.\n let vnode = pageVnode\n for (let i = chain.length - 1; i >= 0; i--) {\n const tag = layouts[chain[i]]\n if (tag) vnode = { tag, props: {}, children: [vnode] }\n }\n return vnode\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 + hydration strategy \u2500\u2500\u2500\u2500\u2500\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//\n// meta.hydrate controls WHEN the initial page activates:\n// 'load' \u2014 immediately (default)\n// 'idle' \u2014 deferred until requestIdleCallback (browser idle)\n// 'visible' \u2014 deferred until cer-layout-view enters the viewport\n// 'none' \u2014 never: SSR HTML stays as-is, no JS activation\n\nif (typeof window !== 'undefined') {\n const _initMatch = router.matchRoute(window.location.pathname)\n const _hydrateStrategy = _initMatch?.route?.meta?.hydrate ?? 'load'\n\n if (_hydrateStrategy === 'none') {\n // Static HTML only \u2014 leave SSR output untouched, clean up data immediately.\n delete (globalThis).__CER_DATA__\n } else {\n const _doHydrate = async () => {\n const _initPath = window.location.pathname + window.location.search + window.location.hash\n // Pre-load the page module and run the loader so cer-layout-view renders\n // the page tag directly with loader attrs (enables useProps() on hydration).\n await _loadPageForPath(_initPath)\n // Only activate the initial route if the URL hasn't changed while we were\n // loading the module asynchronously (e.g. a test or plugin navigated away\n // before _doHydrate finished). Calling _replace with a stale path would\n // override any navigation that happened during the async gap.\n const _currentPath = window.location.pathname + window.location.search + window.location.hash\n if (_currentPath === _initPath) {\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(_initPath)\n }\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\n if (_hydrateStrategy === 'idle') {\n // Defer until the browser has finished higher-priority work.\n if (typeof requestIdleCallback !== 'undefined') {\n requestIdleCallback(() => { void _doHydrate() })\n } else {\n // Safari / older environments fallback.\n setTimeout(() => { void _doHydrate() }, 1)\n }\n } else if (_hydrateStrategy === 'visible') {\n // Defer until cer-layout-view (or body as fallback) enters the viewport.\n const _el = document.querySelector('cer-layout-view') ?? document.body\n const _io = new IntersectionObserver(([entry]) => {\n if (entry.isIntersecting) { _io.disconnect(); void _doHydrate() }\n })\n _io.observe(_el)\n } else {\n // 'load' \u2014 hydrate immediately (default behaviour).\n await _doHydrate()\n }\n }\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 { runtimeConfig } from 'virtual:cer-app-config'\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'\nimport { initRuntimeConfig } from '@jasonshimmy/vite-plugin-cer-app/composables'\n\nregisterBuiltinComponents()\nenableJITCSS()\ninitRuntimeConfig(runtimeConfig)\n\nconst router = initRouter({ routes })\n\n// Expose the router globally so useRoute() and navigateTo() can access it\n// from any composable without circular imports.\n;(globalThis).__cerRouter = router\n\n// \u2500\u2500\u2500 Page loader 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\n\n// Holds the pre-loaded page tag and loader-derived attrs for the current route.\n// Set by _loadPageForPath before every navigation so cer-layout-view can render\n// the page element directly with the correct attributes (enabling useProps()).\nlet _currentPageTag = null\nlet _currentPageAttrs = {}\n// The pathname this tag was loaded for \u2014 used to detect router-internal\n// redirects (e.g. middleware returning '/login') so cer-layout-view falls\n// back to <router-view> when the current route differs from what was pre-loaded.\nlet _currentPagePath = null\n\n// Pre-loads the page module for `path`, calls its loader if present, and\n// stores the results so cer-layout-view can pass them as element attributes.\nasync function _loadPageForPath(path) {\n try {\n const url = new URL(path, 'http://x')\n const query = Object.fromEntries(url.searchParams)\n const matched = router.matchRoute(url.pathname)\n const route = matched?.route\n if (!route?.load) {\n _currentPageTag = null\n _currentPageAttrs = {}\n _currentPagePath = url.pathname\n return\n }\n const mod = await route.load()\n _currentPageTag = mod.default ?? null\n _currentPagePath = url.pathname\n const params = matched.params ?? {}\n let loaderAttrs = { ...params }\n if (typeof mod.loader === 'function') {\n try {\n const data = await mod.loader({ params, query })\n if (data !== undefined && data !== null) {\n // Make loader data available via usePageData() for this navigation.\n ;(globalThis).__CER_DATA__ = data\n // Merge primitive values as element attributes so useProps() works.\n const primitives = Object.fromEntries(\n Object.entries(data).filter(([, v]) => v !== null && v !== undefined && typeof v !== 'object' && typeof v !== 'function')\n )\n loaderAttrs = { ...loaderAttrs, ...primitives }\n }\n } catch { /* loader errors are non-fatal client-side */ }\n }\n _currentPageAttrs = loaderAttrs\n } catch {\n _currentPageTag = null\n _currentPageAttrs = {}\n _currentPagePath = null\n }\n}\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 // Clear stale loader data from the previous route before loading the new one.\n // If the new route has no loader, __CER_DATA__ stays undefined so usePageData()\n // correctly returns null instead of leaking the previous page's data.\n delete (globalThis).__CER_DATA__\n await _loadPageForPath(path)\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 // Clear stale loader data from the previous route before loading the new one.\n delete (globalThis).__CER_DATA__\n await _loadPageForPath(path)\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\n // Render the page component directly when a pre-loaded tag is available AND\n // the loaded path matches the current route. The path guard detects\n // router-internal redirects (e.g. middleware returning '/login'): when the\n // router redirects to a different path, _currentPagePath won't match\n // current.value.path and we fall back to <router-view> so the correct page\n // is rendered without stale pre-loaded state.\n const _useDirectRender = _currentPageTag && _currentPagePath === current.value.path\n const pageVnode = _useDirectRender\n ? { tag: _currentPageTag, props: { attrs: _currentPageAttrs }, children: [] }\n : { tag: 'router-view', props: {}, children: [] }\n\n // Support nested layout chains: meta.layoutChain = ['default', 'admin']\n // renders <layout-default><layout-admin><page/></layout-admin></layout-default>\n const chain = routeMeta?.layoutChain\n ? routeMeta.layoutChain\n : [routeMeta?.layout ?? 'default']\n\n // Build nested vnodes from innermost to outermost.\n let vnode = pageVnode\n for (let i = chain.length - 1; i >= 0; i--) {\n const tag = layouts[chain[i]]\n if (tag) vnode = { tag, props: {}, children: [vnode] }\n }\n return vnode\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 + hydration strategy \u2500\u2500\u2500\u2500\u2500\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//\n// meta.hydrate controls WHEN the initial page activates:\n// 'load' \u2014 immediately (default)\n// 'idle' \u2014 deferred until requestIdleCallback (browser idle)\n// 'visible' \u2014 deferred until cer-layout-view enters the viewport\n// 'none' \u2014 never: SSR HTML stays as-is, no JS activation\n\nif (typeof window !== 'undefined') {\n const _initMatch = router.matchRoute(window.location.pathname)\n const _hydrateStrategy = _initMatch?.route?.meta?.hydrate ?? 'load'\n\n if (_hydrateStrategy === 'none') {\n // Static HTML only \u2014 leave SSR output untouched, clean up data immediately.\n delete (globalThis).__CER_DATA__\n } else {\n const _doHydrate = async () => {\n const _initPath = window.location.pathname + window.location.search + window.location.hash\n // Pre-load the page module and run the loader so cer-layout-view renders\n // the page tag directly with loader attrs (enables useProps() on hydration).\n await _loadPageForPath(_initPath)\n // Only activate the initial route if the URL hasn't changed while we were\n // loading the module asynchronously (e.g. a test or plugin navigated away\n // before _doHydrate finished). Calling _replace with a stale path would\n // override any navigation that happened during the async gap.\n const _currentPath = window.location.pathname + window.location.search + window.location.hash\n if (_currentPath === _initPath) {\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(_initPath)\n }\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\n if (_hydrateStrategy === 'idle') {\n // Defer until the browser has finished higher-priority work.\n if (typeof requestIdleCallback !== 'undefined') {\n requestIdleCallback(() => { void _doHydrate() })\n } else {\n // Safari / older environments fallback.\n setTimeout(() => { void _doHydrate() }, 1)\n }\n } else if (_hydrateStrategy === 'visible') {\n // Defer until cer-layout-view (or body as fallback) enters the viewport.\n const _el = document.querySelector('cer-layout-view') ?? document.body\n const _io = new IntersectionObserver(([entry]) => {\n if (entry.isIntersecting) { _io.disconnect(); void _doHydrate() }\n })\n _io.observe(_el)\n } else {\n // 'load' \u2014 hydrate immediately (default behaviour).\n await _doHydrate()\n }\n }\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,
|
|
1
|
+
{"version":3,"file":"app-template.d.ts","sourceRoot":"","sources":["../../src/runtime/app-template.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,eAAO,MAAM,kBAAkB,s3YAmR9B,CAAA"}
|
|
@@ -110,6 +110,10 @@ router.push = async (path) => {
|
|
|
110
110
|
isNavigating.value = true
|
|
111
111
|
currentError.value = null
|
|
112
112
|
try {
|
|
113
|
+
// Clear stale loader data from the previous route before loading the new one.
|
|
114
|
+
// If the new route has no loader, __CER_DATA__ stays undefined so usePageData()
|
|
115
|
+
// correctly returns null instead of leaking the previous page's data.
|
|
116
|
+
delete (globalThis).__CER_DATA__
|
|
113
117
|
await _loadPageForPath(path)
|
|
114
118
|
await _push(path)
|
|
115
119
|
} catch (err) {
|
|
@@ -123,6 +127,8 @@ router.replace = async (path) => {
|
|
|
123
127
|
isNavigating.value = true
|
|
124
128
|
currentError.value = null
|
|
125
129
|
try {
|
|
130
|
+
// Clear stale loader data from the previous route before loading the new one.
|
|
131
|
+
delete (globalThis).__CER_DATA__
|
|
126
132
|
await _loadPageForPath(path)
|
|
127
133
|
await _replace(path)
|
|
128
134
|
} catch (err) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"app-template.js","sourceRoot":"","sources":["../../src/runtime/app-template.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG
|
|
1
|
+
{"version":3,"file":"app-template.js","sourceRoot":"","sources":["../../src/runtime/app-template.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAmRjC,CAAA"}
|
|
@@ -106,6 +106,33 @@ describe('Loader props — useProps reads loader return values', () => {
|
|
|
106
106
|
}
|
|
107
107
|
})
|
|
108
108
|
|
|
109
|
+
describe('Blog detail — client-side navigation loader', () => {
|
|
110
|
+
// These tests verify that navigating between pages via router.push correctly
|
|
111
|
+
// runs the new route's loader and clears stale data from the previous route.
|
|
112
|
+
|
|
113
|
+
it('navigating from /blog to /blog/first-post via router.push loads loader data', () => {
|
|
114
|
+
cy.visit('/blog')
|
|
115
|
+
cy.get('[data-cy=blog-list]').should('exist')
|
|
116
|
+
cy.window().then((win) => {
|
|
117
|
+
return (win as any).__cerRouter?.push('/blog/first-post')
|
|
118
|
+
})
|
|
119
|
+
cy.url().should('include', '/blog/first-post')
|
|
120
|
+
cy.get('[data-cy=post-title]', { timeout: 8000 }).should('contain', 'First Post')
|
|
121
|
+
cy.get('[data-cy=post-body]', { timeout: 8000 }).should('contain', 'First post body content')
|
|
122
|
+
})
|
|
123
|
+
|
|
124
|
+
it('navigating between blog posts via router.push loads new loader data', () => {
|
|
125
|
+
cy.visit('/blog/first-post')
|
|
126
|
+
cy.get('[data-cy=post-title]').should('contain', 'First Post')
|
|
127
|
+
cy.window().then((win) => {
|
|
128
|
+
return (win as any).__cerRouter?.push('/blog/second-post')
|
|
129
|
+
})
|
|
130
|
+
cy.url().should('include', '/blog/second-post')
|
|
131
|
+
cy.get('[data-cy=post-title]', { timeout: 8000 }).should('contain', 'Second Post')
|
|
132
|
+
cy.get('[data-cy=post-body]', { timeout: 8000 }).should('contain', 'Second post body content')
|
|
133
|
+
})
|
|
134
|
+
})
|
|
135
|
+
|
|
109
136
|
describe('Item detail — route params via useProps', () => {
|
|
110
137
|
it('shows item ID 1 for /items/1', () => {
|
|
111
138
|
cy.visit('/items/1')
|
|
@@ -120,16 +147,12 @@ describe('Item detail — route params via useProps', () => {
|
|
|
120
147
|
it('shows correct ID for client-side nav to /items/2 from /items/1', () => {
|
|
121
148
|
cy.visit('/items/1')
|
|
122
149
|
cy.get('[data-cy=item-id]').should('contain', '1')
|
|
123
|
-
// Navigate via
|
|
150
|
+
// Navigate via the framework router (same pattern as navigate.cy.ts).
|
|
151
|
+
// __cerRouter is exposed on globalThis by app-template.ts.
|
|
124
152
|
cy.window().then((win) => {
|
|
125
|
-
|
|
126
|
-
const router = (win as any).__cer_router__ ?? (win as any).router
|
|
127
|
-
if (router?.push) {
|
|
128
|
-
router.push('/items/2')
|
|
129
|
-
}
|
|
153
|
+
return (win as any).__cerRouter?.push('/items/2')
|
|
130
154
|
})
|
|
131
|
-
|
|
132
|
-
cy.visit('/items/2')
|
|
155
|
+
cy.url().should('include', '/items/2')
|
|
133
156
|
cy.get('[data-cy=item-id]').should('contain', '2')
|
|
134
157
|
})
|
|
135
158
|
})
|
package/error.log
CHANGED
|
@@ -1,46 +1,261 @@
|
|
|
1
1
|
────────────────────────────────────────────────────────────────────────────────────────────────────
|
|
2
2
|
|
|
3
|
-
Running:
|
|
3
|
+
Running: api.cy.ts (1 of 16)
|
|
4
4
|
|
|
5
|
+
Oops...we found an error preparing this test file:
|
|
5
6
|
|
|
6
|
-
|
|
7
|
-
1) navigates to /about when button is clicked
|
|
8
|
-
✓ navigates to /route-info when second button is clicked (58ms)
|
|
7
|
+
> e2e/cypress/e2e/api.cy.ts
|
|
9
8
|
|
|
10
|
-
|
|
11
|
-
✓ returns the correct path (46ms)
|
|
12
|
-
✓ returns route meta fields (44ms)
|
|
9
|
+
The error was:
|
|
13
10
|
|
|
11
|
+
Error: Webpack Compilation Error
|
|
12
|
+
[tsl] ERROR
|
|
13
|
+
TS5101: Option 'downlevelIteration' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error.
|
|
14
14
|
|
|
15
|
-
|
|
16
|
-
|
|
15
|
+
[tsl] ERROR
|
|
16
|
+
TS5101: Option 'downlevelIteration' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error.
|
|
17
|
+
at handle (/Users/jshimkoski/Library/Caches/Cypress/15.13.0/Cypress.app/Contents/Resources/app/packages/server/node_modules/@cypress/webpack-preprocessor/dist/index.js:296:23)
|
|
18
|
+
at finalCallback (/Users/jshimkoski/Library/Caches/Cypress/15.13.0/Cypress.app/Contents/Resources/app/node_modules/webpack/lib/Compiler.js:500:32)
|
|
19
|
+
at /Users/jshimkoski/Library/Caches/Cypress/15.13.0/Cypress.app/Contents/Resources/app/node_modules/webpack/lib/Compiler.js:578:17
|
|
20
|
+
at /Users/jshimkoski/Library/Caches/Cypress/15.13.0/Cypress.app/Contents/Resources/app/node_modules/webpack/lib/HookWebpackError.js:67:2
|
|
21
|
+
at Hook.eval [as callAsync] (eval at create (/Users/jshimkoski/Library/Caches/Cypress/15.13.0/Cypress.app/Contents/Resources/app/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:6:1)
|
|
22
|
+
at Hook.CALL_ASYNC_DELEGATE [as _callAsync] (/Users/jshimkoski/Library/Caches/Cypress/15.13.0/Cypress.app/Contents/Resources/app/node_modules/tapable/lib/Hook.js:18:14)
|
|
23
|
+
at Cache.storeBuildDependencies (/Users/jshimkoski/Library/Caches/Cypress/15.13.0/Cypress.app/Contents/Resources/app/node_modules/webpack/lib/Cache.js:126:37)
|
|
24
|
+
at /Users/jshimkoski/Library/Caches/Cypress/15.13.0/Cypress.app/Contents/Resources/app/node_modules/webpack/lib/Compiler.js:574:19
|
|
25
|
+
at Hook.eval [as callAsync] (eval at create (/Users/jshimkoski/Library/Caches/Cypress/15.13.0/Cypress.app/Contents/Resources/app/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:6:1)
|
|
26
|
+
at Hook.CALL_ASYNC_DELEGATE [as _callAsync] (/Users/jshimkoski/Library/Caches/Cypress/15.13.0/Cypress.app/Contents/Resources/app/node_modules/tapable/lib/Hook.js:18:14)
|
|
27
|
+
at /Users/jshimkoski/Library/Caches/Cypress/15.13.0/Cypress.app/Contents/Resources/app/node_modules/webpack/lib/Compiler.js:570:23
|
|
28
|
+
at Compiler.emitRecords (/Users/jshimkoski/Library/Caches/Cypress/15.13.0/Cypress.app/Contents/Resources/app/node_modules/webpack/lib/Compiler.js:1046:4)
|
|
29
|
+
at /Users/jshimkoski/Library/Caches/Cypress/15.13.0/Cypress.app/Contents/Resources/app/node_modules/webpack/lib/Compiler.js:560:11
|
|
30
|
+
at /Users/jshimkoski/Library/Caches/Cypress/15.13.0/Cypress.app/Contents/Resources/app/node_modules/webpack/lib/Compiler.js:1009:14
|
|
31
|
+
at Hook.eval [as callAsync] (eval at create (/Users/jshimkoski/Library/Caches/Cypress/15.13.0/Cypress.app/Contents/Resources/app/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:6:1)
|
|
32
|
+
at Hook.CALL_ASYNC_DELEGATE [as _callAsync] (/Users/jshimkoski/Library/Caches/Cypress/15.13.0/Cypress.app/Contents/Resources/app/node_modules/tapable/lib/Hook.js:18:14)
|
|
33
|
+
at /Users/jshimkoski/Library/Caches/Cypress/15.13.0/Cypress.app/Contents/Resources/app/node_modules/webpack/lib/Compiler.js:1006:27
|
|
34
|
+
at /Users/jshimkoski/Library/Caches/Cypress/15.13.0/Cypress.app/Contents/Resources/app/node_modules/neo-async/async.js:2818:7
|
|
35
|
+
at done (/Users/jshimkoski/Library/Caches/Cypress/15.13.0/Cypress.app/Contents/Resources/app/node_modules/neo-async/async.js:3522:9)
|
|
36
|
+
at alreadyWritten (/Users/jshimkoski/Library/Caches/Cypress/15.13.0/Cypress.app/Contents/Resources/app/node_modules/webpack/lib/Compiler.js:811:8)
|
|
37
|
+
at /Users/jshimkoski/Library/Caches/Cypress/15.13.0/Cypress.app/Contents/Resources/app/node_modules/webpack/lib/Compiler.js:922:17
|
|
38
|
+
at /Users/jshimkoski/Library/Caches/Cypress/15.13.0/Cypress.app/Contents/Resources/app/node_modules/graceful-fs/graceful-fs.js:123:16
|
|
17
39
|
|
|
18
|
-
|
|
19
|
-
navigates to /about when button is clicked:
|
|
20
|
-
AssertionError: Timed out retrying after 4000ms: expected 'http://localhost:4176/navigate-test' to include '/about'
|
|
21
|
-
at Context.eval (webpack://@jasonshimmy/vite-plugin-cer-app/./e2e/cypress/e2e/navigate.cy.ts:15:13)
|
|
40
|
+
This occurred while Cypress was compiling and bundling your test code. This is usually caused by:
|
|
22
41
|
|
|
42
|
+
- A missing file or dependency
|
|
43
|
+
- A syntax error in the file or one of its dependencies
|
|
23
44
|
|
|
45
|
+
Fix the error in your code and re-run your tests.
|
|
24
46
|
|
|
47
|
+
(Results)
|
|
48
|
+
|
|
49
|
+
┌────────────────────────────────────────────────────────────────────────────────────────────────┐
|
|
50
|
+
│ Tests: 0 │
|
|
51
|
+
│ Passing: 0 │
|
|
52
|
+
│ Failing: 1 │
|
|
53
|
+
│ Pending: 0 │
|
|
54
|
+
│ Skipped: 0 │
|
|
55
|
+
│ Screenshots: 0 │
|
|
56
|
+
│ Video: false │
|
|
57
|
+
│ Duration: 0 seconds │
|
|
58
|
+
│ Spec Ran: api.cy.ts │
|
|
59
|
+
└────────────────────────────────────────────────────────────────────────────────────────────────┘
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
Oops...we found an error preparing this test file:
|
|
63
|
+
|
|
64
|
+
> e2e/cypress/support/e2e.ts
|
|
65
|
+
|
|
66
|
+
The error was:
|
|
67
|
+
|
|
68
|
+
Error: Webpack Compilation Error
|
|
69
|
+
[tsl] ERROR
|
|
70
|
+
TS5101: Option 'downlevelIteration' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error.
|
|
71
|
+
|
|
72
|
+
[tsl] ERROR
|
|
73
|
+
TS5101: Option 'downlevelIteration' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error.
|
|
74
|
+
|
|
75
|
+
[tsl] ERROR
|
|
76
|
+
TS5101: Option 'downlevelIteration' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error.
|
|
77
|
+
at handle (/Users/jshimkoski/Library/Caches/Cypress/15.13.0/Cypress.app/Contents/Resources/app/packages/server/node_modules/@cypress/webpack-preprocessor/dist/index.js:296:23)
|
|
78
|
+
at finalCallback (/Users/jshimkoski/Library/Caches/Cypress/15.13.0/Cypress.app/Contents/Resources/app/node_modules/webpack/lib/Compiler.js:500:32)
|
|
79
|
+
at /Users/jshimkoski/Library/Caches/Cypress/15.13.0/Cypress.app/Contents/Resources/app/node_modules/webpack/lib/Compiler.js:578:17
|
|
80
|
+
at /Users/jshimkoski/Library/Caches/Cypress/15.13.0/Cypress.app/Contents/Resources/app/node_modules/webpack/lib/HookWebpackError.js:67:2
|
|
81
|
+
at Hook.eval [as callAsync] (eval at create (/Users/jshimkoski/Library/Caches/Cypress/15.13.0/Cypress.app/Contents/Resources/app/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:6:1)
|
|
82
|
+
at Hook.CALL_ASYNC_DELEGATE [as _callAsync] (/Users/jshimkoski/Library/Caches/Cypress/15.13.0/Cypress.app/Contents/Resources/app/node_modules/tapable/lib/Hook.js:18:14)
|
|
83
|
+
at Cache.storeBuildDependencies (/Users/jshimkoski/Library/Caches/Cypress/15.13.0/Cypress.app/Contents/Resources/app/node_modules/webpack/lib/Cache.js:126:37)
|
|
84
|
+
at /Users/jshimkoski/Library/Caches/Cypress/15.13.0/Cypress.app/Contents/Resources/app/node_modules/webpack/lib/Compiler.js:574:19
|
|
85
|
+
at Hook.eval [as callAsync] (eval at create (/Users/jshimkoski/Library/Caches/Cypress/15.13.0/Cypress.app/Contents/Resources/app/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:6:1)
|
|
86
|
+
at Hook.CALL_ASYNC_DELEGATE [as _callAsync] (/Users/jshimkoski/Library/Caches/Cypress/15.13.0/Cypress.app/Contents/Resources/app/node_modules/tapable/lib/Hook.js:18:14)
|
|
87
|
+
at /Users/jshimkoski/Library/Caches/Cypress/15.13.0/Cypress.app/Contents/Resources/app/node_modules/webpack/lib/Compiler.js:570:23
|
|
88
|
+
at Compiler.emitRecords (/Users/jshimkoski/Library/Caches/Cypress/15.13.0/Cypress.app/Contents/Resources/app/node_modules/webpack/lib/Compiler.js:1046:4)
|
|
89
|
+
at /Users/jshimkoski/Library/Caches/Cypress/15.13.0/Cypress.app/Contents/Resources/app/node_modules/webpack/lib/Compiler.js:560:11
|
|
90
|
+
at /Users/jshimkoski/Library/Caches/Cypress/15.13.0/Cypress.app/Contents/Resources/app/node_modules/webpack/lib/Compiler.js:1009:14
|
|
91
|
+
at Hook.eval [as callAsync] (eval at create (/Users/jshimkoski/Library/Caches/Cypress/15.13.0/Cypress.app/Contents/Resources/app/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:6:1)
|
|
92
|
+
at Hook.CALL_ASYNC_DELEGATE [as _callAsync] (/Users/jshimkoski/Library/Caches/Cypress/15.13.0/Cypress.app/Contents/Resources/app/node_modules/tapable/lib/Hook.js:18:14)
|
|
93
|
+
at /Users/jshimkoski/Library/Caches/Cypress/15.13.0/Cypress.app/Contents/Resources/app/node_modules/webpack/lib/Compiler.js:1006:27
|
|
94
|
+
at /Users/jshimkoski/Library/Caches/Cypress/15.13.0/Cypress.app/Contents/Resources/app/node_modules/neo-async/async.js:2818:7
|
|
95
|
+
at done (/Users/jshimkoski/Library/Caches/Cypress/15.13.0/Cypress.app/Contents/Resources/app/node_modules/neo-async/async.js:3522:9)
|
|
96
|
+
at alreadyWritten (/Users/jshimkoski/Library/Caches/Cypress/15.13.0/Cypress.app/Contents/Resources/app/node_modules/webpack/lib/Compiler.js:811:8)
|
|
97
|
+
at /Users/jshimkoski/Library/Caches/Cypress/15.13.0/Cypress.app/Contents/Resources/app/node_modules/webpack/lib/Compiler.js:922:17
|
|
98
|
+
at /Users/jshimkoski/Library/Caches/Cypress/15.13.0/Cypress.app/Contents/Resources/app/node_modules/graceful-fs/graceful-fs.js:123:16
|
|
99
|
+
|
|
100
|
+
This occurred while Cypress was compiling and bundling your test code. This is usually caused by:
|
|
101
|
+
|
|
102
|
+
- A missing file or dependency
|
|
103
|
+
- A syntax error in the file or one of its dependencies
|
|
104
|
+
|
|
105
|
+
Fix the error in your code and re-run your tests.
|
|
106
|
+
|
|
107
|
+
────────────────────────────────────────────────────────────────────────────────────────────────────
|
|
108
|
+
|
|
109
|
+
Running: cookie.cy.ts (2 of 16)
|
|
25
110
|
|
|
26
111
|
(Results)
|
|
27
112
|
|
|
28
113
|
┌────────────────────────────────────────────────────────────────────────────────────────────────┐
|
|
29
|
-
│ Tests:
|
|
30
|
-
│ Passing:
|
|
114
|
+
│ Tests: 0 │
|
|
115
|
+
│ Passing: 0 │
|
|
31
116
|
│ Failing: 1 │
|
|
32
117
|
│ Pending: 0 │
|
|
33
118
|
│ Skipped: 0 │
|
|
34
|
-
│ Screenshots:
|
|
119
|
+
│ Screenshots: 0 │
|
|
35
120
|
│ Video: false │
|
|
36
|
-
│ Duration:
|
|
37
|
-
│ Spec Ran:
|
|
121
|
+
│ Duration: 0 seconds │
|
|
122
|
+
│ Spec Ran: cookie.cy.ts │
|
|
38
123
|
└────────────────────────────────────────────────────────────────────────────────────────────────┘
|
|
39
124
|
|
|
40
125
|
|
|
41
|
-
|
|
126
|
+
Oops...we found an error preparing this test file:
|
|
127
|
+
|
|
128
|
+
> e2e/cypress/support/e2e.ts
|
|
129
|
+
|
|
130
|
+
The error was:
|
|
131
|
+
|
|
132
|
+
Error: Webpack Compilation Error
|
|
133
|
+
[tsl] ERROR
|
|
134
|
+
TS5101: Option 'downlevelIteration' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error.
|
|
42
135
|
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
136
|
+
[tsl] ERROR
|
|
137
|
+
TS5101: Option 'downlevelIteration' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error.
|
|
138
|
+
|
|
139
|
+
[tsl] ERROR
|
|
140
|
+
TS5101: Option 'downlevelIteration' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error.
|
|
141
|
+
at handle (/Users/jshimkoski/Library/Caches/Cypress/15.13.0/Cypress.app/Contents/Resources/app/packages/server/node_modules/@cypress/webpack-preprocessor/dist/index.js:296:23)
|
|
142
|
+
at finalCallback (/Users/jshimkoski/Library/Caches/Cypress/15.13.0/Cypress.app/Contents/Resources/app/node_modules/webpack/lib/Compiler.js:500:32)
|
|
143
|
+
at /Users/jshimkoski/Library/Caches/Cypress/15.13.0/Cypress.app/Contents/Resources/app/node_modules/webpack/lib/Compiler.js:578:17
|
|
144
|
+
at /Users/jshimkoski/Library/Caches/Cypress/15.13.0/Cypress.app/Contents/Resources/app/node_modules/webpack/lib/HookWebpackError.js:67:2
|
|
145
|
+
at Hook.eval [as callAsync] (eval at create (/Users/jshimkoski/Library/Caches/Cypress/15.13.0/Cypress.app/Contents/Resources/app/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:6:1)
|
|
146
|
+
at Hook.CALL_ASYNC_DELEGATE [as _callAsync] (/Users/jshimkoski/Library/Caches/Cypress/15.13.0/Cypress.app/Contents/Resources/app/node_modules/tapable/lib/Hook.js:18:14)
|
|
147
|
+
at Cache.storeBuildDependencies (/Users/jshimkoski/Library/Caches/Cypress/15.13.0/Cypress.app/Contents/Resources/app/node_modules/webpack/lib/Cache.js:126:37)
|
|
148
|
+
at /Users/jshimkoski/Library/Caches/Cypress/15.13.0/Cypress.app/Contents/Resources/app/node_modules/webpack/lib/Compiler.js:574:19
|
|
149
|
+
at Hook.eval [as callAsync] (eval at create (/Users/jshimkoski/Library/Caches/Cypress/15.13.0/Cypress.app/Contents/Resources/app/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:6:1)
|
|
150
|
+
at Hook.CALL_ASYNC_DELEGATE [as _callAsync] (/Users/jshimkoski/Library/Caches/Cypress/15.13.0/Cypress.app/Contents/Resources/app/node_modules/tapable/lib/Hook.js:18:14)
|
|
151
|
+
at /Users/jshimkoski/Library/Caches/Cypress/15.13.0/Cypress.app/Contents/Resources/app/node_modules/webpack/lib/Compiler.js:570:23
|
|
152
|
+
at Compiler.emitRecords (/Users/jshimkoski/Library/Caches/Cypress/15.13.0/Cypress.app/Contents/Resources/app/node_modules/webpack/lib/Compiler.js:1046:4)
|
|
153
|
+
at /Users/jshimkoski/Library/Caches/Cypress/15.13.0/Cypress.app/Contents/Resources/app/node_modules/webpack/lib/Compiler.js:560:11
|
|
154
|
+
at /Users/jshimkoski/Library/Caches/Cypress/15.13.0/Cypress.app/Contents/Resources/app/node_modules/webpack/lib/Compiler.js:1009:14
|
|
155
|
+
at Hook.eval [as callAsync] (eval at create (/Users/jshimkoski/Library/Caches/Cypress/15.13.0/Cypress.app/Contents/Resources/app/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:6:1)
|
|
156
|
+
at Hook.CALL_ASYNC_DELEGATE [as _callAsync] (/Users/jshimkoski/Library/Caches/Cypress/15.13.0/Cypress.app/Contents/Resources/app/node_modules/tapable/lib/Hook.js:18:14)
|
|
157
|
+
at /Users/jshimkoski/Library/Caches/Cypress/15.13.0/Cypress.app/Contents/Resources/app/node_modules/webpack/lib/Compiler.js:1006:27
|
|
158
|
+
at /Users/jshimkoski/Library/Caches/Cypress/15.13.0/Cypress.app/Contents/Resources/app/node_modules/neo-async/async.js:2818:7
|
|
159
|
+
at done (/Users/jshimkoski/Library/Caches/Cypress/15.13.0/Cypress.app/Contents/Resources/app/node_modules/neo-async/async.js:3522:9)
|
|
160
|
+
at alreadyWritten (/Users/jshimkoski/Library/Caches/Cypress/15.13.0/Cypress.app/Contents/Resources/app/node_modules/webpack/lib/Compiler.js:811:8)
|
|
161
|
+
at /Users/jshimkoski/Library/Caches/Cypress/15.13.0/Cypress.app/Contents/Resources/app/node_modules/webpack/lib/Compiler.js:922:17
|
|
162
|
+
at /Users/jshimkoski/Library/Caches/Cypress/15.13.0/Cypress.app/Contents/Resources/app/node_modules/graceful-fs/graceful-fs.js:123:16
|
|
163
|
+
|
|
164
|
+
This occurred while Cypress was compiling and bundling your test code. This is usually caused by:
|
|
165
|
+
|
|
166
|
+
- A missing file or dependency
|
|
167
|
+
- A syntax error in the file or one of its dependencies
|
|
168
|
+
|
|
169
|
+
Fix the error in your code and re-run your tests.
|
|
170
|
+
|
|
171
|
+
Oops...we found an error preparing this test file:
|
|
172
|
+
|
|
173
|
+
> e2e/cypress/e2e/cookie.cy.ts
|
|
174
|
+
|
|
175
|
+
The error was:
|
|
176
|
+
|
|
177
|
+
Error: Webpack Compilation Error
|
|
178
|
+
[tsl] ERROR
|
|
179
|
+
TS5101: Option 'downlevelIteration' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error.
|
|
180
|
+
|
|
181
|
+
[tsl] ERROR
|
|
182
|
+
TS5101: Option 'downlevelIteration' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error.
|
|
183
|
+
at handle (/Users/jshimkoski/Library/Caches/Cypress/15.13.0/Cypress.app/Contents/Resources/app/packages/server/node_modules/@cypress/webpack-preprocessor/dist/index.js:296:23)
|
|
184
|
+
at finalCallback (/Users/jshimkoski/Library/Caches/Cypress/15.13.0/Cypress.app/Contents/Resources/app/node_modules/webpack/lib/Compiler.js:500:32)
|
|
185
|
+
at /Users/jshimkoski/Library/Caches/Cypress/15.13.0/Cypress.app/Contents/Resources/app/node_modules/webpack/lib/Compiler.js:578:17
|
|
186
|
+
at /Users/jshimkoski/Library/Caches/Cypress/15.13.0/Cypress.app/Contents/Resources/app/node_modules/webpack/lib/HookWebpackError.js:67:2
|
|
187
|
+
at Hook.eval [as callAsync] (eval at create (/Users/jshimkoski/Library/Caches/Cypress/15.13.0/Cypress.app/Contents/Resources/app/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:6:1)
|
|
188
|
+
at Hook.CALL_ASYNC_DELEGATE [as _callAsync] (/Users/jshimkoski/Library/Caches/Cypress/15.13.0/Cypress.app/Contents/Resources/app/node_modules/tapable/lib/Hook.js:18:14)
|
|
189
|
+
at Cache.storeBuildDependencies (/Users/jshimkoski/Library/Caches/Cypress/15.13.0/Cypress.app/Contents/Resources/app/node_modules/webpack/lib/Cache.js:126:37)
|
|
190
|
+
at /Users/jshimkoski/Library/Caches/Cypress/15.13.0/Cypress.app/Contents/Resources/app/node_modules/webpack/lib/Compiler.js:574:19
|
|
191
|
+
at Hook.eval [as callAsync] (eval at create (/Users/jshimkoski/Library/Caches/Cypress/15.13.0/Cypress.app/Contents/Resources/app/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:6:1)
|
|
192
|
+
at Hook.CALL_ASYNC_DELEGATE [as _callAsync] (/Users/jshimkoski/Library/Caches/Cypress/15.13.0/Cypress.app/Contents/Resources/app/node_modules/tapable/lib/Hook.js:18:14)
|
|
193
|
+
at /Users/jshimkoski/Library/Caches/Cypress/15.13.0/Cypress.app/Contents/Resources/app/node_modules/webpack/lib/Compiler.js:570:23
|
|
194
|
+
at Compiler.emitRecords (/Users/jshimkoski/Library/Caches/Cypress/15.13.0/Cypress.app/Contents/Resources/app/node_modules/webpack/lib/Compiler.js:1046:4)
|
|
195
|
+
at /Users/jshimkoski/Library/Caches/Cypress/15.13.0/Cypress.app/Contents/Resources/app/node_modules/webpack/lib/Compiler.js:560:11
|
|
196
|
+
at /Users/jshimkoski/Library/Caches/Cypress/15.13.0/Cypress.app/Contents/Resources/app/node_modules/webpack/lib/Compiler.js:1009:14
|
|
197
|
+
at Hook.eval [as callAsync] (eval at create (/Users/jshimkoski/Library/Caches/Cypress/15.13.0/Cypress.app/Contents/Resources/app/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:6:1)
|
|
198
|
+
at Hook.CALL_ASYNC_DELEGATE [as _callAsync] (/Users/jshimkoski/Library/Caches/Cypress/15.13.0/Cypress.app/Contents/Resources/app/node_modules/tapable/lib/Hook.js:18:14)
|
|
199
|
+
at /Users/jshimkoski/Library/Caches/Cypress/15.13.0/Cypress.app/Contents/Resources/app/node_modules/webpack/lib/Compiler.js:1006:27
|
|
200
|
+
at /Users/jshimkoski/Library/Caches/Cypress/15.13.0/Cypress.app/Contents/Resources/app/node_modules/neo-async/async.js:2818:7
|
|
201
|
+
at done (/Users/jshimkoski/Library/Caches/Cypress/15.13.0/Cypress.app/Contents/Resources/app/node_modules/neo-async/async.js:3522:9)
|
|
202
|
+
at alreadyWritten (/Users/jshimkoski/Library/Caches/Cypress/15.13.0/Cypress.app/Contents/Resources/app/node_modules/webpack/lib/Compiler.js:811:8)
|
|
203
|
+
at /Users/jshimkoski/Library/Caches/Cypress/15.13.0/Cypress.app/Contents/Resources/app/node_modules/webpack/lib/Compiler.js:922:17
|
|
204
|
+
at /Users/jshimkoski/Library/Caches/Cypress/15.13.0/Cypress.app/Contents/Resources/app/node_modules/graceful-fs/graceful-fs.js:123:16
|
|
205
|
+
|
|
206
|
+
This occurred while Cypress was compiling and bundling your test code. This is usually caused by:
|
|
207
|
+
|
|
208
|
+
- A missing file or dependency
|
|
209
|
+
- A syntax error in the file or one of its dependencies
|
|
210
|
+
|
|
211
|
+
Fix the error in your code and re-run your tests.
|
|
212
|
+
|
|
213
|
+
────────────────────────────────────────────────────────────────────────────────────────────────────
|
|
214
|
+
|
|
215
|
+
Running: data.cy.ts (3 of 16)
|
|
216
|
+
|
|
217
|
+
(Results)
|
|
218
|
+
|
|
219
|
+
┌────────────────────────────────────────────────────────────────────────────────────────────────┐
|
|
220
|
+
│ Tests: 0 │
|
|
221
|
+
│ Passing: 0 │
|
|
222
|
+
│ Failing: 1 │
|
|
223
|
+
│ Pending: 0 │
|
|
224
|
+
│ Skipped: 0 │
|
|
225
|
+
│ Screenshots: 0 │
|
|
226
|
+
│ Video: false │
|
|
227
|
+
│ Duration: 0 seconds │
|
|
228
|
+
│ Spec Ran: data.cy.ts │
|
|
229
|
+
└────────────────────────────────────────────────────────────────────────────────────────────────┘
|
|
46
230
|
|
|
231
|
+
Target.getTargets will not run as browser CRI connection was reset
|
|
232
|
+
Error: Target.getTargets will not run as browser CRI connection was reset
|
|
233
|
+
at c.send (<embedded>:2618:536323)
|
|
234
|
+
at async y._onAttachToTarget (<embedded>:2618:675238)
|
|
235
|
+
at async EventEmitter.<anonymous> (<embedded>:2618:673931)
|
|
236
|
+
ERR_FAILED (-2) loading 'about:blank'
|
|
237
|
+
Error: ERR_FAILED (-2) loading 'about:blank'
|
|
238
|
+
at rejectAndCleanup (node:electron/js2c/browser_init:2:79724)
|
|
239
|
+
at finishListener (node:electron/js2c/browser_init:2:79886)
|
|
240
|
+
at WebContents.stopLoadingListener (node:electron/js2c/browser_init:2:80273)
|
|
241
|
+
at WebContents.emit (node:events:531:35)
|
|
242
|
+
[cer-app] Received SIGINT, shutting down gracefully...
|
|
243
|
+
Error: Command failed with exit code 1: npm run e2e:run:ssr
|
|
244
|
+
at makeError (/Users/jshimkoski/dev/vite-plugin-cer-app/node_modules/start-server-and-test/node_modules/execa/lib/error.js:60:11)
|
|
245
|
+
at handlePromise (/Users/jshimkoski/dev/vite-plugin-cer-app/node_modules/start-server-and-test/node_modules/execa/index.js:118:26)
|
|
246
|
+
at process.processTicksAndRejections (node:internal/process/task_queues:105:5) {
|
|
247
|
+
shortMessage: 'Command failed with exit code 1: npm run e2e:run:ssr',
|
|
248
|
+
command: 'npm run e2e:run:ssr',
|
|
249
|
+
escapedCommand: '"npm run e2e:run:ssr"',
|
|
250
|
+
exitCode: 1,
|
|
251
|
+
signal: undefined,
|
|
252
|
+
signalDescription: undefined,
|
|
253
|
+
stdout: undefined,
|
|
254
|
+
stderr: undefined,
|
|
255
|
+
failed: true,
|
|
256
|
+
timedOut: false,
|
|
257
|
+
isCanceled: false,
|
|
258
|
+
killed: false
|
|
259
|
+
}
|
|
260
|
+
[cer-app] Server closed.
|
|
261
|
+
➜ vite-plugin-cer-app git:(main) ✗
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jasonshimmy/vite-plugin-cer-app",
|
|
3
|
-
"version": "0.14.
|
|
3
|
+
"version": "0.14.1",
|
|
4
4
|
"description": "Nuxt-style meta-framework for @jasonshimmy/custom-elements-runtime",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"keywords": [
|
|
@@ -90,15 +90,15 @@
|
|
|
90
90
|
"devDependencies": {
|
|
91
91
|
"@jasonshimmy/custom-elements-runtime": "^3.4.0",
|
|
92
92
|
"@types/node": "^25.5.0",
|
|
93
|
-
"@vitest/coverage-v8": "^4.1.
|
|
94
|
-
"cypress": "^15.
|
|
93
|
+
"@vitest/coverage-v8": "^4.1.1",
|
|
94
|
+
"cypress": "^15.13.0",
|
|
95
95
|
"eslint": "^10.1.0",
|
|
96
|
-
"happy-dom": "^20.8.
|
|
96
|
+
"happy-dom": "^20.8.8",
|
|
97
97
|
"jiti": "^2.6.1",
|
|
98
|
-
"start-server-and-test": "^
|
|
98
|
+
"start-server-and-test": "^3.0.0",
|
|
99
99
|
"typescript": "^5.9.3",
|
|
100
|
-
"typescript-eslint": "^8.57.
|
|
101
|
-
"vite": "^8.0.
|
|
100
|
+
"typescript-eslint": "^8.57.2",
|
|
101
|
+
"vite": "^8.0.2",
|
|
102
102
|
"vitest": "^4.1.0"
|
|
103
103
|
},
|
|
104
104
|
"publishConfig": {
|
|
@@ -198,6 +198,26 @@ describe('generateAutoImportDts', () => {
|
|
|
198
198
|
expect(dts).toContain("const useSession: typeof import('@jasonshimmy/vite-plugin-cer-app/composables')['useSession']")
|
|
199
199
|
})
|
|
200
200
|
|
|
201
|
+
it('declares useAuth as a framework global', async () => {
|
|
202
|
+
const dts = await generateAutoImportDts(ROOT, COMPOSABLES_DIR)
|
|
203
|
+
expect(dts).toContain("const useAuth: typeof import('@jasonshimmy/vite-plugin-cer-app/composables')['useAuth']")
|
|
204
|
+
})
|
|
205
|
+
|
|
206
|
+
it('declares useFetch as a framework global', async () => {
|
|
207
|
+
const dts = await generateAutoImportDts(ROOT, COMPOSABLES_DIR)
|
|
208
|
+
expect(dts).toContain("const useFetch: typeof import('@jasonshimmy/vite-plugin-cer-app/composables')['useFetch']")
|
|
209
|
+
})
|
|
210
|
+
|
|
211
|
+
it('declares useRoute as a framework global', async () => {
|
|
212
|
+
const dts = await generateAutoImportDts(ROOT, COMPOSABLES_DIR)
|
|
213
|
+
expect(dts).toContain("const useRoute: typeof import('@jasonshimmy/vite-plugin-cer-app/composables')['useRoute']")
|
|
214
|
+
})
|
|
215
|
+
|
|
216
|
+
it('declares navigateTo as a framework global', async () => {
|
|
217
|
+
const dts = await generateAutoImportDts(ROOT, COMPOSABLES_DIR)
|
|
218
|
+
expect(dts).toContain("const navigateTo: typeof import('@jasonshimmy/vite-plugin-cer-app/composables')['navigateTo']")
|
|
219
|
+
})
|
|
220
|
+
|
|
201
221
|
it('declares when directive as a global', async () => {
|
|
202
222
|
const dts = await generateAutoImportDts(ROOT, COMPOSABLES_DIR)
|
|
203
223
|
expect(dts).toContain("const when: typeof import('@jasonshimmy/custom-elements-runtime/directives')['when']")
|
|
@@ -278,6 +298,11 @@ describe('generateVirtualModuleDts', () => {
|
|
|
278
298
|
expect(dts).toContain('RuntimePublicConfig')
|
|
279
299
|
})
|
|
280
300
|
|
|
301
|
+
it('declares _authSessionKey in virtual:cer-app-config', async () => {
|
|
302
|
+
const dts = await generateVirtualModuleDts(ROOT, COMPOSABLES_DIR)
|
|
303
|
+
expect(dts).toContain('_authSessionKey')
|
|
304
|
+
})
|
|
305
|
+
|
|
281
306
|
it('declares virtual:cer-server-middleware module', async () => {
|
|
282
307
|
const dts = await generateVirtualModuleDts(ROOT, COMPOSABLES_DIR)
|
|
283
308
|
expect(dts).toContain("declare module 'virtual:cer-server-middleware'")
|
|
@@ -87,3 +87,67 @@ describe('APP_ENTRY_TEMPLATE — meta.hydrate', () => {
|
|
|
87
87
|
expect(doHydrateBlock).toContain('delete (globalThis).__CER_DATA__')
|
|
88
88
|
})
|
|
89
89
|
})
|
|
90
|
+
|
|
91
|
+
// ─── Loader sequence ──────────────────────────────────────────────────────────
|
|
92
|
+
|
|
93
|
+
describe('APP_ENTRY_TEMPLATE — loader sequence', () => {
|
|
94
|
+
it('_loadPageForPath calls mod.loader with { params, query }', () => {
|
|
95
|
+
expect(APP_ENTRY_TEMPLATE).toContain('mod.loader({ params, query })')
|
|
96
|
+
})
|
|
97
|
+
|
|
98
|
+
it('_loadPageForPath sets globalThis.__CER_DATA__ from loader result', () => {
|
|
99
|
+
expect(APP_ENTRY_TEMPLATE).toContain('(globalThis).__CER_DATA__ = data')
|
|
100
|
+
})
|
|
101
|
+
|
|
102
|
+
it('_loadPageForPath merges loader primitive values into _currentPageAttrs', () => {
|
|
103
|
+
expect(APP_ENTRY_TEMPLATE).toContain('_currentPageAttrs = loaderAttrs')
|
|
104
|
+
})
|
|
105
|
+
|
|
106
|
+
it('_currentPageAttrs is passed as attrs in the direct-render page vnode', () => {
|
|
107
|
+
// The direct-render path passes _currentPageAttrs to the page element attrs
|
|
108
|
+
// so useProps() in the page component can read loader-returned primitives.
|
|
109
|
+
expect(APP_ENTRY_TEMPLATE).toContain('attrs: _currentPageAttrs')
|
|
110
|
+
})
|
|
111
|
+
|
|
112
|
+
it('router.push deletes __CER_DATA__ before loading the new page', () => {
|
|
113
|
+
// Prevents stale loader data from leaking to pages without a loader.
|
|
114
|
+
const pushStart = APP_ENTRY_TEMPLATE.indexOf('router.push = async')
|
|
115
|
+
const pushEnd = APP_ENTRY_TEMPLATE.indexOf('\n}', pushStart)
|
|
116
|
+
const pushBlock = APP_ENTRY_TEMPLATE.slice(pushStart, pushEnd)
|
|
117
|
+
expect(pushBlock).toContain('delete (globalThis).__CER_DATA__')
|
|
118
|
+
// The delete must appear before _loadPageForPath is called.
|
|
119
|
+
const deleteIdx = pushBlock.indexOf('delete (globalThis).__CER_DATA__')
|
|
120
|
+
const loadIdx = pushBlock.indexOf('_loadPageForPath')
|
|
121
|
+
expect(deleteIdx).toBeLessThan(loadIdx)
|
|
122
|
+
})
|
|
123
|
+
|
|
124
|
+
it('router.replace deletes __CER_DATA__ before loading the new page', () => {
|
|
125
|
+
const replaceStart = APP_ENTRY_TEMPLATE.indexOf('router.replace = async')
|
|
126
|
+
const replaceEnd = APP_ENTRY_TEMPLATE.indexOf('\n}', replaceStart)
|
|
127
|
+
const replaceBlock = APP_ENTRY_TEMPLATE.slice(replaceStart, replaceEnd)
|
|
128
|
+
expect(replaceBlock).toContain('delete (globalThis).__CER_DATA__')
|
|
129
|
+
const deleteIdx = replaceBlock.indexOf('delete (globalThis).__CER_DATA__')
|
|
130
|
+
const loadIdx = replaceBlock.indexOf('_loadPageForPath')
|
|
131
|
+
expect(deleteIdx).toBeLessThan(loadIdx)
|
|
132
|
+
})
|
|
133
|
+
|
|
134
|
+
it('router.push awaits _loadPageForPath before _push', () => {
|
|
135
|
+
const pushStart = APP_ENTRY_TEMPLATE.indexOf('router.push = async')
|
|
136
|
+
const pushEnd = APP_ENTRY_TEMPLATE.indexOf('\n}', pushStart)
|
|
137
|
+
const pushBlock = APP_ENTRY_TEMPLATE.slice(pushStart, pushEnd)
|
|
138
|
+
const loadIdx = pushBlock.indexOf('await _loadPageForPath')
|
|
139
|
+
const pushIdx = pushBlock.indexOf('await _push')
|
|
140
|
+
expect(loadIdx).toBeGreaterThanOrEqual(0)
|
|
141
|
+
expect(pushIdx).toBeGreaterThan(loadIdx)
|
|
142
|
+
})
|
|
143
|
+
|
|
144
|
+
it('router.replace awaits _loadPageForPath before _replace', () => {
|
|
145
|
+
const replaceStart = APP_ENTRY_TEMPLATE.indexOf('router.replace = async')
|
|
146
|
+
const replaceEnd = APP_ENTRY_TEMPLATE.indexOf('\n}', replaceStart)
|
|
147
|
+
const replaceBlock = APP_ENTRY_TEMPLATE.slice(replaceStart, replaceEnd)
|
|
148
|
+
const loadIdx = replaceBlock.indexOf('await _loadPageForPath')
|
|
149
|
+
const replaceIdx = replaceBlock.indexOf('await _replace')
|
|
150
|
+
expect(loadIdx).toBeGreaterThanOrEqual(0)
|
|
151
|
+
expect(replaceIdx).toBeGreaterThan(loadIdx)
|
|
152
|
+
})
|
|
153
|
+
})
|
|
@@ -76,7 +76,7 @@ const RUNTIME_GLOBALS = [
|
|
|
76
76
|
|
|
77
77
|
const DIRECTIVE_GLOBALS = ['when', 'each', 'match', 'anchorBlock']
|
|
78
78
|
|
|
79
|
-
const FRAMEWORK_GLOBALS = ['useHead', 'usePageData', 'useInject', 'useRuntimeConfig', 'defineMiddleware', 'defineServerMiddleware', 'useSeoMeta', 'useCookie', 'useSession']
|
|
79
|
+
const FRAMEWORK_GLOBALS = ['useHead', 'usePageData', 'useInject', 'useRuntimeConfig', 'defineMiddleware', 'defineServerMiddleware', 'useSeoMeta', 'useCookie', 'useSession', 'useAuth', 'useFetch', 'useRoute', 'navigateTo']
|
|
80
80
|
|
|
81
81
|
/**
|
|
82
82
|
* Scans a composables directory and returns a map of export name → file path.
|
|
@@ -225,6 +225,8 @@ export async function generateVirtualModuleDts(
|
|
|
225
225
|
lines.push(` export const runtimeConfig: { public: RuntimePublicConfig }`)
|
|
226
226
|
lines.push(` /** Server-only — present only in the SSR bundle. Always \`undefined\` in the client bundle. */`)
|
|
227
227
|
lines.push(` export const _runtimePrivateDefaults: RuntimePrivateConfig | undefined`)
|
|
228
|
+
lines.push(` /** Cookie/session key for the auth session. Derived from the app name. */`)
|
|
229
|
+
lines.push(` export const _authSessionKey: string`)
|
|
228
230
|
lines.push(` export default appConfig`)
|
|
229
231
|
lines.push(`}`)
|
|
230
232
|
lines.push('')
|
package/src/plugin/index.ts
CHANGED
|
@@ -386,16 +386,19 @@ export function cerApp(userConfig: CerAppConfig = {}): Plugin[] {
|
|
|
386
386
|
await writeAutoImportDts(config.root, config.composablesDir, composableExports)
|
|
387
387
|
writeTsconfigPaths(config.root, config.srcDir)
|
|
388
388
|
// Warm the virtual module cache.
|
|
389
|
-
// virtual:cer-app-config is cached under separate :client/:ssr keys
|
|
390
|
-
//
|
|
391
|
-
//
|
|
389
|
+
// virtual:cer-app-config is cached under separate :client/:ssr keys because
|
|
390
|
+
// the SSR variant includes _runtimePrivateDefaults (private env var defaults)
|
|
391
|
+
// that must never appear in the client bundle. Warm both variants here so
|
|
392
|
+
// neither the client build nor the SSR build incurs a cache miss on first load.
|
|
392
393
|
for (const resolvedId of Object.values(RESOLVED_IDS)) {
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
394
|
+
if (resolvedId === RESOLVED_IDS.appConfig) {
|
|
395
|
+
const clientCode = await generateVirtualModule(resolvedId, config, false)
|
|
396
|
+
if (clientCode !== null) moduleCache.set(`${resolvedId}:client`, clientCode)
|
|
397
|
+
const ssrCode = await generateVirtualModule(resolvedId, config, true)
|
|
398
|
+
if (ssrCode !== null) moduleCache.set(`${resolvedId}:ssr`, ssrCode)
|
|
399
|
+
} else {
|
|
400
|
+
const code = await generateVirtualModule(resolvedId, config)
|
|
401
|
+
if (code !== null) moduleCache.set(resolvedId, code)
|
|
399
402
|
}
|
|
400
403
|
}
|
|
401
404
|
},
|
|
@@ -110,6 +110,10 @@ router.push = async (path) => {
|
|
|
110
110
|
isNavigating.value = true
|
|
111
111
|
currentError.value = null
|
|
112
112
|
try {
|
|
113
|
+
// Clear stale loader data from the previous route before loading the new one.
|
|
114
|
+
// If the new route has no loader, __CER_DATA__ stays undefined so usePageData()
|
|
115
|
+
// correctly returns null instead of leaking the previous page's data.
|
|
116
|
+
delete (globalThis).__CER_DATA__
|
|
113
117
|
await _loadPageForPath(path)
|
|
114
118
|
await _push(path)
|
|
115
119
|
} catch (err) {
|
|
@@ -123,6 +127,8 @@ router.replace = async (path) => {
|
|
|
123
127
|
isNavigating.value = true
|
|
124
128
|
currentError.value = null
|
|
125
129
|
try {
|
|
130
|
+
// Clear stale loader data from the previous route before loading the new one.
|
|
131
|
+
delete (globalThis).__CER_DATA__
|
|
126
132
|
await _loadPageForPath(path)
|
|
127
133
|
await _replace(path)
|
|
128
134
|
} catch (err) {
|