@analogjs/platform 3.0.0-alpha.92 → 3.0.0-alpha.93
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/package.json +2 -2
- package/src/lib/nx-plugin/src/generators/app/generator.js +5 -0
- package/src/lib/nx-plugin/src/generators/app/generator.js.map +1 -1
- package/src/lib/nx-plugin/src/generators/app/versions/nx_18_X/versions.d.ts +7 -7
- package/src/lib/nx-plugin/src/generators/app/versions/nx_18_X/versions.js.map +1 -1
- package/src/lib/nx-plugin/src/generators/init/lib/update-git-ignore.js +4 -7
- package/src/lib/nx-plugin/src/generators/init/lib/update-git-ignore.js.map +1 -1
- package/src/lib/nx-plugin/src/utils/versions/ng_19_X/versions.d.ts +6 -6
- package/src/lib/nx-plugin/src/utils/versions/ng_19_X/versions.js +6 -6
- package/src/lib/nx-plugin/src/utils/versions/ng_19_X/versions.js.map +1 -1
- package/src/lib/options.d.ts +9 -1
- package/src/lib/ssr/defer-streaming-plugin.d.ts +3 -35
- package/src/lib/ssr/defer-streaming-plugin.js +54 -48
- package/src/lib/ssr/defer-streaming-plugin.js.map +1 -1
- package/src/lib/ssr/ssr-build-plugin.d.ts +1 -1
- package/src/lib/ssr/ssr-build-plugin.js.map +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@analogjs/platform",
|
|
3
|
-
"version": "3.0.0-alpha.
|
|
3
|
+
"version": "3.0.0-alpha.93",
|
|
4
4
|
"description": "The fullstack meta-framework for Angular",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"author": "Brandon Roberts <robertsbt@gmail.com>",
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
"url": "https://github.com/sponsors/brandonroberts"
|
|
32
32
|
},
|
|
33
33
|
"dependencies": {
|
|
34
|
-
"@analogjs/vite-plugin-angular": "3.0.0-alpha.
|
|
34
|
+
"@analogjs/vite-plugin-angular": "3.0.0-alpha.93",
|
|
35
35
|
"es-toolkit": "^1.45.1",
|
|
36
36
|
"front-matter": "^4.0.2",
|
|
37
37
|
"magic-string": "^0.30.21",
|
|
@@ -72,6 +72,11 @@ async function appGenerator(tree, options) {
|
|
|
72
72
|
}, {});
|
|
73
73
|
(0, _nx_devkit.updateJson)(tree, "/package.json", (json) => {
|
|
74
74
|
json.dependencies["@angular/platform-server"] = `~${angularVersion}`;
|
|
75
|
+
json.overrides = {
|
|
76
|
+
...json.overrides,
|
|
77
|
+
vite: "$vite",
|
|
78
|
+
vitest: "$vitest"
|
|
79
|
+
};
|
|
75
80
|
return json;
|
|
76
81
|
});
|
|
77
82
|
require_update_index_html.updateIndex(tree, normalizedOptions.analogAppName);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generator.js","names":[],"sources":["../../../../../../../../nx-plugin/src/generators/app/generator.ts"],"sourcesContent":["import {\n formatFiles,\n getWorkspaceLayout,\n installPackagesTask,\n names,\n offsetFromRoot as determineOffsetFromRoot,\n stripIndents,\n Tree,\n addDependenciesToPackageJson,\n updateJson,\n} from '@nx/devkit';\nimport { wrapAngularDevkitSchematic } from '@nx/devkit/ngcli-adapter';\nimport { AnalogNxApplicationGeneratorOptions } from './schema';\nimport { major, coerce } from 'semver';\nimport { getInstalledPackageVersion } from '../../utils/version-utils';\nimport { addHomePage } from './lib/add-home-page';\nimport {\n belowMinimumSupportedNxVersion,\n belowMinimumSupportedOxlintNxVersion,\n MINIMUM_SUPPORTED_OXLINT_NX_VERSION,\n} from './versions/minimum-supported-versions';\nimport { addAngularApp } from './lib/add-angular-app';\nimport setupAnalogGenerator from '../init/generator';\nimport { addFiles } from './lib/add-files';\nimport { addAgentContext } from './lib/add-agent-context';\nimport { addTailwindConfig } from './lib/add-tailwind-config';\nimport { cleanupFiles } from './lib/cleanup-files';\nimport { addAnalogProjectConfig } from './lib/add-analog-project-config';\nimport { updateIndex } from './lib/update-index-html';\n\nexport interface NormalizedOptions\n extends AnalogNxApplicationGeneratorOptions, ReturnType<typeof names> {\n projectName: string;\n projectRoot: string;\n projectDirectory: string;\n parsedTags: string[];\n offsetFromRoot: string;\n appsDir: string;\n nxPackageNamespace: string;\n isNx: boolean;\n}\n\nfunction normalizeOptions(\n tree: Tree,\n options: AnalogNxApplicationGeneratorOptions,\n): NormalizedOptions {\n const isNx = tree.exists('/nx.json');\n const appsDir = isNx ? getWorkspaceLayout(tree).appsDir : 'projects';\n const allNames = names(options.analogAppName);\n const projectDirectory = allNames.fileName;\n const projectName = projectDirectory.replace(new RegExp('/', 'g'), '-');\n const projectRoot = `${appsDir}/${projectDirectory}`;\n const parsedTags = options.tags\n ? options.tags.split(',').map((s) => s.trim())\n : [];\n const offsetFromRoot = determineOffsetFromRoot(projectRoot);\n const nxPackageNamespace = '@nx';\n const addTailwind = options.addTailwind ?? true;\n\n return {\n ...options,\n ...allNames,\n projectName,\n projectRoot,\n projectDirectory,\n parsedTags,\n offsetFromRoot,\n appsDir,\n nxPackageNamespace,\n addTailwind,\n isNx,\n };\n}\n\nasync function appGenerator(\n tree: Tree,\n options: AnalogNxApplicationGeneratorOptions,\n): Promise<() => void> {\n const nxVersion = getInstalledPackageVersion(tree, 'nx');\n\n if (nxVersion && belowMinimumSupportedNxVersion(nxVersion)) {\n throw new Error(\n stripIndents`Nx v17.0.0 or newer is required to install Analog`,\n );\n }\n\n if (options.linter === 'oxlint') {\n if (!nxVersion) {\n throw new Error(\n stripIndents`The oxlint linter is only supported in Nx workspaces`,\n );\n }\n if (belowMinimumSupportedOxlintNxVersion(nxVersion)) {\n throw new Error(\n stripIndents`Nx v${MINIMUM_SUPPORTED_OXLINT_NX_VERSION} or newer is required to use the oxlint linter`,\n );\n }\n }\n\n const normalizedOptions = normalizeOptions(tree, options);\n\n if (nxVersion) {\n await addAngularApp(tree, normalizedOptions);\n } else {\n const angularAppSchematic = wrapAngularDevkitSchematic(\n '@schematics/angular',\n 'application',\n );\n await angularAppSchematic(tree, {\n projectRoot: normalizedOptions.projectRoot,\n name: normalizedOptions.analogAppName,\n });\n addAnalogProjectConfig(\n tree,\n normalizedOptions.projectRoot,\n normalizedOptions.projectName,\n normalizedOptions.parsedTags,\n normalizedOptions.name,\n normalizedOptions.appsDir,\n normalizedOptions.nxPackageNamespace,\n );\n }\n\n await setupAnalogGenerator(tree, {\n project: normalizedOptions.analogAppName,\n vitest: true,\n });\n\n const angularVersion = getInstalledPackageVersion(tree, '@angular/core');\n const coercedAngularVersion = coerce(angularVersion ?? '');\n if (!coercedAngularVersion) {\n throw new Error('Could not determine installed Angular version.');\n }\n const majorAngularVersion = major(coercedAngularVersion);\n addFiles(tree, normalizedOptions, majorAngularVersion);\n addDependenciesToPackageJson(\n tree,\n {\n 'front-matter': '^4.0.2',\n marked: '^18.0.0',\n mermaid: '^10.2.4',\n prismjs: '^1.29.0',\n },\n {},\n );\n\n updateJson<{
|
|
1
|
+
{"version":3,"file":"generator.js","names":[],"sources":["../../../../../../../../nx-plugin/src/generators/app/generator.ts"],"sourcesContent":["import {\n formatFiles,\n getWorkspaceLayout,\n installPackagesTask,\n names,\n offsetFromRoot as determineOffsetFromRoot,\n stripIndents,\n Tree,\n addDependenciesToPackageJson,\n updateJson,\n} from '@nx/devkit';\nimport { wrapAngularDevkitSchematic } from '@nx/devkit/ngcli-adapter';\nimport { AnalogNxApplicationGeneratorOptions } from './schema';\nimport { major, coerce } from 'semver';\nimport { getInstalledPackageVersion } from '../../utils/version-utils';\nimport { addHomePage } from './lib/add-home-page';\nimport {\n belowMinimumSupportedNxVersion,\n belowMinimumSupportedOxlintNxVersion,\n MINIMUM_SUPPORTED_OXLINT_NX_VERSION,\n} from './versions/minimum-supported-versions';\nimport { addAngularApp } from './lib/add-angular-app';\nimport setupAnalogGenerator from '../init/generator';\nimport { addFiles } from './lib/add-files';\nimport { addAgentContext } from './lib/add-agent-context';\nimport { addTailwindConfig } from './lib/add-tailwind-config';\nimport { cleanupFiles } from './lib/cleanup-files';\nimport { addAnalogProjectConfig } from './lib/add-analog-project-config';\nimport { updateIndex } from './lib/update-index-html';\n\nexport interface NormalizedOptions\n extends AnalogNxApplicationGeneratorOptions, ReturnType<typeof names> {\n projectName: string;\n projectRoot: string;\n projectDirectory: string;\n parsedTags: string[];\n offsetFromRoot: string;\n appsDir: string;\n nxPackageNamespace: string;\n isNx: boolean;\n}\n\nfunction normalizeOptions(\n tree: Tree,\n options: AnalogNxApplicationGeneratorOptions,\n): NormalizedOptions {\n const isNx = tree.exists('/nx.json');\n const appsDir = isNx ? getWorkspaceLayout(tree).appsDir : 'projects';\n const allNames = names(options.analogAppName);\n const projectDirectory = allNames.fileName;\n const projectName = projectDirectory.replace(new RegExp('/', 'g'), '-');\n const projectRoot = `${appsDir}/${projectDirectory}`;\n const parsedTags = options.tags\n ? options.tags.split(',').map((s) => s.trim())\n : [];\n const offsetFromRoot = determineOffsetFromRoot(projectRoot);\n const nxPackageNamespace = '@nx';\n const addTailwind = options.addTailwind ?? true;\n\n return {\n ...options,\n ...allNames,\n projectName,\n projectRoot,\n projectDirectory,\n parsedTags,\n offsetFromRoot,\n appsDir,\n nxPackageNamespace,\n addTailwind,\n isNx,\n };\n}\n\nasync function appGenerator(\n tree: Tree,\n options: AnalogNxApplicationGeneratorOptions,\n): Promise<() => void> {\n const nxVersion = getInstalledPackageVersion(tree, 'nx');\n\n if (nxVersion && belowMinimumSupportedNxVersion(nxVersion)) {\n throw new Error(\n stripIndents`Nx v17.0.0 or newer is required to install Analog`,\n );\n }\n\n if (options.linter === 'oxlint') {\n if (!nxVersion) {\n throw new Error(\n stripIndents`The oxlint linter is only supported in Nx workspaces`,\n );\n }\n if (belowMinimumSupportedOxlintNxVersion(nxVersion)) {\n throw new Error(\n stripIndents`Nx v${MINIMUM_SUPPORTED_OXLINT_NX_VERSION} or newer is required to use the oxlint linter`,\n );\n }\n }\n\n const normalizedOptions = normalizeOptions(tree, options);\n\n if (nxVersion) {\n await addAngularApp(tree, normalizedOptions);\n } else {\n const angularAppSchematic = wrapAngularDevkitSchematic(\n '@schematics/angular',\n 'application',\n );\n await angularAppSchematic(tree, {\n projectRoot: normalizedOptions.projectRoot,\n name: normalizedOptions.analogAppName,\n });\n addAnalogProjectConfig(\n tree,\n normalizedOptions.projectRoot,\n normalizedOptions.projectName,\n normalizedOptions.parsedTags,\n normalizedOptions.name,\n normalizedOptions.appsDir,\n normalizedOptions.nxPackageNamespace,\n );\n }\n\n await setupAnalogGenerator(tree, {\n project: normalizedOptions.analogAppName,\n vitest: true,\n });\n\n const angularVersion = getInstalledPackageVersion(tree, '@angular/core');\n const coercedAngularVersion = coerce(angularVersion ?? '');\n if (!coercedAngularVersion) {\n throw new Error('Could not determine installed Angular version.');\n }\n const majorAngularVersion = major(coercedAngularVersion);\n addFiles(tree, normalizedOptions, majorAngularVersion);\n addDependenciesToPackageJson(\n tree,\n {\n 'front-matter': '^4.0.2',\n marked: '^18.0.0',\n mermaid: '^10.2.4',\n prismjs: '^1.29.0',\n },\n {},\n );\n\n updateJson<{\n dependencies: Record<string, string>;\n overrides?: Record<string, unknown>;\n }>(tree, '/package.json', (json) => {\n json.dependencies['@angular/platform-server'] = `~${angularVersion}`;\n json.overrides = {\n ...json.overrides,\n vite: '$vite',\n vitest: '$vitest',\n };\n\n return json;\n });\n\n updateIndex(tree, normalizedOptions.analogAppName);\n\n if (normalizedOptions.addTailwind) {\n await addTailwindConfig(tree, normalizedOptions.projectName);\n }\n\n addHomePage(tree, normalizedOptions, majorAngularVersion);\n\n if (!normalizedOptions.skipAgentContext) {\n addAgentContext(tree, normalizedOptions.projectRoot);\n }\n\n cleanupFiles(tree, normalizedOptions);\n\n if (!normalizedOptions.skipFormat) {\n await formatFiles(tree);\n }\n\n return () => {\n installPackagesTask(tree);\n };\n}\n\nexport default appGenerator;\n"],"mappings":";;;;;;;;;;;;;;;;AA0CA,SAAS,iBACP,MACA,SACmB;CACnB,MAAM,OAAO,KAAK,OAAO,WAAW;CACpC,MAAM,UAAU,QAAA,GAAA,WAAA,oBAA0B,KAAK,CAAC,UAAU;CAC1D,MAAM,YAAA,GAAA,WAAA,OAAiB,QAAQ,cAAc;CAC7C,MAAM,mBAAmB,SAAS;CAClC,MAAM,cAAc,iBAAiB,wBAAQ,IAAI,OAAO,KAAK,IAAI,EAAE,IAAI;CACvE,MAAM,cAAc,GAAG,QAAQ,GAAG;CAClC,MAAM,aAAa,QAAQ,OACvB,QAAQ,KAAK,MAAM,IAAI,CAAC,KAAK,MAAM,EAAE,MAAM,CAAC,GAC5C,EAAE;CACN,MAAM,kBAAA,GAAA,WAAA,gBAAyC,YAAY;CAC3D,MAAM,qBAAqB;CAC3B,MAAM,cAAc,QAAQ,eAAe;AAE3C,QAAO;EACL,GAAG;EACH,GAAG;EACH;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACD;;AAGH,eAAe,aACb,MACA,SACqB;CACrB,MAAM,YAAY,sBAAA,2BAA2B,MAAM,KAAK;AAExD,KAAI,aAAa,mCAAA,+BAA+B,UAAU,CACxD,OAAM,IAAI,MACR,WAAA,YAAY,oDACb;AAGH,KAAI,QAAQ,WAAW,UAAU;AAC/B,MAAI,CAAC,UACH,OAAM,IAAI,MACR,WAAA,YAAY,uDACb;AAEH,MAAI,mCAAA,qCAAqC,UAAU,CACjD,OAAM,IAAI,MACR,WAAA,YAAY,OAAO,mCAAA,oCAAoC,gDACxD;;CAIL,MAAM,oBAAoB,iBAAiB,MAAM,QAAQ;AAEzD,KAAI,UACF,OAAM,wBAAA,cAAc,MAAM,kBAAkB;MACvC;AAKL,SAAA,GAAA,yBAAA,4BAHE,uBACA,cACD,CACyB,MAAM;GAC9B,aAAa,kBAAkB;GAC/B,MAAM,kBAAkB;GACzB,CAAC;AACF,oCAAA,uBACE,MACA,kBAAkB,aAClB,kBAAkB,aAClB,kBAAkB,YAClB,kBAAkB,MAClB,kBAAkB,SAClB,kBAAkB,mBACnB;;AAGH,OAAM,sCAAqB,MAAM;EAC/B,SAAS,kBAAkB;EAC3B,QAAQ;EACT,CAAC;CAEF,MAAM,iBAAiB,sBAAA,2BAA2B,MAAM,gBAAgB;CACxE,MAAM,yBAAA,GAAA,OAAA,QAA+B,kBAAkB,GAAG;AAC1D,KAAI,CAAC,sBACH,OAAM,IAAI,MAAM,iDAAiD;CAEnE,MAAM,uBAAA,GAAA,OAAA,OAA4B,sBAAsB;AACxD,mBAAA,SAAS,MAAM,mBAAmB,oBAAoB;AACtD,EAAA,GAAA,WAAA,8BACE,MACA;EACE,gBAAgB;EAChB,QAAQ;EACR,SAAS;EACT,SAAS;EACV,EACD,EAAE,CACH;AAED,EAAA,GAAA,WAAA,YAGG,MAAM,kBAAkB,SAAS;AAClC,OAAK,aAAa,8BAA8B,IAAI;AACpD,OAAK,YAAY;GACf,GAAG,KAAK;GACR,MAAM;GACN,QAAQ;GACT;AAED,SAAO;GACP;AAEF,2BAAA,YAAY,MAAM,kBAAkB,cAAc;AAElD,KAAI,kBAAkB,YACpB,OAAM,4BAAA,kBAAkB,MAAM,kBAAkB,YAAY;AAG9D,uBAAA,YAAY,MAAM,mBAAmB,oBAAoB;AAEzD,KAAI,CAAC,kBAAkB,iBACrB,2BAAA,gBAAgB,MAAM,kBAAkB,YAAY;AAGtD,uBAAA,aAAa,MAAM,kBAAkB;AAErC,KAAI,CAAC,kBAAkB,WACrB,QAAA,GAAA,WAAA,aAAkB,KAAK;AAGzB,cAAa;AACX,GAAA,GAAA,WAAA,qBAAoB,KAAK"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
export declare const V18_X_NX_DEVKIT = "^20.0.0";
|
|
2
2
|
export declare const V18_X_NX_ANGULAR = "^20.0.0";
|
|
3
|
-
export declare const V18_X_ANALOG_JS_CONTENT = "^3.0.0-alpha.
|
|
4
|
-
export declare const V18_X_ANALOG_JS_ROUTER = "^3.0.0-alpha.
|
|
5
|
-
export declare const V18_X_ANALOG_JS_VITE_PLUGIN_ANGULAR = "^3.0.0-alpha.
|
|
6
|
-
export declare const V18_X_ANALOG_JS_VITEST_ANGULAR = "^3.0.0-alpha.
|
|
3
|
+
export declare const V18_X_ANALOG_JS_CONTENT = "^3.0.0-alpha.93";
|
|
4
|
+
export declare const V18_X_ANALOG_JS_ROUTER = "^3.0.0-alpha.93";
|
|
5
|
+
export declare const V18_X_ANALOG_JS_VITE_PLUGIN_ANGULAR = "^3.0.0-alpha.93";
|
|
6
|
+
export declare const V18_X_ANALOG_JS_VITEST_ANGULAR = "^3.0.0-alpha.93";
|
|
7
7
|
export declare const V18_X_FRONT_MATTER = "^4.0.2";
|
|
8
8
|
export declare const V18_X_MARKED = "^18.0.0";
|
|
9
9
|
export declare const V18_X_MARKED_GFM_HEADING_ID = "^4.1.1";
|
|
@@ -15,8 +15,8 @@ export declare const V18_X_TAILWINDCSS = "^4.2.2";
|
|
|
15
15
|
export declare const V18_X_TAILWINDCSS_POSTCSS = "^4.2.2";
|
|
16
16
|
export declare const V18_X_TAILWINDCSS_VITE = "^4.2.2";
|
|
17
17
|
export declare const V18_X_POSTCSS = "^8.5.6";
|
|
18
|
-
export declare const V18_X_ANALOG_JS_PLATFORM = "^3.0.0-alpha.
|
|
19
|
-
export declare const V18_X_ANALOG_JS_VITE_PLUGIN_NITRO = "^3.0.0-alpha.
|
|
18
|
+
export declare const V18_X_ANALOG_JS_PLATFORM = "^3.0.0-alpha.93";
|
|
19
|
+
export declare const V18_X_ANALOG_JS_VITE_PLUGIN_NITRO = "^3.0.0-alpha.93";
|
|
20
20
|
export declare const V18_X_H3 = "^1.13.0";
|
|
21
21
|
export declare const V18_X_ANGULAR_DEVKIT_BUILD_ANGULAR = "^19.0.0";
|
|
22
22
|
export declare const V18_X_NX_VITE = "^21.0.0";
|
|
@@ -24,5 +24,5 @@ export declare const V18_X_NX_LINTER = "^21.0.0";
|
|
|
24
24
|
export declare const V18_X_JSDOM = "^22.1.0";
|
|
25
25
|
export declare const V18_X_VITE = "^8.0.0";
|
|
26
26
|
export declare const V18_X_VITE_TSCONFIG_PATHS = "^4.2.0";
|
|
27
|
-
export declare const V18_X_VITEST = "^
|
|
27
|
+
export declare const V18_X_VITEST = "^5.0.0";
|
|
28
28
|
export declare const V18_X_ZOD = "^3.21.4";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"versions.js","names":[],"sources":["../../../../../../../../../../nx-plugin/src/generators/app/versions/nx_18_X/versions.ts"],"sourcesContent":["// V18_X\n// dependencies\nexport const V18_X_NX_DEVKIT = '^20.0.0';\nexport const V18_X_NX_ANGULAR = '^20.0.0';\nexport const V18_X_ANALOG_JS_CONTENT = '^3.0.0-alpha.
|
|
1
|
+
{"version":3,"file":"versions.js","names":[],"sources":["../../../../../../../../../../nx-plugin/src/generators/app/versions/nx_18_X/versions.ts"],"sourcesContent":["// V18_X\n// dependencies\nexport const V18_X_NX_DEVKIT = '^20.0.0';\nexport const V18_X_NX_ANGULAR = '^20.0.0';\nexport const V18_X_ANALOG_JS_CONTENT = '^3.0.0-alpha.93';\nexport const V18_X_ANALOG_JS_ROUTER = '^3.0.0-alpha.93';\nexport const V18_X_ANALOG_JS_VITE_PLUGIN_ANGULAR = '^3.0.0-alpha.93';\nexport const V18_X_ANALOG_JS_VITEST_ANGULAR = '^3.0.0-alpha.93';\nexport const V18_X_FRONT_MATTER = '^4.0.2';\nexport const V18_X_MARKED = '^18.0.0';\nexport const V18_X_MARKED_GFM_HEADING_ID = '^4.1.1';\nexport const V18_X_MARKED_HIGHLIGHT = '^2.2.1';\nexport const V18_X_MARKED_MANGLE = '^1.1.10';\nexport const V18_X_MERMAID = '^10.2.4';\nexport const V18_X_PRISMJS = '^1.29.0';\nexport const V18_X_TAILWINDCSS = '^4.2.2';\nexport const V18_X_TAILWINDCSS_POSTCSS = '^4.2.2';\nexport const V18_X_TAILWINDCSS_VITE = '^4.2.2';\nexport const V18_X_POSTCSS = '^8.5.6';\n\n// devDependencies\nexport const V18_X_ANALOG_JS_PLATFORM = '^3.0.0-alpha.93';\nexport const V18_X_ANALOG_JS_VITE_PLUGIN_NITRO = '^3.0.0-alpha.93';\nexport const V18_X_H3 = '^1.13.0';\nexport const V18_X_ANGULAR_DEVKIT_BUILD_ANGULAR = '^19.0.0';\nexport const V18_X_NX_VITE = '^21.0.0';\nexport const V18_X_NX_LINTER = '^21.0.0';\nexport const V18_X_JSDOM = '^22.1.0';\nexport const V18_X_VITE = '^8.0.0';\nexport const V18_X_VITE_TSCONFIG_PATHS = '^4.2.0';\nexport const V18_X_VITEST = '^5.0.0';\nexport const V18_X_ZOD = '^3.21.4';\n"],"mappings":";AAeA,IAAa,oBAAoB;AACjC,IAAa,4BAA4B;AACzC,IAAa,yBAAyB;AACtC,IAAa,gBAAgB"}
|
|
@@ -1,15 +1,12 @@
|
|
|
1
1
|
//#region packages/nx-plugin/src/generators/init/lib/update-git-ignore.ts
|
|
2
2
|
function updateGitIgnore(tree) {
|
|
3
3
|
const gitIgnorePath = "/.gitignore";
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
if (gitIgnoreContents && !gitIgnoreContents.includes(".nx/cache")) {
|
|
7
|
-
const updatedGitIgnore = `${gitIgnoreContents}\n
|
|
4
|
+
let gitIgnoreContents = tree.read(gitIgnorePath, "utf-8") ?? "";
|
|
5
|
+
if (!gitIgnoreContents.includes(".nx/cache")) gitIgnoreContents += `\n
|
|
8
6
|
.nx/cache
|
|
9
7
|
.nx/workspace-data`;
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
}
|
|
8
|
+
if (!gitIgnoreContents.includes(".vitest/")) gitIgnoreContents += "\n.vitest/\n";
|
|
9
|
+
tree.write(gitIgnorePath, gitIgnoreContents);
|
|
13
10
|
}
|
|
14
11
|
//#endregion
|
|
15
12
|
exports.updateGitIgnore = updateGitIgnore;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"update-git-ignore.js","names":[],"sources":["../../../../../../../../../nx-plugin/src/generators/init/lib/update-git-ignore.ts"],"sourcesContent":["import { Tree } from '@nx/devkit';\n\nexport function updateGitIgnore(tree: Tree): void {\n const gitIgnorePath = '/.gitignore';\n
|
|
1
|
+
{"version":3,"file":"update-git-ignore.js","names":[],"sources":["../../../../../../../../../nx-plugin/src/generators/init/lib/update-git-ignore.ts"],"sourcesContent":["import { Tree } from '@nx/devkit';\n\nexport function updateGitIgnore(tree: Tree): void {\n const gitIgnorePath = '/.gitignore';\n let gitIgnoreContents = tree.read(gitIgnorePath, 'utf-8') ?? '';\n\n if (!gitIgnoreContents.includes('.nx/cache')) {\n gitIgnoreContents += `\\n\n.nx/cache\n.nx/workspace-data`;\n }\n\n if (!gitIgnoreContents.includes('.vitest/')) {\n gitIgnoreContents += '\\n.vitest/\\n';\n }\n\n tree.write(gitIgnorePath, gitIgnoreContents);\n}\n"],"mappings":";AAEA,SAAgB,gBAAgB,MAAkB;CAChD,MAAM,gBAAgB;CACtB,IAAI,oBAAoB,KAAK,KAAK,eAAe,QAAQ,IAAI;AAE7D,KAAI,CAAC,kBAAkB,SAAS,YAAY,CAC1C,sBAAqB;;;AAKvB,KAAI,CAAC,kBAAkB,SAAS,WAAW,CACzC,sBAAqB;AAGvB,MAAK,MAAM,eAAe,kBAAkB"}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
export declare const V19_X_ANALOG_JS_ROUTER = "^3.0.0-alpha.
|
|
2
|
-
export declare const V19_X_ANALOG_JS_CONTENT = "^3.0.0-alpha.
|
|
1
|
+
export declare const V19_X_ANALOG_JS_ROUTER = "^3.0.0-alpha.93";
|
|
2
|
+
export declare const V19_X_ANALOG_JS_CONTENT = "^3.0.0-alpha.93";
|
|
3
3
|
export declare const V19_X_MARKED = "^18.0.0";
|
|
4
4
|
export declare const V19_X_MARKED_GFM_HEADING_ID = "^4.1.1";
|
|
5
5
|
export declare const V19_X_MARKED_HIGHLIGHT = "^2.2.1";
|
|
6
6
|
export declare const V19_X_MARKED_MANGLE = "^1.1.10";
|
|
7
7
|
export declare const V19_X_PRISMJS = "^1.29.0";
|
|
8
|
-
export declare const V19_X_ANALOG_JS_PLATFORM = "^3.0.0-alpha.
|
|
9
|
-
export declare const V19_X_ANALOG_JS_VITE_PLUGIN_ANGULAR = "^3.0.0-alpha.
|
|
10
|
-
export declare const V19_X_ANALOG_JS_VITEST_ANGULAR = "^3.0.0-alpha.
|
|
8
|
+
export declare const V19_X_ANALOG_JS_PLATFORM = "^3.0.0-alpha.93";
|
|
9
|
+
export declare const V19_X_ANALOG_JS_VITE_PLUGIN_ANGULAR = "^3.0.0-alpha.93";
|
|
10
|
+
export declare const V19_X_ANALOG_JS_VITEST_ANGULAR = "^3.0.0-alpha.93";
|
|
11
11
|
export declare const V19_X_NX_ANGULAR = "^22.0.0";
|
|
12
12
|
export declare const V19_X_NX_VITE = "^22.0.0";
|
|
13
13
|
export declare const V19_X_JSDOM = "^22.0.0";
|
|
@@ -15,5 +15,5 @@ export declare const V19_X_VITE_TSCONFIG_PATHS = "^4.2.0";
|
|
|
15
15
|
export declare const V19_X_VITEST = "^3.0.0";
|
|
16
16
|
export declare const V19_X_VITE = "^6.0.0";
|
|
17
17
|
export declare const NX_X_LATEST_VITE = "^8.0.0";
|
|
18
|
-
export declare const NX_X_LATEST_VITEST = "^
|
|
18
|
+
export declare const NX_X_LATEST_VITEST = "^5.0.0";
|
|
19
19
|
export declare const NX_X_LATEST_NX = "^23.0.0";
|
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
//#region packages/nx-plugin/src/utils/versions/ng_19_X/versions.ts
|
|
2
|
-
var V19_X_ANALOG_JS_ROUTER = "^3.0.0-alpha.
|
|
3
|
-
var V19_X_ANALOG_JS_CONTENT = "^3.0.0-alpha.
|
|
2
|
+
var V19_X_ANALOG_JS_ROUTER = "^3.0.0-alpha.93";
|
|
3
|
+
var V19_X_ANALOG_JS_CONTENT = "^3.0.0-alpha.93";
|
|
4
4
|
var V19_X_MARKED = "^18.0.0";
|
|
5
5
|
var V19_X_MARKED_GFM_HEADING_ID = "^4.1.1";
|
|
6
6
|
var V19_X_MARKED_HIGHLIGHT = "^2.2.1";
|
|
7
7
|
var V19_X_MARKED_MANGLE = "^1.1.10";
|
|
8
8
|
var V19_X_PRISMJS = "^1.29.0";
|
|
9
|
-
var V19_X_ANALOG_JS_PLATFORM = "^3.0.0-alpha.
|
|
10
|
-
var V19_X_ANALOG_JS_VITE_PLUGIN_ANGULAR = "^3.0.0-alpha.
|
|
11
|
-
var V19_X_ANALOG_JS_VITEST_ANGULAR = "^3.0.0-alpha.
|
|
9
|
+
var V19_X_ANALOG_JS_PLATFORM = "^3.0.0-alpha.93";
|
|
10
|
+
var V19_X_ANALOG_JS_VITE_PLUGIN_ANGULAR = "^3.0.0-alpha.93";
|
|
11
|
+
var V19_X_ANALOG_JS_VITEST_ANGULAR = "^3.0.0-alpha.93";
|
|
12
12
|
var V19_X_NX_VITE = "^22.0.0";
|
|
13
13
|
var V19_X_JSDOM = "^22.0.0";
|
|
14
14
|
var V19_X_VITE_TSCONFIG_PATHS = "^4.2.0";
|
|
15
15
|
var V19_X_VITEST = "^3.0.0";
|
|
16
16
|
var V19_X_VITE = "^6.0.0";
|
|
17
17
|
var NX_X_LATEST_VITE = "^8.0.0";
|
|
18
|
-
var NX_X_LATEST_VITEST = "^
|
|
18
|
+
var NX_X_LATEST_VITEST = "^5.0.0";
|
|
19
19
|
var NX_X_LATEST_NX = "^23.0.0";
|
|
20
20
|
//#endregion
|
|
21
21
|
exports.NX_X_LATEST_NX = NX_X_LATEST_NX;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"versions.js","names":[],"sources":["../../../../../../../../../nx-plugin/src/utils/versions/ng_19_X/versions.ts"],"sourcesContent":["// V19_X\nexport const V19_X_ANALOG_JS_ROUTER = '^3.0.0-alpha.
|
|
1
|
+
{"version":3,"file":"versions.js","names":[],"sources":["../../../../../../../../../nx-plugin/src/utils/versions/ng_19_X/versions.ts"],"sourcesContent":["// V19_X\nexport const V19_X_ANALOG_JS_ROUTER = '^3.0.0-alpha.93';\nexport const V19_X_ANALOG_JS_CONTENT = '^3.0.0-alpha.93';\nexport const V19_X_MARKED = '^18.0.0';\nexport const V19_X_MARKED_GFM_HEADING_ID = '^4.1.1';\nexport const V19_X_MARKED_HIGHLIGHT = '^2.2.1';\nexport const V19_X_MARKED_MANGLE = '^1.1.10';\nexport const V19_X_PRISMJS = '^1.29.0';\n\n// devDependencies\nexport const V19_X_ANALOG_JS_PLATFORM = '^3.0.0-alpha.93';\nexport const V19_X_ANALOG_JS_VITE_PLUGIN_ANGULAR = '^3.0.0-alpha.93';\nexport const V19_X_ANALOG_JS_VITEST_ANGULAR = '^3.0.0-alpha.93';\nexport const V19_X_NX_ANGULAR = '^22.0.0';\nexport const V19_X_NX_VITE = '^22.0.0';\nexport const V19_X_JSDOM = '^22.0.0';\nexport const V19_X_VITE_TSCONFIG_PATHS = '^4.2.0';\nexport const V19_X_VITEST = '^3.0.0';\nexport const V19_X_VITE = '^6.0.0';\nexport const NX_X_LATEST_VITE = '^8.0.0';\nexport const NX_X_LATEST_VITEST = '^5.0.0';\nexport const NX_X_LATEST_NX = '^23.0.0';\n"],"mappings":";AACA,IAAa,yBAAyB;AACtC,IAAa,0BAA0B;AACvC,IAAa,eAAe;AAC5B,IAAa,8BAA8B;AAC3C,IAAa,yBAAyB;AACtC,IAAa,sBAAsB;AACnC,IAAa,gBAAgB;AAG7B,IAAa,2BAA2B;AACxC,IAAa,sCAAsC;AACnD,IAAa,iCAAiC;AAE9C,IAAa,gBAAgB;AAC7B,IAAa,cAAc;AAC3B,IAAa,4BAA4B;AACzC,IAAa,eAAe;AAC5B,IAAa,aAAa;AAC1B,IAAa,mBAAmB;AAChC,IAAa,qBAAqB;AAClC,IAAa,iBAAiB"}
|
package/src/lib/options.d.ts
CHANGED
|
@@ -30,6 +30,14 @@ export interface PrerenderOptions {
|
|
|
30
30
|
postRenderingHooks?: ((routes: PrerenderRoute) => Promise<void>)[];
|
|
31
31
|
}
|
|
32
32
|
export interface I18nOptions {
|
|
33
|
+
/** Path to the translation loader module, relative to the app root. */
|
|
34
|
+
loader?: string;
|
|
35
|
+
/**
|
|
36
|
+
* Fixed-locale SSR workers. Automatically enabled for supported
|
|
37
|
+
* Node server builds with a loader and multiple locales. Set false to opt out.
|
|
38
|
+
* Set true to require workers and fail on unsupported configurations.
|
|
39
|
+
*/
|
|
40
|
+
workers?: boolean;
|
|
33
41
|
/**
|
|
34
42
|
* The default/source locale for the application.
|
|
35
43
|
*/
|
|
@@ -115,7 +123,7 @@ export interface Options {
|
|
|
115
123
|
i18n?: I18nOptions;
|
|
116
124
|
/** Opt-in experimental features. */
|
|
117
125
|
experimental?: {
|
|
118
|
-
/**
|
|
126
|
+
/** Opt into generated route types and typed navigation helpers. */
|
|
119
127
|
typedRouting?: boolean | import("./typed-routes-plugin.js").TypedRoutingOptions;
|
|
120
128
|
/**
|
|
121
129
|
* Opt into progressive streaming SSR. When enabled, the SSR build patches
|
|
@@ -1,13 +1,5 @@
|
|
|
1
1
|
import type { Plugin } from "vite";
|
|
2
|
-
/**
|
|
3
|
-
* Minimum Angular major whose compiled `@angular/core` FESM matches the
|
|
4
|
-
* streaming patch anchors. Incremental hydration is a stable public API from
|
|
5
|
-
* v20 (`withIncrementalHydration`, `@publicApi 20.0`), but v20's FESM inlines
|
|
6
|
-
* the injection anchor's `DeferBlockStateEnd` profiler event to its numeric
|
|
7
|
-
* ordinal, whereas v21+ keeps the symbolic `ProfilerEvent.DeferBlockStateEnd`
|
|
8
|
-
* form the anchor matches on. Keying on the literal ordinal would be fragile
|
|
9
|
-
* (enum values shift between versions), so v21 is the floor.
|
|
10
|
-
*/
|
|
2
|
+
/** Minimum Angular major qualified for streaming; the actual runtime shape is checked below. */
|
|
11
3
|
export declare const MIN_STREAMING_ANGULAR_MAJOR = 21;
|
|
12
4
|
/**
|
|
13
5
|
* Whether the streaming SSR patch can be applied to the installed Angular.
|
|
@@ -16,33 +8,9 @@ export declare const MIN_STREAMING_ANGULAR_MAJOR = 21;
|
|
|
16
8
|
* build time and falls back to buffered rendering.
|
|
17
9
|
*/
|
|
18
10
|
export declare function streamingSupportedOnAngular(major: number | null): boolean;
|
|
19
|
-
/**
|
|
20
|
-
* Pure transform that injects the streaming-SSR per-block resolution hook into
|
|
21
|
-
* `@angular/core`'s compiled output. It is the same class of transform as
|
|
22
|
-
* `i18nDefRegistryPlugin` in ./ssr-build-plugin — a string patch of Angular's
|
|
23
|
-
* bundle applied only to SSR builds. Exported separately so it can be unit
|
|
24
|
-
* tested against a bundle string.
|
|
25
|
-
*
|
|
26
|
-
* Two edits, both keyed on single-occurrence anchors in the module that holds
|
|
27
|
-
* the defer runtime:
|
|
28
|
-
* 1. Inside `applyDeferBlockState`, fire `globalThis.__analogSsrDeferCapture`
|
|
29
|
-
* when a `@defer` block reaches `Complete` on the server, passing the
|
|
30
|
-
* block's live `lContainer` — this is the per-block resolution signal a
|
|
31
|
-
* streaming renderer consumes.
|
|
32
|
-
* 2. Expose `collectNativeNodesInLContainer` via `globalThis.__analogSsrInternals`
|
|
33
|
-
* so the renderer can serialize a block's subtree.
|
|
34
|
-
*
|
|
35
|
-
* Returns `null` when the module is not the one carrying the defer runtime, so
|
|
36
|
-
* it is a no-op on every other Angular module.
|
|
37
|
-
*/
|
|
11
|
+
/** Inject capture before the named defer function's final profiler call, preserving its original source. */
|
|
38
12
|
export declare function injectDeferStreamingHook(code: string): string | null;
|
|
39
|
-
/**
|
|
40
|
-
* Classify an `@angular/core` module for the streaming patch. The patch anchors
|
|
41
|
-
* on internal symbol names, so when Angular changes those the transform would
|
|
42
|
-
* otherwise become a silent no-op and streaming would degrade to buffered with
|
|
43
|
-
* no signal. This distinguishes "not the target module" (skip quietly) from
|
|
44
|
-
* "this IS the `@defer` runtime module but the anchors drifted" (worth warning).
|
|
45
|
-
*/
|
|
13
|
+
/** Inspect the named function's final profiler call without depending on enum ordinals. */
|
|
46
14
|
export declare function inspectAngularCoreModule(code: string): {
|
|
47
15
|
kind: "not-target";
|
|
48
16
|
} | {
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { parseSync } from "oxc-parser";
|
|
1
2
|
/**
|
|
2
3
|
* Whether the streaming SSR patch can be applied to the installed Angular.
|
|
3
4
|
* A `null` major (version undetectable) returns `true`: don't block on a failed
|
|
@@ -7,49 +8,46 @@
|
|
|
7
8
|
function streamingSupportedOnAngular(major) {
|
|
8
9
|
return major === null || major >= 21;
|
|
9
10
|
}
|
|
10
|
-
|
|
11
|
-
* Pure transform that injects the streaming-SSR per-block resolution hook into
|
|
12
|
-
* `@angular/core`'s compiled output. It is the same class of transform as
|
|
13
|
-
* `i18nDefRegistryPlugin` in ./ssr-build-plugin — a string patch of Angular's
|
|
14
|
-
* bundle applied only to SSR builds. Exported separately so it can be unit
|
|
15
|
-
* tested against a bundle string.
|
|
16
|
-
*
|
|
17
|
-
* Two edits, both keyed on single-occurrence anchors in the module that holds
|
|
18
|
-
* the defer runtime:
|
|
19
|
-
* 1. Inside `applyDeferBlockState`, fire `globalThis.__analogSsrDeferCapture`
|
|
20
|
-
* when a `@defer` block reaches `Complete` on the server, passing the
|
|
21
|
-
* block's live `lContainer` — this is the per-block resolution signal a
|
|
22
|
-
* streaming renderer consumes.
|
|
23
|
-
* 2. Expose `collectNativeNodesInLContainer` via `globalThis.__analogSsrInternals`
|
|
24
|
-
* so the renderer can serialize a block's subtree.
|
|
25
|
-
*
|
|
26
|
-
* Returns `null` when the module is not the one carrying the defer runtime, so
|
|
27
|
-
* it is a no-op on every other Angular module.
|
|
28
|
-
*/
|
|
29
|
-
function injectDeferStreamingHook(code) {
|
|
30
|
-
const END_ANCHOR = "profiler(ProfilerEvent.DeferBlockStateEnd);";
|
|
31
|
-
if (!code.includes("function applyDeferBlockState(") || !code.includes(END_ANCHOR)) return null;
|
|
32
|
-
let out = code.replace(END_ANCHOR, "try { if (newState === DeferBlockState.Complete && typeof ngServerMode !== 'undefined' && ngServerMode && typeof globalThis.__analogSsrDeferCapture === 'function') { globalThis.__analogSsrDeferCapture({ ssrUniqueId: lDetails[SSR_UNIQUE_ID], lContainer, hostLView }); } } catch (e) {}\n " + END_ANCHOR);
|
|
33
|
-
if (code.includes("function collectNativeNodesInLContainer(")) out += "\nglobalThis.__analogSsrInternals = Object.assign(globalThis.__analogSsrInternals || {}, { collectNativeNodesInLContainer });\n";
|
|
34
|
-
return out;
|
|
35
|
-
}
|
|
36
|
-
/**
|
|
37
|
-
* Classify an `@angular/core` module for the streaming patch. The patch anchors
|
|
38
|
-
* on internal symbol names, so when Angular changes those the transform would
|
|
39
|
-
* otherwise become a silent no-op and streaming would degrade to buffered with
|
|
40
|
-
* no signal. This distinguishes "not the target module" (skip quietly) from
|
|
41
|
-
* "this IS the `@defer` runtime module but the anchors drifted" (worth warning).
|
|
42
|
-
*/
|
|
43
|
-
function inspectAngularCoreModule(code) {
|
|
11
|
+
function analyzeDeferRuntime(code) {
|
|
44
12
|
if (!code.includes("function applyDeferBlockState(")) return { kind: "not-target" };
|
|
45
|
-
const
|
|
46
|
-
if (
|
|
47
|
-
|
|
48
|
-
|
|
13
|
+
const parsed = parseSync("angular-core.mjs", code);
|
|
14
|
+
if (parsed.errors.length) return {
|
|
15
|
+
kind: "drifted",
|
|
16
|
+
reason: "invalid Angular core JavaScript"
|
|
17
|
+
};
|
|
18
|
+
const fn = parsed.program.body.find((node) => node.type === "FunctionDeclaration" && node.id?.name === "applyDeferBlockState");
|
|
19
|
+
if (!fn || fn.type !== "FunctionDeclaration" || !fn.body) return { kind: "not-target" };
|
|
20
|
+
if (fn.params.map((param) => param.type === "Identifier" ? param.name : "").join(",") !== "newState,lDetails,lContainer,tNode,hostLView") return {
|
|
49
21
|
kind: "drifted",
|
|
50
|
-
reason:
|
|
22
|
+
reason: "changed applyDeferBlockState parameters"
|
|
23
|
+
};
|
|
24
|
+
if (!parsed.program.body.some((node) => node.type === "FunctionDeclaration" && node.id?.name === "collectNativeNodesInLContainer")) return {
|
|
25
|
+
kind: "drifted",
|
|
26
|
+
reason: "missing collectNativeNodesInLContainer"
|
|
27
|
+
};
|
|
28
|
+
const offset = profilerEndOffset(fn.body.body[fn.body.body.length - 1]);
|
|
29
|
+
return offset === void 0 ? {
|
|
30
|
+
kind: "drifted",
|
|
31
|
+
reason: "missing DeferBlockStateEnd profiler anchor"
|
|
32
|
+
} : {
|
|
33
|
+
kind: "patchable",
|
|
34
|
+
offset
|
|
51
35
|
};
|
|
52
36
|
}
|
|
37
|
+
function profilerEndOffset(statement) {
|
|
38
|
+
if (statement?.type !== "ExpressionStatement" || statement.expression.type !== "CallExpression") return;
|
|
39
|
+
const call = statement.expression;
|
|
40
|
+
if (call.callee.type !== "Identifier" || call.callee.name !== "profiler" || call.arguments.length !== 1) return;
|
|
41
|
+
return isEndEvent(call.arguments[0]) ? statement.start : void 0;
|
|
42
|
+
}
|
|
43
|
+
function isEndEvent(event) {
|
|
44
|
+
if (event?.type === "Literal") return typeof event.value === "number";
|
|
45
|
+
return event?.type === "MemberExpression" && !event.computed && event.object.type === "Identifier" && event.object.name === "ProfilerEvent" && event.property.type === "Identifier" && event.property.name === "DeferBlockStateEnd";
|
|
46
|
+
}
|
|
47
|
+
function patchDeferRuntime(code, offset) {
|
|
48
|
+
if (code.includes("globalThis.__analogSsrDeferCapture({")) return code;
|
|
49
|
+
return code.slice(0, offset) + "try { if (newState === DeferBlockState.Complete && typeof ngServerMode !== 'undefined' && ngServerMode && typeof globalThis.__analogSsrDeferCapture === 'function') { globalThis.__analogSsrDeferCapture({ ssrUniqueId: lDetails[SSR_UNIQUE_ID], lContainer, hostLView }); } } catch (e) {}\n " + code.slice(offset) + "\nglobalThis.__analogSsrInternals = Object.assign(globalThis.__analogSsrInternals || {}, { collectNativeNodesInLContainer });\n";
|
|
50
|
+
}
|
|
53
51
|
/**
|
|
54
52
|
* Vite plugin that applies {@link injectDeferStreamingHook} to `@angular/core`
|
|
55
53
|
* during SSR builds, so `@analogjs/router`'s `renderStream` can flush `@defer`
|
|
@@ -62,32 +60,40 @@ function inspectAngularCoreModule(code) {
|
|
|
62
60
|
* that falls back to buffered rendering.
|
|
63
61
|
*/
|
|
64
62
|
function deferStreamingPlugin() {
|
|
65
|
-
|
|
66
|
-
|
|
63
|
+
const applied = /* @__PURE__ */ new Set();
|
|
64
|
+
const warnedDrift = /* @__PURE__ */ new Set();
|
|
67
65
|
return {
|
|
68
66
|
name: "analogjs-defer-streaming",
|
|
69
67
|
enforce: "post",
|
|
68
|
+
config() {
|
|
69
|
+
return {
|
|
70
|
+
ssr: { noExternal: ["@angular/core"] },
|
|
71
|
+
environments: { ssr: { optimizeDeps: { exclude: ["@angular/core"] } } }
|
|
72
|
+
};
|
|
73
|
+
},
|
|
70
74
|
transform: {
|
|
71
75
|
filter: { id: /\/@angular\/core\// },
|
|
72
76
|
handler(code, _id, options) {
|
|
73
77
|
if (!options?.ssr) return;
|
|
74
|
-
const
|
|
78
|
+
const environment = this.environment.name;
|
|
79
|
+
const info = analyzeDeferRuntime(code);
|
|
75
80
|
if (info.kind === "not-target") return;
|
|
76
81
|
if (info.kind === "drifted") {
|
|
77
|
-
if (!warnedDrift) {
|
|
78
|
-
warnedDrift
|
|
82
|
+
if (!warnedDrift.has(environment)) {
|
|
83
|
+
warnedDrift.add(environment);
|
|
79
84
|
this.warn(`experimental streaming SSR: found @angular/core's @defer runtime but could not apply the resolution hook (${info.reason}). The installed Angular version likely changed internals the patch depends on; streaming will fall back to buffered rendering.`);
|
|
80
85
|
}
|
|
81
86
|
return;
|
|
82
87
|
}
|
|
83
|
-
const out =
|
|
84
|
-
|
|
85
|
-
applied = true;
|
|
88
|
+
const out = patchDeferRuntime(code, info.offset);
|
|
89
|
+
applied.add(environment);
|
|
86
90
|
return { code: out };
|
|
87
91
|
}
|
|
88
92
|
},
|
|
89
93
|
buildEnd() {
|
|
90
|
-
|
|
94
|
+
const environment = this.environment.name;
|
|
95
|
+
if (environment !== "ssr") return;
|
|
96
|
+
if (!applied.has(environment) && !warnedDrift.has(environment)) this.warn("experimental streaming SSR is enabled but @angular/core's @defer runtime module was never encountered during the SSR build, so the resolution hook was not injected. Streaming will fall back to buffered rendering.");
|
|
91
97
|
}
|
|
92
98
|
};
|
|
93
99
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"defer-streaming-plugin.js","names":[],"sources":["../../../../src/lib/ssr/defer-streaming-plugin.ts"],"sourcesContent":["import type { Plugin } from 'vite';\
|
|
1
|
+
{"version":3,"file":"defer-streaming-plugin.js","names":[],"sources":["../../../../src/lib/ssr/defer-streaming-plugin.ts"],"sourcesContent":["import type { Plugin } from 'vite';\nimport { parseSync, type Argument, type Statement } from 'oxc-parser';\n\n/** Minimum Angular major qualified for streaming; the actual runtime shape is checked below. */\nexport const MIN_STREAMING_ANGULAR_MAJOR = 21;\n\n/**\n * Whether the streaming SSR patch can be applied to the installed Angular.\n * A `null` major (version undetectable) returns `true`: don't block on a failed\n * detection — the plugin's anchor-drift detection catches a real mismatch at\n * build time and falls back to buffered rendering.\n */\nexport function streamingSupportedOnAngular(major: number | null): boolean {\n return major === null || major >= MIN_STREAMING_ANGULAR_MAJOR;\n}\n\ntype DeferAnalysis =\n | { kind: 'not-target' }\n | { kind: 'patchable'; offset: number }\n | { kind: 'drifted'; reason: string };\n\nfunction analyzeDeferRuntime(code: string): DeferAnalysis {\n if (!code.includes('function applyDeferBlockState('))\n return { kind: 'not-target' };\n const parsed = parseSync('angular-core.mjs', code);\n if (parsed.errors.length)\n return { kind: 'drifted', reason: 'invalid Angular core JavaScript' };\n const fn = parsed.program.body.find(\n (node) =>\n node.type === 'FunctionDeclaration' &&\n node.id?.name === 'applyDeferBlockState',\n );\n if (!fn || fn.type !== 'FunctionDeclaration' || !fn.body)\n return { kind: 'not-target' };\n const names = fn.params\n .map((param) => (param.type === 'Identifier' ? param.name : ''))\n .join(',');\n if (names !== 'newState,lDetails,lContainer,tNode,hostLView')\n return {\n kind: 'drifted',\n reason: 'changed applyDeferBlockState parameters',\n };\n const collector = parsed.program.body.some(\n (node) =>\n node.type === 'FunctionDeclaration' &&\n node.id?.name === 'collectNativeNodesInLContainer',\n );\n if (!collector)\n return {\n kind: 'drifted',\n reason: 'missing collectNativeNodesInLContainer',\n };\n const offset = profilerEndOffset(fn.body.body[fn.body.body.length - 1]);\n return offset === undefined\n ? { kind: 'drifted', reason: 'missing DeferBlockStateEnd profiler anchor' }\n : { kind: 'patchable', offset };\n}\n\nfunction profilerEndOffset(\n statement: Statement | undefined,\n): number | undefined {\n if (\n statement?.type !== 'ExpressionStatement' ||\n statement.expression.type !== 'CallExpression'\n )\n return;\n const call = statement.expression;\n if (\n call.callee.type !== 'Identifier' ||\n call.callee.name !== 'profiler' ||\n call.arguments.length !== 1\n )\n return;\n return isEndEvent(call.arguments[0]) ? statement.start : undefined;\n}\n\nfunction isEndEvent(event: Argument | undefined): boolean {\n if (event?.type === 'Literal') return typeof event.value === 'number';\n return (\n event?.type === 'MemberExpression' &&\n !event.computed &&\n event.object.type === 'Identifier' &&\n event.object.name === 'ProfilerEvent' &&\n event.property.type === 'Identifier' &&\n event.property.name === 'DeferBlockStateEnd'\n );\n}\n\nfunction patchDeferRuntime(code: string, offset: number): string {\n if (code.includes('globalThis.__analogSsrDeferCapture({')) return code;\n const capture =\n `try { if (newState === DeferBlockState.Complete && ` +\n `typeof ngServerMode !== 'undefined' && ngServerMode && ` +\n `typeof globalThis.__analogSsrDeferCapture === 'function') { ` +\n `globalThis.__analogSsrDeferCapture({ ssrUniqueId: lDetails[SSR_UNIQUE_ID], lContainer, hostLView }); } } catch (e) {}\\n `;\n return (\n code.slice(0, offset) +\n capture +\n code.slice(offset) +\n '\\nglobalThis.__analogSsrInternals = Object.assign(globalThis.__analogSsrInternals || {}, { collectNativeNodesInLContainer });\\n'\n );\n}\n\n/** Inject capture before the named defer function's final profiler call, preserving its original source. */\nexport function injectDeferStreamingHook(code: string): string | null {\n const info = analyzeDeferRuntime(code);\n return info.kind === 'patchable'\n ? patchDeferRuntime(code, info.offset)\n : null;\n}\n\n/** Inspect the named function's final profiler call without depending on enum ordinals. */\nexport function inspectAngularCoreModule(\n code: string,\n):\n | { kind: 'not-target' }\n | { kind: 'patchable' }\n | { kind: 'drifted'; reason: string } {\n const info = analyzeDeferRuntime(code);\n return info.kind === 'patchable' ? { kind: 'patchable' } : info;\n}\n\n/**\n * Vite plugin that applies {@link injectDeferStreamingHook} to `@angular/core`\n * during SSR builds, so `@analogjs/router`'s `renderStream` can flush `@defer`\n * blocks as they resolve on the server — without hand-patching node_modules.\n *\n * Only active for SSR. Mirrors the enforce/filter/ssr-gate shape of\n * `i18nDefRegistryPlugin`. If the `@defer` runtime module is found but its\n * anchors have drifted (Angular changed internals), or if it is never\n * encountered at all, the plugin warns rather than silently producing a build\n * that falls back to buffered rendering.\n */\nexport function deferStreamingPlugin(): Plugin {\n const applied = new Set<string>();\n const warnedDrift = new Set<string>();\n return {\n name: 'analogjs-defer-streaming',\n enforce: 'post',\n config() {\n return {\n ssr: { noExternal: ['@angular/core'] },\n environments: { ssr: { optimizeDeps: { exclude: ['@angular/core'] } } },\n };\n },\n transform: {\n filter: {\n id: /\\/@angular\\/core\\//,\n },\n handler(code, _id, options) {\n if (!options?.ssr) return;\n const environment = this.environment.name;\n const info = analyzeDeferRuntime(code);\n if (info.kind === 'not-target') return;\n if (info.kind === 'drifted') {\n if (!warnedDrift.has(environment)) {\n warnedDrift.add(environment);\n this.warn(\n `experimental streaming SSR: found @angular/core's @defer runtime ` +\n `but could not apply the resolution hook (${info.reason}). The ` +\n `installed Angular version likely changed internals the patch ` +\n `depends on; streaming will fall back to buffered rendering.`,\n );\n }\n return;\n }\n const out = patchDeferRuntime(code, info.offset);\n applied.add(environment);\n return { code: out };\n },\n },\n buildEnd() {\n // Require coverage from the SSR service. A later Nitro rebundle may\n // also encounter Angular modules imported by endpoint handlers.\n const environment = this.environment.name;\n if (environment !== 'ssr') return;\n if (!applied.has(environment) && !warnedDrift.has(environment)) {\n this.warn(\n `experimental streaming SSR is enabled but @angular/core's @defer ` +\n `runtime module was never encountered during the SSR build, so the ` +\n `resolution hook was not injected. Streaming will fall back to ` +\n `buffered rendering.`,\n );\n }\n },\n };\n}\n"],"mappings":";;;;;;;AAYA,SAAgB,4BAA4B,OAA+B;AACzE,QAAO,UAAU,QAAQ,SAAA;;AAQ3B,SAAS,oBAAoB,MAA6B;AACxD,KAAI,CAAC,KAAK,SAAS,iCAAiC,CAClD,QAAO,EAAE,MAAM,cAAc;CAC/B,MAAM,SAAS,UAAU,oBAAoB,KAAK;AAClD,KAAI,OAAO,OAAO,OAChB,QAAO;EAAE,MAAM;EAAW,QAAQ;EAAmC;CACvE,MAAM,KAAK,OAAO,QAAQ,KAAK,MAC5B,SACC,KAAK,SAAS,yBACd,KAAK,IAAI,SAAS,uBACrB;AACD,KAAI,CAAC,MAAM,GAAG,SAAS,yBAAyB,CAAC,GAAG,KAClD,QAAO,EAAE,MAAM,cAAc;AAI/B,KAHc,GAAG,OACd,KAAK,UAAW,MAAM,SAAS,eAAe,MAAM,OAAO,GAAI,CAC/D,KAAK,IAAI,KACE,+CACZ,QAAO;EACL,MAAM;EACN,QAAQ;EACT;AAMH,KAAI,CALc,OAAO,QAAQ,KAAK,MACnC,SACC,KAAK,SAAS,yBACd,KAAK,IAAI,SAAS,iCACrB,CAEC,QAAO;EACL,MAAM;EACN,QAAQ;EACT;CACH,MAAM,SAAS,kBAAkB,GAAG,KAAK,KAAK,GAAG,KAAK,KAAK,SAAS,GAAG;AACvE,QAAO,WAAW,KAAA,IACd;EAAE,MAAM;EAAW,QAAQ;EAA8C,GACzE;EAAE,MAAM;EAAa;EAAQ;;AAGnC,SAAS,kBACP,WACoB;AACpB,KACE,WAAW,SAAS,yBACpB,UAAU,WAAW,SAAS,iBAE9B;CACF,MAAM,OAAO,UAAU;AACvB,KACE,KAAK,OAAO,SAAS,gBACrB,KAAK,OAAO,SAAS,cACrB,KAAK,UAAU,WAAW,EAE1B;AACF,QAAO,WAAW,KAAK,UAAU,GAAG,GAAG,UAAU,QAAQ,KAAA;;AAG3D,SAAS,WAAW,OAAsC;AACxD,KAAI,OAAO,SAAS,UAAW,QAAO,OAAO,MAAM,UAAU;AAC7D,QACE,OAAO,SAAS,sBAChB,CAAC,MAAM,YACP,MAAM,OAAO,SAAS,gBACtB,MAAM,OAAO,SAAS,mBACtB,MAAM,SAAS,SAAS,gBACxB,MAAM,SAAS,SAAS;;AAI5B,SAAS,kBAAkB,MAAc,QAAwB;AAC/D,KAAI,KAAK,SAAS,uCAAuC,CAAE,QAAO;AAMlE,QACE,KAAK,MAAM,GAAG,OAAO,GALrB,oSAOA,KAAK,MAAM,OAAO,GAClB;;;;;;;;;;;;;AAkCJ,SAAgB,uBAA+B;CAC7C,MAAM,0BAAU,IAAI,KAAa;CACjC,MAAM,8BAAc,IAAI,KAAa;AACrC,QAAO;EACL,MAAM;EACN,SAAS;EACT,SAAS;AACP,UAAO;IACL,KAAK,EAAE,YAAY,CAAC,gBAAgB,EAAE;IACtC,cAAc,EAAE,KAAK,EAAE,cAAc,EAAE,SAAS,CAAC,gBAAgB,EAAE,EAAE,EAAE;IACxE;;EAEH,WAAW;GACT,QAAQ,EACN,IAAI,sBACL;GACD,QAAQ,MAAM,KAAK,SAAS;AAC1B,QAAI,CAAC,SAAS,IAAK;IACnB,MAAM,cAAc,KAAK,YAAY;IACrC,MAAM,OAAO,oBAAoB,KAAK;AACtC,QAAI,KAAK,SAAS,aAAc;AAChC,QAAI,KAAK,SAAS,WAAW;AAC3B,SAAI,CAAC,YAAY,IAAI,YAAY,EAAE;AACjC,kBAAY,IAAI,YAAY;AAC5B,WAAK,KACH,6GAC8C,KAAK,OAAO,iIAG3D;;AAEH;;IAEF,MAAM,MAAM,kBAAkB,MAAM,KAAK,OAAO;AAChD,YAAQ,IAAI,YAAY;AACxB,WAAO,EAAE,MAAM,KAAK;;GAEvB;EACD,WAAW;GAGT,MAAM,cAAc,KAAK,YAAY;AACrC,OAAI,gBAAgB,MAAO;AAC3B,OAAI,CAAC,QAAQ,IAAI,YAAY,IAAI,CAAC,YAAY,IAAI,YAAY,CAC5D,MAAK,KACH,uNAID;;EAGN"}
|
|
@@ -23,4 +23,4 @@ export declare function ssrBuildPlugin(): vite.Plugin[];
|
|
|
23
23
|
* Only active when the platform's `i18n` option is configured.
|
|
24
24
|
* Only transforms `@angular/core` modules in SSR builds.
|
|
25
25
|
*/
|
|
26
|
-
export declare function i18nDefRegistryPlugin(): Plugin;
|
|
26
|
+
export declare function i18nDefRegistryPlugin(): vite.Plugin;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ssr-build-plugin.js","names":[],"sources":["../../../../src/lib/ssr/ssr-build-plugin.ts"],"sourcesContent":["import * as vite from 'vite';\n\n/**\n * SSR build patches for Angular platform-server, Zone.js, and Domino.\n *\n * **Why each patch exists:**\n * - zone-node: removes a `const global = globalThis` alias that shadows the\n * real global in strict mode.\n * - platform-server: rewrites `xhr2.XMLHttpRequest` for CJS/ESM compat and\n * replaces bare `global` references with `globalThis`.\n * - xhr2: strips Node-specific `os`/`process` references for SSR bundling.\n * - domino/sloppy.js: replaces `with()` statements that are illegal in ESM.\n */\nexport function ssrBuildPlugin(): vite.Plugin[] {\n const plugins: vite.Plugin[] = [\n {\n name: 'analogjs-ssr-build-plugin',\n apply: 'build',\n config() {\n return {\n ssr: {\n noExternal: ['xhr2'],\n },\n };\n },\n transform: {\n filter: {\n id: /zone-node|platform-server|xhr2\\.js|domino\\/lib\\/sloppy\\.js/,\n },\n handler(code, id) {\n if (\n id.includes('zone-node') &&\n code.includes('const global = globalThis;')\n ) {\n return {\n code: code.replace('const global = globalThis;', ''),\n };\n }\n\n if (id.includes('platform-server')) {\n let result = code.replace(\n 'new xhr2.XMLHttpRequest',\n 'new (xhr2.default.XMLHttpRequest || xhr2.default)',\n );\n\n // Narrowly scoped text replacement of the bare `global`\n // identifier. Matching `global.`, `global,` and ` global[`\n // targets the known occurrences in the @angular/platform-server\n // bundle while leaving strings, comments and asset paths that\n // merely contain the word `global` untouched (see #2426).\n result = result\n .replaceAll('global.', 'globalThis.')\n .replaceAll('global,', 'globalThis,')\n .replaceAll(' global[', ' globalThis[');\n\n return { code: result };\n }\n\n if (id.includes(vite.normalizePath('xhr2.js'))) {\n return {\n code: code\n .replace('os.type()', `''`)\n .replace('os.arch()', `''`)\n .replace('process.versions.node', `'node'`)\n .replace('process.versions.v8', `'v8'`),\n };\n }\n\n if (id.includes(vite.normalizePath('domino/lib/sloppy.js'))) {\n return {\n code: code.replace(/with\\(/gi, 'if('),\n };\n }\n\n return;\n },\n },\n },\n ];\n\n return plugins;\n}\n\n/**\n * Vite plugin that patches `@angular/core`'s `getComponentId()` to\n * mirror every compiled component definition to a global Set, bypassing\n * the `ngServerMode` guard that normally prevents registration on the\n * server. The set lives at `globalThis.__ngComponentDefs` and is read by\n * `@analogjs/router`'s SSR render function to null cached `tView`\n * objects between requests so that `$localize` tagged templates in\n * `consts()` re-evaluate with the freshly loaded translations.\n *\n * Only active when the platform's `i18n` option is configured.\n * Only transforms `@angular/core` modules in SSR builds.\n */\nexport function i18nDefRegistryPlugin(): Plugin {\n const DETECT_MARKER = 'GENERATED_COMP_IDS.set(compId, componentDef.type);';\n const RETURN_STMT = 'return compId;\\n}';\n\n return {\n name: 'analogjs-i18n-def-registry',\n enforce: 'post',\n\n transform: {\n filter: {\n id: /\\/@angular\\/core\\//,\n },\n handler(code, id, options) {\n if (!options?.ssr) return;\n if (!code.includes(DETECT_MARKER)) return;\n\n return {\n code: code.replace(\n RETURN_STMT,\n '(globalThis.__ngComponentDefs ??= new Set()).add(componentDef);\\n' +\n RETURN_STMT,\n ),\n };\n },\n },\n };\n}\n"],"mappings":";;;;;;;;;;;;;AAaA,SAAgB,iBAAgC;AAmE9C,QAlE+B,CAC7B;EACE,MAAM;EACN,OAAO;EACP,SAAS;AACP,UAAO,EACL,KAAK,EACH,YAAY,CAAC,OAAO,EACrB,EACF;;EAEH,WAAW;GACT,QAAQ,EACN,IAAI,8DACL;GACD,QAAQ,MAAM,IAAI;AAChB,QACE,GAAG,SAAS,YAAY,IACxB,KAAK,SAAS,6BAA6B,CAE3C,QAAO,EACL,MAAM,KAAK,QAAQ,8BAA8B,GAAG,EACrD;AAGH,QAAI,GAAG,SAAS,kBAAkB,EAAE;KAClC,IAAI,SAAS,KAAK,QAChB,2BACA,oDACD;AAOD,cAAS,OACN,WAAW,WAAW,cAAc,CACpC,WAAW,WAAW,cAAc,CACpC,WAAW,YAAY,eAAe;AAEzC,YAAO,EAAE,MAAM,QAAQ;;AAGzB,QAAI,GAAG,SAAS,KAAK,cAAc,UAAU,CAAC,CAC5C,QAAO,EACL,MAAM,KACH,QAAQ,aAAa,KAAK,CAC1B,QAAQ,aAAa,KAAK,CAC1B,QAAQ,yBAAyB,SAAS,CAC1C,QAAQ,uBAAuB,OAAO,EAC1C;AAGH,QAAI,GAAG,SAAS,KAAK,cAAc,uBAAuB,CAAC,CACzD,QAAO,EACL,MAAM,KAAK,QAAQ,YAAY,MAAM,EACtC;;GAKN;EACF,CACF"}
|
|
1
|
+
{"version":3,"file":"ssr-build-plugin.js","names":[],"sources":["../../../../src/lib/ssr/ssr-build-plugin.ts"],"sourcesContent":["import * as vite from 'vite';\n\n/**\n * SSR build patches for Angular platform-server, Zone.js, and Domino.\n *\n * **Why each patch exists:**\n * - zone-node: removes a `const global = globalThis` alias that shadows the\n * real global in strict mode.\n * - platform-server: rewrites `xhr2.XMLHttpRequest` for CJS/ESM compat and\n * replaces bare `global` references with `globalThis`.\n * - xhr2: strips Node-specific `os`/`process` references for SSR bundling.\n * - domino/sloppy.js: replaces `with()` statements that are illegal in ESM.\n */\nexport function ssrBuildPlugin(): vite.Plugin[] {\n const plugins: vite.Plugin[] = [\n {\n name: 'analogjs-ssr-build-plugin',\n apply: 'build',\n config() {\n return {\n ssr: {\n noExternal: ['xhr2'],\n },\n };\n },\n transform: {\n filter: {\n id: /zone-node|platform-server|xhr2\\.js|domino\\/lib\\/sloppy\\.js/,\n },\n handler(code, id) {\n if (\n id.includes('zone-node') &&\n code.includes('const global = globalThis;')\n ) {\n return {\n code: code.replace('const global = globalThis;', ''),\n };\n }\n\n if (id.includes('platform-server')) {\n let result = code.replace(\n 'new xhr2.XMLHttpRequest',\n 'new (xhr2.default.XMLHttpRequest || xhr2.default)',\n );\n\n // Narrowly scoped text replacement of the bare `global`\n // identifier. Matching `global.`, `global,` and ` global[`\n // targets the known occurrences in the @angular/platform-server\n // bundle while leaving strings, comments and asset paths that\n // merely contain the word `global` untouched (see #2426).\n result = result\n .replaceAll('global.', 'globalThis.')\n .replaceAll('global,', 'globalThis,')\n .replaceAll(' global[', ' globalThis[');\n\n return { code: result };\n }\n\n if (id.includes(vite.normalizePath('xhr2.js'))) {\n return {\n code: code\n .replace('os.type()', `''`)\n .replace('os.arch()', `''`)\n .replace('process.versions.node', `'node'`)\n .replace('process.versions.v8', `'v8'`),\n };\n }\n\n if (id.includes(vite.normalizePath('domino/lib/sloppy.js'))) {\n return {\n code: code.replace(/with\\(/gi, 'if('),\n };\n }\n\n return;\n },\n },\n },\n ];\n\n return plugins;\n}\n\n/**\n * Vite plugin that patches `@angular/core`'s `getComponentId()` to\n * mirror every compiled component definition to a global Set, bypassing\n * the `ngServerMode` guard that normally prevents registration on the\n * server. The set lives at `globalThis.__ngComponentDefs` and is read by\n * `@analogjs/router`'s SSR render function to null cached `tView`\n * objects between requests so that `$localize` tagged templates in\n * `consts()` re-evaluate with the freshly loaded translations.\n *\n * Only active when the platform's `i18n` option is configured.\n * Only transforms `@angular/core` modules in SSR builds.\n */\nexport function i18nDefRegistryPlugin(): vite.Plugin {\n let fixedLocale = false;\n const DETECT_MARKER = 'GENERATED_COMP_IDS.set(compId, componentDef.type);';\n const RETURN_STMT = 'return compId;\\n}';\n\n return {\n name: 'analogjs-i18n-def-registry',\n enforce: 'post',\n configResolved(config) {\n const locale = config.define?.['ANALOG_I18N_FIXED_LOCALE'];\n fixedLocale =\n config.command === 'build' && !!locale && locale !== 'undefined';\n },\n\n transform: {\n filter: {\n id: /\\/@angular\\/core\\//,\n },\n handler(code, id, options) {\n if (fixedLocale || !options?.ssr) return;\n if (!code.includes(DETECT_MARKER)) return;\n\n return {\n code: code.replace(\n RETURN_STMT,\n '(globalThis.__ngComponentDefs ??= new Set()).add(componentDef);\\n' +\n RETURN_STMT,\n ),\n };\n },\n },\n };\n}\n"],"mappings":";;;;;;;;;;;;;AAaA,SAAgB,iBAAgC;AAmE9C,QAlE+B,CAC7B;EACE,MAAM;EACN,OAAO;EACP,SAAS;AACP,UAAO,EACL,KAAK,EACH,YAAY,CAAC,OAAO,EACrB,EACF;;EAEH,WAAW;GACT,QAAQ,EACN,IAAI,8DACL;GACD,QAAQ,MAAM,IAAI;AAChB,QACE,GAAG,SAAS,YAAY,IACxB,KAAK,SAAS,6BAA6B,CAE3C,QAAO,EACL,MAAM,KAAK,QAAQ,8BAA8B,GAAG,EACrD;AAGH,QAAI,GAAG,SAAS,kBAAkB,EAAE;KAClC,IAAI,SAAS,KAAK,QAChB,2BACA,oDACD;AAOD,cAAS,OACN,WAAW,WAAW,cAAc,CACpC,WAAW,WAAW,cAAc,CACpC,WAAW,YAAY,eAAe;AAEzC,YAAO,EAAE,MAAM,QAAQ;;AAGzB,QAAI,GAAG,SAAS,KAAK,cAAc,UAAU,CAAC,CAC5C,QAAO,EACL,MAAM,KACH,QAAQ,aAAa,KAAK,CAC1B,QAAQ,aAAa,KAAK,CAC1B,QAAQ,yBAAyB,SAAS,CAC1C,QAAQ,uBAAuB,OAAO,EAC1C;AAGH,QAAI,GAAG,SAAS,KAAK,cAAc,uBAAuB,CAAC,CACzD,QAAO,EACL,MAAM,KAAK,QAAQ,YAAY,MAAM,EACtC;;GAKN;EACF,CACF"}
|