@analogjs/platform 3.0.0-beta.5 → 3.0.0-beta.51

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 (88) hide show
  1. package/migrations/migrate-to-separated-plugins/migrate-to-separated-plugins.js +2 -1
  2. package/migrations/migrate-to-separated-plugins/migrate-to-separated-plugins.js.map +1 -1
  3. package/migrations/migrate-vitest-builder-aliases/migrate-vitest-builder-aliases.js +2 -1
  4. package/migrations/migrate-vitest-builder-aliases/migrate-vitest-builder-aliases.js.map +1 -1
  5. package/package.json +12 -9
  6. package/src/lib/content-plugin.js +12 -3
  7. package/src/lib/content-plugin.js.map +1 -1
  8. package/src/lib/deps-plugin.d.ts +1 -1
  9. package/src/lib/deps-plugin.js +11 -7
  10. package/src/lib/deps-plugin.js.map +1 -1
  11. package/src/lib/discover-library-routes.d.ts +3 -3
  12. package/src/lib/discover-library-routes.js +4 -4
  13. package/src/lib/discover-library-routes.js.map +1 -1
  14. package/src/lib/get-page-endpoints.d.ts +25 -0
  15. package/src/lib/get-page-endpoints.js +29 -0
  16. package/src/lib/get-page-endpoints.js.map +1 -0
  17. package/src/lib/nitro/analog-nitro-plugin.d.ts +6 -6
  18. package/src/lib/nitro/analog-nitro-plugin.js +116 -47
  19. package/src/lib/nitro/analog-nitro-plugin.js.map +1 -1
  20. package/src/lib/nitro/angular-linker-plugin.d.ts +4 -2
  21. package/src/lib/nitro/angular-linker-plugin.js +24 -38
  22. package/src/lib/nitro/angular-linker-plugin.js.map +1 -1
  23. package/src/lib/nitro/build-sitemap.js +2 -2
  24. package/src/lib/nitro/build-sitemap.js.map +1 -1
  25. package/src/lib/nitro/get-page-handlers.d.ts +4 -19
  26. package/src/lib/nitro/get-page-handlers.js +9 -26
  27. package/src/lib/nitro/get-page-handlers.js.map +1 -1
  28. package/src/lib/nitro/i18n-prerender.d.ts +2 -1
  29. package/src/lib/nitro/i18n-prerender.js +10 -7
  30. package/src/lib/nitro/i18n-prerender.js.map +1 -1
  31. package/src/lib/nitro/server-fn-endpoints.d.ts +3 -1
  32. package/src/lib/nitro/server-fn-endpoints.js +14 -5
  33. package/src/lib/nitro/server-fn-endpoints.js.map +1 -1
  34. package/src/lib/nx-plugin/executors.json +0 -7
  35. package/src/lib/nx-plugin/src/generators/app/compat.d.ts +2 -1
  36. package/src/lib/nx-plugin/src/generators/app/compat.js +4 -1
  37. package/src/lib/nx-plugin/src/generators/app/compat.js.map +1 -1
  38. package/src/lib/nx-plugin/src/generators/app/generator.js +7 -2
  39. package/src/lib/nx-plugin/src/generators/app/generator.js.map +1 -1
  40. package/src/lib/nx-plugin/src/generators/app/lib/add-tailwind-helpers.js +2 -2
  41. package/src/lib/nx-plugin/src/generators/app/lib/add-tailwind-helpers.js.map +1 -1
  42. package/src/lib/nx-plugin/src/generators/app/versions/minimum-supported-versions.d.ts +3 -1
  43. package/src/lib/nx-plugin/src/generators/app/versions/minimum-supported-versions.js +5 -1
  44. package/src/lib/nx-plugin/src/generators/app/versions/minimum-supported-versions.js.map +1 -1
  45. package/src/lib/nx-plugin/src/generators/init/compat.d.ts +2 -1
  46. package/src/lib/nx-plugin/src/generators/init/compat.js +4 -1
  47. package/src/lib/nx-plugin/src/generators/init/compat.js.map +1 -1
  48. package/src/lib/nx-plugin/src/generators/init/lib/add-analog-dependencies.js +2 -2
  49. package/src/lib/nx-plugin/src/generators/init/lib/add-analog-dependencies.js.map +1 -1
  50. package/src/lib/nx-plugin/src/generators/page/compat.d.ts +2 -1
  51. package/src/lib/nx-plugin/src/generators/page/compat.js +4 -1
  52. package/src/lib/nx-plugin/src/generators/page/compat.js.map +1 -1
  53. package/src/lib/nx-plugin/src/generators/preset/__snapshots__/generator.spec.ts.snap +4 -0
  54. package/src/lib/nx-plugin/src/generators/preset/generator.js +5 -2
  55. package/src/lib/nx-plugin/src/generators/preset/generator.js.map +1 -1
  56. package/src/lib/nx-plugin/src/utils/versions/dev-dependencies.d.ts +2 -2
  57. package/src/lib/nx-plugin/src/utils/versions/dev-dependencies.js +7 -3
  58. package/src/lib/nx-plugin/src/utils/versions/dev-dependencies.js.map +1 -1
  59. package/src/lib/nx-plugin/src/utils/versions/versions.d.ts +9 -6
  60. package/src/lib/nx-plugin/src/utils/versions/versions.js +13 -7
  61. package/src/lib/nx-plugin/src/utils/versions/versions.js.map +1 -1
  62. package/src/lib/options.d.ts +16 -0
  63. package/src/lib/platform-plugin.js +2 -0
  64. package/src/lib/platform-plugin.js.map +1 -1
  65. package/src/lib/route-file-discovery.js +8 -4
  66. package/src/lib/route-file-discovery.js.map +1 -1
  67. package/src/lib/route-idiom-diagnostics.js +23 -8
  68. package/src/lib/route-idiom-diagnostics.js.map +1 -1
  69. package/src/lib/route-manifest.d.ts +1 -1
  70. package/src/lib/route-manifest.js +6 -6
  71. package/src/lib/route-manifest.js.map +1 -1
  72. package/src/lib/router-plugin.js +7 -3
  73. package/src/lib/router-plugin.js.map +1 -1
  74. package/src/lib/server-plugin.d.ts +9 -0
  75. package/src/lib/server-plugin.js +170 -0
  76. package/src/lib/server-plugin.js.map +1 -0
  77. package/src/lib/typed-routes-plugin.js +6 -5
  78. package/src/lib/typed-routes-plugin.js.map +1 -1
  79. package/src/server-mode-plugin.js +1 -0
  80. package/src/server-mode-plugin.js.map +1 -1
  81. package/src/lib/nx-plugin/src/executors/vite-dev-server/compat.d.ts +0 -3
  82. package/src/lib/nx-plugin/src/executors/vite-dev-server/compat.js +0 -7
  83. package/src/lib/nx-plugin/src/executors/vite-dev-server/compat.js.map +0 -1
  84. package/src/lib/nx-plugin/src/executors/vite-dev-server/schema.d.ts +0 -1
  85. package/src/lib/nx-plugin/src/executors/vite-dev-server/schema.json +0 -101
  86. package/src/lib/nx-plugin/src/executors/vite-dev-server/vite-dev-server.impl.d.ts +0 -2
  87. package/src/lib/nx-plugin/src/executors/vite-dev-server/vite-dev-server.impl.js +0 -6
  88. package/src/lib/nx-plugin/src/executors/vite-dev-server/vite-dev-server.impl.js.map +0 -1
