@gracile/engine 0.9.0 → 0.9.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.
Files changed (62) hide show
  1. package/dist/dev/development.d.ts.map +1 -1
  2. package/dist/dev/development.js +1 -1
  3. package/dist/dev/ssr-ce-tracker.d.ts +27 -0
  4. package/dist/dev/ssr-ce-tracker.d.ts.map +1 -0
  5. package/dist/dev/ssr-ce-tracker.js +113 -0
  6. package/dist/plugin.d.ts.map +1 -1
  7. package/dist/plugin.js +51 -264
  8. package/dist/render/route-template-pipeline.d.ts +64 -0
  9. package/dist/render/route-template-pipeline.d.ts.map +1 -0
  10. package/dist/render/route-template-pipeline.js +144 -0
  11. package/dist/render/route-template.d.ts +1 -2
  12. package/dist/render/route-template.d.ts.map +1 -1
  13. package/dist/render/route-template.js +37 -92
  14. package/dist/routes/collect.d.ts +5 -1
  15. package/dist/routes/collect.d.ts.map +1 -1
  16. package/dist/routes/collect.js +8 -6
  17. package/dist/routes/load-module.d.ts.map +1 -1
  18. package/dist/routes/load-module.js +5 -2
  19. package/dist/routes/match.d.ts +31 -1
  20. package/dist/routes/match.d.ts.map +1 -1
  21. package/dist/routes/match.js +22 -4
  22. package/dist/routes/render.d.ts.map +1 -1
  23. package/dist/routes/render.js +11 -3
  24. package/dist/server/request-pipeline.d.ts +109 -0
  25. package/dist/server/request-pipeline.d.ts.map +1 -0
  26. package/dist/server/request-pipeline.js +198 -0
  27. package/dist/server/request.d.ts +3 -16
  28. package/dist/server/request.d.ts.map +1 -1
  29. package/dist/server/request.js +74 -171
  30. package/dist/test/init.d.ts +2 -0
  31. package/dist/test/init.d.ts.map +1 -0
  32. package/dist/test/init.js +7 -0
  33. package/dist/user-config.d.ts +13 -0
  34. package/dist/user-config.d.ts.map +1 -1
  35. package/dist/vite/build-routes.d.ts +1 -2
  36. package/dist/vite/build-routes.d.ts.map +1 -1
  37. package/dist/vite/build-routes.js +0 -98
  38. package/dist/vite/plugin-build-environment.d.ts +21 -0
  39. package/dist/vite/plugin-build-environment.d.ts.map +1 -0
  40. package/dist/vite/plugin-build-environment.js +83 -0
  41. package/dist/vite/plugin-ce-tracker.d.ts +19 -0
  42. package/dist/vite/plugin-ce-tracker.d.ts.map +1 -0
  43. package/dist/vite/plugin-ce-tracker.js +87 -0
  44. package/dist/vite/plugin-client-build.d.ts +20 -0
  45. package/dist/vite/plugin-client-build.d.ts.map +1 -0
  46. package/dist/vite/plugin-client-build.js +55 -0
  47. package/dist/vite/plugin-html-routes-build.d.ts +22 -0
  48. package/dist/vite/plugin-html-routes-build.d.ts.map +1 -0
  49. package/dist/vite/plugin-html-routes-build.js +140 -0
  50. package/dist/vite/plugin-serve.d.ts +18 -0
  51. package/dist/vite/plugin-serve.d.ts.map +1 -0
  52. package/dist/vite/plugin-serve.js +61 -0
  53. package/dist/vite/plugin-server-build.d.ts +43 -0
  54. package/dist/vite/plugin-server-build.d.ts.map +1 -0
  55. package/dist/vite/plugin-server-build.js +108 -0
  56. package/dist/vite/plugin-shared-state.d.ts +33 -0
  57. package/dist/vite/plugin-shared-state.d.ts.map +1 -0
  58. package/dist/vite/plugin-shared-state.js +23 -0
  59. package/dist/vite/virtual-routes.d.ts +8 -5
  60. package/dist/vite/virtual-routes.d.ts.map +1 -1
  61. package/dist/vite/virtual-routes.js +32 -31
  62. package/package.json +5 -5
