@analogjs/platform 3.0.0-alpha.54 → 3.0.0-alpha.56
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/migrations/migration.json +7 -1
- package/package.json +8 -5
- package/src/index.d.ts +2 -0
- package/src/index.js +2 -1
- package/src/index.js.map +1 -1
- package/src/lib/deps-plugin.js +2 -5
- package/src/lib/deps-plugin.js.map +1 -1
- package/src/lib/discover-library-routes.d.ts +9 -0
- package/src/lib/discover-library-routes.js +12 -1
- package/src/lib/discover-library-routes.js.map +1 -1
- package/src/lib/nitro/analog-nitro-plugin.d.ts +8 -0
- package/src/lib/nitro/analog-nitro-plugin.js +502 -0
- package/src/lib/nitro/analog-nitro-plugin.js.map +1 -0
- package/src/lib/nitro/angular-linker-plugin.d.ts +17 -0
- package/src/lib/nitro/angular-linker-plugin.js +51 -0
- package/src/lib/nitro/angular-linker-plugin.js.map +1 -0
- package/src/lib/nitro/build-sitemap.d.ts +23 -0
- package/src/lib/nitro/build-sitemap.js +137 -0
- package/src/lib/nitro/build-sitemap.js.map +1 -0
- package/src/lib/nitro/debug.d.ts +5 -0
- package/src/lib/nitro/debug.js +11 -0
- package/src/lib/nitro/debug.js.map +1 -0
- package/src/lib/nitro/get-content-files.d.ts +13 -0
- package/src/lib/nitro/get-content-files.js +52 -0
- package/src/lib/nitro/get-content-files.js.map +1 -0
- package/src/lib/nitro/get-page-handlers.d.ts +23 -0
- package/src/lib/nitro/get-page-handlers.js +34 -0
- package/src/lib/nitro/get-page-handlers.js.map +1 -0
- package/src/lib/nitro/i18n-prerender.d.ts +29 -0
- package/src/lib/nitro/i18n-prerender.js +61 -0
- package/src/lib/nitro/i18n-prerender.js.map +1 -0
- package/src/lib/nitro/page-endpoints-plugin.d.ts +7 -0
- package/src/lib/nitro/page-endpoints-plugin.js +72 -0
- package/src/lib/nitro/page-endpoints-plugin.js.map +1 -0
- package/src/lib/nitro/post-rendering-hook.d.ts +2 -0
- package/src/lib/nitro/post-rendering-hook.js +10 -0
- package/src/lib/nitro/post-rendering-hook.js.map +1 -0
- package/src/lib/nitro/renderers.d.ts +53 -0
- package/src/lib/nitro/renderers.js +22 -0
- package/src/lib/nitro/renderers.js.map +1 -0
- package/src/lib/nitro/types.d.ts +122 -0
- package/src/lib/nx-plugin/_virtual/_rolldown/runtime.js +23 -0
- package/src/lib/nx-plugin/builders.json +10 -2
- package/src/lib/nx-plugin/executors.json +10 -7
- package/src/lib/nx-plugin/src/builders/vite/schema.json +39 -0
- package/src/lib/nx-plugin/src/builders/vite/vite-build.d.ts +11 -0
- package/src/lib/nx-plugin/src/builders/vite/vite-build.js +18 -0
- package/src/lib/nx-plugin/src/builders/vite/vite-build.js.map +1 -0
- package/src/lib/nx-plugin/src/builders/vite-dev-server/dev-server.d.ts +7 -0
- package/src/lib/nx-plugin/src/builders/vite-dev-server/dev-server.js +14 -0
- package/src/lib/nx-plugin/src/builders/vite-dev-server/dev-server.js.map +1 -0
- package/src/lib/nx-plugin/src/builders/vite-dev-server/schema.json +27 -0
- package/src/lib/nx-plugin/src/executors/vite-dev-server/compat.js +1 -0
- 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 +1 -0
- 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 +1 -0
- package/src/lib/nx-plugin/src/executors/vitest/compat.js.map +1 -1
- package/src/lib/nx-plugin/src/executors/vitest/vitest.impl.js +1 -0
- package/src/lib/nx-plugin/src/executors/vitest/vitest.impl.js.map +1 -1
- package/src/lib/nx-plugin/src/generators/app/compat.js +1 -0
- package/src/lib/nx-plugin/src/generators/app/compat.js.map +1 -1
- package/src/lib/nx-plugin/src/generators/app/generator.js +1 -0
- 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 +1 -0
- 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 +1 -0
- 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 +1 -0
- 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 +1 -0
- 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 +1 -0
- 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 +1 -0
- 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/update-index-html.js +1 -0
- 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 +1 -0
- 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/init/compat.js +1 -0
- package/src/lib/nx-plugin/src/generators/init/compat.js.map +1 -1
- package/src/lib/nx-plugin/src/generators/init/generator.js +1 -0
- 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 +1 -0
- 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 +1 -0
- 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 +1 -0
- 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-index-html.js +1 -0
- 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 +1 -0
- 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 +1 -0
- 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 +1 -0
- 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 +1 -0
- 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 +1 -0
- 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 +1 -0
- package/src/lib/nx-plugin/src/generators/page/compat.js.map +1 -1
- package/src/lib/nx-plugin/src/generators/page/generator.js +1 -0
- package/src/lib/nx-plugin/src/generators/page/generator.js.map +1 -1
- package/src/lib/nx-plugin/src/generators/preset/generator.js +1 -0
- package/src/lib/nx-plugin/src/generators/preset/generator.js.map +1 -1
- package/src/lib/nx-plugin/src/generators/setup-vitest/compat.js +1 -0
- 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 +1 -0
- 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 +1 -0
- 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 +1 -0
- 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 +1 -0
- 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 +1 -0
- package/src/lib/nx-plugin/src/utils/version-utils.js.map +1 -1
- package/src/lib/nx-plugin/src/utils/versions/dependencies.js +1 -0
- package/src/lib/nx-plugin/src/utils/versions/dependencies.js.map +1 -1
- package/src/lib/nx-plugin/src/utils/versions/dev-dependencies.js +1 -0
- package/src/lib/nx-plugin/src/utils/versions/dev-dependencies.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/options.d.ts +9 -146
- package/src/lib/platform-plugin.js +3 -40
- package/src/lib/platform-plugin.js.map +1 -1
- package/src/lib/style-pipeline.d.ts +0 -1
- package/src/lib/style-pipeline.js.map +1 -1
- package/src/lib/utils/debug.js +2 -2
- package/src/lib/utils/debug.js.map +1 -1
- package/src/lib/nx-plugin/src/executors/vite/compat.d.ts +0 -3
- package/src/lib/nx-plugin/src/executors/vite/compat.js +0 -7
- package/src/lib/nx-plugin/src/executors/vite/compat.js.map +0 -1
- package/src/lib/nx-plugin/src/executors/vite/schema.d.ts +0 -2
- package/src/lib/nx-plugin/src/executors/vite/schema.json +0 -147
- package/src/lib/nx-plugin/src/executors/vite/vite.impl.d.ts +0 -2
- package/src/lib/nx-plugin/src/executors/vite/vite.impl.js +0 -6
- package/src/lib/nx-plugin/src/executors/vite/vite.impl.js.map +0 -1
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Code snippet emitted into virtual modules to create a request-scoped
|
|
3
|
+
* fetch using ofetch's `createFetch` + h3's `fetchWithEvent`.
|
|
4
|
+
*
|
|
5
|
+
* Shared between the SSR renderer and page-endpoint virtual modules so
|
|
6
|
+
* the fetch-wiring logic stays in sync.
|
|
7
|
+
*
|
|
8
|
+
* The emitted variable is named `serverFetch` — callers should reference it
|
|
9
|
+
* by that name.
|
|
10
|
+
*/
|
|
11
|
+
export declare const SERVER_FETCH_FACTORY_SNIPPET = "\n const serverFetch = createFetch({\n fetch: (resource, init) => {\n const url = resource instanceof Request ? resource.url : resource.toString();\n return fetchWithEvent(event, url, init);\n }\n });";
|
|
12
|
+
/**
|
|
13
|
+
* SSR renderer virtual module content.
|
|
14
|
+
*
|
|
15
|
+
* This code runs inside Nitro's server runtime (Node.js context) where
|
|
16
|
+
* event.node is always populated. In h3 v2, event.node is typed as optional,
|
|
17
|
+
* so we use h3's first-class event properties (event.path, event.method) where
|
|
18
|
+
* possible and apply optional chaining when accessing the Node.js context for
|
|
19
|
+
* the Angular renderer which requires raw req/res objects.
|
|
20
|
+
*
|
|
21
|
+
* h3 v2 idiomatic APIs used:
|
|
22
|
+
* - defineHandler (replaces defineEventHandler / eventHandler)
|
|
23
|
+
* - event.path (replaces event.node.req.url)
|
|
24
|
+
* - getResponseHeader compat shim (still available in h3 v2)
|
|
25
|
+
*/
|
|
26
|
+
export declare function ssrRenderer(): string;
|
|
27
|
+
/**
|
|
28
|
+
* Client-only renderer virtual module content.
|
|
29
|
+
*
|
|
30
|
+
* Used when SSR is disabled — simply serves the static index.html template
|
|
31
|
+
* for every route, letting the client-side Angular router handle navigation.
|
|
32
|
+
*/
|
|
33
|
+
export declare function clientRenderer(): string;
|
|
34
|
+
/**
|
|
35
|
+
* API middleware virtual module content.
|
|
36
|
+
*
|
|
37
|
+
* Intercepts requests matching the configured API prefix and either:
|
|
38
|
+
* - Uses event-bound internal forwarding for GET requests (except .xml routes)
|
|
39
|
+
* - Uses request proxying for all other methods to forward the full request
|
|
40
|
+
*
|
|
41
|
+
* h3 v2 idiomatic APIs used:
|
|
42
|
+
* - defineHandler (replaces defineEventHandler / eventHandler)
|
|
43
|
+
* - event.path (replaces event.node.req.url)
|
|
44
|
+
* - event.method (replaces event.node.req.method)
|
|
45
|
+
* - proxyRequest is retained internally because it preserves Nitro route
|
|
46
|
+
* matching for event-bound server requests during SSR/prerender
|
|
47
|
+
* - Object.fromEntries(event.req.headers.entries()) replaces direct event.node.req.headers access
|
|
48
|
+
*
|
|
49
|
+
* `fetchWithEvent` keeps the active event context while forwarding to a
|
|
50
|
+
* rewritten path, which avoids falling through to the HTML renderer when
|
|
51
|
+
* SSR code makes relative API requests.
|
|
52
|
+
*/
|
|
53
|
+
export declare const apiMiddleware = "\nimport { defineHandler, fetchWithEvent, proxyRequest } from 'nitro/h3';\nimport { useRuntimeConfig } from 'nitro/runtime-config';\n\nexport default defineHandler(async (event) => {\n const prefix = useRuntimeConfig().prefix;\n const apiPrefix = `${prefix}/${useRuntimeConfig().apiPrefix}`;\n\n // Match the configured prefix as a full path segment. A bare\n // startsWith would false-match /apiary against an apiPrefix of /api.\n if (\n event.path === apiPrefix ||\n event.path?.startsWith(apiPrefix + '/')\n ) {\n const reqUrl = event.path?.replace(apiPrefix, '');\n\n if (\n event.method === 'GET' &&\n // in the case of XML routes, we want to proxy the request so that nitro gets the correct headers\n // and can render the XML correctly as a static asset\n !event.path?.endsWith('.xml')\n ) {\n return fetchWithEvent(event, reqUrl, {\n headers: Object.fromEntries(event.req.headers.entries()),\n });\n }\n\n return proxyRequest(event, reqUrl);\n }\n});";
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
//#region packages/platform/src/lib/nitro/renderers.ts
|
|
2
|
+
/**
|
|
3
|
+
* Code snippet emitted into virtual modules to create a request-scoped
|
|
4
|
+
* fetch using ofetch's `createFetch` + h3's `fetchWithEvent`.
|
|
5
|
+
*
|
|
6
|
+
* Shared between the SSR renderer and page-endpoint virtual modules so
|
|
7
|
+
* the fetch-wiring logic stays in sync.
|
|
8
|
+
*
|
|
9
|
+
* The emitted variable is named `serverFetch` — callers should reference it
|
|
10
|
+
* by that name.
|
|
11
|
+
*/
|
|
12
|
+
var SERVER_FETCH_FACTORY_SNIPPET = `
|
|
13
|
+
const serverFetch = createFetch({
|
|
14
|
+
fetch: (resource, init) => {
|
|
15
|
+
const url = resource instanceof Request ? resource.url : resource.toString();
|
|
16
|
+
return fetchWithEvent(event, url, init);
|
|
17
|
+
}
|
|
18
|
+
});`;
|
|
19
|
+
//#endregion
|
|
20
|
+
export { SERVER_FETCH_FACTORY_SNIPPET };
|
|
21
|
+
|
|
22
|
+
//# sourceMappingURL=renderers.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"renderers.js","names":[],"sources":["../../../../src/lib/nitro/renderers.ts"],"sourcesContent":["/**\n * Code snippet emitted into virtual modules to create a request-scoped\n * fetch using ofetch's `createFetch` + h3's `fetchWithEvent`.\n *\n * Shared between the SSR renderer and page-endpoint virtual modules so\n * the fetch-wiring logic stays in sync.\n *\n * The emitted variable is named `serverFetch` — callers should reference it\n * by that name.\n */\nexport const SERVER_FETCH_FACTORY_SNIPPET = `\n const serverFetch = createFetch({\n fetch: (resource, init) => {\n const url = resource instanceof Request ? resource.url : resource.toString();\n return fetchWithEvent(event, url, init);\n }\n });`;\n\n/**\n * SSR renderer virtual module content.\n *\n * This code runs inside Nitro's server runtime (Node.js context) where\n * event.node is always populated. In h3 v2, event.node is typed as optional,\n * so we use h3's first-class event properties (event.path, event.method) where\n * possible and apply optional chaining when accessing the Node.js context for\n * the Angular renderer which requires raw req/res objects.\n *\n * h3 v2 idiomatic APIs used:\n * - defineHandler (replaces defineEventHandler / eventHandler)\n * - event.path (replaces event.node.req.url)\n * - getResponseHeader compat shim (still available in h3 v2)\n */\nexport function ssrRenderer() {\n return `\nimport { createFetch } from 'ofetch';\nimport { defineHandler, fetchWithEvent } from 'nitro/h3';\n// @ts-ignore\nimport renderer from '#analog/ssr';\nimport template from '#analog/index';\n\nconst normalizeHtmlRequestUrl = (url) =>\n url.replace(/\\\\/index\\\\.html(?=$|[?#])/, '/');\n\nexport default defineHandler(async (event) => {\n event.res.headers.set('content-type', 'text/html; charset=utf-8');\n const noSSR = event.res.headers.get('x-analog-no-ssr');\n const requestPath = normalizeHtmlRequestUrl(event.path);\n\n if (noSSR === 'true') {\n return template;\n }\n\n // event.path is the canonical h3 v2 way to access the request URL.\n // event.node?.req and event.node?.res are needed by the Angular SSR renderer\n // which operates on raw Node.js request/response objects.\n // During prerendering (Nitro v3 fetch-based pipeline), event.node is undefined.\n // The Angular renderer requires a req object with at least { headers, url },\n // so we provide a minimal stub to avoid runtime errors in prerender context.\n const req = event.node?.req\n ? {\n ...event.node.req,\n url: requestPath,\n originalUrl: requestPath,\n }\n : {\n headers: { host: 'localhost' },\n url: requestPath,\n originalUrl: requestPath,\n connection: {},\n };\n const res = event.node?.res;\n${SERVER_FETCH_FACTORY_SNIPPET}\n\n const html = await renderer(requestPath, template, { req, res, fetch: serverFetch });\n\n return html;\n});`;\n}\n\n/**\n * Client-only renderer virtual module content.\n *\n * Used when SSR is disabled — simply serves the static index.html template\n * for every route, letting the client-side Angular router handle navigation.\n */\nexport function clientRenderer() {\n return `\nimport { defineHandler } from 'nitro/h3';\nimport template from '#analog/index';\n\nexport default defineHandler(async (event) => {\n event.res.headers.set('content-type', 'text/html; charset=utf-8');\n return template;\n});\n`;\n}\n\n/**\n * API middleware virtual module content.\n *\n * Intercepts requests matching the configured API prefix and either:\n * - Uses event-bound internal forwarding for GET requests (except .xml routes)\n * - Uses request proxying for all other methods to forward the full request\n *\n * h3 v2 idiomatic APIs used:\n * - defineHandler (replaces defineEventHandler / eventHandler)\n * - event.path (replaces event.node.req.url)\n * - event.method (replaces event.node.req.method)\n * - proxyRequest is retained internally because it preserves Nitro route\n * matching for event-bound server requests during SSR/prerender\n * - Object.fromEntries(event.req.headers.entries()) replaces direct event.node.req.headers access\n *\n * `fetchWithEvent` keeps the active event context while forwarding to a\n * rewritten path, which avoids falling through to the HTML renderer when\n * SSR code makes relative API requests.\n */\nexport const apiMiddleware = `\nimport { defineHandler, fetchWithEvent, proxyRequest } from 'nitro/h3';\nimport { useRuntimeConfig } from 'nitro/runtime-config';\n\nexport default defineHandler(async (event) => {\n const prefix = useRuntimeConfig().prefix;\n const apiPrefix = \\`\\${prefix}/\\${useRuntimeConfig().apiPrefix}\\`;\n\n // Match the configured prefix as a full path segment. A bare\n // startsWith would false-match /apiary against an apiPrefix of /api.\n if (\n event.path === apiPrefix ||\n event.path?.startsWith(apiPrefix + '/')\n ) {\n const reqUrl = event.path?.replace(apiPrefix, '');\n\n if (\n event.method === 'GET' &&\n // in the case of XML routes, we want to proxy the request so that nitro gets the correct headers\n // and can render the XML correctly as a static asset\n !event.path?.endsWith('.xml')\n ) {\n return fetchWithEvent(event, reqUrl, {\n headers: Object.fromEntries(event.req.headers.entries()),\n });\n }\n\n return proxyRequest(event, reqUrl);\n }\n});`;\n"],"mappings":";;;;;;;;;;;AAUA,IAAa,+BAA+B"}
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
import type { PrerenderRoute } from "nitro/types";
|
|
2
|
+
export interface I18nPrerenderOptions {
|
|
3
|
+
/**
|
|
4
|
+
* The default/source locale for the application.
|
|
5
|
+
*/
|
|
6
|
+
defaultLocale: string;
|
|
7
|
+
/**
|
|
8
|
+
* List of supported locale identifiers.
|
|
9
|
+
* Each route will be prerendered once per locale with a locale prefix.
|
|
10
|
+
*/
|
|
11
|
+
locales: string[];
|
|
12
|
+
}
|
|
13
|
+
export interface PrerenderOptions {
|
|
14
|
+
/**
|
|
15
|
+
* Add additional routes to prerender through crawling page links.
|
|
16
|
+
*/
|
|
17
|
+
discover?: boolean;
|
|
18
|
+
/**
|
|
19
|
+
* List of routes to prerender resolved statically or dynamically.
|
|
20
|
+
*/
|
|
21
|
+
routes?: (string | PrerenderContentDir | PrerenderRouteConfig)[] | (() => Promise<(string | PrerenderContentDir | PrerenderRouteConfig | undefined)[]>);
|
|
22
|
+
sitemap?: SitemapConfig;
|
|
23
|
+
/** List of functions that run for each route after pre-rendering is complete. */
|
|
24
|
+
postRenderingHooks?: ((routes: PrerenderRoute) => Promise<void>)[];
|
|
25
|
+
}
|
|
26
|
+
export type SitemapPriority = number | `${number}`;
|
|
27
|
+
export interface SitemapRouteDefinition {
|
|
28
|
+
route: string;
|
|
29
|
+
lastmod?: string;
|
|
30
|
+
changefreq?: "always" | "hourly" | "daily" | "weekly" | "monthly" | "yearly" | "never";
|
|
31
|
+
priority?: SitemapPriority;
|
|
32
|
+
}
|
|
33
|
+
export interface SitemapEntry extends SitemapRouteDefinition {
|
|
34
|
+
loc: string;
|
|
35
|
+
}
|
|
36
|
+
export type SitemapRouteInput = string | SitemapRouteDefinition | undefined;
|
|
37
|
+
export type SitemapRouteSource = SitemapRouteInput[] | (() => Promise<SitemapRouteInput[]>);
|
|
38
|
+
export type SitemapExcludeRule = string | RegExp | ((entry: SitemapEntry) => boolean | Promise<boolean>);
|
|
39
|
+
export type SitemapTransform = (entry: SitemapEntry) => SitemapRouteDefinition | false | Promise<SitemapRouteDefinition | false>;
|
|
40
|
+
export interface SitemapConfig {
|
|
41
|
+
host: string;
|
|
42
|
+
include?: SitemapRouteSource;
|
|
43
|
+
exclude?: SitemapExcludeRule[];
|
|
44
|
+
defaults?: PrerenderSitemapConfig;
|
|
45
|
+
transform?: SitemapTransform;
|
|
46
|
+
}
|
|
47
|
+
export interface PrerenderContentDir {
|
|
48
|
+
/**
|
|
49
|
+
* The directory where files should be grabbed from.
|
|
50
|
+
* @example `/src/contents/blog`
|
|
51
|
+
*/
|
|
52
|
+
contentDir: string;
|
|
53
|
+
/**
|
|
54
|
+
* Transform the matching content files path into a route.
|
|
55
|
+
* The function is called for each matching content file within the specified contentDir.
|
|
56
|
+
* @param file information of the matching file (`path`, `name`, `extension`, `attributes`, `content`)
|
|
57
|
+
* @returns a string with the route should be returned (e. g. `/blog/<slug>`) or the value `false`, when the route should not be prerendered.
|
|
58
|
+
*/
|
|
59
|
+
transform: (file: PrerenderContentFile) => string | false;
|
|
60
|
+
/**
|
|
61
|
+
* Customize the sitemap definition for the prerendered route
|
|
62
|
+
*
|
|
63
|
+
* https://www.sitemaps.org/protocol.html#xmlTagDefinitions
|
|
64
|
+
*/
|
|
65
|
+
sitemap?: PrerenderSitemapConfig | ((file: PrerenderContentFile) => PrerenderSitemapConfig);
|
|
66
|
+
/**
|
|
67
|
+
* Output the source markdown content alongside the prerendered route.
|
|
68
|
+
* The source file will be accessible at the route path with a .md extension.
|
|
69
|
+
* @param file information of the matching file including its content
|
|
70
|
+
* @returns the markdown content string to output, or `false` to skip outputting for this file
|
|
71
|
+
*/
|
|
72
|
+
outputSourceFile?: (file: PrerenderContentFile) => string | false;
|
|
73
|
+
/**
|
|
74
|
+
* Recurse into subdirectories of `contentDir` when discovering files.
|
|
75
|
+
* When enabled, the matching file's directory relative to `contentDir`
|
|
76
|
+
* is exposed via `PrerenderContentFile.relativePath` so transforms can
|
|
77
|
+
* disambiguate identically-named files across subdirectories.
|
|
78
|
+
* @default false
|
|
79
|
+
*/
|
|
80
|
+
recursive?: boolean;
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* @param path the path to the content file
|
|
84
|
+
* @param name the basename of the matching content file without the file extension
|
|
85
|
+
* @param extension the file extension
|
|
86
|
+
* @param attributes the frontmatter attributes extracted from the frontmatter section of the file
|
|
87
|
+
* @param content the raw file content including frontmatter
|
|
88
|
+
* @param relativePath when `recursive` is enabled, the directory of the file relative to `contentDir` (empty string for files at the top level)
|
|
89
|
+
* @returns a string with the route should be returned (e. g. `/blog/<slug>`) or the value `false`, when the route should not be prerendered.
|
|
90
|
+
*/
|
|
91
|
+
export interface PrerenderContentFile {
|
|
92
|
+
path: string;
|
|
93
|
+
attributes: Record<string, any>;
|
|
94
|
+
name: string;
|
|
95
|
+
extension: string;
|
|
96
|
+
content: string;
|
|
97
|
+
relativePath?: string;
|
|
98
|
+
}
|
|
99
|
+
export interface PrerenderSitemapConfig {
|
|
100
|
+
lastmod?: string;
|
|
101
|
+
changefreq?: "always" | "hourly" | "daily" | "weekly" | "monthly" | "yearly" | "never";
|
|
102
|
+
priority?: SitemapPriority;
|
|
103
|
+
}
|
|
104
|
+
export interface PrerenderRouteConfig {
|
|
105
|
+
route: string;
|
|
106
|
+
/**
|
|
107
|
+
* Customize the sitemap definition for the prerendered route
|
|
108
|
+
*
|
|
109
|
+
* https://www.sitemaps.org/protocol.html#xmlTagDefinitions
|
|
110
|
+
*/
|
|
111
|
+
sitemap?: PrerenderSitemapConfig | (() => PrerenderSitemapConfig);
|
|
112
|
+
/**
|
|
113
|
+
* Prerender static data for the prerendered route
|
|
114
|
+
*/
|
|
115
|
+
staticData?: boolean;
|
|
116
|
+
/**
|
|
117
|
+
* Path to the source markdown file to output alongside the prerendered route.
|
|
118
|
+
* The source file will be accessible at the route path with a .md extension.
|
|
119
|
+
* @example 'src/content/overview.md'
|
|
120
|
+
*/
|
|
121
|
+
outputSourceFile?: string;
|
|
122
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
//#region \0rolldown/runtime.js
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __copyProps = (to, from, except, desc) => {
|
|
9
|
+
if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
|
|
10
|
+
key = keys[i];
|
|
11
|
+
if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
12
|
+
get: ((k) => from[k]).bind(null, key),
|
|
13
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
14
|
+
});
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
19
|
+
value: mod,
|
|
20
|
+
enumerable: true
|
|
21
|
+
}) : target, mod));
|
|
22
|
+
//#endregion
|
|
23
|
+
exports.__toESM = __toESM;
|
|
@@ -1,7 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"builders": {
|
|
3
|
-
"vite-dev-server":
|
|
4
|
-
|
|
3
|
+
"vite-dev-server": {
|
|
4
|
+
"implementation": "./src/builders/vite-dev-server/dev-server.js",
|
|
5
|
+
"schema": "./src/builders/vite-dev-server/schema.json",
|
|
6
|
+
"description": "Vite dev server."
|
|
7
|
+
},
|
|
8
|
+
"vite": {
|
|
9
|
+
"implementation": "./src/builders/vite/vite-build.js",
|
|
10
|
+
"schema": "./src/builders/vite/schema.json",
|
|
11
|
+
"description": "Build with Vite."
|
|
12
|
+
},
|
|
5
13
|
"vitest": "@analogjs/vitest-angular:test"
|
|
6
14
|
}
|
|
7
15
|
}
|
|
@@ -1,7 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"builders": {
|
|
3
|
-
"vite-dev-server":
|
|
4
|
-
|
|
3
|
+
"vite-dev-server": {
|
|
4
|
+
"implementation": "./src/builders/vite-dev-server/dev-server.js",
|
|
5
|
+
"schema": "./src/builders/vite-dev-server/schema.json",
|
|
6
|
+
"description": "Vite dev server."
|
|
7
|
+
},
|
|
8
|
+
"vite": {
|
|
9
|
+
"implementation": "./src/builders/vite/vite-build.js",
|
|
10
|
+
"schema": "./src/builders/vite/schema.json",
|
|
11
|
+
"description": "Build with Vite."
|
|
12
|
+
},
|
|
5
13
|
"vitest": "@analogjs/vitest-angular:test"
|
|
6
14
|
},
|
|
7
15
|
"executors": {
|
|
@@ -10,11 +18,6 @@
|
|
|
10
18
|
"schema": "./src/executors/vite-dev-server/schema.json",
|
|
11
19
|
"description": "Vite dev server."
|
|
12
20
|
},
|
|
13
|
-
"vite": {
|
|
14
|
-
"implementation": "./src/executors/vite/vite.impl",
|
|
15
|
-
"schema": "./src/executors/vite/schema.json",
|
|
16
|
-
"description": "Build with Vite."
|
|
17
|
-
},
|
|
18
21
|
"vitest": {
|
|
19
22
|
"implementation": "./src/executors/vitest/vitest.impl",
|
|
20
23
|
"schema": "./src/executors/vitest/schema.json",
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 2,
|
|
3
|
+
"outputCapture": "direct-nodejs",
|
|
4
|
+
"title": "Vite Prod Builder",
|
|
5
|
+
"cli": "nx",
|
|
6
|
+
"description": "Builds a Vite.js application for production.",
|
|
7
|
+
"type": "object",
|
|
8
|
+
"properties": {
|
|
9
|
+
"outputPath": {
|
|
10
|
+
"type": "string",
|
|
11
|
+
"description": "The output path of the generated files.",
|
|
12
|
+
"x-completion-type": "directory",
|
|
13
|
+
"x-priority": "important"
|
|
14
|
+
},
|
|
15
|
+
"configFile": {
|
|
16
|
+
"type": "string",
|
|
17
|
+
"description": "The name of the Vite.js configuration file.",
|
|
18
|
+
"x-completion-type": "file",
|
|
19
|
+
"x-completion-glob": "vite.config.@(js|ts)"
|
|
20
|
+
},
|
|
21
|
+
"sourcemap": {
|
|
22
|
+
"description": "Output sourcemaps. Use 'hidden' for use with error reporting tools without generating sourcemap comment.",
|
|
23
|
+
"oneOf": [
|
|
24
|
+
{
|
|
25
|
+
"type": "boolean"
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
"type": "string"
|
|
29
|
+
}
|
|
30
|
+
]
|
|
31
|
+
},
|
|
32
|
+
"mode": {
|
|
33
|
+
"type": "string",
|
|
34
|
+
"description": "Mode to run the build in."
|
|
35
|
+
}
|
|
36
|
+
},
|
|
37
|
+
"definitions": {},
|
|
38
|
+
"required": ["outputPath"]
|
|
39
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Thin shim that re-exports the Angular Devkit Architect build builder
|
|
3
|
+
* shipped by `@analogjs/vite-plugin-angular`. Architect resolves the
|
|
4
|
+
* implementation from the local `builders.json` entry without traversing a
|
|
5
|
+
* cross-package string redirect, so the user-facing `@analogjs/platform:vite`
|
|
6
|
+
* identifier stays stable while the real implementation continues to live in
|
|
7
|
+
* `@analogjs/vite-plugin-angular`. Mirrors `@analogjs/storybook-angular`'s
|
|
8
|
+
* pattern for surfacing `@storybook/angular`'s builders.
|
|
9
|
+
*/
|
|
10
|
+
import viteBuilder from "@analogjs/vite-plugin-angular/builders/vite";
|
|
11
|
+
export default viteBuilder;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
const require_runtime = require("../../../_virtual/_rolldown/runtime.js");
|
|
2
|
+
let _analogjs_vite_plugin_angular_builders_vite = require("@analogjs/vite-plugin-angular/builders/vite");
|
|
3
|
+
_analogjs_vite_plugin_angular_builders_vite = require_runtime.__toESM(_analogjs_vite_plugin_angular_builders_vite);
|
|
4
|
+
//#region packages/nx-plugin/src/builders/vite/vite-build.ts
|
|
5
|
+
/**
|
|
6
|
+
* Thin shim that re-exports the Angular Devkit Architect build builder
|
|
7
|
+
* shipped by `@analogjs/vite-plugin-angular`. Architect resolves the
|
|
8
|
+
* implementation from the local `builders.json` entry without traversing a
|
|
9
|
+
* cross-package string redirect, so the user-facing `@analogjs/platform:vite`
|
|
10
|
+
* identifier stays stable while the real implementation continues to live in
|
|
11
|
+
* `@analogjs/vite-plugin-angular`. Mirrors `@analogjs/storybook-angular`'s
|
|
12
|
+
* pattern for surfacing `@storybook/angular`'s builders.
|
|
13
|
+
*/
|
|
14
|
+
var vite_build_default = _analogjs_vite_plugin_angular_builders_vite.default;
|
|
15
|
+
//#endregion
|
|
16
|
+
module.exports = vite_build_default;
|
|
17
|
+
|
|
18
|
+
//# sourceMappingURL=vite-build.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vite-build.js","names":[],"sources":["../../../../../../../../nx-plugin/src/builders/vite/vite-build.ts"],"sourcesContent":["/**\n * Thin shim that re-exports the Angular Devkit Architect build builder\n * shipped by `@analogjs/vite-plugin-angular`. Architect resolves the\n * implementation from the local `builders.json` entry without traversing a\n * cross-package string redirect, so the user-facing `@analogjs/platform:vite`\n * identifier stays stable while the real implementation continues to live in\n * `@analogjs/vite-plugin-angular`. Mirrors `@analogjs/storybook-angular`'s\n * pattern for surfacing `@storybook/angular`'s builders.\n */\nimport viteBuilder from '@analogjs/vite-plugin-angular/builders/vite';\n\nexport default viteBuilder;\n"],"mappings":";;;;;;;;;;;;;AAWA,IAAA,qBAAe,4CAAA"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Thin shim that re-exports the Angular Devkit Architect dev-server builder
|
|
3
|
+
* shipped by `@analogjs/vite-plugin-angular`. See `../vite/vite-build.ts` for
|
|
4
|
+
* the rationale; mirrors `@analogjs/storybook-angular`'s pattern.
|
|
5
|
+
*/
|
|
6
|
+
import devServerBuilder from "@analogjs/vite-plugin-angular/builders/vite-dev-server";
|
|
7
|
+
export default devServerBuilder;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
const require_runtime = require("../../../_virtual/_rolldown/runtime.js");
|
|
2
|
+
let _analogjs_vite_plugin_angular_builders_vite_dev_server = require("@analogjs/vite-plugin-angular/builders/vite-dev-server");
|
|
3
|
+
_analogjs_vite_plugin_angular_builders_vite_dev_server = require_runtime.__toESM(_analogjs_vite_plugin_angular_builders_vite_dev_server);
|
|
4
|
+
//#region packages/nx-plugin/src/builders/vite-dev-server/dev-server.ts
|
|
5
|
+
/**
|
|
6
|
+
* Thin shim that re-exports the Angular Devkit Architect dev-server builder
|
|
7
|
+
* shipped by `@analogjs/vite-plugin-angular`. See `../vite/vite-build.ts` for
|
|
8
|
+
* the rationale; mirrors `@analogjs/storybook-angular`'s pattern.
|
|
9
|
+
*/
|
|
10
|
+
var dev_server_default = _analogjs_vite_plugin_angular_builders_vite_dev_server.default;
|
|
11
|
+
//#endregion
|
|
12
|
+
module.exports = dev_server_default;
|
|
13
|
+
|
|
14
|
+
//# sourceMappingURL=dev-server.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dev-server.js","names":[],"sources":["../../../../../../../../nx-plugin/src/builders/vite-dev-server/dev-server.ts"],"sourcesContent":["/**\n * Thin shim that re-exports the Angular Devkit Architect dev-server builder\n * shipped by `@analogjs/vite-plugin-angular`. See `../vite/vite-build.ts` for\n * the rationale; mirrors `@analogjs/storybook-angular`'s pattern.\n */\nimport devServerBuilder from '@analogjs/vite-plugin-angular/builders/vite-dev-server';\n\nexport default devServerBuilder;\n"],"mappings":";;;;;;;;;AAOA,IAAA,qBAAe,uDAAA"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 2,
|
|
3
|
+
"outputCapture": "direct-nodejs",
|
|
4
|
+
"title": "Vite Dev Server",
|
|
5
|
+
"description": "Starts a dev server using Vite.",
|
|
6
|
+
"type": "object",
|
|
7
|
+
"properties": {
|
|
8
|
+
"buildTarget": {
|
|
9
|
+
"type": "string",
|
|
10
|
+
"description": "Target which builds the application. Only used to retrieve the configuration as the dev-server does not build the code.",
|
|
11
|
+
"x-priority": "important"
|
|
12
|
+
},
|
|
13
|
+
"port": {
|
|
14
|
+
"type": "integer",
|
|
15
|
+
"minimum": 1,
|
|
16
|
+
"maximum": 65535,
|
|
17
|
+
"description": "Port to listen on.",
|
|
18
|
+
"x-priority": "important"
|
|
19
|
+
},
|
|
20
|
+
"hmr": {
|
|
21
|
+
"description": "Enable hot module replacement. For more options, use the 'hmr' option in the Vite configuration file.",
|
|
22
|
+
"type": "boolean"
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
"definitions": {},
|
|
26
|
+
"required": ["buildTarget"]
|
|
27
|
+
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
require("../../../_virtual/_rolldown/runtime.js");
|
|
1
2
|
const require_src_executors_vite_dev_server_vite_dev_server_impl = require("./vite-dev-server.impl.js");
|
|
2
3
|
//#region packages/nx-plugin/src/executors/vite-dev-server/compat.ts
|
|
3
4
|
var compat = (0, require("@nx/devkit").convertNxExecutor)(require_src_executors_vite_dev_server_vite_dev_server_impl);
|
|
@@ -1 +1 @@
|
|
|
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":"
|
|
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":["../../../../../../../../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":"
|
|
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,3 +1,4 @@
|
|
|
1
|
+
require("../../../_virtual/_rolldown/runtime.js");
|
|
1
2
|
const require_src_executors_vitest_vitest_impl = require("./vitest.impl.js");
|
|
2
3
|
//#region packages/nx-plugin/src/executors/vitest/compat.ts
|
|
3
4
|
var compat = (0, require("@nx/devkit").convertNxExecutor)(require_src_executors_vitest_vitest_impl);
|
|
@@ -1 +1 @@
|
|
|
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":"
|
|
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":["../../../../../../../../nx-plugin/src/executors/vitest/vitest.impl.ts"],"sourcesContent":["import { vitestExecutor } from '@nx/vite/executors';\n\nexport default vitestExecutor;\n"],"mappings":"
|
|
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"}
|
|
@@ -2,6 +2,7 @@ Object.defineProperties(exports, {
|
|
|
2
2
|
__esModule: { value: true },
|
|
3
3
|
[Symbol.toStringTag]: { value: "Module" }
|
|
4
4
|
});
|
|
5
|
+
require("../../../_virtual/_rolldown/runtime.js");
|
|
5
6
|
const require_src_generators_app_generator = require("./generator.js");
|
|
6
7
|
//#region packages/nx-plugin/src/generators/app/compat.ts
|
|
7
8
|
/**
|
|
@@ -1 +1 @@
|
|
|
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":"
|
|
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,3 +1,4 @@
|
|
|
1
|
+
require("../../../_virtual/_rolldown/runtime.js");
|
|
1
2
|
const require_version_utils = require("../../utils/version-utils.js");
|
|
2
3
|
const require_add_home_page = require("./lib/add-home-page.js");
|
|
3
4
|
const require_minimum_supported_versions = require("./versions/minimum-supported-versions.js");
|
|
@@ -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 { 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: '^18.0.0',\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":"
|
|
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: '^18.0.0',\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,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;CAGH,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,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,3 +1,4 @@
|
|
|
1
|
+
require("../../../../_virtual/_rolldown/runtime.js");
|
|
1
2
|
let _nx_devkit = require("@nx/devkit");
|
|
2
3
|
//#region packages/nx-plugin/src/generators/app/lib/add-analog-project-config.ts
|
|
3
4
|
function addAnalogProjectConfig(tree, projectRoot, projectName, parsedTags, name, appsDir, nxPackageNamespace) {
|
|
@@ -1 +1 @@
|
|
|
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":"
|
|
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":["../../../../../../../../../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":"
|
|
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":["../../../../../../../../../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":"
|
|
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":["../../../../../../../../../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":"
|
|
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"}
|