@analogjs/platform 3.0.0-alpha.17 → 3.0.0-alpha.18
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 +3 -3
- package/src/index.d.ts +2 -0
- package/src/index.js +2 -1
- package/src/index.js.map +1 -1
- package/src/lib/clear-client-page-endpoint.js.map +1 -1
- package/src/lib/content/marked/index.js.map +1 -1
- package/src/lib/content/marked/marked-content-highlighter.js.map +1 -1
- package/src/lib/content/marked/marked-setup.service.js.map +1 -1
- package/src/lib/content/prism/angular.js.map +1 -1
- package/src/lib/content/prism/index.js.map +1 -1
- package/src/lib/content/prism/prism-highlighter.js.map +1 -1
- package/src/lib/content/shiki/index.js.map +1 -1
- package/src/lib/content/shiki/shiki-highlighter.js.map +1 -1
- package/src/lib/content-plugin.js.map +1 -1
- package/src/lib/deps-plugin.js.map +1 -1
- package/src/lib/json-ld-manifest-plugin.js.map +1 -1
- package/src/lib/nx-plugin/src/executors/vite/compat.js.map +1 -1
- package/src/lib/nx-plugin/src/executors/vite/vite.impl.js.map +1 -1
- package/src/lib/nx-plugin/src/executors/vite-dev-server/compat.js.map +1 -1
- package/src/lib/nx-plugin/src/executors/vite-dev-server/vite-dev-server.impl.js.map +1 -1
- package/src/lib/nx-plugin/src/executors/vitest/compat.js.map +1 -1
- package/src/lib/nx-plugin/src/executors/vitest/vitest.impl.js.map +1 -1
- package/src/lib/nx-plugin/src/generators/app/compat.js.map +1 -1
- package/src/lib/nx-plugin/src/generators/app/generator.js.map +1 -1
- package/src/lib/nx-plugin/src/generators/app/lib/add-analog-project-config.js.map +1 -1
- package/src/lib/nx-plugin/src/generators/app/lib/add-angular-app.js.map +1 -1
- package/src/lib/nx-plugin/src/generators/app/lib/add-files.js.map +1 -1
- package/src/lib/nx-plugin/src/generators/app/lib/add-home-page.js.map +1 -1
- package/src/lib/nx-plugin/src/generators/app/lib/add-tailwind-config.js.map +1 -1
- package/src/lib/nx-plugin/src/generators/app/lib/add-tailwind-helpers.js.map +1 -1
- package/src/lib/nx-plugin/src/generators/app/lib/cleanup-files.js.map +1 -1
- package/src/lib/nx-plugin/src/generators/app/lib/update-index-html.js.map +1 -1
- package/src/lib/nx-plugin/src/generators/app/versions/minimum-supported-versions.js.map +1 -1
- package/src/lib/nx-plugin/src/generators/app/versions/nx_18_X/versions.d.ts +5 -5
- package/src/lib/nx-plugin/src/generators/app/versions/nx_18_X/versions.js.map +1 -1
- package/src/lib/nx-plugin/src/generators/app/versions/tailwind-dependencies.js.map +1 -1
- package/src/lib/nx-plugin/src/generators/init/compat.js.map +1 -1
- package/src/lib/nx-plugin/src/generators/init/generator.js.map +1 -1
- package/src/lib/nx-plugin/src/generators/init/lib/add-analog-dependencies.js.map +1 -1
- package/src/lib/nx-plugin/src/generators/init/lib/update-app-tsconfig.js.map +1 -1
- package/src/lib/nx-plugin/src/generators/init/lib/update-build-target.js.map +1 -1
- package/src/lib/nx-plugin/src/generators/init/lib/update-git-ignore.js.map +1 -1
- package/src/lib/nx-plugin/src/generators/init/lib/update-index-html.js.map +1 -1
- package/src/lib/nx-plugin/src/generators/init/lib/update-main.js.map +1 -1
- package/src/lib/nx-plugin/src/generators/init/lib/update-package-json.js.map +1 -1
- package/src/lib/nx-plugin/src/generators/init/lib/update-serve-target.js.map +1 -1
- package/src/lib/nx-plugin/src/generators/init/lib/update-test-target.js.map +1 -1
- package/src/lib/nx-plugin/src/generators/init/lib/update-test-tsconfig.js.map +1 -1
- package/src/lib/nx-plugin/src/generators/page/compat.js.map +1 -1
- package/src/lib/nx-plugin/src/generators/page/generator.js.map +1 -1
- package/src/lib/nx-plugin/src/generators/preset/generator.js +7 -1
- package/src/lib/nx-plugin/src/generators/preset/generator.js.map +1 -1
- package/src/lib/nx-plugin/src/generators/setup-vitest/compat.js.map +1 -1
- package/src/lib/nx-plugin/src/generators/setup-vitest/generator.js.map +1 -1
- package/src/lib/nx-plugin/src/generators/setup-vitest/lib/add-analog-dependencies.js.map +1 -1
- package/src/lib/nx-plugin/src/generators/setup-vitest/lib/update-test-target.js.map +1 -1
- package/src/lib/nx-plugin/src/generators/setup-vitest/lib/update-tsconfig.js.map +1 -1
- package/src/lib/nx-plugin/src/utils/version-utils.js.map +1 -1
- package/src/lib/nx-plugin/src/utils/versions/dependencies.js.map +1 -1
- package/src/lib/nx-plugin/src/utils/versions/dev-dependencies.js.map +1 -1
- package/src/lib/nx-plugin/src/utils/versions/ng_17_X/versions.js.map +1 -1
- package/src/lib/nx-plugin/src/utils/versions/ng_18_X/versions.js.map +1 -1
- package/src/lib/nx-plugin/src/utils/versions/ng_19_X/versions.d.ts +5 -5
- package/src/lib/nx-plugin/src/utils/versions/ng_19_X/versions.js +5 -5
- package/src/lib/nx-plugin/src/utils/versions/ng_19_X/versions.js.map +1 -1
- package/src/lib/platform-plugin.js.map +1 -1
- package/src/lib/route-file-discovery.js.map +1 -1
- package/src/lib/route-generation-plugin.js.map +1 -1
- package/src/lib/route-manifest.js.map +1 -1
- package/src/lib/router-plugin.js.map +1 -1
- package/src/lib/ssr/inject-html-plugin.js.map +1 -1
- package/src/lib/ssr/ssr-build-plugin.js.map +1 -1
- package/src/lib/tailwind-preprocessor.d.ts +23 -0
- package/src/lib/tailwind-preprocessor.js +33 -0
- package/src/lib/tailwind-preprocessor.js.map +1 -0
- package/src/lib/typed-routes-plugin.js.map +1 -1
- package/src/lib/utils/rolldown.js.map +1 -1
- package/src/server-mode-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.18",
|
|
4
4
|
"description": "The fullstack meta-framework for Angular",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"author": "Brandon Roberts <robertsbt@gmail.com>",
|
|
@@ -31,8 +31,8 @@
|
|
|
31
31
|
"front-matter": "^4.0.2",
|
|
32
32
|
"tinyglobby": "^0.2.15",
|
|
33
33
|
"nitro": "3.0.260311-beta",
|
|
34
|
-
"@analogjs/vite-plugin-angular": "^3.0.0-alpha.
|
|
35
|
-
"@analogjs/vite-plugin-nitro": "^3.0.0-alpha.
|
|
34
|
+
"@analogjs/vite-plugin-angular": "^3.0.0-alpha.18",
|
|
35
|
+
"@analogjs/vite-plugin-nitro": "^3.0.0-alpha.18",
|
|
36
36
|
"rolldown": "^1.0.0-rc.11",
|
|
37
37
|
"vitefu": "^1.1.2"
|
|
38
38
|
},
|
package/src/index.d.ts
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import { platformPlugin } from "./lib/platform-plugin.js";
|
|
2
2
|
export type { Options, PrerenderSitemapConfig, TypedRouterOptions, PrerenderContentFile, SitemapConfig, SitemapEntry, SitemapExcludeRule, SitemapPriority, SitemapRouteDefinition, SitemapRouteInput, SitemapRouteSource, SitemapTransform } from "./lib/options.js";
|
|
3
3
|
export { routeGenerationPlugin } from "./lib/route-generation-plugin.js";
|
|
4
|
+
export { tailwindPreprocessor } from "./lib/tailwind-preprocessor.js";
|
|
5
|
+
export type { TailwindPreprocessorMode, TailwindPreprocessorOptions } from "./lib/tailwind-preprocessor.js";
|
|
4
6
|
export default platformPlugin;
|
package/src/index.js
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { routeGenerationPlugin } from "./lib/route-generation-plugin.js";
|
|
2
2
|
import { platformPlugin } from "./lib/platform-plugin.js";
|
|
3
|
+
import { tailwindPreprocessor } from "./lib/tailwind-preprocessor.js";
|
|
3
4
|
//#region packages/platform/src/index.ts
|
|
4
5
|
var src_default = platformPlugin;
|
|
5
6
|
//#endregion
|
|
6
|
-
export { src_default as default, routeGenerationPlugin };
|
|
7
|
+
export { src_default as default, routeGenerationPlugin, tailwindPreprocessor };
|
|
7
8
|
|
|
8
9
|
//# sourceMappingURL=index.js.map
|
package/src/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../src/index.ts"],"sourcesContent":["import { platformPlugin } from './lib/platform-plugin.js';\n\nexport type {\n Options,\n PrerenderSitemapConfig,\n TypedRouterOptions,\n PrerenderContentFile,\n SitemapConfig,\n SitemapEntry,\n SitemapExcludeRule,\n SitemapPriority,\n SitemapRouteDefinition,\n SitemapRouteInput,\n SitemapRouteSource,\n SitemapTransform,\n} from './lib/options.js';\nexport { routeGenerationPlugin } from './lib/route-generation-plugin.js';\nexport { tailwindPreprocessor } from './lib/tailwind-preprocessor.js';\nexport type {\n TailwindPreprocessorMode,\n TailwindPreprocessorOptions,\n} from './lib/tailwind-preprocessor.js';\nexport default platformPlugin;\n"],"mappings":";;;;AAsBA,IAAA,cAAe"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"clear-client-page-endpoint.js","names":[],"sources":["
|
|
1
|
+
{"version":3,"file":"clear-client-page-endpoint.js","names":[],"sources":["../../../src/lib/clear-client-page-endpoint.ts"],"sourcesContent":["import { Plugin, normalizePath } from 'vite';\n\nexport function clearClientPageEndpointsPlugin(): Plugin[] {\n return [\n {\n name: 'analogjs-platform-clear-client-page-endpoint',\n apply: 'build',\n config() {\n return {\n build: {\n rollupOptions: {\n onwarn(warning) {\n if (\n warning.message.includes('empty chunk') &&\n warning.message.endsWith('.server')\n ) {\n return;\n }\n },\n },\n },\n };\n },\n transform(_code, id, options) {\n if (\n !options?.ssr &&\n id.includes(normalizePath('src/app/pages')) &&\n id.endsWith('.server.ts')\n ) {\n return {\n code: 'export default undefined;',\n map: null,\n };\n }\n\n return;\n },\n },\n ];\n}\n"],"mappings":";;AAEA,SAAgB,iCAA2C;AACzD,QAAO,CACL;EACE,MAAM;EACN,OAAO;EACP,SAAS;AACP,UAAO,EACL,OAAO,EACL,eAAe,EACb,OAAO,SAAS;AACd,QACE,QAAQ,QAAQ,SAAS,cAAc,IACvC,QAAQ,QAAQ,SAAS,UAAU,CAEnC;MAGL,EACF,EACF;;EAEH,UAAU,OAAO,IAAI,SAAS;AAC5B,OACE,CAAC,SAAS,OACV,GAAG,SAAS,cAAc,gBAAgB,CAAC,IAC3C,GAAG,SAAS,aAAa,CAEzB,QAAO;IACL,MAAM;IACN,KAAK;IACN;;EAKN,CACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../../../../src/lib/content/marked/index.ts"],"sourcesContent":["import { MarkedExtension } from 'marked';\nimport { MarkedSetupService } from './marked-setup.service.js';\nimport { MarkedContentHighlighter } from './marked-content-highlighter.js';\n\nexport type WithMarkedOptions = {\n mangle?: boolean;\n extensions?: MarkedExtension[];\n};\n\nlet markedSetupInstance: MarkedSetupService;\n\nexport function getMarkedSetup(\n options?: WithMarkedOptions,\n highlighter?: MarkedContentHighlighter,\n): MarkedSetupService {\n markedSetupInstance ??= new MarkedSetupService(options, highlighter);\n return markedSetupInstance;\n}\n"],"mappings":";;AASA,IAAI;AAEJ,SAAgB,eACd,SACA,aACoB;AACpB,yBAAwB,IAAI,mBAAmB,SAAS,YAAY;AACpE,QAAO"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"marked-content-highlighter.js","names":[],"sources":["
|
|
1
|
+
{"version":3,"file":"marked-content-highlighter.js","names":[],"sources":["../../../../../src/lib/content/marked/marked-content-highlighter.ts"],"sourcesContent":["export abstract class MarkedContentHighlighter {\n augmentCodeBlock?(code: string, lang: string): string;\n abstract getHighlightExtension(): import('marked').MarkedExtension;\n}\n"],"mappings":";AAAA,IAAsB,2BAAtB,MAA+C"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"marked-setup.service.js","names":[],"sources":["
|
|
1
|
+
{"version":3,"file":"marked-setup.service.js","names":[],"sources":["../../../../../src/lib/content/marked/marked-setup.service.ts"],"sourcesContent":["import { marked, Parser, MarkedExtension } from 'marked';\nimport { gfmHeadingId } from 'marked-gfm-heading-id';\nimport { mangle } from 'marked-mangle';\n\nimport { MarkedContentHighlighter } from './marked-content-highlighter.js';\nimport { WithMarkedOptions } from './index.js';\n\nexport class MarkedSetupService {\n private readonly marked: typeof marked;\n\n constructor(\n private readonly options?: WithMarkedOptions | undefined,\n private readonly highlighter?: MarkedContentHighlighter | undefined,\n ) {\n const analogMarkedExtension: MarkedExtension = {\n pedantic: false,\n gfm: true,\n breaks: false,\n renderer: {\n code({ text, lang }) {\n // Let's do a language based detection like on GitHub\n // So we can still have non-interpreted mermaid code\n if (lang === 'mermaid') {\n return '<pre class=\"mermaid\">' + text + '</pre>';\n }\n\n if (!lang) {\n return '<pre><code>' + text + '</code></pre>';\n }\n\n if (highlighter?.augmentCodeBlock) {\n return highlighter?.augmentCodeBlock(text, lang);\n }\n\n return `<pre class=\"language-${lang}\"><code class=\"language-${lang}\">${text}</code></pre>`;\n },\n codespan({ text }) {\n return `<code>${text}</code>`;\n },\n paragraph({ tokens }) {\n const text = this.parser.parseInline(tokens);\n return `<p>${text}</p>`;\n },\n },\n };\n\n const extensions = [\n analogMarkedExtension,\n gfmHeadingId(),\n ...(options?.extensions || []),\n ];\n\n if (this.options?.mangle) {\n extensions.push(mangle());\n }\n\n if (this.highlighter) {\n extensions.push(this.highlighter.getHighlightExtension());\n }\n\n marked.use(...extensions);\n\n this.marked = marked;\n }\n\n getMarkedInstance(): typeof marked {\n return this.marked;\n }\n}\n"],"mappings":";;;;AAOA,IAAa,qBAAb,MAAgC;CAG9B,YACE,SACA,aACA;AAFiB,OAAA,UAAA;AACA,OAAA,cAAA;EAkCjB,MAAM,aAAa;GAhC4B;IAC7C,UAAU;IACV,KAAK;IACL,QAAQ;IACR,UAAU;KACR,KAAK,EAAE,MAAM,QAAQ;AAGnB,UAAI,SAAS,UACX,QAAO,4BAA0B,OAAO;AAG1C,UAAI,CAAC,KACH,QAAO,gBAAgB,OAAO;AAGhC,UAAI,aAAa,iBACf,QAAO,aAAa,iBAAiB,MAAM,KAAK;AAGlD,aAAO,wBAAwB,KAAK,0BAA0B,KAAK,IAAI,KAAK;;KAE9E,SAAS,EAAE,QAAQ;AACjB,aAAO,SAAS,KAAK;;KAEvB,UAAU,EAAE,UAAU;AAEpB,aAAO,MADM,KAAK,OAAO,YAAY,OAAO,CAC1B;;KAErB;IACF;GAIC,cAAc;GACd,GAAI,SAAS,cAAc,EAAE;GAC9B;AAED,MAAI,KAAK,SAAS,OAChB,YAAW,KAAK,QAAQ,CAAC;AAG3B,MAAI,KAAK,YACP,YAAW,KAAK,KAAK,YAAY,uBAAuB,CAAC;AAG3D,SAAO,IAAI,GAAG,WAAW;AAEzB,OAAK,SAAS;;CAGhB,oBAAmC;AACjC,SAAO,KAAK"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"angular.js","names":[],"sources":["
|
|
1
|
+
{"version":3,"file":"angular.js","names":[],"sources":["../../../../../src/lib/content/prism/angular.ts"],"sourcesContent":["import Prism from 'prismjs';\n\n(function () {\n if (typeof Prism === 'undefined') {\n return;\n }\n\n Prism.languages['angular'] = Prism.languages.extend('markup', {\n keyword:\n /(?:@if|@for|@switch|@defer|@loading|@error|@placeholder|prefetch)\\b/,\n operator: /\\b(?:on|when)\\b/,\n number: {\n pattern: /\\b(minimum|after)\\s+\\d+(?:s|ms|)/gi,\n lookbehind: true,\n },\n builtin: {\n pattern:\n /\\b(?:viewport|timer|minimum|after|hover|idle|immediate|interaction)/,\n },\n function:\n /#?(?!\\s)[_$a-zA-Z\\xA0-\\uFFFF](?:(?!\\s)[$\\w\\xA0-\\uFFFF])*(?=\\s*(?:\\.\\s*(?:apply|bind|call)\\s*)?\\()/,\n });\n\n Prism.languages['ng'] = Prism.languages['angular'];\n})();\n"],"mappings":";;CAEC,WAAY;AACX,KAAI,OAAO,UAAU,YACnB;AAGF,OAAM,UAAU,aAAa,MAAM,UAAU,OAAO,UAAU;EAC5D,SACE;EACF,UAAU;EACV,QAAQ;GACN,SAAS;GACT,YAAY;GACb;EACD,SAAS,EACP,SACE,uEACH;EACD,UACE;EACH,CAAC;AAEF,OAAM,UAAU,QAAQ,MAAM,UAAU;IACtC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../../../../src/lib/content/prism/index.ts"],"sourcesContent":["import { PrismHighlighter } from './prism-highlighter.js';\n\nexport { PrismHighlighter };\n\nlet highlighterInstance: PrismHighlighter;\n\nexport function getPrismHighlighter(): PrismHighlighter {\n highlighterInstance ??= new PrismHighlighter();\n return highlighterInstance;\n}\n"],"mappings":";;AAIA,IAAI;AAEJ,SAAgB,sBAAwC;AACtD,yBAAwB,IAAI,kBAAkB;AAC9C,QAAO"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prism-highlighter.js","names":[],"sources":["
|
|
1
|
+
{"version":3,"file":"prism-highlighter.js","names":[],"sources":["../../../../../src/lib/content/prism/prism-highlighter.ts"],"sourcesContent":["import { markedHighlight } from 'marked-highlight';\n\nimport 'prismjs';\nimport './angular.js';\n\nimport { MarkedContentHighlighter } from '../marked/marked-content-highlighter.js';\n\ndeclare const Prism: typeof import('prismjs');\n\nexport class PrismHighlighter extends MarkedContentHighlighter {\n override augmentCodeBlock(code: string, lang: string): string {\n const classes =\n lang.startsWith('diff') && Prism.languages['diff']\n ? `language-${lang} diff-highlight`\n : `language-${lang.replace('diff-', '')}`;\n return `<pre class=\"${classes}\"><code class=\"${classes}\">${code}</code></pre>`;\n }\n\n override getHighlightExtension(): import('marked').MarkedExtension {\n return markedHighlight({\n async: true,\n highlight: (code: string, lang: string) => {\n let diff = lang?.startsWith('diff-');\n lang = diff ? lang.replace('diff-', '') : lang || 'typescript';\n\n if (diff && !Prism.languages['diff']) {\n diff = false;\n console.warn(`Notice:\n ---------------------------------------------------------------------------------------\n The \\`diff\\` language and plugin are not available in the provided setup.\n\n To enable, add it to the \\`analog\\` plugin in your \\`vite.config.ts\\`:\n analog({\n content: {\n prismOptions: {\n additionalLangs: [\n 'prism-diff'\n ]\n }\n }\n })\n\n Add the plugin import to your \\`app.config.ts\\`\n import 'prismjs/plugins/diff-highlight/prism-diff-highlight.js';\n ---------------------------------------------------------------------------------------\n `);\n }\n\n if (!Prism.languages[lang]) {\n if (lang !== 'mermaid') {\n console.warn(`Notice:\n ---------------------------------------------------------------------------------------\n The requested language '${lang}' is not available in the provided setup.\n To enable, add it to the \\`analog\\` plugin in your \\`vite.config.ts\\`:\n analog({\n content: {\n prismOptions: {\n additionalLangs: [\n '${lang}',\n ]\n }\n }\n })\n ---------------------------------------------------------------------------------------\n `);\n }\n return code;\n }\n return Prism.highlight(\n code,\n diff ? Prism.languages['diff'] : Prism.languages[lang],\n lang,\n );\n },\n });\n }\n}\n"],"mappings":";;;;;AASA,IAAa,mBAAb,cAAsC,yBAAyB;CAC7D,iBAA0B,MAAc,MAAsB;EAC5D,MAAM,UACJ,KAAK,WAAW,OAAO,IAAI,MAAM,UAAU,UACvC,YAAY,KAAK,mBACjB,YAAY,KAAK,QAAQ,SAAS,GAAG;AAC3C,SAAO,eAAe,QAAQ,iBAAiB,QAAQ,IAAI,KAAK;;CAGlE,wBAAmE;AACjE,SAAO,gBAAgB;GACrB,OAAO;GACP,YAAY,MAAc,SAAiB;IACzC,IAAI,OAAO,MAAM,WAAW,QAAQ;AACpC,WAAO,OAAO,KAAK,QAAQ,SAAS,GAAG,GAAG,QAAQ;AAElD,QAAI,QAAQ,CAAC,MAAM,UAAU,SAAS;AACpC,YAAO;AACP,aAAQ,KAAK;;;;;;;;;;;;;;;;;;cAkBT;;AAGN,QAAI,CAAC,MAAM,UAAU,OAAO;AAC1B,SAAI,SAAS,UACX,SAAQ,KAAK;;8BAEK,KAAK;;;;;;iBAMlB,KAAK;;;;;;gBAMN;AAEN,YAAO;;AAET,WAAO,MAAM,UACX,MACA,OAAO,MAAM,UAAU,UAAU,MAAM,UAAU,OACjD,KACD;;GAEJ,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../../../../src/lib/content/shiki/index.ts"],"sourcesContent":["import { WithShikiHighlighterOptions } from './options.js';\nimport {\n defaultHighlighterOptions,\n ShikiHighlighter,\n ShikiHighlighterOptions,\n} from './shiki-highlighter.js';\n\nexport { ShikiHighlighter };\n\nlet highlighterInstance: ShikiHighlighter;\n\nexport function getShikiHighlighter({\n highlighter = {},\n highlight = {},\n container = '%s',\n}: WithShikiHighlighterOptions = {}): ShikiHighlighter {\n if (highlighterInstance) {\n return highlighterInstance;\n }\n\n if (!highlighter.themes) {\n if (highlight.theme) {\n highlighter.themes = [highlight.theme];\n } else if (highlight.themes && typeof highlight.themes === 'object') {\n highlighter.themes = Object.values(highlight.themes) as string[];\n } else {\n highlighter.themes = defaultHighlighterOptions.themes;\n }\n }\n\n if (!highlighter.langs) {\n highlighter.langs = defaultHighlighterOptions.langs;\n }\n\n if (highlighter.additionalLangs) {\n highlighter.langs.push(...highlighter.additionalLangs);\n delete highlighter.additionalLangs;\n }\n\n highlighterInstance = new ShikiHighlighter(\n highlighter as ShikiHighlighterOptions,\n highlight,\n container,\n !!highlighter.langs.includes('mermaid'),\n );\n\n return highlighterInstance;\n}\n"],"mappings":";;AASA,IAAI;AAEJ,SAAgB,oBAAoB,EAClC,cAAc,EAAE,EAChB,YAAY,EAAE,EACd,YAAY,SACmB,EAAE,EAAoB;AACrD,KAAI,oBACF,QAAO;AAGT,KAAI,CAAC,YAAY,OACf,KAAI,UAAU,MACZ,aAAY,SAAS,CAAC,UAAU,MAAM;UAC7B,UAAU,UAAU,OAAO,UAAU,WAAW,SACzD,aAAY,SAAS,OAAO,OAAO,UAAU,OAAO;KAEpD,aAAY,SAAS,0BAA0B;AAInD,KAAI,CAAC,YAAY,MACf,aAAY,QAAQ,0BAA0B;AAGhD,KAAI,YAAY,iBAAiB;AAC/B,cAAY,MAAM,KAAK,GAAG,YAAY,gBAAgB;AACtD,SAAO,YAAY;;AAGrB,uBAAsB,IAAI,iBACxB,aACA,WACA,WACA,CAAC,CAAC,YAAY,MAAM,SAAS,UAAU,CACxC;AAED,QAAO"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shiki-highlighter.js","names":[],"sources":["
|
|
1
|
+
{"version":3,"file":"shiki-highlighter.js","names":[],"sources":["../../../../../src/lib/content/shiki/shiki-highlighter.ts"],"sourcesContent":["import markedShiki from 'marked-shiki';\nimport {\n type BundledLanguage,\n type BundledTheme,\n type CodeOptionsMeta,\n type CodeOptionsMultipleThemes,\n type CodeOptionsSingleTheme,\n type CodeToHastOptionsCommon,\n createHighlighter,\n} from 'shiki';\n\nimport { MarkedContentHighlighter } from '../marked/marked-content-highlighter.js';\n\nexport type ShikiHighlighterOptions = Parameters<typeof createHighlighter>[0];\nexport type ShikiHighlightOptions = Partial<\n Omit<CodeToHastOptionsCommon<BundledLanguage>, 'lang'>\n> &\n CodeOptionsMeta &\n Partial<CodeOptionsSingleTheme<BundledTheme>> &\n Partial<CodeOptionsMultipleThemes<BundledTheme>>;\n\nexport const defaultHighlighterOptions: {\n langs: string[];\n themes: string[];\n} = {\n langs: [\n 'json',\n 'ts',\n 'tsx',\n 'js',\n 'jsx',\n 'html',\n 'css',\n 'angular-html',\n 'angular-ts',\n ],\n themes: ['github-dark', 'github-light'],\n};\n\nexport class ShikiHighlighter extends MarkedContentHighlighter {\n private readonly highlighter: ReturnType<typeof createHighlighter>;\n\n constructor(\n private highlighterOptions: ShikiHighlighterOptions,\n private highlightOptions: ShikiHighlightOptions,\n private container: string,\n private hasLoadMermaid = false,\n ) {\n super();\n this.highlighter = createHighlighter(this.highlighterOptions);\n }\n getHighlightExtension(): import('marked').MarkedExtension {\n return markedShiki({\n container: this.container,\n highlight: async (code, lang, props) => {\n if (this.hasLoadMermaid && lang === 'mermaid') {\n return `<pre class=\"mermaid\">${code}</pre>`;\n }\n\n const { codeToHtml } = await this.highlighter;\n return codeToHtml(\n code,\n Object.assign(\n {\n lang,\n // required by `transformerMeta*`\n meta: { __raw: props.join(' ') },\n theme: 'github-dark',\n },\n this.highlightOptions,\n ),\n );\n },\n });\n }\n}\n"],"mappings":";;;;AAqBA,IAAa,4BAGT;CACF,OAAO;EACL;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACD;CACD,QAAQ,CAAC,eAAe,eAAe;CACxC;AAED,IAAa,mBAAb,cAAsC,yBAAyB;CAG7D,YACE,oBACA,kBACA,WACA,iBAAyB,OACzB;AACA,SAAO;AALC,OAAA,qBAAA;AACA,OAAA,mBAAA;AACA,OAAA,YAAA;AACA,OAAA,iBAAA;AAGR,OAAK,cAAc,kBAAkB,KAAK,mBAAmB;;CAE/D,wBAA0D;AACxD,SAAO,YAAY;GACjB,WAAW,KAAK;GAChB,WAAW,OAAO,MAAM,MAAM,UAAU;AACtC,QAAI,KAAK,kBAAkB,SAAS,UAClC,QAAO,wBAAwB,KAAK;IAGtC,MAAM,EAAE,eAAe,MAAM,KAAK;AAClC,WAAO,WACL,MACA,OAAO,OACL;KACE;KAEA,MAAM,EAAE,OAAO,MAAM,KAAK,IAAI,EAAE;KAChC,OAAO;KACR,EACD,KAAK,iBACN,CACF;;GAEJ,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"content-plugin.js","names":[],"sources":["../../../../../packages/platform/src/lib/content-plugin.ts"],"sourcesContent":["import * as vite from 'vite';\nimport { readFileSync } from 'node:fs';\nimport { relative, resolve } from 'node:path';\nimport { globSync } from 'tinyglobby';\n\nimport type { WithShikiHighlighterOptions } from './content/shiki/options.js';\nimport type { MarkedContentHighlighter } from './content/marked/marked-content-highlighter.js';\nimport type { WithPrismHighlighterOptions } from './content/prism/options.js';\nimport type { WithMarkedOptions } from './content/marked/index.js';\nimport type { Options } from './options.js';\nimport { getBundleOptionsKey } from './utils/rolldown.js';\n\ninterface Content {\n code: string;\n attributes: string;\n}\n\nexport type ContentPluginOptions = {\n highlighter?: 'shiki' | 'prism';\n markedOptions?: WithMarkedOptions;\n shikiOptions?: WithShikiHighlighterOptions;\n prismOptions?: WithPrismHighlighterOptions;\n};\n\n/**\n * Content plugin that provides markdown and content file processing for Analog.\n *\n * IMPORTANT: This plugin uses tinyglobby for file discovery.\n * Key pitfall with { dot: true }:\n * - Returns relative paths from cwd (e.g., \"apps/blog-app/src/content/...\")\n * - These paths CANNOT be used directly in ES module imports\n * - Relative paths without ./ or ../ are treated as package names\n * - Must convert to absolute paths for imports to work correctly\n */\nexport function contentPlugin(\n {\n highlighter,\n markedOptions,\n shikiOptions,\n prismOptions,\n }: ContentPluginOptions = {},\n options?: Options,\n): vite.Plugin[] {\n const cache = new Map<string, Content>();\n // The content list placeholder can be transformed several times during serve.\n // Caching the discovered markdown paths keeps those repeat passes cheap.\n let contentFilesListCache: string[] | undefined;\n\n let markedHighlighter: MarkedContentHighlighter;\n const workspaceRoot = vite.normalizePath(\n options?.workspaceRoot ?? process.cwd(),\n );\n let config: vite.UserConfig;\n let root: string;\n // Keep discovery and invalidation aligned by deriving both from the same\n // normalized content roots. That way external content dirs participate in\n // cache busting exactly the same way they participate in glob discovery.\n // Initialized once in the `config` hook after `root` is resolved — all\n // inputs (`root`, `workspaceRoot`, `options`) are stable after that point.\n let contentRootDirs: string[];\n const normalizeContentDir = (dir: string) => {\n const normalized = vite.normalizePath(\n dir.startsWith('/')\n ? `${workspaceRoot}${dir}`\n : resolve(workspaceRoot, dir),\n );\n return normalized.endsWith('/') ? normalized.slice(0, -1) : normalized;\n };\n const initContentRootDirs = () => {\n contentRootDirs = [\n vite.normalizePath(`${root}/src/content`),\n ...(options?.additionalContentDirs || []).map(normalizeContentDir),\n ];\n };\n const discoverContentFilesList = () => {\n contentFilesListCache ??= globSync(\n contentRootDirs.map((dir) => `${dir}/**/*.md`),\n { dot: true },\n );\n\n return contentFilesListCache;\n };\n const resolveContentModulePath = (module: string) =>\n vite.normalizePath(\n module.startsWith('/') ? module : `${workspaceRoot}/${module}`,\n );\n const getContentModuleKey = (module: string) => {\n const absolutePath = resolveContentModulePath(module);\n const relativeToRoot = vite.normalizePath(relative(root, absolutePath));\n // `startsWith(root)` is not safe here because sibling directories such as\n // `/apps/my-app-tools` also start with `/apps/my-app`. A relative path only\n // represents in-app content when it stays within `root`.\n const isInApp =\n !relativeToRoot.startsWith('..') && !relativeToRoot.startsWith('/');\n\n // Both branches prepend `/` so generated keys are always absolute-\n // looking (`/src/content/...` for in-app, `/libs/shared/...` for\n // workspace-external). Downstream consumers like content-files-token\n // rely on the leading `/` for slug extraction regexes.\n return isInApp\n ? `/${relativeToRoot}`\n : `/${vite.normalizePath(relative(workspaceRoot, absolutePath))}`;\n };\n\n const contentDiscoveryPlugins: vite.Plugin[] = [\n {\n name: 'analog-content-glob-routes',\n config(_config) {\n config = _config;\n root = vite.normalizePath(\n resolve(workspaceRoot, config.root || '.') || '.',\n );\n initContentRootDirs();\n },\n // Vite 8 / Rolldown \"filtered transform\" — the `filter.code` string\n // tells the bundler to skip this handler entirely for modules whose\n // source does not contain the substring, avoiding unnecessary JS→Rust\n // round-trips. The inner `code.includes()` guard is kept for Vite 7\n // compat where filters are not evaluated by the bundler.\n transform: {\n filter: {\n code: 'ANALOG_CONTENT_FILE_LIST',\n },\n handler(code) {\n if (code.includes('ANALOG_CONTENT_FILE_LIST')) {\n const contentFilesList = discoverContentFilesList();\n\n const eagerImports: string[] = [];\n\n contentFilesList.forEach((module, index) => {\n // CRITICAL: tinyglobby returns relative paths like \"apps/blog-app/src/content/file.md\"\n // These MUST be converted to absolute paths for ES module imports\n // Otherwise Node.js treats \"apps\" as a package name and throws \"Cannot find package 'apps'\"\n const absolutePath = resolveContentModulePath(module);\n eagerImports.push(\n `import { default as analog_module_${index} } from \"${absolutePath}?analog-content-list=true\";`,\n );\n });\n\n let result = code.replace(\n 'const ANALOG_CONTENT_FILE_LIST = {};',\n `\n let ANALOG_CONTENT_FILE_LIST = {${contentFilesList.map(\n (module, index) =>\n `\"${getContentModuleKey(module)}\": analog_module_${index}`,\n )}};\n `,\n );\n\n if (!code.includes('analog_module_')) {\n result = `${eagerImports.join('\\n')}\\n${result}`;\n }\n\n return {\n code: result,\n map: { mappings: '' },\n };\n }\n\n return;\n },\n },\n },\n {\n name: 'analogjs-invalidate-content-dirs',\n configureServer(server) {\n function invalidateContent(path: string) {\n const normalizedPath = vite.normalizePath(path);\n const isContentPath = contentRootDirs.some(\n (dir) =>\n normalizedPath === dir || normalizedPath.startsWith(`${dir}/`),\n );\n\n if (isContentPath) {\n // The file set only changes on add/remove because this watcher is\n // intentionally scoped to those events. Clear the list cache so the\n // next transform sees the updated directory contents.\n contentFilesListCache = undefined;\n server.moduleGraph.fileToModulesMap.forEach((mods) => {\n mods.forEach((mod) => {\n if (\n mod.id?.includes('analogjs') &&\n mod.id?.includes('content')\n ) {\n server.moduleGraph.invalidateModule(mod);\n\n mod.importers.forEach((imp) => {\n server.moduleGraph.invalidateModule(imp);\n });\n }\n });\n });\n\n server.ws.send({\n type: 'full-reload',\n });\n }\n }\n\n server.watcher.on('add', invalidateContent);\n server.watcher.on('unlink', invalidateContent);\n },\n },\n ];\n\n if (!highlighter) {\n return [\n {\n name: 'analogjs-external-content',\n config() {\n const bundleOptionsKey = getBundleOptionsKey();\n return {\n build: {\n [bundleOptionsKey]: {\n external: ['@analogjs/content'],\n },\n },\n };\n },\n },\n {\n name: 'analogjs-exclude-content-import',\n transform: {\n filter: {\n code: '@analogjs/content',\n },\n handler(code) {\n /**\n * Remove the package so it doesn't get\n * referenced when building for serverless\n * functions.\n */\n if (code.includes(`import('@analogjs/content')`)) {\n return {\n code: code.replace(\n `import('@analogjs/content')`,\n 'Promise.resolve({})',\n ),\n };\n }\n\n return;\n },\n },\n },\n ...contentDiscoveryPlugins,\n ];\n }\n\n return [\n {\n name: 'analogjs-content-frontmatter',\n // Filter by module ID so only `?analog-content-list=true` virtual\n // imports enter the handler. Returns `moduleSideEffects: false` so\n // Rolldown can tree-shake unused content list entries.\n transform: {\n filter: {\n id: /analog-content-list=true/,\n },\n async handler(code, id) {\n const cachedContent = cache.get(id);\n // There's no reason to run `readFileSync` and frontmatter parsing if the\n // `transform` hook is called with the same code. In such cases, we can simply\n // return the cached attributes, which is faster than repeatedly reading files\n // synchronously during the build process.\n if (cachedContent?.code === code) {\n return {\n code: `export default ${cachedContent.attributes}`,\n moduleSideEffects: false,\n };\n }\n\n const fm: any = await import('front-matter');\n // The `default` property will be available in CommonJS environment, for instance,\n // when running unit tests. It's safe to retrieve `default` first, since we still\n // fallback to the original implementation.\n const frontmatter = fm.default || fm;\n const fileContents = readFileSync(id.split('?')[0], 'utf8');\n const { attributes } = frontmatter(fileContents);\n const content = {\n code,\n attributes: JSON.stringify(attributes),\n };\n cache.set(id, content);\n\n return {\n code: `export default ${content.attributes}`,\n moduleSideEffects: false,\n };\n },\n },\n },\n {\n name: 'analogjs-content-file',\n enforce: 'post',\n async load(id) {\n if (!id.includes('analog-content-file=true')) {\n return;\n }\n\n if (!markedHighlighter) {\n if (highlighter === 'shiki') {\n const { getShikiHighlighter } =\n await import('./content/shiki/index.js');\n markedHighlighter = getShikiHighlighter(shikiOptions);\n } else {\n const { getPrismHighlighter } =\n await import('./content/prism/index.js');\n markedHighlighter = getPrismHighlighter();\n\n const langs = [\n 'bash',\n 'css',\n 'javascript',\n 'json',\n 'markup',\n 'typescript',\n ];\n\n if (\n Array.isArray(prismOptions?.additionalLangs) &&\n prismOptions?.additionalLangs?.length > 0\n ) {\n langs.push(...prismOptions.additionalLangs);\n }\n\n const loadLanguages = await import('prismjs/components/index.js');\n\n (\n loadLanguages as unknown as { default: (...args: any[]) => any }\n ).default(langs);\n }\n }\n\n const fm: any = await import('front-matter');\n // The `default` property will be available in CommonJS environment, for instance,\n // when running unit tests. It's safe to retrieve `default` first, since we still\n // fallback to the original implementation.\n const frontmatterFn = fm.default || fm;\n const fileContents = readFileSync(id.split('?')[0], 'utf8');\n const { body, frontmatter } = frontmatterFn(fileContents);\n\n // parse markdown and highlight\n const { getMarkedSetup } = await import('./content/marked/index.js');\n const markedSetupService = getMarkedSetup(\n { mangle: true, ...(markedOptions || {}) },\n markedHighlighter,\n );\n const mdContent = (await markedSetupService\n .getMarkedInstance()\n .parse(body)) as unknown as string;\n\n return `export default ${JSON.stringify(\n `---\\n${frontmatter}\\n---\\n\\n${mdContent}`,\n )}`;\n },\n },\n ...contentDiscoveryPlugins,\n ];\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAkCA,SAAgB,cACd,EACE,aACA,eACA,cACA,iBACwB,EAAE,EAC5B,SACe;CACf,MAAM,wBAAQ,IAAI,KAAsB;CAGxC,IAAI;CAEJ,IAAI;CACJ,MAAM,gBAAgB,KAAK,cACzB,SAAS,iBAAiB,QAAQ,KAAK,CACxC;CACD,IAAI;CACJ,IAAI;CAMJ,IAAI;CACJ,MAAM,uBAAuB,QAAgB;EAC3C,MAAM,aAAa,KAAK,cACtB,IAAI,WAAW,IAAI,GACf,GAAG,gBAAgB,QACnB,QAAQ,eAAe,IAAI,CAChC;AACD,SAAO,WAAW,SAAS,IAAI,GAAG,WAAW,MAAM,GAAG,GAAG,GAAG;;CAE9D,MAAM,4BAA4B;AAChC,oBAAkB,CAChB,KAAK,cAAc,GAAG,KAAK,cAAc,EACzC,IAAI,SAAS,yBAAyB,EAAE,EAAE,IAAI,oBAAoB,CACnE;;CAEH,MAAM,iCAAiC;AACrC,4BAA0B,SACxB,gBAAgB,KAAK,QAAQ,GAAG,IAAI,UAAU,EAC9C,EAAE,KAAK,MAAM,CACd;AAED,SAAO;;CAET,MAAM,4BAA4B,WAChC,KAAK,cACH,OAAO,WAAW,IAAI,GAAG,SAAS,GAAG,cAAc,GAAG,SACvD;CACH,MAAM,uBAAuB,WAAmB;EAC9C,MAAM,eAAe,yBAAyB,OAAO;EACrD,MAAM,iBAAiB,KAAK,cAAc,SAAS,MAAM,aAAa,CAAC;AAW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AO;AACf,yBAAoB,oBAAoB,aAAa;WAChD;KACL,MAAM,EAAE,wBACN,MAAM,OAAO;AACf,yBAAoB,qBAAqB;KAEzC,MAAM,QAAQ;MACZ;MACA;MACA;MACA;MACA;MACA;MACD;AAED,SACE,MAAM,QAAQ,cAAc,gBAAgB,IAC5C,cAAc,iBAAiB,SAAS,EAExC,OAAM,KAAK,GAAG,aAAa,gBAAgB;AAM3C,MAHoB,MAAM,OAAO,gCAIjC,QAAQ,MAAM;;IAIpB,MAAM,KAAU,MAAM,OAAO;IAM7B,MAAM,EAAE,MAAM,iBAFQ,GAAG,WAAW,IACf,aAAa,GAAG,MAAM,IAAI,CAAC,IAAI,OAAO,CACF;IAGzD,MAAM,EAAE,mBAAmB,MAAM,OAAO;IAKxC,MAAM,YAAa,MAJQ,eACzB;KAAE,QAAQ;KAAM,GAAI,iBAAiB,EAAE;KAAG,EAC1C,kBACD,CAEE,mBAAmB,CACnB,MAAM,KAAK;AAEd,WAAO,kBAAkB,KAAK,UAC5B,QAAQ,YAAY,WAAW,YAChC;;GAEJ;EACD,GAAG;EACJ"}
|
|
1
|
+
{"version":3,"file":"content-plugin.js","names":[],"sources":["../../../src/lib/content-plugin.ts"],"sourcesContent":["import * as vite from 'vite';\nimport { readFileSync } from 'node:fs';\nimport { relative, resolve } from 'node:path';\nimport { globSync } from 'tinyglobby';\n\nimport type { WithShikiHighlighterOptions } from './content/shiki/options.js';\nimport type { MarkedContentHighlighter } from './content/marked/marked-content-highlighter.js';\nimport type { WithPrismHighlighterOptions } from './content/prism/options.js';\nimport type { WithMarkedOptions } from './content/marked/index.js';\nimport type { Options } from './options.js';\nimport { getBundleOptionsKey } from './utils/rolldown.js';\n\ninterface Content {\n code: string;\n attributes: string;\n}\n\nexport type ContentPluginOptions = {\n highlighter?: 'shiki' | 'prism';\n markedOptions?: WithMarkedOptions;\n shikiOptions?: WithShikiHighlighterOptions;\n prismOptions?: WithPrismHighlighterOptions;\n};\n\n/**\n * Content plugin that provides markdown and content file processing for Analog.\n *\n * IMPORTANT: This plugin uses tinyglobby for file discovery.\n * Key pitfall with { dot: true }:\n * - Returns relative paths from cwd (e.g., \"apps/blog-app/src/content/...\")\n * - These paths CANNOT be used directly in ES module imports\n * - Relative paths without ./ or ../ are treated as package names\n * - Must convert to absolute paths for imports to work correctly\n */\nexport function contentPlugin(\n {\n highlighter,\n markedOptions,\n shikiOptions,\n prismOptions,\n }: ContentPluginOptions = {},\n options?: Options,\n): vite.Plugin[] {\n const cache = new Map<string, Content>();\n // The content list placeholder can be transformed several times during serve.\n // Caching the discovered markdown paths keeps those repeat passes cheap.\n let contentFilesListCache: string[] | undefined;\n\n let markedHighlighter: MarkedContentHighlighter;\n const workspaceRoot = vite.normalizePath(\n options?.workspaceRoot ?? process.cwd(),\n );\n let config: vite.UserConfig;\n let root: string;\n // Keep discovery and invalidation aligned by deriving both from the same\n // normalized content roots. That way external content dirs participate in\n // cache busting exactly the same way they participate in glob discovery.\n // Initialized once in the `config` hook after `root` is resolved — all\n // inputs (`root`, `workspaceRoot`, `options`) are stable after that point.\n let contentRootDirs: string[];\n const normalizeContentDir = (dir: string) => {\n const normalized = vite.normalizePath(\n dir.startsWith('/')\n ? `${workspaceRoot}${dir}`\n : resolve(workspaceRoot, dir),\n );\n return normalized.endsWith('/') ? normalized.slice(0, -1) : normalized;\n };\n const initContentRootDirs = () => {\n contentRootDirs = [\n vite.normalizePath(`${root}/src/content`),\n ...(options?.additionalContentDirs || []).map(normalizeContentDir),\n ];\n };\n const discoverContentFilesList = () => {\n contentFilesListCache ??= globSync(\n contentRootDirs.map((dir) => `${dir}/**/*.md`),\n { dot: true },\n );\n\n return contentFilesListCache;\n };\n const resolveContentModulePath = (module: string) =>\n vite.normalizePath(\n module.startsWith('/') ? module : `${workspaceRoot}/${module}`,\n );\n const getContentModuleKey = (module: string) => {\n const absolutePath = resolveContentModulePath(module);\n const relativeToRoot = vite.normalizePath(relative(root, absolutePath));\n // `startsWith(root)` is not safe here because sibling directories such as\n // `/apps/my-app-tools` also start with `/apps/my-app`. A relative path only\n // represents in-app content when it stays within `root`.\n const isInApp =\n !relativeToRoot.startsWith('..') && !relativeToRoot.startsWith('/');\n\n // Both branches prepend `/` so generated keys are always absolute-\n // looking (`/src/content/...` for in-app, `/libs/shared/...` for\n // workspace-external). Downstream consumers like content-files-token\n // rely on the leading `/` for slug extraction regexes.\n return isInApp\n ? `/${relativeToRoot}`\n : `/${vite.normalizePath(relative(workspaceRoot, absolutePath))}`;\n };\n\n const contentDiscoveryPlugins: vite.Plugin[] = [\n {\n name: 'analog-content-glob-routes',\n config(_config) {\n config = _config;\n root = vite.normalizePath(\n resolve(workspaceRoot, config.root || '.') || '.',\n );\n initContentRootDirs();\n },\n // Vite 8 / Rolldown \"filtered transform\" — the `filter.code` string\n // tells the bundler to skip this handler entirely for modules whose\n // source does not contain the substring, avoiding unnecessary JS→Rust\n // round-trips. The inner `code.includes()` guard is kept for Vite 7\n // compat where filters are not evaluated by the bundler.\n transform: {\n filter: {\n code: 'ANALOG_CONTENT_FILE_LIST',\n },\n handler(code) {\n if (code.includes('ANALOG_CONTENT_FILE_LIST')) {\n const contentFilesList = discoverContentFilesList();\n\n const eagerImports: string[] = [];\n\n contentFilesList.forEach((module, index) => {\n // CRITICAL: tinyglobby returns relative paths like \"apps/blog-app/src/content/file.md\"\n // These MUST be converted to absolute paths for ES module imports\n // Otherwise Node.js treats \"apps\" as a package name and throws \"Cannot find package 'apps'\"\n const absolutePath = resolveContentModulePath(module);\n eagerImports.push(\n `import { default as analog_module_${index} } from \"${absolutePath}?analog-content-list=true\";`,\n );\n });\n\n let result = code.replace(\n 'const ANALOG_CONTENT_FILE_LIST = {};',\n `\n let ANALOG_CONTENT_FILE_LIST = {${contentFilesList.map(\n (module, index) =>\n `\"${getContentModuleKey(module)}\": analog_module_${index}`,\n )}};\n `,\n );\n\n if (!code.includes('analog_module_')) {\n result = `${eagerImports.join('\\n')}\\n${result}`;\n }\n\n return {\n code: result,\n map: { mappings: '' },\n };\n }\n\n return;\n },\n },\n },\n {\n name: 'analogjs-invalidate-content-dirs',\n configureServer(server) {\n function invalidateContent(path: string) {\n const normalizedPath = vite.normalizePath(path);\n const isContentPath = contentRootDirs.some(\n (dir) =>\n normalizedPath === dir || normalizedPath.startsWith(`${dir}/`),\n );\n\n if (isContentPath) {\n // The file set only changes on add/remove because this watcher is\n // intentionally scoped to those events. Clear the list cache so the\n // next transform sees the updated directory contents.\n contentFilesListCache = undefined;\n server.moduleGraph.fileToModulesMap.forEach((mods) => {\n mods.forEach((mod) => {\n if (\n mod.id?.includes('analogjs') &&\n mod.id?.includes('content')\n ) {\n server.moduleGraph.invalidateModule(mod);\n\n mod.importers.forEach((imp) => {\n server.moduleGraph.invalidateModule(imp);\n });\n }\n });\n });\n\n server.ws.send({\n type: 'full-reload',\n });\n }\n }\n\n server.watcher.on('add', invalidateContent);\n server.watcher.on('unlink', invalidateContent);\n },\n },\n ];\n\n if (!highlighter) {\n return [\n {\n name: 'analogjs-external-content',\n config() {\n const bundleOptionsKey = getBundleOptionsKey();\n return {\n build: {\n [bundleOptionsKey]: {\n external: ['@analogjs/content'],\n },\n },\n };\n },\n },\n {\n name: 'analogjs-exclude-content-import',\n transform: {\n filter: {\n code: '@analogjs/content',\n },\n handler(code) {\n /**\n * Remove the package so it doesn't get\n * referenced when building for serverless\n * functions.\n */\n if (code.includes(`import('@analogjs/content')`)) {\n return {\n code: code.replace(\n `import('@analogjs/content')`,\n 'Promise.resolve({})',\n ),\n };\n }\n\n return;\n },\n },\n },\n ...contentDiscoveryPlugins,\n ];\n }\n\n return [\n {\n name: 'analogjs-content-frontmatter',\n // Filter by module ID so only `?analog-content-list=true` virtual\n // imports enter the handler. Returns `moduleSideEffects: false` so\n // Rolldown can tree-shake unused content list entries.\n transform: {\n filter: {\n id: /analog-content-list=true/,\n },\n async handler(code, id) {\n const cachedContent = cache.get(id);\n // There's no reason to run `readFileSync` and frontmatter parsing if the\n // `transform` hook is called with the same code. In such cases, we can simply\n // return the cached attributes, which is faster than repeatedly reading files\n // synchronously during the build process.\n if (cachedContent?.code === code) {\n return {\n code: `export default ${cachedContent.attributes}`,\n moduleSideEffects: false,\n };\n }\n\n const fm: any = await import('front-matter');\n // The `default` property will be available in CommonJS environment, for instance,\n // when running unit tests. It's safe to retrieve `default` first, since we still\n // fallback to the original implementation.\n const frontmatter = fm.default || fm;\n const fileContents = readFileSync(id.split('?')[0], 'utf8');\n const { attributes } = frontmatter(fileContents);\n const content = {\n code,\n attributes: JSON.stringify(attributes),\n };\n cache.set(id, content);\n\n return {\n code: `export default ${content.attributes}`,\n moduleSideEffects: false,\n };\n },\n },\n },\n {\n name: 'analogjs-content-file',\n enforce: 'post',\n async load(id) {\n if (!id.includes('analog-content-file=true')) {\n return;\n }\n\n if (!markedHighlighter) {\n if (highlighter === 'shiki') {\n const { getShikiHighlighter } =\n await import('./content/shiki/index.js');\n markedHighlighter = getShikiHighlighter(shikiOptions);\n } else {\n const { getPrismHighlighter } =\n await import('./content/prism/index.js');\n markedHighlighter = getPrismHighlighter();\n\n const langs = [\n 'bash',\n 'css',\n 'javascript',\n 'json',\n 'markup',\n 'typescript',\n ];\n\n if (\n Array.isArray(prismOptions?.additionalLangs) &&\n prismOptions?.additionalLangs?.length > 0\n ) {\n langs.push(...prismOptions.additionalLangs);\n }\n\n const loadLanguages = await import('prismjs/components/index.js');\n\n (\n loadLanguages as unknown as { default: (...args: any[]) => any }\n ).default(langs);\n }\n }\n\n const fm: any = await import('front-matter');\n // The `default` property will be available in CommonJS environment, for instance,\n // when running unit tests. It's safe to retrieve `default` first, since we still\n // fallback to the original implementation.\n const frontmatterFn = fm.default || fm;\n const fileContents = readFileSync(id.split('?')[0], 'utf8');\n const { body, frontmatter } = frontmatterFn(fileContents);\n\n // parse markdown and highlight\n const { getMarkedSetup } = await import('./content/marked/index.js');\n const markedSetupService = getMarkedSetup(\n { mangle: true, ...(markedOptions || {}) },\n markedHighlighter,\n );\n const mdContent = (await markedSetupService\n .getMarkedInstance()\n .parse(body)) as unknown as string;\n\n return `export default ${JSON.stringify(\n `---\\n${frontmatter}\\n---\\n\\n${mdContent}`,\n )}`;\n },\n },\n ...contentDiscoveryPlugins,\n ];\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAkCA,SAAgB,cACd,EACE,aACA,eACA,cACA,iBACwB,EAAE,EAC5B,SACe;CACf,MAAM,wBAAQ,IAAI,KAAsB;CAGxC,IAAI;CAEJ,IAAI;CACJ,MAAM,gBAAgB,KAAK,cACzB,SAAS,iBAAiB,QAAQ,KAAK,CACxC;CACD,IAAI;CACJ,IAAI;CAMJ,IAAI;CACJ,MAAM,uBAAuB,QAAgB;EAC3C,MAAM,aAAa,KAAK,cACtB,IAAI,WAAW,IAAI,GACf,GAAG,gBAAgB,QACnB,QAAQ,eAAe,IAAI,CAChC;AACD,SAAO,WAAW,SAAS,IAAI,GAAG,WAAW,MAAM,GAAG,GAAG,GAAG;;CAE9D,MAAM,4BAA4B;AAChC,oBAAkB,CAChB,KAAK,cAAc,GAAG,KAAK,cAAc,EACzC,IAAI,SAAS,yBAAyB,EAAE,EAAE,IAAI,oBAAoB,CACnE;;CAEH,MAAM,iCAAiC;AACrC,4BAA0B,SACxB,gBAAgB,KAAK,QAAQ,GAAG,IAAI,UAAU,EAC9C,EAAE,KAAK,MAAM,CACd;AAED,SAAO;;CAET,MAAM,4BAA4B,WAChC,KAAK,cACH,OAAO,WAAW,IAAI,GAAG,SAAS,GAAG,cAAc,GAAG,SACvD;CACH,MAAM,uBAAuB,WAAmB;EAC9C,MAAM,eAAe,yBAAyB,OAAO;EACrD,MAAM,iBAAiB,KAAK,cAAc,SAAS,MAAM,aAAa,CAAC;AAWvE,SANE,CAAC,eAAe,WAAW,KAAK,IAAI,CAAC,eAAe,WAAW,IAAI,GAOjE,IAAI,mBACJ,IAAI,KAAK,cAAc,SAAS,eAAe,aAAa,CAAC;;CAGnE,MAAM,0BAAyC,CAC7C;EACE,MAAM;EACN,OAAO,SAAS;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gB,IAC5C,cAAc,iBAAiB,SAAS,EAExC,OAAM,KAAK,GAAG,aAAa,gBAAgB;AAM3C,MAHoB,MAAM,OAAO,gCAIjC,QAAQ,MAAM;;IAIpB,MAAM,KAAU,MAAM,OAAO;IAM7B,MAAM,EAAE,MAAM,iBAFQ,GAAG,WAAW,IACf,aAAa,GAAG,MAAM,IAAI,CAAC,IAAI,OAAO,CACF;IAGzD,MAAM,EAAE,mBAAmB,MAAM,OAAO;IAKxC,MAAM,YAAa,MAJQ,eACzB;KAAE,QAAQ;KAAM,GAAI,iBAAiB,EAAE;KAAG,EAC1C,kBACD,CAEE,mBAAmB,CACnB,MAAM,KAAK;AAEd,WAAO,kBAAkB,KAAK,UAC5B,QAAQ,YAAY,WAAW,YAChC;;GAEJ;EACD,GAAG;EACJ"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deps-plugin.js","names":[],"sources":["
|
|
1
|
+
{"version":3,"file":"deps-plugin.js","names":[],"sources":["../../../src/lib/deps-plugin.ts"],"sourcesContent":["import { VERSION } from '@angular/compiler-cli';\nimport type { Plugin } from 'vite';\nimport { crawlFrameworkPkgs } from 'vitefu';\n\nimport { Options } from './options.js';\nimport { getJsTransformConfigKey } from './utils/rolldown.js';\n\nexport function depsPlugin(options?: Options): Plugin[] {\n const workspaceRoot = options?.workspaceRoot ?? process.cwd();\n const viteOptions = options?.vite === false ? undefined : options?.vite;\n\n return [\n {\n name: 'analogjs-deps-plugin',\n config() {\n const useAngularCompilationAPI =\n options?.experimental?.useAngularCompilationAPI ??\n viteOptions?.experimental?.useAngularCompilationAPI;\n\n const transformConfig =\n options?.vite === false || useAngularCompilationAPI\n ? {}\n : { exclude: ['**/*.ts', '**/*.js'] };\n\n return {\n [getJsTransformConfigKey()]: transformConfig,\n ssr: {\n noExternal: [\n '@analogjs/**',\n 'firebase/**',\n 'firebase-admin/**',\n 'rxfire',\n '@ng-web-apis/**',\n '@taiga-ui/**',\n '@tanstack/angular-query-experimental',\n ],\n },\n optimizeDeps: {\n include: [\n '@angular/common',\n '@angular/common/http',\n ...(Number(VERSION.major) > 15\n ? ['@angular/core/rxjs-interop']\n : []),\n 'front-matter',\n ],\n exclude: [\n '@angular/platform-server',\n '@analogjs/content',\n '@analogjs/router',\n '@nx/angular',\n '@nx/vite',\n '@nx/devkit',\n '@nx/js',\n '@nx/devkit',\n '@nx/cypress',\n '@nx/jest',\n '@nx/js',\n '@nx/eslint',\n '@nx/webpack',\n '@nx/web',\n '@nx/workspace',\n '@nx/eslint',\n '@nx/module-federation',\n '@nx/rspack',\n 'webpack',\n 'fsevents',\n 'nx',\n ],\n },\n };\n },\n },\n {\n name: 'analogjs-auto-discover-deps',\n async config(config, { command }) {\n const pkgConfig = await crawlFrameworkPkgs({\n root: workspaceRoot,\n isBuild: command === 'build',\n viteUserConfig: config,\n isSemiFrameworkPkgByJson(pkgJson) {\n return pkgJson['module'] && pkgJson['module'].includes('fesm');\n },\n });\n return pkgConfig;\n },\n },\n ];\n}\n"],"mappings":";;;;AAOA,SAAgB,WAAW,SAA6B;CACtD,MAAM,gBAAgB,SAAS,iBAAiB,QAAQ,KAAK;CAC7D,MAAM,cAAc,SAAS,SAAS,QAAQ,KAAA,IAAY,SAAS;AAEnE,QAAO,CACL;EACE,MAAM;EACN,SAAS;GACP,MAAM,2BACJ,SAAS,cAAc,4BACvB,aAAa,cAAc;GAE7B,MAAM,kBACJ,SAAS,SAAS,SAAS,2BACvB,EAAE,GACF,EAAE,SAAS,CAAC,WAAW,UAAU,EAAE;AAEzC,UAAO;KACJ,yBAAyB,GAAG;IAC7B,KAAK,EACH,YAAY;KACV;KACA;KACA;KACA;KACA;KACA;KACA;KACD,EACF;IACD,cAAc;KACZ,SAAS;MACP;MACA;MACA,GAAI,OAAO,QAAQ,MAAM,GAAG,KACxB,CAAC,6BAA6B,GAC9B,EAAE;MACN;MACD;KACD,SAAS;MACP;MACA;MACA;MACA;MACA;MACA;MACA;MACA;MACA;MACA;MACA;MACA;MACA;MACA;MACA;MACA;MACA;MACA;MACA;MACA;MACA;MACD;KACF;IACF;;EAEJ,EACD;EACE,MAAM;EACN,MAAM,OAAO,QAAQ,EAAE,WAAW;AAShC,UARkB,MAAM,mBAAmB;IACzC,MAAM;IACN,SAAS,YAAY;IACrB,gBAAgB;IAChB,yBAAyB,SAAS;AAChC,YAAO,QAAQ,aAAa,QAAQ,UAAU,SAAS,OAAO;;IAEjE,CAAC;;EAGL,CACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"json-ld-manifest-plugin.js","names":[],"sources":["
|
|
1
|
+
{"version":3,"file":"json-ld-manifest-plugin.js","names":[],"sources":["../../../src/lib/json-ld-manifest-plugin.ts"],"sourcesContent":["import fm from 'front-matter';\nimport { normalizePath } from 'vite';\nimport { dirname, relative } from 'node:path';\n\nimport { normalizeJsonLd, type JsonLdObject } from './route-manifest.js';\n\nexport type JsonLdModuleManifestEntry = {\n kind: 'module';\n routePath: string;\n sourceFile: string;\n importAlias: string;\n};\n\nexport type JsonLdContentManifestEntry = {\n kind: 'content';\n routePath: string;\n sourceFile: string;\n jsonLd: JsonLdObject[];\n};\n\nexport type JsonLdManifestEntry =\n | JsonLdModuleManifestEntry\n | JsonLdContentManifestEntry;\n\n/**\n * Heuristic detector for JSON-LD exports in route modules.\n *\n * This is intentionally regex-based for speed during file scanning.\n * It reliably detects these direct export patterns:\n *\n * - `export const routeJsonLd = ...`\n * - `export const routeMeta = { ..., jsonLd: ... }`\n * - `export const routeJsonLd = (route) => ...` (function form)\n *\n * Known limitations (not detected):\n *\n * - re-exports: `export { routeJsonLd } from './data'`\n * - aliased exports: `export { something as routeJsonLd }`\n * - default exports: `export default { jsonLd: ... }`\n * - indirect assignment: `const data = { jsonLd: ... }; export const routeMeta = data`\n *\n * Known false-positive risks:\n *\n * - comment text containing `export const routeJsonLd`\n * - unrelated `jsonLd` text appearing after `export const routeMeta`\n *\n * Prefer the supported direct export patterns listed above.\n */\nexport function detectJsonLdModuleExports(fileContent: string): boolean {\n return (\n /export\\s+const\\s+routeJsonLd\\b/.test(fileContent) ||\n /export\\s+const\\s+routeMeta\\b[\\s\\S]*?\\bjsonLd\\b/.test(fileContent)\n );\n}\n\nexport function extractMarkdownJsonLd(rawContent: string): JsonLdObject[] {\n const { attributes } = fm<Record<string, unknown>>(rawContent);\n return normalizeJsonLd(attributes['jsonLd']);\n}\n\nexport function generateJsonLdManifestSource(\n entries: JsonLdManifestEntry[],\n outFile: string,\n): string {\n const lines: string[] = [];\n const moduleEntries = entries.filter(\n (entry): entry is JsonLdModuleManifestEntry => entry.kind === 'module',\n );\n\n lines.push('// This file is auto-generated by @analogjs/platform');\n lines.push('// Do not edit manually');\n lines.push('');\n\n lines.push(\"import type { Graph, Thing, WithContext } from 'schema-dts';\");\n\n moduleEntries.forEach((entry) => {\n lines.push(\n `import * as ${entry.importAlias} from '${toImportPath(outFile, entry.sourceFile)}';`,\n );\n });\n\n lines.push('');\n lines.push(\n 'export type AnalogJsonLdDocument = WithContext<Thing> | Graph | Array<WithContext<Thing>>;',\n );\n lines.push(\n \"export type GeneratedJsonLdManifestEntry = { routePath: string; sourceFile: string; kind: 'module' | 'content'; resolveJsonLd: () => AnalogJsonLdDocument[]; };\",\n );\n lines.push('');\n lines.push(\n 'function normalizeJsonLd(value: unknown): AnalogJsonLdDocument[] {',\n );\n lines.push(' if (Array.isArray(value)) {');\n lines.push(\n \" return value.filter((entry): entry is AnalogJsonLdDocument => typeof entry === 'object' && entry !== null && !Array.isArray(entry));\",\n );\n lines.push(' }');\n lines.push('');\n lines.push(\n \" return typeof value === 'object' && value !== null ? [value as AnalogJsonLdDocument] : [];\",\n );\n lines.push('}');\n lines.push('');\n lines.push(\n 'function resolveModuleJsonLd(routeModule: unknown): AnalogJsonLdDocument[] {',\n );\n lines.push(\n ' const typedRouteModule = routeModule as { routeJsonLd?: unknown; routeMeta?: { jsonLd?: unknown } };',\n );\n lines.push(\n // Match runtime precedence (mergeRouteJsonLdIntoRouteMeta in routes.ts):\n // routeMeta.jsonLd wins over standalone routeJsonLd.\n ' return normalizeJsonLd(typedRouteModule.routeMeta?.jsonLd ?? typedRouteModule.routeJsonLd);',\n );\n lines.push('}');\n lines.push('');\n lines.push(\n 'export const routeJsonLdManifest = new Map<string, GeneratedJsonLdManifestEntry>([',\n );\n\n entries.forEach((entry) => {\n if (entry.kind === 'module') {\n lines.push(\n ` ['${entry.routePath}', { routePath: '${entry.routePath}', sourceFile: '${entry.sourceFile}', kind: 'module', resolveJsonLd: () => resolveModuleJsonLd(${entry.importAlias}) }],`,\n );\n return;\n }\n\n lines.push(\n ` ['${entry.routePath}', { routePath: '${entry.routePath}', sourceFile: '${entry.sourceFile}', kind: 'content', resolveJsonLd: () => ${JSON.stringify(entry.jsonLd)} }],`,\n );\n });\n\n lines.push(']);');\n lines.push('');\n\n return lines.join('\\n');\n}\n\nfunction toImportPath(outFile: string, sourceFile: string): string {\n // JSON-LD entries are emitted inside the same generated route module, so\n // imports are always resolved relative to that single output file.\n const fromDir = dirname(outFile);\n const sourceNoExt = sourceFile\n .replace(/^\\//, '')\n .replace(/\\.(ts|js|analog|ag)$/, '');\n const relativePath = normalizePath(relative(fromDir, sourceNoExt));\n\n if (relativePath.startsWith('.')) {\n return relativePath;\n }\n\n return `./${relativePath}`;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgDA,SAAgB,0BAA0B,aAA8B;AACtE,QACE,iCAAiC,KAAK,YAAY,IAClD,iDAAiD,KAAK,YAAY;;AAItE,SAAgB,sBAAsB,YAAoC;CACxE,MAAM,EAAE,eAAe,GAA4B,WAAW;AAC9D,QAAO,gBAAgB,WAAW,UAAU;;AAG9C,SAAgB,6BACd,SACA,SACQ;CACR,MAAM,QAAkB,EAAE;CAC1B,MAAM,gBAAgB,QAAQ,QAC3B,UAA8C,MAAM,SAAS,SAC/D;AAED,OAAM,KAAK,uDAAuD;AAClE,OAAM,KAAK,0BAA0B;AACrC,OAAM,KAAK,G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"file":"compat.js","names":[],"sources":["../../../../../../../../nx-plugin/src/executors/vite/compat.ts"],"sourcesContent":["import { convertNxExecutor } from '@nx/devkit';\n\nimport viteBuildExecutor from './vite.impl';\n\nconst compat: ReturnType<typeof convertNxExecutor> =\n convertNxExecutor(viteBuildExecutor);\nexport default compat;\n"],"mappings":";;AAIA,IAAM,UAAA,yBAAA,mBACc,qCAAkB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vite.impl.js","names":[],"sources":["
|
|
1
|
+
{"version":3,"file":"vite.impl.js","names":[],"sources":["../../../../../../../../nx-plugin/src/executors/vite/vite.impl.ts"],"sourcesContent":["import { viteBuildExecutor } from '@nx/vite/executors';\n\nexport default viteBuildExecutor;\n"],"mappings":";AAEA,IAAA,kDAAe"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"compat.js","names":[],"sources":["
|
|
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,yBAAA,mBACJ,2DACD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vite-dev-server.impl.js","names":[],"sources":["
|
|
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,6DAAe"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"compat.js","names":[],"sources":["
|
|
1
|
+
{"version":3,"file":"compat.js","names":[],"sources":["../../../../../../../../nx-plugin/src/executors/vitest/compat.ts"],"sourcesContent":["import { convertNxExecutor } from '@nx/devkit';\n\nimport vitestExecutor from './vitest.impl';\n\nconst compat: ReturnType<typeof convertNxExecutor> =\n convertNxExecutor(vitestExecutor);\nexport default compat;\n"],"mappings":";;AAIA,IAAM,UAAA,yBAAA,mBACc,yCAAe"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vitest.impl.js","names":[],"sources":["
|
|
1
|
+
{"version":3,"file":"vitest.impl.js","names":[],"sources":["../../../../../../../../nx-plugin/src/executors/vitest/vitest.impl.ts"],"sourcesContent":["import { vitestExecutor } from '@nx/vite/executors';\n\nexport default vitestExecutor;\n"],"mappings":";AAEA,IAAA,oDAAe"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"compat.js","names":[],"sources":["
|
|
1
|
+
{"version":3,"file":"compat.js","names":[],"sources":["../../../../../../../../nx-plugin/src/generators/app/compat.ts"],"sourcesContent":["import { convertNxGenerator } from '@nx/devkit';\nimport generator from './generator';\n\n/**\n * Angular CLI schematic wrapper for the Analog application generator.\n * Referenced by `generators.json#schematics.application.factory` so that\n * `ng generate @analogjs/platform:application` resolves through the\n * Angular schematics engine (which uses named exports, not default).\n */\nexport const applicationSchematic: ReturnType<typeof convertNxGenerator> =\n convertNxGenerator(generator) as ReturnType<typeof convertNxGenerator>;\nexport default applicationSchematic;\n"],"mappings":";;;;;;;;;;;;AASA,IAAa,wBAAA,yBAAA,oBACQ,qCAAU"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generator.js","names":[],"sources":["
|
|
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 { belowMinimumSupportedNxVersion } from './versions/minimum-supported-versions';\nimport { addAngularApp } from './lib/add-angular-app';\nimport setupAnalogGenerator from '../init/generator';\nimport { addFiles } from './lib/add-files';\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 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: '^15.0.7',\n mermaid: '^10.2.4',\n prismjs: '^1.29.0',\n },\n {},\n );\n\n updateJson<{ dependencies: Record<string, string> }>(\n tree,\n '/package.json',\n (json) => {\n json.dependencies['@angular/platform-server'] = `~${angularVersion}`;\n\n return json;\n },\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 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":";;;;;;;;;;;;;;AAqCA,SAAS,iBACP,MACA,SACmB;CACnB,MAAM,OAAO,KAAK,OAAO,WAAW;CACpC,MAAM,UAAU,QAAA,GAAA,WAAA,oBAA0B,KAAK,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,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,YACE,MACA,kBACC,SAAS;AACR,OAAK,aAAa,8BAA8B,IAAI;AAEpD,SAAO;GAEV;AAED,2BAAA,YAAY,MAAM,kBAAkB,cAAc;AAElD,KAAI,kBAAkB,YACpB,OAAM,4BAAA,kBAAkB,MAAM,kBAAkB,YAAY;AAG9D,uBAAA,YAAY,MAAM,mBAAmB,oBAAoB;AAEzD,uBAAA,aAAa,MAAM,kBAAkB;AAErC,KAAI,CAAC,kBAAkB,WACrB,QAAA,GAAA,WAAA,aAAkB,KAAK;AAGzB,cAAa;AACX,GAAA,GAAA,WAAA,qBAAoB,KAAK"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"add-analog-project-config.js","names":[],"sources":["
|
|
1
|
+
{"version":3,"file":"add-analog-project-config.js","names":[],"sources":["../../../../../../../../../nx-plugin/src/generators/app/lib/add-analog-project-config.ts"],"sourcesContent":["import type { ProjectConfiguration, Tree } from '@nx/devkit';\nimport { addProjectConfiguration, getProjects, updateJson } from '@nx/devkit';\n\nexport function addAnalogProjectConfig(\n tree: Tree,\n projectRoot: string,\n projectName: string,\n parsedTags: string[],\n name: string,\n appsDir: string,\n nxPackageNamespace: string,\n): void {\n const isStandalone = appsDir === '.';\n const isNx = tree.exists('/nx.json');\n const workspaceAppsDir = isStandalone || !isNx ? '' : `${appsDir}/`;\n\n if (isNx) {\n const projectConfiguration: ProjectConfiguration = {\n root: projectRoot,\n projectType: 'application',\n sourceRoot: `${projectRoot}/src`,\n tags: parsedTags,\n targets: {\n build: {\n executor: '@analogjs/platform:vite',\n outputs: [\n '{options.outputPath}',\n `{workspaceRoot}/dist/${workspaceAppsDir}${projectName}/.nitro`,\n `{workspaceRoot}/dist/${workspaceAppsDir}${projectName}/ssr`,\n `{workspaceRoot}/dist/${workspaceAppsDir}${projectName}/analog`,\n ],\n options: {\n main: `${workspaceAppsDir}${projectName}/src/main.ts`,\n configFile: `${workspaceAppsDir}${projectName}/vite.config.ts`,\n outputPath: `dist/${workspaceAppsDir}${projectName}/client`,\n tsConfig: `${workspaceAppsDir}${projectName}/tsconfig.app.json`,\n },\n defaultConfiguration: 'production',\n configurations: {\n development: {\n mode: 'development',\n },\n production: {\n sourcemap: false,\n mode: 'production',\n },\n },\n },\n serve: {\n executor: '@analogjs/platform:vite-dev-server',\n defaultConfiguration: 'development',\n options: {\n buildTarget: `${projectName}:build`,\n port: 4200,\n },\n configurations: {\n development: {\n buildTarget: `${projectName}:build:development`,\n hmr: true,\n },\n production: {\n buildTarget: `${projectName}:build:production`,\n },\n },\n },\n test: {\n executor: '@analogjs/vitest-angular:test',\n outputs: [`{projectRoot}/coverage`],\n },\n },\n };\n\n addProjectConfiguration(tree, name, projectConfiguration);\n } else {\n const projects = getProjects(tree);\n const fetched = projects.get(projectName);\n\n if (!fetched) {\n throw new Error(`Project \"${projectName}\" not found in workspace.`);\n }\n\n const {\n targets,\n $schema,\n name: _name,\n generators,\n 'extract-i18n': _,\n 'serve-static': __,\n ...rest\n } = fetched as ProjectConfiguration & Record<string, unknown>;\n\n const {\n 'extract-i18n': _ei,\n 'serve-static': _ss,\n ...architect\n } = targets ?? {};\n\n updateJson(tree, '/angular.json', (json) => {\n json.projects[projectName] = {\n ...rest,\n architect,\n tags: parsedTags,\n };\n\n return json;\n });\n }\n}\n"],"mappings":";;AAGA,SAAgB,uBACd,MACA,aACA,aACA,YACA,MACA,SACA,oBACM;CACN,MAAM,eAAe,YAAY;CACjC,MAAM,OAAO,KAAK,OAAO,WAAW;CACpC,MAAM,mBAAmB,gBAAgB,CAAC,OAAO,KAAK,GAAG,QAAQ;AAEjE,KAAI,KAwDF,EAAA,GAAA,WAAA,yBAAwB,MAAM,MAvDqB;EACjD,MAAM;EACN,aAAa;EACb,YAAY,GAAG,YAAY;EAC3B,MAAM;EACN,SAAS;GACP,OAAO;IACL,UAAU;IACV,SAAS;KACP;KACA,wBAAwB,mBAAmB,YAAY;KACvD,wBAAwB,mBAAmB,YAAY;KACvD,wBAAwB,mBAAmB,YAAY;KACxD;IACD,SAAS;KACP,MAAM,GAAG,mBAAmB,YAAY;KACxC,YAAY,GAAG,mBAAmB,YAAY;KAC9C,YAAY,QAAQ,mBAAmB,YAAY;KACnD,UAAU,GAAG,mBAAmB,YAAY;KAC7C;IACD,sBAAsB;IACtB,gBAAgB;KACd,aAAa,EACX,MAAM,eACP;KACD,YAAY;MACV,WAAW;MACX,MAAM;MACP;KACF;IACF;GACD,OAAO;IACL,UAAU;IACV,sBAAsB;IACtB,SAAS;KACP,aAAa,GAAG,YAAY;KAC5B,MAAM;KACP;IACD,gBAAgB;KACd,aAAa;MACX,aAAa,GAAG,YAAY;MAC5B,KAAK;MACN;KACD,YAAY,EACV,aAAa,GAAG,YAAY,oBAC7B;KACF;IACF;GACD,MAAM;IACJ,UAAU;IACV,SAAS,CAAC,yBAAyB;IACpC;GACF;EACF,CAEwD;MACpD;EAEL,MAAM,WAAA,GAAA,WAAA,aADuB,KAAK,CACT,IAAI,YAAY;AAEzC,MAAI,CAAC,QACH,OAAM,IAAI,MAAM,YAAY,YAAY,2BAA2B;EAGrE,MAAM,EACJ,SACA,SACA,MAAM,OACN,YACA,gBAAgB,GAChB,gBAAgB,IAChB,GAAG,SACD;EAEJ,MAAM,EACJ,gBAAgB,KAChB,gBAAgB,KAChB,GAAG,cACD,WAAW,EAAE;AAEjB,GAAA,GAAA,WAAA,YAAW,MAAM,kBAAkB,SAAS;AAC1C,QAAK,SAAS,eAAe;IAC3B,GAAG;IACH;IACA,MAAM;IACP;AAED,UAAO;IACP"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"add-angular-app.js","names":[],"sources":["
|
|
1
|
+
{"version":3,"file":"add-angular-app.js","names":[],"sources":["../../../../../../../../../nx-plugin/src/generators/app/lib/add-angular-app.ts"],"sourcesContent":["import { getWorkspaceLayout, Tree } from '@nx/devkit';\nimport { NormalizedOptions } from '../generator';\n\nexport async function addAngularApp(\n tree: Tree,\n options: NormalizedOptions,\n): Promise<void> {\n const isNx = tree.exists('/nx.json');\n const appsDir = isNx ? getWorkspaceLayout(tree).appsDir : 'projects';\n\n const appOptions: typeof import('@nx/angular/src/generators/application/schema') =\n {\n name: options.analogAppName,\n directory: `${appsDir}/${options.analogAppName}`,\n linter: !isNx || process.env['NODE_ENV'] === 'test' ? 'none' : 'eslint',\n e2eTestRunner: 'none',\n unitTestRunner: 'vitest',\n standalone: true,\n ssr: false,\n bundler: 'esbuild',\n serverRouting: false,\n skipFormat: true,\n tags: options.tags,\n };\n\n await (\n await import(\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n '@nx/angular/generators'\n )\n ).applicationGenerator(tree, {\n ...appOptions,\n directory: `${appsDir}/${options.analogAppName}`,\n });\n}\n"],"mappings":";;AAGA,eAAsB,cACpB,MACA,SACe;CACf,MAAM,OAAO,KAAK,OAAO,WAAW;CACpC,MAAM,UAAU,QAAA,GAAA,WAAA,oBAA0B,KAAK,CAAC,UAAU;CAE1D,MAAM,aACJ;EACE,MAAM,QAAQ;EACd,WAAW,GAAG,QAAQ,GAAG,QAAQ;EACjC,QAAQ,CAAC,QAAA,QAAA,IAAA,aAAoC,SAAS,SAAS;EAC/D,eAAe;EACf,gBAAgB;EAChB,YAAY;EACZ,KAAK;EACL,SAAS;EACT,eAAe;EACf,YAAY;EACZ,MAAM,QAAQ;EACf;AAEH,QACE,MAAM,OAGJ,2BAEF,qBAAqB,MAAM;EAC3B,GAAG;EACH,WAAW,GAAG,QAAQ,GAAG,QAAQ;EAClC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"add-files.js","names":[],"sources":["
|
|
1
|
+
{"version":3,"file":"add-files.js","names":[],"sources":["../../../../../../../../../nx-plugin/src/generators/app/lib/add-files.ts"],"sourcesContent":["import { generateFiles, Tree } from '@nx/devkit';\nimport { join } from 'node:path';\nimport { NormalizedOptions } from '../generator';\n\nexport function addFiles(\n tree: Tree,\n options: NormalizedOptions,\n majorAngularVersion: number,\n): void {\n const isNx = tree.exists('/nx.json');\n const templateOptions = {\n ...options,\n template: '',\n tsconfig: isNx ? 'tsconfig.base.json' : 'tsconfig.json',\n majorAngularVersion,\n };\n generateFiles(\n tree,\n join(__dirname, '..', 'files', 'template-angular'),\n options.projectRoot,\n templateOptions,\n );\n\n if (!tree.exists('/angular.json') && !tree.exists('/tsconfig.base.json')) {\n generateFiles(\n tree,\n join(__dirname, '..', 'files', 'root'),\n '.',\n templateOptions,\n );\n }\n}\n"],"mappings":";;;AAIA,SAAgB,SACd,MACA,SACA,qBACM;CACN,MAAM,OAAO,KAAK,OAAO,WAAW;CACpC,MAAM,kBAAkB;EACtB,GAAG;EACH,UAAU;EACV,UAAU,OAAO,uBAAuB;EACxC;EACD;AACD,EAAA,GAAA,WAAA,eACE,OAAA,GAAA,UAAA,MACK,WAAW,MAAM,SAAS,mBAAmB,EAClD,QAAQ,aACR,gBACD;AAED,KAAI,CAAC,KAAK,OAAO,gBAAgB,IAAI,CAAC,KAAK,OAAO,sBAAsB,CACtE,EAAA,GAAA,WAAA,eACE,OAAA,GAAA,UAAA,MACK,WAAW,MAAM,SAAS,OAAO,EACtC,KACA,gBACD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"add-home-page.js","names":[],"sources":["
|
|
1
|
+
{"version":3,"file":"add-home-page.js","names":[],"sources":["../../../../../../../../../nx-plugin/src/generators/app/lib/add-home-page.ts"],"sourcesContent":["import { generateFiles, Tree } from '@nx/devkit';\nimport { join } from 'node:path';\nimport { NormalizedOptions } from '../generator';\n\nexport function addHomePage(\n tree: Tree,\n options: NormalizedOptions,\n majorAngularVersion: number,\n): void {\n const templateOptions = {\n ...options,\n template: '',\n majorAngularVersion,\n };\n\n generateFiles(\n tree,\n join(__dirname, '..', 'files', 'index-page'),\n options.projectRoot,\n templateOptions,\n );\n\n const pageDirectory = options.addTailwind ? 'tailwind' : 'css';\n\n generateFiles(\n tree,\n join(__dirname, '..', 'files', 'welcome-components', pageDirectory),\n options.projectRoot,\n templateOptions,\n );\n}\n"],"mappings":";;;AAIA,SAAgB,YACd,MACA,SACA,qBACM;CACN,MAAM,kBAAkB;EACtB,GAAG;EACH,UAAU;EACV;EACD;AAED,EAAA,GAAA,WAAA,eACE,OAAA,GAAA,UAAA,MACK,WAAW,MAAM,SAAS,aAAa,EAC5C,QAAQ,aACR,gBACD;CAED,MAAM,gBAAgB,QAAQ,cAAc,aAAa;AAEzD,EAAA,GAAA,WAAA,eACE,OAAA,GAAA,UAAA,MACK,WAAW,MAAM,SAAS,sBAAsB,cAAc,EACnE,QAAQ,aACR,gBACD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"add-tailwind-config.js","names":[],"sources":["
|
|
1
|
+
{"version":3,"file":"add-tailwind-config.js","names":[],"sources":["../../../../../../../../../nx-plugin/src/generators/app/lib/add-tailwind-config.ts"],"sourcesContent":["import {\n formatFiles,\n GeneratorCallback,\n readProjectConfiguration,\n Tree,\n} from '@nx/devkit';\nimport {\n addTailwindRequiredPackages,\n detectTailwindInstalledVersion,\n normalizeOptions,\n updateApplicationStyles,\n} from './add-tailwind-helpers';\n\nexport async function addTailwindConfig(\n tree: Tree,\n projectName: string,\n): Promise<void> {\n await setupTailwindGenerator(tree, {\n project: projectName,\n });\n}\n\nexport interface GeneratorOptions {\n project: string;\n buildTarget?: string;\n skipFormat?: boolean;\n stylesEntryPoint?: string;\n skipPackageJson?: boolean;\n}\n\nexport interface NormalizedGeneratorOptions extends GeneratorOptions {\n buildTarget: string;\n}\n\nexport async function setupTailwindGenerator(\n tree: Tree,\n rawOptions: GeneratorOptions,\n): Promise<GeneratorCallback> {\n const options = normalizeOptions(rawOptions);\n const project = readProjectConfiguration(tree, options.project);\n\n // TODO: use return value for v5+ branching when needed\n detectTailwindInstalledVersion(tree);\n\n // eslint-disable-next-line @typescript-eslint/no-empty-function\n let installTask: GeneratorCallback = () => {};\n if (!options.skipPackageJson) {\n installTask = addTailwindRequiredPackages(tree);\n }\n\n if (project.projectType === 'application') {\n updateApplicationStyles(tree, options, project);\n }\n\n if (!options.skipFormat) {\n await formatFiles(tree);\n }\n\n return installTask;\n}\n"],"mappings":";;;AAaA,eAAsB,kBACpB,MACA,aACe;AACf,OAAM,uBAAuB,MAAM,EACjC,SAAS,aACV,CAAC;;AAeJ,eAAsB,uBACpB,MACA,YAC4B;CAC5B,MAAM,UAAU,6BAAA,iBAAiB,WAAW;CAC5C,MAAM,WAAA,GAAA,WAAA,0BAAmC,MAAM,QAAQ,QAAQ;AAG/D,8BAAA,+BAA+B,KAAK;CAGpC,IAAI,oBAAuC;AAC3C,KAAI,CAAC,QAAQ,gBACX,eAAc,6BAAA,4BAA4B,KAAK;AAGjD,KAAI,QAAQ,gBAAgB,cAC1B,8BAAA,wBAAwB,MAAM,SAAS,QAAQ;AAGjD,KAAI,CAAC,QAAQ,WACX,QAAA,GAAA,WAAA,aAAkB,KAAK;AAGzB,QAAO"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"add-tailwind-helpers.js","names":[],"sources":["
|
|
1
|
+
{"version":3,"file":"add-tailwind-helpers.js","names":[],"sources":["../../../../../../../../../nx-plugin/src/generators/app/lib/add-tailwind-helpers.ts"],"sourcesContent":["import { checkAndCleanWithSemver } from '@nx/devkit/src/utils/semver';\nimport { getTailwindDependencies } from '../versions/tailwind-dependencies';\nimport { lt } from 'semver';\nimport {\n Tree,\n readJson,\n addDependenciesToPackageJson,\n GeneratorCallback,\n ProjectConfiguration,\n joinPathFragments,\n stripIndents,\n} from '@nx/devkit';\nimport {\n GeneratorOptions,\n NormalizedGeneratorOptions,\n} from './add-tailwind-config';\n\nexport function normalizeOptions(\n options: GeneratorOptions,\n): NormalizedGeneratorOptions {\n return {\n ...options,\n buildTarget: options.buildTarget || 'build',\n };\n}\n\nexport function detectTailwindInstalledVersion(\n tree: Tree,\n): '4' | '5' | undefined {\n const { dependencies, devDependencies } = readJson(tree, 'package.json');\n const tailwindVersion =\n dependencies?.tailwindcss ?? devDependencies?.tailwindcss;\n\n if (!tailwindVersion) {\n return undefined;\n }\n\n const version = checkAndCleanWithSemver('tailwindcss', tailwindVersion);\n if (lt(version, '4.0.0')) {\n throw new Error(\n `The Tailwind CSS version \"${tailwindVersion}\" is not supported. Please upgrade to v4.0.0 or higher.`,\n );\n }\n return lt(version, '5.0.0') ? '4' : '5';\n}\n\nexport function addTailwindRequiredPackages(tree: Tree): GeneratorCallback {\n const pkgVersions = getTailwindDependencies();\n return addDependenciesToPackageJson(\n tree,\n {\n tailwindcss: pkgVersions.tailwindcss,\n '@tailwindcss/vite': pkgVersions['@tailwindcss/vite'],\n },\n {},\n );\n}\n\nexport function updateApplicationStyles(\n tree: Tree,\n options: NormalizedGeneratorOptions,\n project: ProjectConfiguration,\n): void {\n let stylesEntryPoint = options.stylesEntryPoint;\n\n if (stylesEntryPoint && !tree.exists(stylesEntryPoint)) {\n throw new Error(\n `The provided styles entry point \"${stylesEntryPoint}\" could not be found.`,\n );\n }\n\n if (!stylesEntryPoint) {\n stylesEntryPoint = findStylesEntryPoint(tree, options, project);\n\n if (!stylesEntryPoint) {\n throw new Error(\n stripIndents`Could not find a styles entry point for project \"${options.project}\".\n Please specify a styles entry point using the \"--stylesEntryPoint\" option.`,\n );\n }\n }\n\n if (!stylesEntryPoint.endsWith('.css')) {\n throw new Error(\n `Tailwind CSS v4 is not compatible with any css preprocessors like sass or less. Please use a css file as the styles entry point.`,\n );\n }\n\n const stylesEntryPointContent = tree.read(stylesEntryPoint, 'utf-8');\n\n tree.write(\n stylesEntryPoint,\n stripIndents`@import \"tailwindcss\";\n\n\n ${stylesEntryPointContent}`,\n );\n}\n\nfunction findStylesEntryPoint(\n tree: Tree,\n options: NormalizedGeneratorOptions,\n project: ProjectConfiguration,\n): string | undefined {\n // first check for common names\n const possibleStylesEntryPoints = [\n joinPathFragments(project.sourceRoot ?? project.root, 'styles.css'),\n joinPathFragments(project.sourceRoot ?? project.root, 'styles.scss'),\n joinPathFragments(project.sourceRoot ?? project.root, 'styles.sass'),\n joinPathFragments(project.sourceRoot ?? project.root, 'styles.less'),\n ];\n\n const stylesEntryPoint = possibleStylesEntryPoints.find((s) =>\n tree.exists(s),\n );\n if (stylesEntryPoint) {\n return stylesEntryPoint;\n }\n\n // then check for the specified styles in the build configuration if it exists\n const styles: Array<string | { input: string; inject: boolean }> =\n project.targets?.[options.buildTarget].options?.styles;\n\n if (!styles) {\n return undefined;\n }\n\n // find the first style that belongs to the project source\n const style = styles.find((s) =>\n typeof s === 'string'\n ? s.startsWith(project.root) && tree.exists(s)\n : s.input.startsWith(project.root) &&\n s.inject !== false &&\n tree.exists(s.input),\n );\n\n if (!style) {\n return undefined;\n }\n\n return typeof style === 'string' ? style : style.input;\n}\n"],"mappings":";;;;;AAiBA,SAAgB,iBACd,SAC4B;AAC5B,QAAO;EACL,GAAG;EACH,aAAa,QAAQ,eAAe;EACrC;;AAGH,SAAgB,+BACd,MACuB;CACvB,MAAM,EAAE,cAAc,qBAAA,GAAA,WAAA,UAA6B,MAAM,eAAe;CACxE,MAAM,kBACJ,cAAc,eAAe,iBAAiB;AAEhD,KAAI,CAAC,gBACH;CAGF,MAAM,WAAA,GAAA,4BAAA,yBAAkC,eAAe,gBAAgB;AACvE,MAAA,GAAA,OAAA,IAAO,SAAS,QAAQ,CACtB,OAAM,IAAI,MACR,6BAA6B,gBAAgB,yDAC9C;AAEH,SAAA,GAAA,OAAA,IAAU,SAAS,QAAQ,GAAG,MAAM;;AAGtC,SAAgB,4BAA4B,MAA+B;CACzE,MAAM,cAAc,8BAAA,yBAAyB;AAC7C,SAAA,GAAA,WAAA,8BACE,MACA;EACE,aAAa,YAAY;EACzB,qBAAqB,YAAY;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["../../../../../../../../../nx-plugin/src/generators/app/lib/cleanup-files.ts"],"sourcesContent":["import { Tree } from '@nx/devkit';\nimport { NormalizedOptions } from '../generator';\n\nexport function cleanupFiles(tree: Tree, options: NormalizedOptions): void {\n const files = [\n 'src/app/app.component.css',\n 'src/app/app.component.html',\n 'src/app/app.routes.ts',\n 'src/app/nx-welcome.component.ts',\n 'src/index.html',\n 'vite.config.mts',\n ];\n\n if (!options.isNx) {\n files.push('project.json');\n }\n\n files.forEach((file) => {\n const filePath = `${options.projectRoot}/${file}`;\n if (tree.exists(filePath)) {\n tree.delete(filePath);\n }\n });\n}\n"],"mappings":";AAGA,SAAgB,aAAa,MAAY,SAAkC;CACzE,MAAM,QAAQ;EACZ;EACA;EACA;EACA;EACA;EACA;EACD;AAED,KAAI,CAAC,QAAQ,KACX,OAAM,KAAK,eAAe;AAG5B,OAAM,SAAS,SAAS;EACtB,MAAM,WAAW,GAAG,QAAQ,YAAY,GAAG;AAC3C,MAAI,KAAK,OAAO,SAAS,CACvB,MAAK,OAAO,SAAS;GAEvB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"update-index-html.js","names":[],"sources":["
|
|
1
|
+
{"version":3,"file":"update-index-html.js","names":[],"sources":["../../../../../../../../../nx-plugin/src/generators/app/lib/update-index-html.ts"],"sourcesContent":["import { Tree, getProjects, joinPathFragments } from '@nx/devkit';\n\nexport function updateIndex(tree: Tree, projectName: string): void {\n const projects = getProjects(tree);\n const projectConfig = projects.get(projectName);\n if (!projectConfig) {\n return;\n }\n\n const indexPath = joinPathFragments(projectConfig.root, 'index.html');\n\n if (tree.exists(indexPath)) {\n const indexContents = tree.read(indexPath, 'utf-8');\n if (!indexContents) {\n return;\n }\n const updatedIndex = indexContents.replace(\n '</head>',\n `<link rel=\"stylesheet\" href=\"/src/styles.css\" />\n </head>`,\n );\n\n tree.write(indexPath, updatedIndex);\n }\n}\n"],"mappings":";;AAEA,SAAgB,YAAY,MAAY,aAA2B;CAEjE,MAAM,iBAAA,GAAA,WAAA,aADuB,KAAK,CACH,IAAI,YAAY;AAC/C,KAAI,CAAC,cACH;CAGF,MAAM,aAAA,GAAA,WAAA,mBAA8B,cAAc,MAAM,aAAa;AAErE,KAAI,KAAK,OAAO,UAAU,EAAE;EAC1B,MAAM,gBAAgB,KAAK,KAAK,WAAW,QAAQ;AACnD,MAAI,CAAC,cACH;EAEF,MAAM,eAAe,cAAc,QACjC,WACA;eAED;AAED,OAAK,MAAM,WAAW,aAAa"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"minimum-supported-versions.js","names":[],"sources":["
|
|
1
|
+
{"version":3,"file":"minimum-supported-versions.js","names":[],"sources":["../../../../../../../../../nx-plugin/src/generators/app/versions/minimum-supported-versions.ts"],"sourcesContent":["import { lt, coerce } from 'semver';\n\nexport const MINIMUM_SUPPORTED_NX_VERSION = '17.0.0';\nexport const MINIMUM_SUPPORTED_ANGULAR_VERSION = '17.0.0';\n\nexport const belowMinimumSupportedNxVersion = (nxVersion: string): boolean =>\n lt(coerce(nxVersion)!, MINIMUM_SUPPORTED_NX_VERSION);\n\nexport const belowMinimumSupportedAngularVersion = (\n angularVersion: string,\n): boolean => lt(coerce(angularVersion)!, MINIMUM_SUPPORTED_ANGULAR_VERSION);\n"],"mappings":";;AAEA,IAAa,+BAA+B;AAG5C,IAAa,kCAAkC,eAAA,GAAA,OAAA,KAAA,GAAA,OAAA,QACnC,UAAU,EAAG,6BAA6B"}
|
|
@@ -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.18";
|
|
4
|
+
export declare const V18_X_ANALOG_JS_ROUTER = "^3.0.0-alpha.18";
|
|
5
|
+
export declare const V18_X_ANALOG_JS_VITE_PLUGIN_ANGULAR = "^3.0.0-alpha.18";
|
|
6
|
+
export declare const V18_X_ANALOG_JS_VITEST_ANGULAR = "^3.0.0-alpha.18";
|
|
7
7
|
export declare const V18_X_FRONT_MATTER = "^4.0.2";
|
|
8
8
|
export declare const V18_X_MARKED = "^15.0.7";
|
|
9
9
|
export declare const V18_X_MARKED_GFM_HEADING_ID = "^4.1.1";
|
|
@@ -13,7 +13,7 @@ export declare const V18_X_MERMAID = "^10.2.4";
|
|
|
13
13
|
export declare const V18_X_PRISMJS = "^1.29.0";
|
|
14
14
|
export declare const V18_X_TAILWINDCSS = "^4.2.2";
|
|
15
15
|
export declare const V18_X_TAILWINDCSS_VITE = "^4.2.2";
|
|
16
|
-
export declare const V18_X_ANALOG_JS_PLATFORM = "^3.0.0-alpha.
|
|
16
|
+
export declare const V18_X_ANALOG_JS_PLATFORM = "^3.0.0-alpha.18";
|
|
17
17
|
export declare const V18_X_ANGULAR_DEVKIT_BUILD_ANGULAR = "^19.0.0";
|
|
18
18
|
export declare const V18_X_NX_VITE = "^21.0.0";
|
|
19
19
|
export declare const V18_X_NX_LINTER = "^21.0.0";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"versions.js","names":[],"sources":["
|
|
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.18';\nexport const V18_X_ANALOG_JS_ROUTER = '^3.0.0-alpha.18';\nexport const V18_X_ANALOG_JS_VITE_PLUGIN_ANGULAR = '^3.0.0-alpha.18';\nexport const V18_X_ANALOG_JS_VITEST_ANGULAR = '^3.0.0-alpha.18';\nexport const V18_X_FRONT_MATTER = '^4.0.2';\nexport const V18_X_MARKED = '^15.0.7';\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_VITE = '^4.2.2';\n\n// devDependencies\nexport const V18_X_ANALOG_JS_PLATFORM = '^3.0.0-alpha.18';\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 = '^4.0.0';\nexport const V18_X_ZOD = '^3.21.4';\n"],"mappings":";AAeA,IAAa,oBAAoB;AACjC,IAAa,yBAAyB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tailwind-dependencies.js","names":[],"sources":["
|
|
1
|
+
{"version":3,"file":"tailwind-dependencies.js","names":[],"sources":["../../../../../../../../../nx-plugin/src/generators/app/versions/tailwind-dependencies.ts"],"sourcesContent":["import { V18_X_TAILWINDCSS, V18_X_TAILWINDCSS_VITE } from './nx_18_X/versions';\n\nconst tailwindDependencyKeys = ['tailwindcss', '@tailwindcss/vite'] as const;\n\nexport type TailwindDependency = (typeof tailwindDependencyKeys)[number];\n\nexport const getTailwindDependencies = (): Record<\n TailwindDependency,\n string\n> => {\n return {\n tailwindcss: V18_X_TAILWINDCSS,\n '@tailwindcss/vite': V18_X_TAILWINDCSS_VITE,\n };\n};\n"],"mappings":";;AAMA,IAAa,gCAGR;AACH,QAAO;EACL,aAAa,iBAAA;EACb,qBAAqB,iBAAA;EACtB"}
|