@@ -0,0 +1,61 @@
1
+ /**
2
+ * Vite plugin: development server middleware.
3
+ *
4
+ * Sets up the Gracile request handler, route watcher, and dev-time
5
+ * logging for `vite dev`.
6
+ *
7
+ * @internal
8
+ */
9
+ import { getVersion } from '@gracile/internal-utils/version';
10
+ import c from 'picocolors';
11
+ import { createDevelopmentHandler } from '../dev/development.js';
12
+ import { nodeAdapter } from '../server/adapters/node.js';
13
+ export function gracileServePlugin({ state, config, logger, resetClientBuiltFlag, }) {
14
+ return {
15
+ name: 'vite-plugin-gracile-serve-middleware',
16
+ apply: 'serve',
17
+ config(_, environment) {
18
+ if (environment.isPreview)
19
+ return null;
20
+ return {
21
+ // NOTE: Supresses message: `Could not auto-determine entry point from rollupOptions or html files…`
22
+ // FIXME: It's not working when reloading the Vite config.
23
+ // Is user config, putting `optimizeDeps: { include: [] }` solve this.
24
+ optimizeDeps: { include: [] },
25
+ // NOTE: Useful? It breaks preview (expected)
26
+ appType: 'custom',
27
+ };
28
+ },
29
+ async configureServer(server) {
30
+ // Reset so dev-mode config hot-reloads don't hit the guard.
31
+ resetClientBuiltFlag();
32
+ const version = getVersion();
33
+ logger.info(`${c.cyan(c.italic(c.underline('🧚 Gracile')))}` +
34
+ ` ${c.dim(`~`)} ${c.green(`v${version ?? 'X'}`)}`);
35
+ const { handler } = await createDevelopmentHandler({
36
+ routes: state.routes,
37
+ vite: server,
38
+ gracileConfig: state.gracileConfig,
39
+ });
40
+ logger.info(c.dim('Vite development server is starting…'), {
41
+ timestamp: true,
42
+ });
43
+ server.watcher.on('ready', () => {
44
+ setTimeout(() => {
45
+ logger.info('');
46
+ logger.info(c.green('Watching for file changes…'), {
47
+ timestamp: true,
48
+ });
49
+ logger.info('');
50
+ // NOTE: We want it to show after the Vite intro stuff
51
+ }, 100);
52
+ });
53
+ return () => {
54
+ server.middlewares.use((request, response, next) => {
55
+ const locals = config?.dev?.locals?.({ nodeRequest: request });
56
+ Promise.resolve(nodeAdapter(handler, { logger })(request, response, locals)).catch((error) => next(error));
57
+ });
58
+ };
59
+ },
60
+ };
61
+ }
@@ -0,0 +1,43 @@
1
+ /**
2
+ * Vite plugins: server-side build pipeline.
3
+ *
4
+ * Uses the Vite Environment API (`builder.buildApp()`) to coordinate
5
+ * client and SSR builds instead of a nested `build()` call.
6
+ *
7
+ * Includes:
8
+ * - Client asset filename collector (client env writeBundle)
9
+ * - Virtual entrypoint codegen (SSR env only)
10
+ * - Server-to-client asset mover (SSR env only)
11
+ *
12
+ * @internal
13
+ */
14
+ import type { PluginOption } from 'vite';
15
+ import type { PluginSharedState } from './plugin-shared-state.js';
16
+ /**
17
+ * Tracks client bundle assets so the server build can reference them
18
+ * with their hashed filenames.
19
+ */
20
+ export declare function gracileCollectClientAssetsPlugin({ state, }: {
21
+ state: PluginSharedState;
22
+ }): PluginOption;
23
+ /**
24
+ * Generates the virtual `entrypoint.js` module for the server build.
25
+ * This is the server's main entry: it imports routes and creates the
26
+ * Gracile handler.
27
+ *
28
+ * Scoped to the SSR environment via `applyToEnvironment`.
29
+ */
30
+ export declare function gracileEntrypointPlugin({ state, }: {
31
+ state: PluginSharedState;
32
+ }): PluginOption;
33
+ /**
34
+ * After the server build writes its bundle, move any assets from
35
+ * `dist/server/assets/` into `dist/client/assets/` so the client
36
+ * can serve them.
37
+ *
38
+ * Scoped to the SSR environment via `applyToEnvironment`.
39
+ */
40
+ export declare function gracileMoveServerAssetsPlugin({ state, }: {
41
+ state: PluginSharedState;
42
+ }): PluginOption;
43
+ //# sourceMappingURL=plugin-server-build.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plugin-server-build.d.ts","sourceRoot":"","sources":["../../src/vite/plugin-server-build.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAKH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,MAAM,CAAC;AAEzC,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAIlE;;;GAGG;AACH,wBAAgB,gCAAgC,CAAC,EAChD,KAAK,GACL,EAAE;IACF,KAAK,EAAE,iBAAiB,CAAC;CACzB,GAAG,YAAY,CAgBf;AAID;;;;;;GAMG;AACH,wBAAgB,uBAAuB,CAAC,EACvC,KAAK,GACL,EAAE;IACF,KAAK,EAAE,iBAAiB,CAAC;CACzB,GAAG,YAAY,CAsCf;AAID;;;;;;GAMG;AACH,wBAAgB,6BAA6B,CAAC,EAC7C,KAAK,GACL,EAAE;IACF,KAAK,EAAE,iBAAiB,CAAC;CACzB,GAAG,YAAY,CA2Bf"}
@@ -0,0 +1,108 @@
1
+ /**
2
+ * Vite plugins: server-side build pipeline.
3
+ *
4
+ * Uses the Vite Environment API (`builder.buildApp()`) to coordinate
5
+ * client and SSR builds instead of a nested `build()` call.
6
+ *
7
+ * Includes:
8
+ * - Client asset filename collector (client env writeBundle)
9
+ * - Virtual entrypoint codegen (SSR env only)
10
+ * - Server-to-client asset mover (SSR env only)
11
+ *
12
+ * @internal
13
+ */
14
+ import { join } from 'node:path';
15
+ import { rename, rm } from 'node:fs/promises';
16
+ // ── Client asset collector ───────────────────────────────────────────
17
+ /**
18
+ * Tracks client bundle assets so the server build can reference them
19
+ * with their hashed filenames.
20
+ */
21
+ export function gracileCollectClientAssetsPlugin({ state, }) {
22
+ return {
23
+ name: 'vite-plugin-gracile-collect-client-assets-for-server',
24
+ applyToEnvironment(environment) {
25
+ return environment.name !== 'ssr';
26
+ },
27
+ writeBundle(_, bundle) {
28
+ if (state.outputMode === 'static')
29
+ return;
30
+ for (const file of Object.values(bundle))
31
+ if (file.type === 'asset' && file.name)
32
+ state.clientAssets[file.name] = file.fileName;
33
+ },
34
+ };
35
+ }
36
+ // ── Virtual entrypoint ───────────────────────────────────────────────
37
+ /**
38
+ * Generates the virtual `entrypoint.js` module for the server build.
39
+ * This is the server's main entry: it imports routes and creates the
40
+ * Gracile handler.
41
+ *
42
+ * Scoped to the SSR environment via `applyToEnvironment`.
43
+ */
44
+ export function gracileEntrypointPlugin({ state, }) {
45
+ return {
46
+ name: 'vite-plugin-gracile-entry',
47
+ apply: 'build',
48
+ applyToEnvironment(environment) {
49
+ return environment.name === 'ssr';
50
+ },
51
+ resolveId(id) {
52
+ if (id === 'entrypoint.js') {
53
+ return id;
54
+ }
55
+ return null;
56
+ },
57
+ load(id) {
58
+ if (id === 'entrypoint.js' && state.routes && state.renderedRoutes) {
59
+ return `
60
+ import { routeAssets, routeImports, routes } from 'gracile:routes';
61
+ import { createGracileHandler } from '@gracile/gracile/_internals/server-runtime';
62
+ import { createLogger } from '@gracile/gracile/_internals/logger';
63
+
64
+ createLogger();
65
+
66
+ export const handler = createGracileHandler({
67
+ root: process.cwd(),
68
+ routes,
69
+ routeImports,
70
+ routeAssets,
71
+ serverMode: true,
72
+ gracileConfig: ${JSON.stringify(state.gracileConfig, null, 2)}
73
+ });
74
+ `;
75
+ }
76
+ return null;
77
+ },
78
+ };
79
+ }
80
+ // ── Server asset mover ───────────────────────────────────────────────
81
+ /**
82
+ * After the server build writes its bundle, move any assets from
83
+ * `dist/server/assets/` into `dist/client/assets/` so the client
84
+ * can serve them.
85
+ *
86
+ * Scoped to the SSR environment via `applyToEnvironment`.
87
+ */
88
+ export function gracileMoveServerAssetsPlugin({ state, }) {
89
+ return {
90
+ name: 'gracile-move-server-assets',
91
+ apply: 'build',
92
+ applyToEnvironment(environment) {
93
+ return environment.name === 'ssr';
94
+ },
95
+ async writeBundle(_, bundle) {
96
+ const cwd = state.root || process.cwd();
97
+ await Promise.all(Object.entries(bundle).map(async ([file]) => {
98
+ if (file.startsWith('assets/') === false)
99
+ return;
100
+ await rename(join(cwd, `/dist/server/${file}`), join(cwd, `/dist/client/${file}`));
101
+ }));
102
+ // NOTE: Disabled for now, because it conflict with test's folder comparer
103
+ await rm(join(cwd, `/dist/server/assets`), {
104
+ recursive: true,
105
+ }).catch(() => null);
106
+ },
107
+ };
108
+ }
@@ -0,0 +1,33 @@
1
+ /**
2
+ * Shared mutable state passed between the Gracile Vite plugin phases.
3
+ *
4
+ * This exists because Vite plugins in the same array share data through
5
+ * closures. Making the shared state explicit (instead of ad-hoc `let`
6
+ * variables) makes the data flow between plugins visible and auditable.
7
+ *
8
+ * @internal
9
+ */
10
+ import type { RenderedRouteDefinition } from '../routes/render.js';
11
+ import type { RoutesManifest } from '../routes/route.js';
12
+ import type { GracileConfig } from '../user-config.js';
13
+ export interface PluginSharedState {
14
+ /** Collected file-system routes (populated during dev and build). */
15
+ routes: RoutesManifest;
16
+ /** Rendered route definitions from the client build phase. */
17
+ renderedRoutes: RenderedRouteDefinition[] | null;
18
+ /** Rollup input list for the client build (populated by route renderer). */
19
+ clientBuildInputList: string[] | null;
20
+ /** Maps original asset names → hashed filenames from the client bundle. */
21
+ clientAssets: Record<string, string>;
22
+ /** Vite `root` captured during build config. */
23
+ root: string | null;
24
+ /** The resolved Gracile configuration. */
25
+ gracileConfig: GracileConfig;
26
+ /** The output mode: 'static' or 'server'. */
27
+ outputMode: 'static' | 'server';
28
+ }
29
+ /**
30
+ * Create a fresh shared state object.
31
+ */
32
+ export declare function createPluginSharedState(config: GracileConfig | undefined): PluginSharedState;
33
+ //# sourceMappingURL=plugin-shared-state.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plugin-shared-state.d.ts","sourceRoot":"","sources":["../../src/vite/plugin-shared-state.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,qBAAqB,CAAC;AACnE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACzD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAEvD,MAAM,WAAW,iBAAiB;IACjC,qEAAqE;IACrE,MAAM,EAAE,cAAc,CAAC;IAEvB,8DAA8D;IAC9D,cAAc,EAAE,uBAAuB,EAAE,GAAG,IAAI,CAAC;IAEjD,4EAA4E;IAC5E,oBAAoB,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC;IAEtC,2EAA2E;IAC3E,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAErC,gDAAgD;IAChD,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IAEpB,0CAA0C;IAC1C,aAAa,EAAE,aAAa,CAAC;IAE7B,6CAA6C;IAC7C,UAAU,EAAE,QAAQ,GAAG,QAAQ,CAAC;CAChC;AAED;;GAEG;AACH,wBAAgB,uBAAuB,CACtC,MAAM,EAAE,aAAa,GAAG,SAAS,GAC/B,iBAAiB,CAUnB"}
@@ -0,0 +1,23 @@
1
+ /**
2
+ * Shared mutable state passed between the Gracile Vite plugin phases.
3
+ *
4
+ * This exists because Vite plugins in the same array share data through
5
+ * closures. Making the shared state explicit (instead of ad-hoc `let`
6
+ * variables) makes the data flow between plugins visible and auditable.
7
+ *
8
+ * @internal
9
+ */
10
+ /**
11
+ * Create a fresh shared state object.
12
+ */
13
+ export function createPluginSharedState(config) {
14
+ return {
15
+ routes: new Map(),
16
+ renderedRoutes: null,
17
+ clientBuildInputList: null,
18
+ clientAssets: {},
19
+ root: null,
20
+ gracileConfig: config || {},
21
+ outputMode: config?.output || 'static',
22
+ };
23
+ }
@@ -1,13 +1,16 @@
1
1
  import { type Plugin } from 'vite';