@@ -2,15 +2,15 @@ import { createRouteFileDiscovery } from "./route-file-discovery.js";
2
2
  import { generateRouteManifest, generateRouteTableDeclaration } from "./route-manifest.js";
3
3
  import { dirname, join, relative, resolve } from "node:path";
4
4
  import { existsSync, mkdirSync, readFileSync, writeFileSync } from "node:fs";
5
- import { normalizePath } from "vite";
5
+ import { normalizePath, searchForWorkspaceRoot } from "vite";
6
6
  import { parseSync } from "oxc-parser";
7
7
  import { readConfiguration } from "@angular/compiler-cli";
8
8
  //#region packages/platform/src/lib/typed-routes-plugin.ts
9
9
  function typedRoutes(options = {}) {
10
- const workspaceRoot = normalizePath(options.workspaceRoot ?? process.cwd());
11
10
  const outFile = options.outFile ?? "src/routeTree.gen.d.ts";
12
11
  if (!outFile.endsWith(".d.ts")) throw new Error("[analog] Typed routing outFile must end in .d.ts. Include this declaration in your application tsconfig.");
13
12
  let root;
13
+ let workspaceRoot;
14
14
  let command;
15
15
  let discovery;
16
16
  let getTsConfigPath;
@@ -37,7 +37,7 @@ function typedRoutes(options = {}) {
37
37
  filename
38
38
  ].find((file) => existsSync(file));
39
39
  if (!pageFile) return void 0;
40
- const serverFile = pageFile.replace(/\.page\.ts$/, ".server.ts");
40
+ const serverFile = pageFile.replace(/\.page\.(?:ts|tsrx)$/, ".server.ts");
41
41
  return {
42
42
  routeMeta: hasNamedExport(pageFile, "routeMeta") ? toImportSpecifier(dirname(outputPath), pageFile) : void 0,
43
43
  load: serverFile !== pageFile && existsSync(serverFile) && hasNamedExport(serverFile, "load") ? toImportSpecifier(dirname(outputPath), serverFile) : void 0
@@ -55,7 +55,8 @@ function typedRoutes(options = {}) {
55
55
  name: "analog-typed-routes",
56
56
  config(config, env) {
57
57
  command = env.command;
58
- root = normalizePath(resolve(workspaceRoot, config.root ?? "."));
58
+ root = normalizePath(resolve(options.workspaceRoot ?? process.cwd(), config.root ?? "."));
59
+ workspaceRoot = normalizePath(options.workspaceRoot ?? process.env["NX_WORKSPACE_ROOT"] ?? searchForWorkspaceRoot(root));
59
60
  discovery = createRouteFileDiscovery({
60
61
  root,
61
62
  workspaceRoot,
@@ -65,7 +66,7 @@ function typedRoutes(options = {}) {
65
66
  generate();
66
67
  },
67
68
  configResolved(config) {
68
- const compiler = config.plugins.find((plugin) => plugin.name === "@analogjs/vite-plugin-angular" || plugin.name === "@analogjs/vite-plugin-angular-fast-compile" || plugin.name === "@analogjs/vite-plugin-angular-compilation-api");
69
+ const compiler = config.plugins.find((plugin) => plugin.name === "@analogjs/vite-plugin-angular" || plugin.name === "@analogjs/vite-plugin-angular-fast-compile" || plugin.name === "@analogjs/vite-plugin-angular-compilation-api" || plugin.name === "@analogjs/vite-plugin-angular-ngp");
69
70
  getTsConfigPath = compiler?.api?.getTsConfigPath;
70
71
  if (compiler && !getTsConfigPath) throw new Error("[analog] Typed routing requires a matching @analogjs/vite-plugin-angular version to verify the application tsconfig.");
71
72
  verifyTypeInclusion();
@@ -1 +1 @@
1
- {"version":3,"file":"typed-routes-plugin.js","names":[],"sources":["../../../src/lib/typed-routes-plugin.ts"],"sourcesContent":["import { existsSync, mkdirSync, readFileSync, writeFileSync } from 'node:fs';\nimport { dirname, join, relative, resolve } from 'node:path';\nimport { readConfiguration } from '@angular/compiler-cli';\nimport { parseSync } from 'oxc-parser';\nimport { normalizePath, type Plugin } from 'vite';\n\nimport {\n createRouteFileDiscovery,\n type RouteFileDiscovery,\n} from './route-file-discovery.js';\nimport {\n generateRouteManifest,\n generateRouteTableDeclaration,\n} from './route-manifest.js';\n\nexport interface TypedRoutingOptions {\n /** Generated declaration path (.d.ts), relative to the app root. */\n outFile?: string;\n /** Fail builds when a checked-in route table is stale. Defaults to true. */\n verifyOnBuild?: boolean;\n}\n\nexport interface TypedRoutesPluginOptions extends TypedRoutingOptions {\n workspaceRoot?: string;\n additionalPagesDirs?: string[];\n additionalContentDirs?: string[];\n}\n\nexport function typedRoutes(options: TypedRoutesPluginOptions = {}): Plugin {\n const workspaceRoot = normalizePath(options.workspaceRoot ?? process.cwd());\n const outFile = options.outFile ?? 'src/routeTree.gen.d.ts';\n if (!outFile.endsWith('.d.ts')) {\n throw new Error(\n '[analog] Typed routing outFile must end in .d.ts. Include this declaration in your application tsconfig.',\n );\n }\n let root: string;\n let command: 'build' | 'serve';\n let discovery: RouteFileDiscovery;\n\n let getTsConfigPath: (() => string) | undefined;\n\n function verifyTypeInclusion(): void {\n if (!getTsConfigPath) return;\n const tsconfig = getTsConfigPath();\n const { rootNames, errors } = readConfiguration(tsconfig);\n if (errors.length) {\n throw new Error(\n `[analog] Cannot verify typed routing: unable to read ${tsconfig}.`,\n );\n }\n const outputPath = normalizePath(resolve(root, outFile));\n if (\n !rootNames.some((file) => normalizePath(resolve(file)) === outputPath)\n ) {\n const declaration = normalizePath(\n relative(dirname(tsconfig), outputPath),\n );\n throw new Error(\n `[analog] Typed route declaration is not included in ${tsconfig}. Add \"${declaration}\" to its \"files\" or \"include\" list so typed routing is available to the compiler and editor.`,\n );\n }\n }\n\n function generate(): void {\n const manifest = generateRouteManifest(\n [...discovery.getRouteFiles(), ...discovery.getContentFiles()],\n (filename) => (discovery.isAppLocal(filename) ? 0 : 1),\n );\n const collisions = manifest.collisions.filter(\n (collision) => collision.samePriority,\n );\n if (command === 'build' && collisions.length) {\n throw new Error(\n `[analog] Route collisions detected: ${collisions.map((c) => `${c.fullPath}: ${c.keptFile}, ${c.droppedFile}`).join('; ')}`,\n );\n }\n const outputPath = join(root, outFile);\n const output = generateRouteTableDeclaration(manifest, (filename) => {\n const pageFile = [\n join(root, filename),\n join(workspaceRoot, filename),\n filename,\n ].find((file) => existsSync(file));\n if (!pageFile) return undefined;\n const serverFile = pageFile.replace(/\\.page\\.ts$/, '.server.ts');\n return {\n routeMeta: hasNamedExport(pageFile, 'routeMeta')\n ? toImportSpecifier(dirname(outputPath), pageFile)\n : undefined,\n load:\n serverFile !== pageFile &&\n existsSync(serverFile) &&\n hasNamedExport(serverFile, 'load')\n ? toImportSpecifier(dirname(outputPath), serverFile)\n : undefined,\n };\n });\n const exists = existsSync(outputPath);\n const current = exists ? readFileSync(outputPath, 'utf8') : '';\n if (current !== output && !sameDeclarations(current, output)) {\n if (exists && command === 'build' && (options.verifyOnBuild ?? true)) {\n throw new Error(\n `[analog] Stale route file: ${outFile}. Run the dev server to regenerate it before building.`,\n );\n }\n mkdirSync(dirname(outputPath), { recursive: true });\n writeFileSync(outputPath, output);\n }\n }\n\n return {\n name: 'analog-typed-routes',\n config(config, env) {\n command = env.command;\n root = normalizePath(resolve(workspaceRoot, config.root ?? '.'));\n discovery = createRouteFileDiscovery({\n root,\n workspaceRoot,\n additionalPagesDirs: options.additionalPagesDirs ?? [],\n additionalContentDirs: options.additionalContentDirs ?? [],\n });\n // Generate before Angular reads the application tsconfig.\n generate();\n },\n configResolved(config) {\n const compiler = config.plugins.find(\n (plugin) =>\n plugin.name === '@analogjs/vite-plugin-angular' ||\n plugin.name === '@analogjs/vite-plugin-angular-fast-compile' ||\n plugin.name === '@analogjs/vite-plugin-angular-compilation-api',\n );\n getTsConfigPath = compiler?.api?.getTsConfigPath;\n if (compiler && !getTsConfigPath) {\n throw new Error(\n '[analog] Typed routing requires a matching @analogjs/vite-plugin-angular version to verify the application tsconfig.',\n );\n }\n verifyTypeInclusion();\n },\n buildStart() {\n discovery.reset();\n generate();\n verifyTypeInclusion();\n },\n configureServer(server) {\n server.watcher.add(join(root, outFile));\n for (const event of ['add', 'change', 'unlink'] as const) {\n server.watcher.on(event, (path) => {\n if (!discovery.getDiscoveredFileKind(path)) return;\n discovery.updateDiscoveredFile(path, event);\n generate();\n });\n }\n },\n };\n}\n\nfunction toImportSpecifier(fromDir: string, file: string): string {\n const specifier = normalizePath(relative(fromDir, file)).replace(/\\.ts$/, '');\n return specifier.startsWith('.') ? specifier : `./${specifier}`;\n}\n\nfunction hasNamedExport(file: string, name: string): boolean {\n const source = readFileSync(file, 'utf8');\n if (!source.includes(name)) return false;\n const { program, errors } = parseSync(file, source);\n if (errors.length) return false;\n return program.body.some((statement) => {\n if (\n statement.type !== 'ExportNamedDeclaration' ||\n statement.exportKind === 'type'\n ) {\n return false;\n }\n const declaration = statement.declaration;\n if (declaration?.type === 'VariableDeclaration') {\n return declaration.declarations.some(\n (item) => item.id.type === 'Identifier' && item.id.name === name,\n );\n }\n if (declaration?.type === 'FunctionDeclaration') {\n return declaration.id?.name === name;\n }\n return statement.specifiers.some(\n (specifier) =>\n specifier.exportKind !== 'type' &&\n (specifier.exported.type === 'Identifier'\n ? specifier.exported.name\n : specifier.exported.value) === name,\n );\n });\n}\n\nfunction sameDeclarations(current: string, output: string): boolean {\n const left = parseSync('routeTree.gen.d.ts', current);\n const right = parseSync('routeTree.gen.d.ts', output);\n if (left.errors.length || right.errors.length) return false;\n const withoutFormatting = (key: string, value: unknown) =>\n key === 'start' || key === 'end' || key === 'raw' ? undefined : value;\n return (\n JSON.stringify(left.program, withoutFormatting) ===\n JSON.stringify(right.program, withoutFormatting)\n );\n}\n"],"mappings":";;;;;;;;AA4BA,SAAgB,YAAY,UAAoC,CAAC,GAAW;CAC1E,MAAM,gBAAgB,cAAc,QAAQ,iBAAiB,QAAQ,IAAI,CAAC;CAC1E,MAAM,UAAU,QAAQ,WAAW;CACnC,IAAI,CAAC,QAAQ,SAAS,OAAO,GAC3B,MAAM,IAAI,MACR,0GACF;CAEF,IAAI;CACJ,IAAI;CACJ,IAAI;CAEJ,IAAI;CAEJ,SAAS,sBAA4B;EACnC,IAAI,CAAC,iBAAiB;EACtB,MAAM,WAAW,gBAAgB;EACjC,MAAM,EAAE,WAAW,WAAW,kBAAkB,QAAQ;EACxD,IAAI,OAAO,QACT,MAAM,IAAI,MACR,wDAAwD,SAAS,EACnE;EAEF,MAAM,aAAa,cAAc,QAAQ,MAAM,OAAO,CAAC;EACvD,IACE,CAAC,UAAU,MAAM,SAAS,cAAc,QAAQ,IAAI,CAAC,MAAM,UAAU,GACrE;GACA,MAAM,cAAc,cAClB,SAAS,QAAQ,QAAQ,GAAG,UAAU,CACxC;GACA,MAAM,IAAI,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AS,4BACnB,UAAU,eAAe,QAEzB,OAAO;EAET,MAAM,cAAc,UAAU;EAC9B,IAAI,aAAa,SAAS,uBACxB,OAAO,YAAY,aAAa,MAC7B,SAAS,KAAK,GAAG,SAAS,gBAAgB,KAAK,GAAG,SAAS,IAC9D;EAEF,IAAI,aAAa,SAAS,uBACxB,OAAO,YAAY,IAAI,SAAS;EAElC,OAAO,UAAU,WAAW,MACzB,cACC,UAAU,eAAe,WACxB,UAAU,SAAS,SAAS,eACzB,UAAU,SAAS,OACnB,UAAU,SAAS,WAAW,IACtC;CACF,CAAC;AACH;AAEA,SAAS,iBAAiB,SAAiB,QAAyB;CAClE,MAAM,OAAO,UAAU,sBAAsB,OAAO;CACpD,MAAM,QAAQ,UAAU,sBAAsB,MAAM;CACpD,IAAI,KAAK,OAAO,UAAU,MAAM,OAAO,QAAQ,OAAO;CACtD,MAAM,qBAAqB,KAAa,UACtC,QAAQ,WAAW,QAAQ,SAAS,QAAQ,QAAQ,KAAA,IAAY;CAClE,OACE,KAAK,UAAU,KAAK,SAAS,iBAAiB,MAC9C,KAAK,UAAU,MAAM,SAAS,iBAAiB;AAEnD"}
1
+ {"version":3,"file":"typed-routes-plugin.js","names":[],"sources":["../../../src/lib/typed-routes-plugin.ts"],"sourcesContent":["import { existsSync, mkdirSync, readFileSync, writeFileSync } from 'node:fs';\nimport { dirname, join, relative, resolve } from 'node:path';\nimport { readConfiguration } from '@angular/compiler-cli';\nimport { parseSync } from 'oxc-parser';\nimport { normalizePath, searchForWorkspaceRoot, type Plugin } from 'vite';\n\nimport {\n createRouteFileDiscovery,\n type RouteFileDiscovery,\n} from './route-file-discovery.js';\nimport {\n generateRouteManifest,\n generateRouteTableDeclaration,\n} from './route-manifest.js';\n\nexport interface TypedRoutingOptions {\n /** Generated declaration path (.d.ts), relative to the app root. */\n outFile?: string;\n /** Fail builds when a checked-in route table is stale. Defaults to true. */\n verifyOnBuild?: boolean;\n}\n\nexport interface TypedRoutesPluginOptions extends TypedRoutingOptions {\n workspaceRoot?: string;\n additionalPagesDirs?: string[];\n additionalContentDirs?: string[];\n}\n\nexport function typedRoutes(options: TypedRoutesPluginOptions = {}): Plugin {\n const outFile = options.outFile ?? 'src/routeTree.gen.d.ts';\n if (!outFile.endsWith('.d.ts')) {\n throw new Error(\n '[analog] Typed routing outFile must end in .d.ts. Include this declaration in your application tsconfig.',\n );\n }\n let root: string;\n let workspaceRoot: string;\n let command: 'build' | 'serve';\n let discovery: RouteFileDiscovery;\n\n let getTsConfigPath: (() => string) | undefined;\n\n function verifyTypeInclusion(): void {\n if (!getTsConfigPath) return;\n const tsconfig = getTsConfigPath();\n const { rootNames, errors } = readConfiguration(tsconfig);\n if (errors.length) {\n throw new Error(\n `[analog] Cannot verify typed routing: unable to read ${tsconfig}.`,\n );\n }\n const outputPath = normalizePath(resolve(root, outFile));\n if (\n !rootNames.some((file) => normalizePath(resolve(file)) === outputPath)\n ) {\n const declaration = normalizePath(\n relative(dirname(tsconfig), outputPath),\n );\n throw new Error(\n `[analog] Typed route declaration is not included in ${tsconfig}. Add \"${declaration}\" to its \"files\" or \"include\" list so typed routing is available to the compiler and editor.`,\n );\n }\n }\n\n function generate(): void {\n const manifest = generateRouteManifest(\n [...discovery.getRouteFiles(), ...discovery.getContentFiles()],\n (filename) => (discovery.isAppLocal(filename) ? 0 : 1),\n );\n const collisions = manifest.collisions.filter(\n (collision) => collision.samePriority,\n );\n if (command === 'build' && collisions.length) {\n throw new Error(\n `[analog] Route collisions detected: ${collisions.map((c) => `${c.fullPath}: ${c.keptFile}, ${c.droppedFile}`).join('; ')}`,\n );\n }\n const outputPath = join(root, outFile);\n const output = generateRouteTableDeclaration(manifest, (filename) => {\n const pageFile = [\n join(root, filename),\n join(workspaceRoot, filename),\n filename,\n ].find((file) => existsSync(file));\n if (!pageFile) return undefined;\n const serverFile = pageFile.replace(/\\.page\\.(?:ts|tsrx)$/, '.server.ts');\n return {\n routeMeta: hasNamedExport(pageFile, 'routeMeta')\n ? toImportSpecifier(dirname(outputPath), pageFile)\n : undefined,\n load:\n serverFile !== pageFile &&\n existsSync(serverFile) &&\n hasNamedExport(serverFile, 'load')\n ? toImportSpecifier(dirname(outputPath), serverFile)\n : undefined,\n };\n });\n const exists = existsSync(outputPath);\n const current = exists ? readFileSync(outputPath, 'utf8') : '';\n if (current !== output && !sameDeclarations(current, output)) {\n if (exists && command === 'build' && (options.verifyOnBuild ?? true)) {\n throw new Error(\n `[analog] Stale route file: ${outFile}. Run the dev server to regenerate it before building.`,\n );\n }\n mkdirSync(dirname(outputPath), { recursive: true });\n writeFileSync(outputPath, output);\n }\n }\n\n return {\n name: 'analog-typed-routes',\n config(config, env) {\n command = env.command;\n root = normalizePath(\n resolve(options.workspaceRoot ?? process.cwd(), config.root ?? '.'),\n );\n workspaceRoot = normalizePath(\n options.workspaceRoot ??\n process.env['NX_WORKSPACE_ROOT'] ??\n searchForWorkspaceRoot(root),\n );\n discovery = createRouteFileDiscovery({\n root,\n workspaceRoot,\n additionalPagesDirs: options.additionalPagesDirs ?? [],\n additionalContentDirs: options.additionalContentDirs ?? [],\n });\n // Generate before Angular reads the application tsconfig.\n generate();\n },\n configResolved(config) {\n const compiler = config.plugins.find(\n (plugin) =>\n plugin.name === '@analogjs/vite-plugin-angular' ||\n plugin.name === '@analogjs/vite-plugin-angular-fast-compile' ||\n plugin.name === '@analogjs/vite-plugin-angular-compilation-api' ||\n plugin.name === '@analogjs/vite-plugin-angular-ngp',\n );\n getTsConfigPath = compiler?.api?.getTsConfigPath;\n if (compiler && !getTsConfigPath) {\n throw new Error(\n '[analog] Typed routing requires a matching @analogjs/vite-plugin-angular version to verify the application tsconfig.',\n );\n }\n verifyTypeInclusion();\n },\n buildStart() {\n discovery.reset();\n generate();\n verifyTypeInclusion();\n },\n configureServer(server) {\n server.watcher.add(join(root, outFile));\n for (const event of ['add', 'change', 'unlink'] as const) {\n server.watcher.on(event, (path) => {\n if (!discovery.getDiscoveredFileKind(path)) return;\n discovery.updateDiscoveredFile(path, event);\n generate();\n });\n }\n },\n };\n}\n\nfunction toImportSpecifier(fromDir: string, file: string): string {\n const specifier = normalizePath(relative(fromDir, file)).replace(/\\.ts$/, '');\n return specifier.startsWith('.') ? specifier : `./${specifier}`;\n}\n\nfunction hasNamedExport(file: string, name: string): boolean {\n const source = readFileSync(file, 'utf8');\n if (!source.includes(name)) return false;\n const { program, errors } = parseSync(file, source);\n if (errors.length) return false;\n return program.body.some((statement) => {\n if (\n statement.type !== 'ExportNamedDeclaration' ||\n statement.exportKind === 'type'\n ) {\n return false;\n }\n const declaration = statement.declaration;\n if (declaration?.type === 'VariableDeclaration') {\n return declaration.declarations.some(\n (item) => item.id.type === 'Identifier' && item.id.name === name,\n );\n }\n if (declaration?.type === 'FunctionDeclaration') {\n return declaration.id?.name === name;\n }\n return statement.specifiers.some(\n (specifier) =>\n specifier.exportKind !== 'type' &&\n (specifier.exported.type === 'Identifier'\n ? specifier.exported.name\n : specifier.exported.value) === name,\n );\n });\n}\n\nfunction sameDeclarations(current: string, output: string): boolean {\n const left = parseSync('routeTree.gen.d.ts', current);\n const right = parseSync('routeTree.gen.d.ts', output);\n if (left.errors.length || right.errors.length) return false;\n const withoutFormatting = (key: string, value: unknown) =>\n key === 'start' || key === 'end' || key === 'raw' ? undefined : value;\n return (\n JSON.stringify(left.program, withoutFormatting) ===\n JSON.stringify(right.program, withoutFormatting)\n );\n}\n"],"mappings":";;;;;;;;AA4BA,SAAgB,YAAY,UAAoC,CAAC,GAAW;CAC1E,MAAM,UAAU,QAAQ,WAAW;CACnC,IAAI,CAAC,QAAQ,SAAS,OAAO,GAC3B,MAAM,IAAI,MACR,0GACF;CAEF,IAAI;CACJ,IAAI;CACJ,IAAI;CACJ,IAAI;CAEJ,IAAI;CAEJ,SAAS,sBAA4B;EACnC,IAAI,CAAC,iBAAiB;EACtB,MAAM,WAAW,gBAAgB;EACjC,MAAM,EAAE,WAAW,WAAW,kBAAkB,QAAQ;EACxD,IAAI,OAAO,QACT,MAAM,I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S,IAAI,CAAC,CAAC,CAAC,QAAQ,SAAS,EAAE;CAC5E,OAAO,UAAU,WAAW,GAAG,IAAI,YAAY,KAAK;AACtD;AAEA,SAAS,eAAe,MAAc,MAAuB;CAC3D,MAAM,SAAS,aAAa,MAAM,MAAM;CACxC,IAAI,CAAC,OAAO,SAAS,IAAI,GAAG,OAAO;CACnC,MAAM,EAAE,SAAS,WAAW,UAAU,MAAM,MAAM;CAClD,IAAI,OAAO,QAAQ,OAAO;CAC1B,OAAO,QAAQ,KAAK,MAAM,cAAc;EACtC,IACE,UAAU,SAAS,4BACnB,UAAU,eAAe,QAEzB,OAAO;EAET,MAAM,cAAc,UAAU;EAC9B,IAAI,aAAa,SAAS,uBACxB,OAAO,YAAY,aAAa,MAC7B,SAAS,KAAK,GAAG,SAAS,gBAAgB,KAAK,GAAG,SAAS,IAC9D;EAEF,IAAI,aAAa,SAAS,uBACxB,OAAO,YAAY,IAAI,SAAS;EAElC,OAAO,UAAU,WAAW,MACzB,cACC,UAAU,eAAe,WACxB,UAAU,SAAS,SAAS,eACzB,UAAU,SAAS,OACnB,UAAU,SAAS,WAAW,IACtC;CACF,CAAC;AACH;AAEA,SAAS,iBAAiB,SAAiB,QAAyB;CAClE,MAAM,OAAO,UAAU,sBAAsB,OAAO;CACpD,MAAM,QAAQ,UAAU,sBAAsB,MAAM;CACpD,IAAI,KAAK,OAAO,UAAU,MAAM,OAAO,QAAQ,OAAO;CACtD,MAAM,qBAAqB,KAAa,UACtC,QAAQ,WAAW,QAAQ,SAAS,QAAQ,QAAQ,KAAA,IAAY;CAClE,OACE,KAAK,UAAU,KAAK,SAAS,iBAAiB,MAC9C,KAAK,UAAU,MAAM,SAAS,iBAAiB;AAEnD"}
@@ -17,6 +17,7 @@ function serverModePlugin(entryServer) {
17
17
  let entryServerPath = "";
18
18
  return [{
19
19
  name: "analogjs-server-mode-plugin",
20
+ enforce: "post",
20
21
  configResolved(config) {
21
22
  entryServerPath = normalizePath(resolve(config.root, entryServer ?? "src/main.server.ts"));
22
23
  },
@@ -1 +1 @@
1
- {"version":3,"file":"server-mode-plugin.js","names":[],"sources":["../../src/server-mode-plugin.ts"],"sourcesContent":["import { resolve } from 'node:path';\nimport { Plugin, normalizePath } from 'vite';\n\nexport const SERVER_MODE_ID = 'virtual:@analogjs/platform/server-mode';\nconst RESOLVED_SERVER_MODE_ID = `\\0${SERVER_MODE_ID}`;\n\n/**\n * Serves a module that sets `globalThis.ngServerMode = true`.\n *\n * Angular decides at provider-creation time whether browser-only features\n * such as event replay apply, and `provideClientHydration()` runs while the\n * app config module evaluates, before `platformServer()` or\n * `provideServerRendering()` set the flag. The SSR entry imports this module\n * first so the flag is set before any application module evaluates. A text\n * replacement cannot do this because Angular is pre-bundled for SSR.\n */\nexport function serverModePlugin(entryServer?: string): Plugin[] {\n let entryServerPath = '';\n\n return [\n {\n name: 'analogjs-server-mode-plugin',\n configResolved(config) {\n entryServerPath = normalizePath(\n resolve(config.root, entryServer ?? 'src/main.server.ts'),\n );\n },\n // Nitro v2 builds `main.server.ts` as the SSR entry directly, so set the\n // flag there too.\n transform(code, id, options) {\n if (options?.ssr && normalizePath(id) === entryServerPath) {\n return {\n code: `import ${JSON.stringify(SERVER_MODE_ID)};\\n${code}`,\n map: null,\n };\n }\n return undefined;\n },\n resolveId(id) {\n return id === SERVER_MODE_ID ? RESOLVED_SERVER_MODE_ID : undefined;\n },\n load(id) {\n return id === RESOLVED_SERVER_MODE_ID\n ? 'globalThis.ngServerMode = true;\\nexport {};\\n'\n : undefined;\n },\n },\n ];\n}\n"],"mappings":";;;AAGA,IAAa,iBAAiB;AAC9B,IAAM,0BAA0B,KAAK;;;;;;;;;;;AAYrC,SAAgB,iBAAiB,aAAgC;CAC/D,IAAI,kBAAkB;CAEtB,OAAO,CACL;EACE,MAAM;EACN,eAAe,QAAQ;GACrB,kBAAkB,cAChB,QAAQ,OAAO,MAAM,eAAe,oBAAoB,CAC1D;EACF;EAGA,UAAU,MAAM,IAAI,SAAS;GAC3B,IAAI,SAAS,OAAO,cAAc,EAAE,MAAM,iBACxC,OAAO;IACL,MAAM,UAAU,KAAK,UAAU,cAAc,EAAE,KAAK;IACpD,KAAK;GACP;EAGJ;EACA,UAAU,IAAI;GACZ,OAAO,OAAA,2CAAwB,0BAA0B,KAAA;EAC3D;EACA,KAAK,IAAI;GACP,OAAO,OAAO,0BACV,kDACA,KAAA;EACN;CACF,CACF;AACF"}
1
+ {"version":3,"file":"server-mode-plugin.js","names":[],"sources":["../../src/server-mode-plugin.ts"],"sourcesContent":["import { resolve } from 'node:path';\nimport { Plugin, normalizePath } from 'vite';\n\nexport const SERVER_MODE_ID = 'virtual:@analogjs/platform/server-mode';\nconst RESOLVED_SERVER_MODE_ID = `\\0${SERVER_MODE_ID}`;\n\n/**\n * Serves a module that sets `globalThis.ngServerMode = true`.\n *\n * Angular decides at provider-creation time whether browser-only features\n * such as event replay apply, and `provideClientHydration()` runs while the\n * app config module evaluates, before `platformServer()` or\n * `provideServerRendering()` set the flag. The SSR entry imports this module\n * first so the flag is set before any application module evaluates. A text\n * replacement cannot do this because Angular is pre-bundled for SSR.\n */\nexport function serverModePlugin(entryServer?: string): Plugin[] {\n let entryServerPath = '';\n\n return [\n {\n name: 'analogjs-server-mode-plugin',\n enforce: 'post',\n configResolved(config) {\n entryServerPath = normalizePath(\n resolve(config.root, entryServer ?? 'src/main.server.ts'),\n );\n },\n // Nitro v2 builds `main.server.ts` as the SSR entry directly, so set the\n // flag there too.\n transform(code, id, options) {\n if (options?.ssr && normalizePath(id) === entryServerPath) {\n return {\n code: `import ${JSON.stringify(SERVER_MODE_ID)};\\n${code}`,\n map: null,\n };\n }\n return undefined;\n },\n resolveId(id) {\n return id === SERVER_MODE_ID ? RESOLVED_SERVER_MODE_ID : undefined;\n },\n load(id) {\n return id === RESOLVED_SERVER_MODE_ID\n ? 'globalThis.ngServerMode = true;\\nexport {};\\n'\n : undefined;\n },\n },\n ];\n}\n"],"mappings":";;;AAGA,IAAa,iBAAiB;AAC9B,IAAM,0BAA0B,KAAK;;;;;;;;;;;AAYrC,SAAgB,iBAAiB,aAAgC;CAC/D,IAAI,kBAAkB;CAEtB,OAAO,CACL;EACE,MAAM;EACN,SAAS;EACT,eAAe,QAAQ;GACrB,kBAAkB,cAChB,QAAQ,OAAO,MAAM,eAAe,oBAAoB,CAC1D;EACF;EAGA,UAAU,MAAM,IAAI,SAAS;GAC3B,IAAI,SAAS,OAAO,cAAc,EAAE,MAAM,iBACxC,OAAO;IACL,MAAM,UAAU,KAAK,UAAU,cAAc,EAAE,KAAK;IACpD,KAAK;GACP;EAGJ;EACA,UAAU,IAAI;GACZ,OAAO,OAAA,2CAAwB,0BAA0B,KAAA;EAC3D;EACA,KAAK,IAAI;GACP,OAAO,OAAO,0BACV,kDACA,KAAA;EACN;CACF,CACF;AACF"}
@@ -1,3 +0,0 @@
1
- import { convertNxExecutor } from "@nx/devkit";
2
- declare const compat: ReturnType<typeof convertNxExecutor>;
3
- export default compat;
@@ -1,7 +0,0 @@
1
- const require_src_executors_vite_dev_server_vite_dev_server_impl = require("./vite-dev-server.impl.js");
2
- //#region packages/nx-plugin/src/executors/vite-dev-server/compat.ts
3
- var compat = (0, require("@nx/devkit").convertNxExecutor)(require_src_executors_vite_dev_server_vite_dev_server_impl);
4
- //#endregion
5
- module.exports = compat;
6
-
7
- //# sourceMappingURL=compat.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"compat.js","names":[],"sources":["../../../../../../../../nx-plugin/src/executors/vite-dev-server/compat.ts"],"sourcesContent":["import { convertNxExecutor } from '@nx/devkit';\n\nimport viteDevServerExecutor from './vite-dev-server.impl';\n\nconst compat: ReturnType<typeof convertNxExecutor> = convertNxExecutor(\n viteDevServerExecutor,\n);\nexport default compat;\n"],"mappings":";;AAIA,IAAM,UAAA,uBAA+C,CAAA,CAAA,kBAAA,CACnD,0DACF"}
@@ -1 +0,0 @@
1
- export type { ViteDevServerExecutorOptions } from '@nx/vite/executors';
@@ -1,101 +0,0 @@
1
- {
2
- "version": 2,
3
- "outputCapture": "direct-nodejs",
4
- "title": "Vite Dev Server",
5
- "cli": "nx",
6
- "description": "Starts a dev server using Vite.",
7
- "type": "object",
8
- "presets": [
9
- {
10
- "name": "Default minimum setup",
11
- "keys": ["buildTarget"]
12
- },
13
- {
14
- "name": "Using a Different Port",
15
- "keys": ["buildTarget", "port"]
16
- }
17
- ],
18
- "properties": {
19
- "buildTarget": {
20
- "type": "string",
21
- "description": "Target which builds the application. Only used to retrieve the configuration as the dev-server does not build the code.",
22
- "x-priority": "important"
23
- },
24
- "buildLibsFromSource": {
25
- "type": "boolean",
26
- "description": "Read buildable libraries from source instead of building them separately.",
27
- "default": true
28
- },
29
- "proxyConfig": {
30
- "type": "string",
31
- "description": "Path to the proxy configuration file.",
32
- "x-completion-type": "file"
33
- },
34
- "port": {
35
- "type": "number",
36
- "description": "Port to listen on.",
37
- "x-priority": "important"
38
- },
39
- "host": {
40
- "description": "Specify which IP addresses the server should listen on.",
41
- "oneOf": [
42
- {
43
- "type": "boolean"
44
- },
45
- {
46
- "type": "string"
47
- }
48
- ]
49
- },
50
- "https": {
51
- "oneOf": [
52
- {
53
- "type": "boolean"
54
- },
55
- {
56
- "type": "object"
57
- }
58
- ],
59
- "description": "Serve using HTTPS. https://vitejs.dev/config/server-options.html#server-https"
60
- },
61
- "hmr": {
62
- "description": "Enable hot module replacement. For more options, use the 'hmr' option in the Vite configuration file.",
63
- "type": "boolean"
64
- },
65
- "open": {
66
- "description": "Automatically open the app in the browser on server start. When the value is a string, it will be used as the URL's pathname.",
67
- "oneOf": [
68
- {
69
- "type": "boolean"
70
- },
71
- {
72
- "type": "string"
73
- }
74
- ]
75
- },
76
- "cors": {
77
- "description": "Configure CORS for the dev server.",
78
- "type": "boolean"
79
- },
80
- "logLevel": {
81
- "type": "string",
82
- "description": "Adjust console output verbosity.",
83
- "enum": ["info", "warn", "error", "silent"]
84
- },
85
- "mode": {
86
- "type": "string",
87
- "description": "Mode to run the server in."
88
- },
89
- "clearScreen": {
90
- "description": "Set to false to prevent Vite from clearing the terminal screen when logging certain messages.",
91
- "type": "boolean"
92
- },
93
- "force": {
94
- "description": "Force the optimizer to ignore the cache and re-bundle",
95
- "type": "boolean"
96
- }
97
- },
98
- "definitions": {},
99
- "required": ["buildTarget"],
100
- "examplesFile": "../../../docs/dev-server-examples.md"
101
- }
@@ -1,2 +0,0 @@
1
- import { viteDevServerExecutor } from "@nx/vite/executors";
2
- export default viteDevServerExecutor;
@@ -1,6 +0,0 @@
1
- //#region packages/nx-plugin/src/executors/vite-dev-server/vite-dev-server.impl.ts
2
- var vite_dev_server_impl_default = require("@nx/vite/executors").viteDevServerExecutor;
3
- //#endregion
4
- module.exports = vite_dev_server_impl_default;
5
-
6
- //# sourceMappingURL=vite-dev-server.impl.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"vite-dev-server.impl.js","names":[],"sources":["../../../../../../../../nx-plugin/src/executors/vite-dev-server/vite-dev-server.impl.ts"],"sourcesContent":["import { viteDevServerExecutor } from '@nx/vite/executors';\n\nexport default viteDevServerExecutor;\n"],"mappings":";AAEA,IAAA,2DAAe,CAAA,CAAA"}