@analogjs/vite-plugin-nitro 3.0.0-alpha.3 → 3.0.0-alpha.31

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 (57) hide show
  1. package/package.json +27 -11
  2. package/src/index.d.ts +11 -9
  3. package/src/index.js +7 -2
  4. package/src/index.js.map +1 -1
  5. package/src/lib/build-server.d.ts +2 -2
  6. package/src/lib/build-server.js +101 -119
  7. package/src/lib/build-server.js.map +1 -1
  8. package/src/lib/build-sitemap.d.ts +23 -9
  9. package/src/lib/build-sitemap.js +132 -63
  10. package/src/lib/build-sitemap.js.map +1 -1
  11. package/src/lib/build-ssr.d.ts +3 -2
  12. package/src/lib/build-ssr.js +26 -18
  13. package/src/lib/build-ssr.js.map +1 -1
  14. package/src/lib/hooks/post-rendering-hook.d.ts +1 -1
  15. package/src/lib/hooks/post-rendering-hook.js +10 -6
  16. package/src/lib/hooks/post-rendering-hook.js.map +1 -1
  17. package/src/lib/options.d.ts +143 -106
  18. package/src/lib/plugins/dev-server-plugin.d.ts +3 -3
  19. package/src/lib/plugins/dev-server-plugin.js +98 -101
  20. package/src/lib/plugins/dev-server-plugin.js.map +1 -1
  21. package/src/lib/plugins/page-endpoints.d.ts +5 -5
  22. package/src/lib/plugins/page-endpoints.js +26 -57
  23. package/src/lib/plugins/page-endpoints.js.map +1 -1
  24. package/src/lib/utils/debug.d.ts +5 -0
  25. package/src/lib/utils/debug.js +15 -0
  26. package/src/lib/utils/debug.js.map +1 -0
  27. package/src/lib/utils/get-content-files.d.ts +54 -54
  28. package/src/lib/utils/get-content-files.js +88 -97
  29. package/src/lib/utils/get-content-files.js.map +1 -1
  30. package/src/lib/utils/get-page-handlers.d.ts +58 -58
  31. package/src/lib/utils/get-page-handlers.js +70 -84
  32. package/src/lib/utils/get-page-handlers.js.map +1 -1
  33. package/src/lib/utils/i18n-prerender.d.ts +36 -0
  34. package/src/lib/utils/i18n-prerender.js +23 -0
  35. package/src/lib/utils/i18n-prerender.js.map +1 -0
  36. package/src/lib/utils/load-esm.d.ts +18 -18
  37. package/src/lib/utils/node-web-bridge.d.ts +1 -1
  38. package/src/lib/utils/node-web-bridge.js +50 -45
  39. package/src/lib/utils/node-web-bridge.js.map +1 -1
  40. package/src/lib/utils/register-dev-middleware.d.ts +12 -12
  41. package/src/lib/utils/register-dev-middleware.js +41 -47
  42. package/src/lib/utils/register-dev-middleware.js.map +1 -1
  43. package/src/lib/utils/register-i18n-watcher.d.ts +15 -0
  44. package/src/lib/utils/renderers.d.ts +47 -47
  45. package/src/lib/utils/renderers.js +57 -56
  46. package/src/lib/utils/renderers.js.map +1 -1
  47. package/src/lib/utils/rolldown.d.ts +2 -0
  48. package/src/lib/utils/rolldown.js +12 -0
  49. package/src/lib/utils/rolldown.js.map +1 -0
  50. package/src/lib/vite-plugin-nitro.d.ts +3 -3
  51. package/src/lib/vite-plugin-nitro.js +735 -677
  52. package/src/lib/vite-plugin-nitro.js.map +1 -1
  53. package/README.md +0 -125
  54. package/src/lib/options.js +0 -2
  55. package/src/lib/options.js.map +0 -1
  56. package/src/lib/utils/load-esm.js +0 -23
  57. package/src/lib/utils/load-esm.js.map +0 -1