2
- import type { RenderedRouteDefinition } from '../routes/render.js';
3
2
  import type { RoutesManifest } from '../routes/route.js';
4
3
  import type { GracileConfig } from '../user-config.js';
4
+ import type { PluginSharedState } from './plugin-shared-state.js';
5
5
  /**
6
- * @todo Client-side testing, docs.
6
+ * Server-side routes virtual module (`gracile:routes`).
7
+ *
8
+ * Scoped to the SSR build environment via `applyToEnvironment`.
9
+ * Reads from shared state lazily so `renderedRoutes` is available
10
+ * (populated during the client build).
7
11
  */
8
- export declare function virtualRoutes({ routes, renderedRoutes, }: {
9
- routes: RoutesManifest;
10
- renderedRoutes: RenderedRouteDefinition[];
12
+ export declare function virtualRoutes({ state, }: {
13
+ state: PluginSharedState;
11
14
  }): Plugin[];
12
15
  export declare function virtualRoutesClient({ routes: routesMap, mode, gracileConfig, }: {
13
16
  routes: RoutesManifest;
@@ -1 +1 @@
1
- {"version":3,"file":"virtual-routes.d.ts","sourceRoot":"","sources":["../../src/vite/virtual-routes.ts"],"names":[],"mappings":"AACA,OAAO,EAAgB,KAAK,MAAM,EAAE,MAAM,MAAM,CAAC;AAEjD,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,qBAAqB,CAAC;AACnE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACzD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAEvD;;GAEG;AACH,wBAAgB,aAAa,CAAC,EAE7B,MAAM,EACN,cAAc,GACd,EAAE;IAEF,MAAM,EAAE,cAAc,CAAC;IACvB,cAAc,EAAE,uBAAuB,EAAE,CAAC;CAC1C,GAAG,MAAM,EAAE,CAyEX;AAKD,wBAAgB,mBAAmB,CAAC,EACnC,MAAM,EAAE,SAAS,EACjB,IAAe,EACf,aAAa,GACb,EAAE;IACF,MAAM,EAAE,cAAc,CAAC;IACvB,IAAI,EAAE,QAAQ,GAAG,QAAQ,CAAC;IAC1B,aAAa,EAAE,aAAa,CAAC;CAC7B,GAAG,MAAM,EAAE,CA4DX"}
1
+ {"version":3,"file":"virtual-routes.d.ts","sourceRoot":"","sources":["../../src/vite/virtual-routes.ts"],"names":[],"mappings":"AACA,OAAO,EAAgB,KAAK,MAAM,EAAE,MAAM,MAAM,CAAC;AAEjD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACzD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAEvD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAElE;;;;;;GAMG;AACH,wBAAgB,aAAa,CAAC,EAC7B,KAAK,GACL,EAAE;IACF,KAAK,EAAE,iBAAiB,CAAC;CACzB,GAAG,MAAM,EAAE,CAwEX;AAKD,wBAAgB,mBAAmB,CAAC,EACnC,MAAM,EAAE,SAAS,EACjB,IAAe,EACf,aAAa,GACb,EAAE;IACF,MAAM,EAAE,cAAc,CAAC;IACvB,IAAI,EAAE,QAAQ,GAAG,QAAQ,CAAC;IAC1B,aAAa,EAAE,aAAa,CAAC;CAC7B,GAAG,MAAM,EAAE,CA4DX"}
@@ -1,25 +1,22 @@
1
1
  import { normalizeToPosix } from '@gracile/internal-utils/paths';
2
2
  import { createFilter } from 'vite';
3
3
  /**
4
- * @todo Client-side testing, docs.
4
+ * Server-side routes virtual module (`gracile:routes`).
5
+ *
6
+ * Scoped to the SSR build environment via `applyToEnvironment`.
7
+ * Reads from shared state lazily so `renderedRoutes` is available
8
+ * (populated during the client build).
5
9
  */
6
- export function virtualRoutes({
7
- // root,
8
- routes, renderedRoutes, }) {
10
+ export function virtualRoutes({ state, }) {
9
11
  const virtualModuleId = 'gracile:routes';
10
12
  const resolvedVirtualModuleId = `\0${virtualModuleId}`;
11
- // TODO: Remove handler when prerendering route
12
- const routesWithoutPrerender = [...routes];
13
- const renderedRoutesWithoutPrerender = renderedRoutes;
14
- // const routesWithoutPrerender = [...routes].filter(
15
- // ([, r]) => r.prerender !== true,
16
- // );
17
- // const renderedRoutesWithoutPrerender = renderedRoutes.filter(
18
- // (r) => r.savePrerender !== true,
19
- // );
20
13
  return [
21
14
  {
22
15
  name: 'gracile-server-routes',
16
+ apply: 'build',
17
+ applyToEnvironment(environment) {
18
+ return environment.name === 'ssr';
19
+ },
23
20
  resolveId(id) {
24
21
  if (id === virtualModuleId) {
25
22
  return resolvedVirtualModuleId;
@@ -27,39 +24,43 @@ routes, renderedRoutes, }) {
27
24
  return null;
28
25
  },
29
26
  load(id) {
30
- if (id === resolvedVirtualModuleId) {
31
- return `
27
+ if (id !== resolvedVirtualModuleId)
28
+ return null;
29
+ const routes = state.routes;
30
+ const renderedRoutes = state.renderedRoutes;
31
+ if (!routes || routes.size === 0 || !renderedRoutes)
32
+ return null;
33
+ const routesArray = [...routes];
34
+ return `
32
35
  import { URLPattern } from '@gracile/gracile/url-pattern';
33
36
 
34
37
  const routes = new Map(${
35
- //
36
- JSON.stringify(routesWithoutPrerender, null, 2).replaceAll(
37
- // NOTE: Not strictly necessary, but just in case.
38
- '"pattern": {}', '"pattern": null')})
38
+ //
39
+ JSON.stringify(routesArray, null, 2).replaceAll(
40
+ // NOTE: Not strictly necessary, but just in case.
41
+ '"pattern": {}', '"pattern": null')})
39
42
  routes.forEach((route, pattern) => {
40
43
  route.pattern = new URLPattern(pattern, 'http://gracile');
41
44
  });
42
45
 
43
46
  const routeImports = new Map(
44
47
  [
45
- ${routesWithoutPrerender
46
- .map(([pattern, route]) => `['${pattern}', () => import('/${normalizeToPosix(route.filePath)}')],`)
47
- .join('\n ')}
48
+ ${routesArray
49
+ .map(([pattern, route]) => `['${pattern}', () => import('/${normalizeToPosix(route.filePath)}')],`)
50
+ .join('\n ')}
48
51
  ]
49
52
  );
50
53
 
51
- const routeAssets = new Map(${JSON.stringify(renderedRoutesWithoutPrerender.map((r) => [
52
- `/${r.name
53
- //
54
- .replace(/index\.html$/, '')
55
- .replace(/* Error pages */ /\.html$/, '/')}`,
56
- r.handlerAssets,
57
- ]), null, 2)});
54
+ const routeAssets = new Map(${JSON.stringify(renderedRoutes.map((r) => [
55
+ `/${r.name
56
+ //
57
+ .replace(/index\.html$/, '')
58
+ .replace(/* Error pages */ /\.html$/, '/')}`,
59
+ r.handlerAssets,
60
+ ]), null, 2)});
58
61
 
59
62
  export { routes, routeImports, routeAssets };
60
63
  `;
61
- }
62
- return null;
63
64
  },
64
65
  },
65
66
  ];
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@gracile/engine",
3
- "version": "0.9.0",
4
- "description": "A thin, full-stack, web framework",
3
+ "version": "0.9.1",
4
+ "description": "Vite-powered build and dev server engine for the Gracile framework",
5
5
  "keywords": [
6
6
  "custom-elements",
7
7
  "full-stack",
@@ -43,8 +43,8 @@
43
43
  "!/dist/typedoc-entrypoint.*"
44
44
  ],
45
45
  "dependencies": {
46
- "@gracile-labs/better-errors": "^0.2.0",
47
- "@gracile/internal-utils": "^0.6.0",
46
+ "@gracile-labs/better-errors": "^0.3.1",
47
+ "@gracile/internal-utils": "^0.6.2",
48
48
  "@whatwg-node/server": "^0.10.18",
49
49
  "fdir": "^6.5.0",
50
50
  "picocolors": "^1.1.1",
@@ -60,5 +60,5 @@
60
60
  "access": "public",
61
61
  "provenance": true
62
62
  },
63
- "gitHead": "06fa858cfdda41d1888e1f8f5c64da272c68f2d2"
63
+ "gitHead": "09d4bbc63796acf03a9c9f3be45737871ed95d9a"
64
64
  }