@@ -1,70 +1,66 @@
1
- // SSR dev server, middleware and error page source modified from
2
- // https://github.com/solidjs/solid-start/blob/main/packages/start/dev/server.js
3
- import { normalizePath, } from 'vite';
4
- import { resolve } from 'node:path';
5
- import { readFileSync } from 'node:fs';
6
- import { createRouter as createRadixRouter, toRouteMatcher } from 'radix3';
7
- import { defu } from 'defu';
8
- import { registerDevServerMiddleware } from '../utils/register-dev-middleware.js';
9
- import { writeWebResponseToNode } from '../utils/node-web-bridge.js';
10
- export function devServerPlugin(options) {
11
- const workspaceRoot = options?.workspaceRoot || process.cwd();
12
- const sourceRoot = options?.sourceRoot ?? 'src';
13
- const index = options.index || 'index.html';
14
- let config;
15
- let root;
16
- let isTest = false;
17
- return {
18
- name: 'analogjs-dev-ssr-plugin',
19
- config(userConfig, { mode }) {
20
- config = userConfig;
21
- root = normalizePath(resolve(workspaceRoot, config.root || '.') || '.');
22
- isTest = isTest ? isTest : mode === 'test';
23
- return {
24
- appType: 'custom',
25
- resolve: {
26
- alias: {
27
- '~analog/entry-server': options.entryServer || `${root}/${sourceRoot}/main.server.ts`,
28
- },
29
- },
30
- };
31
- },
32
- configureServer(viteServer) {
33
- if (isTest) {
34
- return;
35
- }
36
- return async () => {
37
- remove_html_middlewares(viteServer.middlewares);
38
- registerDevServerMiddleware(root, sourceRoot, viteServer);
39
- viteServer.middlewares.use(async (req, res) => {
40
- let template = readFileSync(resolve(viteServer.config.root, index), 'utf-8');
41
- template = await viteServer.transformIndexHtml(req.originalUrl, template);
42
- const _routeRulesMatcher = toRouteMatcher(createRadixRouter({ routes: options.routeRules }));
43
- const _getRouteRules = (path) => defu({}, ..._routeRulesMatcher.matchAll(path).reverse());
44
- try {
45
- let result;
46
- // Check for route rules explicitly disabling SSR
47
- if (_getRouteRules(req.originalUrl).ssr === false) {
48
- result = template;
49
- }
50
- else {
51
- const entryServer = (await viteServer.ssrLoadModule('~analog/entry-server'))['default'];
52
- result = await entryServer(req.originalUrl, template, {
53
- req,
54
- res,
55
- });
56
- }
57
- if (result instanceof Response) {
58
- await writeWebResponseToNode(res, result);
59
- return;
60
- }
61
- res.setHeader('Content-Type', 'text/html');
62
- res.end(result);
63
- }
64
- catch (e) {
65
- viteServer.ssrFixStacktrace(e);
66
- res.statusCode = 500;
67
- res.end(`
1
+ import { writeWebResponseToNode } from "../utils/node-web-bridge.js";
2
+ import { registerDevServerMiddleware } from "../utils/register-dev-middleware.js";
3
+ import { detectLocaleFromRoute, setHtmlLang } from "../utils/i18n-prerender.js";
4
+ import { normalizePath } from "vite";
5
+ import { resolve } from "node:path";
6
+ import { readFileSync } from "node:fs";
7
+ import { createRouter, toRouteMatcher } from "radix3";
8
+ import { defu } from "defu";
9
+ //#region packages/vite-plugin-nitro/src/lib/plugins/dev-server-plugin.ts
10
+ function devServerPlugin(options) {
11
+ const workspaceRoot = options?.workspaceRoot || process.cwd();
12
+ const sourceRoot = options?.sourceRoot ?? "src";
13
+ const index = options.index || "index.html";
14
+ let config;
15
+ let root;
16
+ let isTest = false;
17
+ return {
18
+ name: "analogjs-dev-ssr-plugin",
19
+ config(userConfig, { mode }) {
20
+ config = userConfig;
21
+ root = normalizePath(resolve(workspaceRoot, config.root || ".") || ".");
22
+ isTest = isTest ? isTest : mode === "test";
23
+ return {
24
+ appType: "custom",
25
+ resolve: { alias: { "~analog/entry-server": options.entryServer || `${root}/${sourceRoot}/main.server.ts` } }
26
+ };
27
+ },
28
+ configureServer(viteServer) {
29
+ if (isTest) return;
30
+ return async () => {
31
+ remove_html_middlewares(viteServer.middlewares);
32
+ registerDevServerMiddleware(root, sourceRoot, viteServer);
33
+ if (options.i18n) registerI18nWatcher(viteServer);
34
+ viteServer.middlewares.use(async (req, res) => {
35
+ let template = readFileSync(resolve(viteServer.config.root, index), "utf-8");
36
+ template = await viteServer.transformIndexHtml(req.originalUrl, template);
37
+ const _routeRulesMatcher = toRouteMatcher(createRouter({ routes: options.routeRules }));
38
+ const _getRouteRules = (path) => defu({}, ..._routeRulesMatcher.matchAll(path).reverse());
39
+ try {
40
+ let result;
41
+ if (_getRouteRules(req.originalUrl).ssr === false) result = template;
42
+ else {
43
+ const entryServer = (await viteServer.ssrLoadModule("~analog/entry-server"))["default"];
44
+ result = await entryServer(req.originalUrl, template, {
45
+ req,
46
+ res
47
+ });
48
+ }
49
+ if (result instanceof Response) {
50
+ await writeWebResponseToNode(res, result);
51
+ return;
52
+ }
53
+ let html = typeof result === "string" ? result : template;
54
+ if (options.i18n) {
55
+ const locale = detectLocaleFromRoute(req.originalUrl, options.i18n);
56
+ html = setHtmlLang(html, locale);
57
+ }
58
+ res.setHeader("Content-Type", "text/html");
59
+ res.end(html);
60
+ } catch (e) {
61
+ viteServer.ssrFixStacktrace(e);
62
+ res.statusCode = 500;
63
+ res.end(`
68
64
  <!DOCTYPE html>
69
65
  <html lang="en">
70
66
  <head>
@@ -72,50 +68,51 @@ export function devServerPlugin(options) {
72
68
  <title>Error</title>
73
69
  <script type="module">
74
70
  import { ErrorOverlay } from '/@vite/client'
75
- document.body.appendChild(new ErrorOverlay(${JSON.stringify(prepareError(req, e)).replace(/</g, '\\u003c')}))
76
- </script>
71
+ document.body.appendChild(new ErrorOverlay(${JSON.stringify(prepareError(req, e)).replace(/</g, "\\u003c")}))
72
+ <\/script>
77
73
  </head>
78
74
  <body>
79
75
  </body>
80
76
  </html>
81
77
  `);
82
- }
83
- });
84
- };
85
- },
86
- };
78
+ }
79
+ });
80
+ };
81
+ }
82
+ };
87
83
  }
88
84
  /**
89
- * Removes Vite internal middleware
90
- *
91
- * @param server
92
- */
85
+ * Removes Vite internal middleware
86
+ *
87
+ * @param server
88
+ */
93
89
  function remove_html_middlewares(server) {
94
- const html_middlewares = [
95
- 'viteIndexHtmlMiddleware',
96
- 'vite404Middleware',
97
- 'viteSpaFallbackMiddleware',
98
- 'viteHtmlFallbackMiddleware',
99
- ];
100
- for (let i = server.stack.length - 1; i > 0; i--) {
101
- const handler = server.stack[i]?.handle;
102
- const handlerName = typeof handler === 'function' ? handler.name : undefined;
103
- if (handlerName && html_middlewares.includes(handlerName)) {
104
- server.stack.splice(i, 1);
105
- }
106
- }
90
+ const html_middlewares = [
91
+ "viteIndexHtmlMiddleware",
92
+ "vite404Middleware",
93
+ "viteSpaFallbackMiddleware",
94
+ "viteHtmlFallbackMiddleware"
95
+ ];
96
+ for (let i = server.stack.length - 1; i > 0; i--) {
97
+ const handler = server.stack[i]?.handle;
98
+ const handlerName = typeof handler === "function" ? handler.name : void 0;
99
+ if (handlerName && html_middlewares.includes(handlerName)) server.stack.splice(i, 1);
100
+ }
107
101
  }
108
102
  /**
109
- * Formats error for SSR message in error overlay
110
- * @param req
111
- * @param error
112
- * @returns
113
- */
103
+ * Formats error for SSR message in error overlay
104
+ * @param req
105
+ * @param error
106
+ * @returns
107
+ */
114
108
  function prepareError(req, error) {
115
- const e = error;
116
- return {
117
- message: `An error occured while server rendering ${req.url}:\n\n\t${typeof e === 'string' ? e : e.message} `,
118
- stack: typeof e === 'string' ? '' : e.stack,
119
- };
109
+ const e = error;
110
+ return {
111
+ message: `An error occured while server rendering ${req.url}:\n\n\t${typeof e === "string" ? e : e.message} `,
112
+ stack: typeof e === "string" ? "" : e.stack
113
+ };
120
114
  }
115
+ //#endregion
116
+ export { devServerPlugin };
117
+
121
118
  //# sourceMappingURL=dev-server-plugin.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"dev-server-plugin.js","sourceRoot":"","sources":["../../../../../../packages/vite-plugin-nitro/src/lib/plugins/dev-server-plugin.ts"],"names":[],"mappings":"AAAA,iEAAiE;AACjE,gFAAgF;AAEhF,OAAO,EAKL,aAAa,GACd,MAAM,MAAM,CAAC;AACd,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,YAAY,IAAI,iBAAiB,EAAE,cAAc,EAAE,MAAM,QAAQ,CAAC;AAC3E,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAG5B,OAAO,EAAE,2BAA2B,EAAE,MAAM,qCAAqC,CAAC;AAClF,OAAO,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AAKrE,MAAM,UAAU,eAAe,CAAC,OAAsB;IACpD,MAAM,aAAa,GAAG,OAAO,EAAE,aAAa,IAAI,OAAO,CAAC,GAAG,EAAE,CAAC;IAC9D,MAAM,UAAU,GAAG,OAAO,EAAE,UAAU,IAAI,KAAK,CAAC;IAChD,MAAM,KAAK,GAAG,OAAO,CAAC,KAAK,IAAI,YAAY,CAAC;IAC5C,IAAI,MAAkB,CAAC;IACvB,IAAI,IAAY,CAAC;IACjB,IAAI,MAAM,GAAG,KAAK,CAAC;IAEnB,OAAO;QACL,IAAI,EAAE,yBAAyB;QAC/B,MAAM,CAAC,UA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AA4B;KAC7B,CAAC;IACF,KAAK,IAAI,CAAC,GAAG,MAAM,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;QACjD,MAAM,OAAO,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,MAAM,CAAC;QACxC,MAAM,WAAW,GACf,OAAO,OAAO,KAAK,UAAU,CAAC,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS,CAAC;QAC3D,IAAI,WAAW,IAAI,gBAAgB,CAAC,QAAQ,CAAC,WAAW,CAAC,EAAE,CAAC;YAC1D,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;QAC5B,CAAC;IACH,CAAC;AACH,CAAC;AAED;;;;;GAKG;AACH,SAAS,YAAY,CAAC,GAA4B,EAAE,KAAc;IAChE,MAAM,CAAC,GAAG,KAAc,CAAC;IACzB,OAAO;QACL,OAAO,EAAE,2CAA2C,GAAG,CAAC,GAAG,UACzD,OAAO,CAAC,KAAK,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,OAChC,GAAG;QACH,KAAK,EAAE,OAAO,CAAC,KAAK,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK;KAC5C,CAAC;AACJ,CAAC"}
1
+ {"version":3,"file":"dev-server-plugin.js","names":[],"sources":["../../../../src/lib/plugins/dev-server-plugin.ts"],"sourcesContent":["// SSR dev server, middleware and error page source modified from\n// https://github.com/solidjs/solid-start/blob/main/packages/start/dev/server.js\n\nimport {\n Connect,\n Plugin,\n UserConfig,\n ViteDevServer,\n normalizePath,\n} from 'vite';\nimport { resolve } from 'node:path';\nimport { readFileSync } from 'node:fs';\nimport { createRouter as createRadixRouter, toRouteMatcher } from 'radix3';\nimport { defu } from 'defu';\nimport type { NitroRouteRules } from 'nitro/types';\n\nimport { registerDevServerMiddleware } from '../utils/register-dev-middleware.js';\nimport { writeWebResponseToNode } from '../utils/node-web-bridge.js';\nimport { Options } from '../options.js';\nimport { detectLocaleFromRoute, setHtmlLang } from '../utils/i18n-prerender.js';\n\ntype ServerOptions = Options & { routeRules?: Record<string, any> | undefined };\n\nexport function devServerPlugin(options: ServerOptions): Plugin {\n const workspaceRoot = options?.workspaceRoot || process.cwd();\n const sourceRoot = options?.sourceRoot ?? 'src';\n const index = options.index || 'index.html';\n let config: UserConfig;\n let root: string;\n let isTest = false;\n\n return {\n name: 'analogjs-dev-ssr-plugin',\n config(userConfig, { mode }) {\n config = userConfig;\n root = normalizePath(resolve(workspaceRoot, config.root || '.') || '.');\n isTest = isTest ? isTest : mode === 'test';\n return {\n appType: 'custom',\n resolve: {\n alias: {\n '~analog/entry-server':\n options.entryServer || `${root}/${sourceRoot}/main.server.ts`,\n },\n },\n };\n },\n configureServer(viteServer) {\n if (isTest) {\n return;\n }\n\n return async () => {\n remove_html_middlewares(viteServer.middlewares);\n registerDevServerMiddleware(root, sourceRoot, viteServer);\n\n if (options.i18n) {\n registerI18nWatcher(viteServer);\n }\n\n viteServer.middlewares.use(async (req, res) => {\n let template = readFileSync(\n resolve(viteServer.config.root, index),\n 'utf-8',\n );\n\n template = await viteServer.transformIndexHtml(\n req.originalUrl as string,\n template,\n );\n\n const _routeRulesMatcher = toRouteMatcher(\n createRadixRouter({ routes: options.routeRules }),\n );\n const _getRouteRules = (path: string) =>\n defu(\n {},\n ..._routeRulesMatcher.matchAll(path).reverse(),\n ) as NitroRouteRules;\n\n try {\n let result: string | Response;\n // Check for route rules explicitly disabling SSR\n if (_getRouteRules(req.originalUrl as string).ssr === false) {\n result = template;\n } else {\n const entryServer = (\n await viteServer.ssrLoadModule('~analog/entry-server')\n )['default'];\n result = await entryServer(req.originalUrl, template, {\n req,\n res,\n });\n }\n\n if (result instanceof Response) {\n await writeWebResponseToNode(res, result);\n return;\n }\n\n // Inject lang attribute when i18n is configured\n let html = typeof result === 'string' ? result : template;\n if (options.i18n) {\n const locale = detectLocaleFromRoute(\n req.originalUrl as string,\n options.i18n,\n );\n html = setHtmlLang(html, locale);\n }\n\n res.setHeader('Content-Type', 'text/html');\n res.end(html);\n } catch (e) {\n viteServer.ssrFixStacktrace(e as Error);\n res.statusCode = 500;\n res.end(`\n <!DOCTYPE html>\n <html lang=\"en\">\n <head>\n <meta charset=\"UTF-8\" />\n <title>Error</title>\n <script type=\"module\">\n import { ErrorOverlay } from '/@vite/client'\n document.body.appendChild(new ErrorOverlay(${JSON.stringify(\n prepareError(req, e),\n ).replace(/</g, '\\\\u003c')}))\n </script>\n </head>\n <body>\n </body>\n </html>\n `);\n }\n });\n };\n },\n };\n}\n\n/**\n * Removes Vite internal middleware\n *\n * @param server\n */\nfunction remove_html_middlewares(server: ViteDevServer['middlewares']) {\n const html_middlewares = [\n 'viteIndexHtmlMiddleware',\n 'vite404Middleware',\n 'viteSpaFallbackMiddleware',\n 'viteHtmlFallbackMiddleware',\n ];\n for (let i = server.stack.length - 1; i > 0; i--) {\n const handler = server.stack[i]?.handle;\n const handlerName =\n typeof handler === 'function' ? handler.name : undefined;\n if (handlerName && html_middlewares.includes(handlerName)) {\n server.stack.splice(i, 1);\n }\n }\n}\n\n/**\n * Formats error for SSR message in error overlay\n * @param req\n * @param error\n * @returns\n */\nfunction prepareError(req: Connect.IncomingMessage, error: unknown) {\n const e = error as Error;\n return {\n message: `An error occured while server rendering ${req.url}:\\n\\n\\t${\n typeof e === 'string' ? e : e.message\n } `,\n stack: typeof e === 'string' ? '' : e.stack,\n };\n}\n"],"mappings":";;;;;;;;;AAuBA,SAAgB,gBAAgB,SAAgC;CAC9D,MAAM,gBAAgB,SAAS,iBAAiB,QAAQ,KAAK;CAC7D,MAAM,aAAa,SAAS,cAAc;CAC1C,MAAM,QAAQ,QAAQ,SAAS;CAC/B,IAAI;CACJ,IAAI;CACJ,IAAI,SAAS;AAEb,QAAO;EACL,MAAM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AACvC,UAAI,aAAa;AACjB,UAAI,IAAI;;;;;;;;iEAQ6C,KAAK,UAChD,aAAa,KAAK,EAAE,CACrB,CAAC,QAAQ,MAAM,UAAU,CAAC;;;;;;cAMjC;;MAEJ;;;EAGP;;;;;;;AAQH,SAAS,wBAAwB,QAAsC;CACrE,MAAM,mBAAmB;EACvB;EACA;EACA;EACA;EACD;AACD,MAAK,IAAI,IAAI,OAAO,MAAM,SAAS,GAAG,IAAI,GAAG,KAAK;EAChD,MAAM,UAAU,OAAO,MAAM,IAAI;EACjC,MAAM,cACJ,OAAO,YAAY,aAAa,QAAQ,OAAO,KAAA;AACjD,MAAI,eAAe,iBAAiB,SAAS,YAAY,CACvD,QAAO,MAAM,OAAO,GAAG,EAAE;;;;;;;;;AAW/B,SAAS,aAAa,KAA8B,OAAgB;CAClE,MAAM,IAAI;AACV,QAAO;EACL,SAAS,2CAA2C,IAAI,IAAI,SAC1D,OAAO,MAAM,WAAW,IAAI,EAAE,QAC/B;EACD,OAAO,OAAO,MAAM,WAAW,KAAK,EAAE;EACvC"}
@@ -1,7 +1,7 @@
1
1
  export declare function pageEndpointsPlugin(): {
2
- name: string;
3
- transform(_code: string, id: string): Promise<{
4
- code: string;
5
- map: null;
6
- } | undefined>;
2
+ name: string;
3
+ transform(_code: string, id: string): Promise<{
4
+ code: string;
5
+ map: null;
6
+ } | undefined>;
7
7
  };
@@ -1,59 +1,28 @@
1
- import { buildSync } from 'esbuild';
2
- import { normalizePath } from 'vite';
3
- import { SERVER_FETCH_FACTORY_SNIPPET } from '../utils/renderers.js';
4
- export function pageEndpointsPlugin() {
5
- return {
6
- name: 'analogjs-vite-plugin-nitro-rollup-page-endpoint',
7
- async transform(_code, id) {
8
- if (normalizePath(id).includes('/pages/') && id.endsWith('.server.ts')) {
9
- const compiled = buildSync({
10
- stdin: {
11
- contents: _code,
12
- sourcefile: id,
13
- loader: 'ts',
14
- },
15
- write: false,
16
- metafile: true,
17
- platform: 'neutral',
18
- format: 'esm',
19
- logLevel: 'silent',
20
- });
21
- let fileExports = [];
22
- for (const key in compiled.metafile?.outputs) {
23
- if (compiled.metafile?.outputs[key].entryPoint) {
24
- fileExports = compiled.metafile?.outputs[key].exports;
25
- }
26
- }
27
- // In h3 v2 / Nitro v3, event.node is undefined during prerendering
28
- // (which uses the fetch-based pipeline, not Node.js http). We use
29
- // optional chaining so that page endpoints work in both Node.js
30
- // server and fetch-based prerender contexts.
31
- // Nitro v3 no longer guarantees the private `nitro/deps/ofetch`
32
- // subpath that older codegen relied on.
33
- //
34
- // Page loaders expect Nitro-style `$fetch` semantics (parsed data plus
35
- // internal relative-route support), so construct a request-local fetch
36
- // using public APIs:
37
- // - `createFetch` from `ofetch` for `$fetch` behavior
38
- // - `fetchWithEvent` from `h3` for internal Nitro request routing
39
- //
40
- // This avoids both unstable private Nitro imports and assumptions about
41
- // a global runtime `$fetch` being available during prerender.
42
- const code = `
1
+ import { SERVER_FETCH_FACTORY_SNIPPET } from "../utils/renderers.js";
2
+ import { normalizePath } from "vite";
3
+ import { parseSync } from "oxc-parser";
4
+ //#region packages/vite-plugin-nitro/src/lib/plugins/page-endpoints.ts
5
+ function pageEndpointsPlugin() {
6
+ return {
7
+ name: "analogjs-vite-plugin-nitro-rollup-page-endpoint",
8
+ async transform(_code, id) {
9
+ if (normalizePath(id).includes("/pages/") && id.endsWith(".server.ts")) {
10
+ const fileExports = parseSync(id, _code, {
11
+ sourceType: "module",
12
+ lang: "ts"
13
+ }).module.staticExports.flatMap((e) => e.entries.filter((entry) => entry.exportName.name !== null).map((entry) => entry.exportName.name));
14
+ return {
15
+ code: `
43
16
  import { defineHandler, fetchWithEvent } from 'nitro/h3';
44
17
  import { createFetch } from 'ofetch';
45
18
 
46
- ${fileExports.includes('load')
47
- ? _code
48
- : `
19
+ ${fileExports.includes("load") ? _code : `
49
20
  ${_code}
50
21
  export const load = () => {
51
22
  return {};
52
23
  }`}
53
24
 
54
- ${fileExports.includes('action')
55
- ? ''
56
- : `
25
+ ${fileExports.includes("action") ? "" : `
57
26
  export const action = () => {
58
27
  return {};
59
28
  }
@@ -90,14 +59,14 @@ export function pageEndpointsPlugin() {
90
59
  }
91
60
  }
92
61
  });
93
- `;
94
- return {
95
- code,
96
- map: null,
97
- };
98
- }
99
- return;
100
- },
101
- };
62
+ `,
63
+ map: null
64
+ };
65
+ }
66
+ }
67
+ };
102
68
  }
69
+ //#endregion
70
+ export { pageEndpointsPlugin };
71
+
103
72
  //# sourceMappingURL=page-endpoints.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"page-endpoints.js","sourceRoot":"","sources":["../../../../../../packages/vite-plugin-nitro/src/lib/plugins/page-endpoints.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AACpC,OAAO,EAAE,aAAa,EAAE,MAAM,MAAM,CAAC;AACrC,OAAO,EAAE,4BAA4B,EAAE,MAAM,uBAAuB,CAAC;AAErE,MAAM,UAAU,mBAAmB;IACjC,OAAO;QACL,IAAI,EAAE,iDAAiD;QACvD,KAAK,CAAC,SAAS,CACb,KAAa,EACb,EAAU;YAEV,IAAI,aAAa,CAAC,EAAE,CAAC,CAAC,QAAQ,CAAC,SAAS,CAAC,IAAI,EAAE,CAAC,QAAQ,CAAC,YAAY,CAAC,EAAE,CAAC;gBACvE,MAAM,QAAQ,GAAG,SAAS,CAAC;oBACzB,KAAK,EAAE;wBACL,QAAQ,EAAE,KAAK;wBACf,UAAU,EAAE,EAAE;wBACd,MAAM,EAAE,IAAI;qBACb;oBACD,KAAK,EAAE,KAAK;oBACZ,QAAQ,EAAE,IAAI;oBACd,QAAQ,EAAE,SAAS;oBACnB,MAAM,EAAE,KAAK;oBACb,QAAQ,EAAE,QAAQ;iBACnB,CAAC,CAAC;gBAEH,IAAI,WAAW,GAAa,EAAE,CAAC;gBAE/B,KAAK,MAAM,GAAG,IAAI,QAAQ,CAAC,QAAQ,EAAE,OAAO,EAAE,CAAC;oBAC7C,IAAI,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAC,GAAG,CAAC,CAAC,UAAU,EAAE,CAAC;wBAC/C,WAAW,GAAG,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAC,GAAG,CAAC,CAAC,OAAO,CAAC;oBACxD,CAAC;gBACH,CAAC;gBAED,mEAAmE;gBACnE,kEAAkE;gBAClE,gEAAgE;gBAChE,6CAA6C;gBAC7C,gEAAgE;gBAChE,wCAAwC;gBACxC,EAAE;gBACF,uEAAuE;gBACvE,uEAAuE;gBACvE,qBAAqB;gBACrB,sDAAsD;gBACtD,kEAAkE;gBAClE,EAAE;gBACF,wEAAwE;gBACxE,8DAA8D;gBAC9D,MAAM,IAAI,GAAG;;;;cAKP,WAAW,CAAC,QAAQ,CAAC,MAAM,CAAC;oBAC1B,CAAC,CAAC,KAAK;oBACP,CAAC,CAAC;kBACA,KAAK;;;kBAIX;;cAGE,WAAW,CAAC,QAAQ,CAAC,QAAQ,CAAC;oBAC5B,CAAC,CAAC,EAAE;oBACJ,CAAC,CAAC;;;;eAKN;;;gBAGI,4BAA4B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;WA8BjC,CAAC;gBAEJ,OAAO;oBACL,IAAI;oBACJ,GAAG,EAAE,IAAI;iBACV,CAAC;YACJ,CAAC;YAED,OAAO;QACT,CAAC;KACF,CAAC;AACJ,CAAC"}
1
+ {"version":3,"file":"page-endpoints.js","names":[],"sources":["../../../../src/lib/plugins/page-endpoints.ts"],"sourcesContent":["import { parseSync } from 'oxc-parser';\nimport { normalizePath } from 'vite';\nimport { SERVER_FETCH_FACTORY_SNIPPET } from '../utils/renderers.js';\n\nexport function pageEndpointsPlugin() {\n return {\n name: 'analogjs-vite-plugin-nitro-rollup-page-endpoint',\n async transform(\n _code: string,\n id: string,\n ): Promise<{ code: string; map: null } | undefined> {\n if (normalizePath(id).includes('/pages/') && id.endsWith('.server.ts')) {\n const result = parseSync(id, _code, {\n sourceType: 'module',\n lang: 'ts',\n });\n\n const fileExports: string[] = result.module.staticExports.flatMap((e) =>\n e.entries\n .filter((entry) => entry.exportName.name !== null)\n .map((entry) => entry.exportName.name as string),\n );\n\n // In h3 v2 / Nitro v3, event.node is undefined during prerendering\n // (which uses the fetch-based pipeline, not Node.js http). We use\n // optional chaining so that page endpoints work in both Node.js\n // server and fetch-based prerender contexts.\n // Nitro v3 no longer guarantees the private `nitro/deps/ofetch`\n // subpath that older codegen relied on.\n //\n // Page loaders expect Nitro-style `$fetch` semantics (parsed data plus\n // internal relative-route support), so construct a request-local fetch\n // using public APIs:\n // - `createFetch` from `ofetch` for `$fetch` behavior\n // - `fetchWithEvent` from `h3` for internal Nitro request routing\n //\n // This avoids both unstable private Nitro imports and assumptions about\n // a global runtime `$fetch` being available during prerender.\n const code = `\n import { defineHandler, fetchWithEvent } from 'nitro/h3';\n import { createFetch } from 'ofetch';\n\n ${\n fileExports.includes('load')\n ? _code\n : `\n ${_code}\n export const load = () => {\n return {};\n }`\n }\n\n ${\n fileExports.includes('action')\n ? ''\n : `\n export const action = () => {\n return {};\n }\n `\n }\n\n export default defineHandler(async(event) => {\n ${SERVER_FETCH_FACTORY_SNIPPET}\n\n if (event.method === 'GET') {\n try {\n return await load({\n params: event.context.params,\n req: event.node?.req,\n res: event.node?.res,\n fetch: serverFetch,\n event\n });\n } catch(e) {\n console.error(\\` An error occurred: \\${e}\\`)\n throw e;\n }\n } else {\n try {\n return await action({\n params: event.context.params,\n req: event.node?.req,\n res: event.node?.res,\n fetch: serverFetch,\n event\n });\n } catch(e) {\n console.error(\\` An error occurred: \\${e}\\`)\n throw e;\n }\n }\n });\n `;\n\n return {\n code,\n map: null,\n };\n }\n\n return;\n },\n };\n}\n"],"mappings":";;;;AAIA,SAAgB,sBAAsB;AACpC,QAAO;EACL,MAAM;EACN,MAAM,UACJ,OACA,IACkD;AAClD,OAAI,cAAc,GAAG,CAAC,SAAS,UAAU,IAAI,GAAG,SAAS,aAAa,EAAE;IAMtE,MAAM,cALS,UAAU,IAAI,OAAO;KAClC,YAAY;KACZ,MAAM;KACP,CAAC,CAEmC,OAAO,cAAc,SAAS,MACjE,EAAE,QACC,QAAQ,UAAU,MAAM,WAAW,SAAS,KAAK,CACjD,KAAK,UAAU,MAAM,WAAW,KAAe,CACnD;AA0ED,WAAO;KACL,MA1DW;;;;cAKP,YAAY,SAAS,OAAO,GACxB,QACA;kBACA,MAAM;;;mBAIX;;cAGC,YAAY,SAAS,SAAS,GAC1B,KACA;;;;gBAKL;;;gBAGG,6BAA6B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAkCnC,KAAK;KACN;;;EAKN"}
@@ -0,0 +1,5 @@
1
+ export declare const debugNitro: unknown;
2
+ export declare const debugSsr: unknown;
3
+ export declare const debugPrerender: unknown;
4
+ /** All debug instances in this package, for external wrapping (e.g. file logging). */
5
+ export declare const debugInstances: unknown;
@@ -0,0 +1,15 @@
1
+ import { createDebug } from "obug";
2
+ //#region packages/vite-plugin-nitro/src/lib/utils/debug.ts
3
+ var debugNitro = createDebug("analog:nitro");
4
+ var debugSsr = createDebug("analog:nitro:ssr");
5
+ var debugPrerender = createDebug("analog:nitro:prerender");
6
+ /** All debug instances in this package, for external wrapping (e.g. file logging). */
7
+ var debugInstances = [
8
+ debugNitro,
9
+ debugSsr,
10
+ debugPrerender
11
+ ];
12
+ //#endregion
13
+ export { debugInstances, debugNitro, debugPrerender, debugSsr };
14
+
15
+ //# sourceMappingURL=debug.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"debug.js","names":[],"sources":["../../../../src/lib/utils/debug.ts"],"sourcesContent":["import { createDebug } from 'obug';\n\nexport const debugNitro = createDebug('analog:nitro');\nexport const debugSsr = createDebug('analog:nitro:ssr');\nexport const debugPrerender = createDebug('analog:nitro:prerender');\n\n/** All debug instances in this package, for external wrapping (e.g. file logging). */\nexport const debugInstances = [debugNitro, debugSsr, debugPrerender];\n"],"mappings":";;AAEA,IAAa,aAAa,YAAY,eAAe;AACrD,IAAa,WAAW,YAAY,mBAAmB;AACvD,IAAa,iBAAiB,YAAY,yBAAyB;;AAGnE,IAAa,iBAAiB;CAAC;CAAY;CAAU;CAAe"}
@@ -1,56 +1,56 @@
1
- import { PrerenderContentFile } from '../options';
1
+ import { PrerenderContentFile } from "../options";
2
2
  /**
3
- * Discovers content files with front matter and extracts metadata for prerendering.
4
- *
5
- * This function:
6
- * 1. Discovers all content files matching the specified glob pattern
7
- * 2. Reads each file and parses front matter metadata
8
- * 3. Extracts file name, extension, and path information
9
- * 4. Returns structured data for prerendering content pages
10
- *
11
- * @param workspaceRoot The workspace root directory path
12
- * @param rootDir The project root directory relative to workspace
13
- * @param glob The glob pattern to match content files (e.g., 'content/blog')
14
- * @returns Array of PrerenderContentFile objects with metadata and front matter
15
- *
16
- * Example usage:
17
- * const contentFiles = getMatchingContentFilesWithFrontMatter(
18
- * '/workspace',
19
- * 'apps/my-app',
20
- * 'content/blog'
21
- * );
22
- *
23
- * Sample discovered file paths:
24
- * - /workspace/apps/my-app/content/blog/first-post.md
25
- * - /workspace/apps/my-app/content/blog/2024/01/hello-world.md
26
- * - /workspace/apps/my-app/content/blog/tech/angular-v17.mdx
27
- * - /workspace/apps/my-app/content/blog/about/index.md
28
- *
29
- * Sample output structure:
30
- * {
31
- * name: 'first-post',
32
- * extension: 'md',
33
- * path: 'content/blog',
34
- * attributes: { title: 'My First Post', date: '2024-01-01', tags: ['intro'] }
35
- * }
36
- *
37
- * tinyglobby vs fast-glob comparison:
38
- * - Both support the same glob patterns for file discovery
39
- * - Both are efficient for finding content files
40
- * - tinyglobby is now used instead of fast-glob
41
- * - tinyglobby provides similar functionality with smaller bundle size
42
- * - tinyglobby's globSync returns absolute paths when absolute: true is set
43
- *
44
- * Front matter parsing:
45
- * - Uses front-matter library to parse YAML/TOML front matter
46
- * - Extracts metadata like title, date, tags, author, etc.
47
- * - Supports both YAML (---) and TOML (+++) delimiters
48
- * - Returns structured attributes for prerendering
49
- *
50
- * File path processing:
51
- * - Normalizes paths for cross-platform compatibility
52
- * - Extracts file name without extension
53
- * - Determines file extension for content type handling
54
- * - Maintains relative path structure for routing
55
- */
3
+ * Discovers content files with front matter and extracts metadata for prerendering.
4
+ *
5
+ * This function:
6
+ * 1. Discovers all content files matching the specified glob pattern
7
+ * 2. Reads each file and parses front matter metadata
8
+ * 3. Extracts file name, extension, and path information
9
+ * 4. Returns structured data for prerendering content pages
10
+ *
11
+ * @param workspaceRoot The workspace root directory path
12
+ * @param rootDir The project root directory relative to workspace
13
+ * @param glob The glob pattern to match content files (e.g., 'content/blog')
14
+ * @returns Array of PrerenderContentFile objects with metadata and front matter
15
+ *
16
+ * Example usage:
17
+ * const contentFiles = getMatchingContentFilesWithFrontMatter(
18
+ * '/workspace',
19
+ * 'apps/my-app',
20
+ * 'content/blog'
21
+ * );
22
+ *
23
+ * Sample discovered file paths:
24
+ * - /workspace/apps/my-app/content/blog/first-post.md
25
+ * - /workspace/apps/my-app/content/blog/2024/01/hello-world.md
26
+ * - /workspace/apps/my-app/content/blog/tech/angular-v17.mdx
27
+ * - /workspace/apps/my-app/content/blog/about/index.md
28
+ *
29
+ * Sample output structure:
30
+ * {
31
+ * name: 'first-post',
32
+ * extension: 'md',
33
+ * path: 'content/blog',
34
+ * attributes: { title: 'My First Post', date: '2024-01-01', tags: ['intro'] }
35
+ * }
36
+ *
37
+ * tinyglobby vs fast-glob comparison:
38
+ * - Both support the same glob patterns for file discovery
39
+ * - Both are efficient for finding content files
40
+ * - tinyglobby is now used instead of fast-glob
41
+ * - tinyglobby provides similar functionality with smaller bundle size
42
+ * - tinyglobby's globSync returns absolute paths when absolute: true is set
43
+ *
44
+ * Front matter parsing:
45
+ * - Uses front-matter library to parse YAML/TOML front matter
46
+ * - Extracts metadata like title, date, tags, author, etc.
47
+ * - Supports both YAML (---) and TOML (+++) delimiters
48
+ * - Returns structured attributes for prerendering
49
+ *
50
+ * File path processing:
51
+ * - Normalizes paths for cross-platform compatibility
52
+ * - Extracts file name without extension
53
+ * - Determines file extension for content type handling
54
+ * - Maintains relative path structure for routing
55
+ */
56
56
  export declare function getMatchingContentFilesWithFrontMatter(workspaceRoot: string, rootDir: string, glob: string): PrerenderContentFile[];