@analogjs/platform 3.0.0-alpha.8 → 3.0.0-alpha.9
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 +5 -13
- package/src/index.d.ts +1 -1
- package/src/index.js +7 -3
- package/src/index.js.map +1 -0
- package/src/lib/clear-client-page-endpoint.js +22 -34
- package/src/lib/clear-client-page-endpoint.js.map +1 -0
- package/src/lib/content/marked/index.js +10 -6
- package/src/lib/content/marked/index.js.map +1 -0
- package/src/lib/content/marked/marked-content-highlighter.js +6 -3
- package/src/lib/content/marked/marked-content-highlighter.js.map +1 -0
- package/src/lib/content/marked/marked-setup.service.js +44 -54
- package/src/lib/content/marked/marked-setup.service.js.map +1 -0
- package/src/lib/content/prism/angular.js +18 -19
- package/src/lib/content/prism/angular.js.map +1 -0
- package/src/lib/content/prism/index.js +10 -7
- package/src/lib/content/prism/index.js.map +1 -0
- package/src/lib/content/prism/prism-highlighter.js +33 -33
- package/src/lib/content/prism/prism-highlighter.js.map +1 -0
- package/src/lib/content/shiki/index.js +19 -28
- package/src/lib/content/shiki/index.js.map +1 -0
- package/src/lib/content/shiki/shiki-highlighter.js +45 -44
- package/src/lib/content/shiki/shiki-highlighter.js.map +1 -0
- package/src/lib/content-plugin.js +155 -222
- package/src/lib/content-plugin.js.map +1 -0
- package/src/lib/deps-plugin.js +71 -78
- package/src/lib/deps-plugin.js.map +1 -0
- package/src/lib/nx-plugin/package.json +2 -4
- package/src/lib/nx-plugin/src/executors/vite/compat.js +7 -7
- package/src/lib/nx-plugin/src/executors/vite/compat.js.map +1 -1
- package/src/lib/nx-plugin/src/executors/vite/schema.d.ts +1 -1
- package/src/lib/nx-plugin/src/executors/vite/vite.impl.js +6 -4
- 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 +7 -7
- 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/schema.d.ts +1 -1
- package/src/lib/nx-plugin/src/executors/vite-dev-server/vite-dev-server.impl.js +6 -4
- 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 +7 -7
- package/src/lib/nx-plugin/src/executors/vitest/compat.js.map +1 -1
- package/src/lib/nx-plugin/src/executors/vitest/schema.d.ts +1 -1
- package/src/lib/nx-plugin/src/executors/vitest/vitest.impl.js +6 -4
- package/src/lib/nx-plugin/src/executors/vitest/vitest.impl.js.map +1 -1
- package/src/lib/nx-plugin/src/generators/app/compat.js +7 -7
- package/src/lib/nx-plugin/src/generators/app/compat.js.map +1 -1
- package/src/lib/nx-plugin/src/generators/app/files/template-angular-v15/src/main.ts__template__ +0 -6
- package/src/lib/nx-plugin/src/generators/app/files/template-angular-v15/vite.config.ts__template__ +0 -8
- package/src/lib/nx-plugin/src/generators/app/files/template-angular-v17/src/app/app.config.ts__template__ +0 -6
- package/src/lib/nx-plugin/src/generators/app/files/template-angular-v17/vite.config.ts__template__ +0 -17
- package/src/lib/nx-plugin/src/generators/app/files/template-angular-v18/src/app/app.config.ts__template__ +0 -6
- package/src/lib/nx-plugin/src/generators/app/files/template-angular-v18/vite.config.ts__template__ +0 -17
- package/src/lib/nx-plugin/src/generators/app/files/template-angular-v19/src/app/app.config.ts__template__ +0 -6
- package/src/lib/nx-plugin/src/generators/app/files/template-angular-v19/vite.config.ts__template__ +0 -8
- package/src/lib/nx-plugin/src/generators/app/generator.js +78 -92
- package/src/lib/nx-plugin/src/generators/app/generator.js.map +1 -1
- package/src/lib/nx-plugin/src/generators/app/lib/add-analog-dependencies.js +11 -12
- package/src/lib/nx-plugin/src/generators/app/lib/add-analog-dependencies.js.map +1 -1
- package/src/lib/nx-plugin/src/generators/app/lib/add-analog-project-config.js +72 -81
- 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 +23 -58
- 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-eslint.js +12 -55
- package/src/lib/nx-plugin/src/generators/app/lib/add-eslint.js.map +1 -1
- package/src/lib/nx-plugin/src/generators/app/lib/add-files.js +15 -16
- 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 +14 -13
- 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 +17 -29
- 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 +59 -95
- 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/add-vite-plugin.js +8 -44
- package/src/lib/nx-plugin/src/generators/app/lib/add-vite-plugin.js.map +1 -1
- package/src/lib/nx-plugin/src/generators/app/lib/cleanup-files.js +17 -20
- package/src/lib/nx-plugin/src/generators/app/lib/cleanup-files.js.map +1 -1
- package/src/lib/nx-plugin/src/generators/app/lib/initialize-analog-workspace.js +59 -105
- package/src/lib/nx-plugin/src/generators/app/lib/initialize-analog-workspace.js.map +1 -1
- package/src/lib/nx-plugin/src/generators/app/lib/update-index-html.js +14 -18
- 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/dependencies.js +35 -54
- package/src/lib/nx-plugin/src/generators/app/versions/dependencies.js.map +1 -1
- package/src/lib/nx-plugin/src/generators/app/versions/dev-dependencies.js +41 -68
- package/src/lib/nx-plugin/src/generators/app/versions/dev-dependencies.js.map +1 -1
- package/src/lib/nx-plugin/src/generators/app/versions/minimum-supported-versions.d.ts +0 -1
- package/src/lib/nx-plugin/src/generators/app/versions/minimum-supported-versions.js +9 -11
- 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-dependencies.js +24 -43
- package/src/lib/nx-plugin/src/generators/app/versions/nx-dependencies.js.map +1 -1
- package/src/lib/nx-plugin/src/generators/app/versions/nx_17_X/versions.d.ts +0 -5
- package/src/lib/nx-plugin/src/generators/app/versions/nx_17_X/versions.js +29 -36
- package/src/lib/nx-plugin/src/generators/app/versions/nx_17_X/versions.js.map +1 -1
- package/src/lib/nx-plugin/src/generators/app/versions/nx_18_X/versions.d.ts +5 -10
- package/src/lib/nx-plugin/src/generators/app/versions/nx_18_X/versions.js +30 -37
- 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 +11 -16
- package/src/lib/nx-plugin/src/generators/app/versions/tailwind-dependencies.js.map +1 -1
- package/src/lib/nx-plugin/src/generators/app/versions.d.ts +0 -10
- package/src/lib/nx-plugin/src/generators/app/versions.js +28 -42
- package/src/lib/nx-plugin/src/generators/app/versions.js.map +1 -1
- package/src/lib/nx-plugin/src/generators/init/compat.js +7 -7
- package/src/lib/nx-plugin/src/generators/init/compat.js.map +1 -1
- package/src/lib/nx-plugin/src/generators/init/generator.js +54 -65
- 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 +19 -20
- 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 +20 -21
- 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 +56 -66
- 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 +12 -11
- 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 +17 -21
- 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 +12 -15
- 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 +19 -31
- 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 +43 -51
- 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 +27 -34
- 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 +19 -20
- package/src/lib/nx-plugin/src/generators/init/lib/update-test-tsconfig.js.map +1 -1
- package/src/lib/nx-plugin/src/generators/page/generator.js +34 -44
- package/src/lib/nx-plugin/src/generators/page/generator.js.map +1 -1
- package/src/lib/nx-plugin/src/generators/preset/generator.js +11 -43
- package/src/lib/nx-plugin/src/generators/preset/generator.js.map +1 -1
- package/src/lib/nx-plugin/src/generators/setup-vitest/compat.js +7 -7
- 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 +35 -42
- 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 +7 -7
- 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 +20 -27
- 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 +19 -22
- package/src/lib/nx-plugin/src/generators/setup-vitest/lib/update-tsconfig.js.map +1 -1
- package/src/lib/nx-plugin/src/index.js +0 -2
- package/src/lib/nx-plugin/src/utils/version-utils.js +20 -27
- package/src/lib/nx-plugin/src/utils/version-utils.js.map +1 -1
- package/src/lib/nx-plugin/src/utils/versions/dependencies.js +42 -62
- package/src/lib/nx-plugin/src/utils/versions/dependencies.js.map +1 -1
- package/src/lib/nx-plugin/src/utils/versions/dev-dependencies.js +49 -83
- 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 +19 -20
- 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 +19 -20
- 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 +22 -23
- package/src/lib/nx-plugin/src/utils/versions/ng_19_X/versions.js.map +1 -1
- package/src/lib/platform-plugin.js +57 -63
- package/src/lib/platform-plugin.js.map +1 -0
- package/src/lib/router-plugin.js +135 -185
- package/src/lib/router-plugin.js.map +1 -0
- package/src/lib/ssr/inject-html-plugin.js +25 -25
- package/src/lib/ssr/inject-html-plugin.js.map +1 -0
- package/src/lib/ssr/ssr-build-plugin.js +53 -88
- package/src/lib/ssr/ssr-build-plugin.js.map +1 -0
- package/src/lib/utils/rolldown.js +12 -8
- package/src/lib/utils/rolldown.js.map +1 -0
- package/src/server-mode-plugin.js +16 -20
- package/src/server-mode-plugin.js.map +1 -0
- package/README.md +0 -5
- package/src/lib/content/prism/options.js +0 -1
- package/src/lib/content/shiki/options.js +0 -1
- package/src/lib/nx-plugin/README.md +0 -23
- package/src/lib/nx-plugin/src/index.js.map +0 -1
- package/src/lib/options.js +0 -1
|
@@ -1,84 +1,75 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
exports.addAnalogProjectConfig = addAnalogProjectConfig;
|
|
4
|
-
const devkit_1 = require("@nx/devkit");
|
|
1
|
+
import { addProjectConfiguration, getProjects, updateJson } from "@nx/devkit";
|
|
2
|
+
//#region packages/nx-plugin/src/generators/app/lib/add-analog-project-config.ts
|
|
5
3
|
function addAnalogProjectConfig(tree, projectRoot, projectName, parsedTags, name, appsDir, nxPackageNamespace) {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
const { 'extract-i18n': _ei, 'serve-static': _ss, ...architect } = targets ?? {};
|
|
74
|
-
(0, devkit_1.updateJson)(tree, '/angular.json', (json) => {
|
|
75
|
-
json.projects[projectName] = {
|
|
76
|
-
...rest,
|
|
77
|
-
architect,
|
|
78
|
-
tags: parsedTags,
|
|
79
|
-
};
|
|
80
|
-
return json;
|
|
81
|
-
});
|
|
82
|
-
}
|
|
4
|
+
const isStandalone = appsDir === ".";
|
|
5
|
+
const isNx = tree.exists("/nx.json");
|
|
6
|
+
const workspaceAppsDir = isStandalone || !isNx ? "" : `${appsDir}/`;
|
|
7
|
+
if (isNx) addProjectConfiguration(tree, name, {
|
|
8
|
+
root: projectRoot,
|
|
9
|
+
projectType: "application",
|
|
10
|
+
sourceRoot: `${projectRoot}/src`,
|
|
11
|
+
tags: parsedTags,
|
|
12
|
+
targets: {
|
|
13
|
+
build: {
|
|
14
|
+
executor: "@analogjs/platform:vite",
|
|
15
|
+
outputs: [
|
|
16
|
+
"{options.outputPath}",
|
|
17
|
+
`{workspaceRoot}/dist/${workspaceAppsDir}${projectName}/.nitro`,
|
|
18
|
+
`{workspaceRoot}/dist/${workspaceAppsDir}${projectName}/ssr`,
|
|
19
|
+
`{workspaceRoot}/dist/${workspaceAppsDir}${projectName}/analog`
|
|
20
|
+
],
|
|
21
|
+
options: {
|
|
22
|
+
main: `${workspaceAppsDir}${projectName}/src/main.ts`,
|
|
23
|
+
configFile: `${workspaceAppsDir}${projectName}/vite.config.ts`,
|
|
24
|
+
outputPath: `dist/${workspaceAppsDir}${projectName}/client`,
|
|
25
|
+
tsConfig: `${workspaceAppsDir}${projectName}/tsconfig.app.json`
|
|
26
|
+
},
|
|
27
|
+
defaultConfiguration: "production",
|
|
28
|
+
configurations: {
|
|
29
|
+
development: { mode: "development" },
|
|
30
|
+
production: {
|
|
31
|
+
sourcemap: false,
|
|
32
|
+
mode: "production"
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
},
|
|
36
|
+
serve: {
|
|
37
|
+
executor: "@analogjs/platform:vite-dev-server",
|
|
38
|
+
defaultConfiguration: "development",
|
|
39
|
+
options: {
|
|
40
|
+
buildTarget: `${projectName}:build`,
|
|
41
|
+
port: 4200
|
|
42
|
+
},
|
|
43
|
+
configurations: {
|
|
44
|
+
development: {
|
|
45
|
+
buildTarget: `${projectName}:build:development`,
|
|
46
|
+
hmr: true
|
|
47
|
+
},
|
|
48
|
+
production: { buildTarget: `${projectName}:build:production` }
|
|
49
|
+
}
|
|
50
|
+
},
|
|
51
|
+
test: {
|
|
52
|
+
executor: "@analogjs/vitest-angular:test",
|
|
53
|
+
outputs: [`{projectRoot}/coverage`]
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
});
|
|
57
|
+
else {
|
|
58
|
+
const fetched = getProjects(tree).get(projectName);
|
|
59
|
+
if (!fetched) throw new Error(`Project "${projectName}" not found in workspace.`);
|
|
60
|
+
const { targets, $schema, name: _name, generators, "extract-i18n": _, "serve-static": __, ...rest } = fetched;
|
|
61
|
+
const { "extract-i18n": _ei, "serve-static": _ss, ...architect } = targets ?? {};
|
|
62
|
+
updateJson(tree, "/angular.json", (json) => {
|
|
63
|
+
json.projects[projectName] = {
|
|
64
|
+
...rest,
|
|
65
|
+
architect,
|
|
66
|
+
tags: parsedTags
|
|
67
|
+
};
|
|
68
|
+
return json;
|
|
69
|
+
});
|
|
70
|
+
}
|
|
83
71
|
}
|
|
72
|
+
//#endregion
|
|
73
|
+
export { addAnalogProjectConfig };
|
|
74
|
+
|
|
84
75
|
//# sourceMappingURL=add-analog-project-config.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"add-analog-project-config.js","
|
|
1
|
+
{"version":3,"file":"add-analog-project-config.js","names":[],"sources":["../../../../../../../../../../packages/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,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,UADW,YAAY,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,aAAW,MAAM,kBAAkB,SAAS;AAC1C,QAAK,SAAS,eAAe;IAC3B,GAAG;IACH;IACA,MAAM;IACP;AAED,UAAO;IACP"}
|
|
@@ -1,61 +1,26 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
-
var ownKeys = function(o) {
|
|
20
|
-
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
-
var ar = [];
|
|
22
|
-
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
-
return ar;
|
|
24
|
-
};
|
|
25
|
-
return ownKeys(o);
|
|
26
|
-
};
|
|
27
|
-
return function (mod) {
|
|
28
|
-
if (mod && mod.__esModule) return mod;
|
|
29
|
-
var result = {};
|
|
30
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
-
__setModuleDefault(result, mod);
|
|
32
|
-
return result;
|
|
33
|
-
};
|
|
34
|
-
})();
|
|
35
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
-
exports.addAngularApp = addAngularApp;
|
|
37
|
-
const devkit_1 = require("@nx/devkit");
|
|
1
|
+
import { getWorkspaceLayout } from "@nx/devkit";
|
|
2
|
+
//#region packages/nx-plugin/src/generators/app/lib/add-angular-app.ts
|
|
38
3
|
async function addAngularApp(tree, options) {
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
...appOptions,
|
|
58
|
-
directory: `${appsDir}/${options.analogAppName}`,
|
|
59
|
-
});
|
|
4
|
+
const isNx = tree.exists("/nx.json");
|
|
5
|
+
const appsDir = isNx ? getWorkspaceLayout(tree).appsDir : "projects";
|
|
6
|
+
const appOptions = {
|
|
7
|
+
name: options.analogAppName,
|
|
8
|
+
directory: `${appsDir}/${options.analogAppName}`,
|
|
9
|
+
linter: !isNx || process.env.NODE_ENV === "test" ? "none" : "eslint",
|
|
10
|
+
unitTestRunner: "vitest",
|
|
11
|
+
standalone: true,
|
|
12
|
+
ssr: false,
|
|
13
|
+
bundler: "esbuild",
|
|
14
|
+
serverRouting: false,
|
|
15
|
+
skipFormat: true,
|
|
16
|
+
tags: options.tags
|
|
17
|
+
};
|
|
18
|
+
await (await import("@nx/angular/generators")).applicationGenerator(tree, {
|
|
19
|
+
...appOptions,
|
|
20
|
+
directory: `${appsDir}/${options.analogAppName}`
|
|
21
|
+
});
|
|
60
22
|
}
|
|
23
|
+
//#endregion
|
|
24
|
+
export { addAngularApp };
|
|
25
|
+
|
|
61
26
|
//# sourceMappingURL=add-angular-app.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"add-angular-app.js","
|
|
1
|
+
{"version":3,"file":"add-angular-app.js","names":[],"sources":["../../../../../../../../../../packages/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 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,OAAO,mBAAmB,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,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,58 +1,15 @@
|
|
|
1
|
-
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
-
var ownKeys = function(o) {
|
|
20
|
-
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
-
var ar = [];
|
|
22
|
-
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
-
return ar;
|
|
24
|
-
};
|
|
25
|
-
return ownKeys(o);
|
|
26
|
-
};
|
|
27
|
-
return function (mod) {
|
|
28
|
-
if (mod && mod.__esModule) return mod;
|
|
29
|
-
var result = {};
|
|
30
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
-
__setModuleDefault(result, mod);
|
|
32
|
-
return result;
|
|
33
|
-
};
|
|
34
|
-
})();
|
|
35
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
-
exports.addEslint = addEslint;
|
|
1
|
+
//#region packages/nx-plugin/src/generators/app/lib/add-eslint.ts
|
|
37
2
|
async function addEslint(tree, majorNxVersion, options) {
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
await (await Promise.resolve().then(() => __importStar(require(
|
|
47
|
-
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
48
|
-
// @ts-ignore
|
|
49
|
-
'@nx/eslint')))).lintProjectGenerator(tree, linterOptions);
|
|
50
|
-
}
|
|
51
|
-
else {
|
|
52
|
-
await (await Promise.resolve().then(() => __importStar(require(
|
|
53
|
-
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
54
|
-
// @ts-ignore
|
|
55
|
-
'@nrwl/linter')))).lintProjectGenerator(tree, linterOptions);
|
|
56
|
-
}
|
|
3
|
+
const linterOptions = {
|
|
4
|
+
linter: "eslint",
|
|
5
|
+
project: options.projectName,
|
|
6
|
+
eslintFilePatterns: [`${options.projectRoot}/**/*.{ts,html}`],
|
|
7
|
+
skipFormat: true
|
|
8
|
+
};
|
|
9
|
+
if (majorNxVersion >= 16) await (await import("@nx/eslint")).lintProjectGenerator(tree, linterOptions);
|
|
10
|
+
else await (await import("@nrwl/linter")).lintProjectGenerator(tree, linterOptions);
|
|
57
11
|
}
|
|
12
|
+
//#endregion
|
|
13
|
+
export { addEslint };
|
|
14
|
+
|
|
58
15
|
//# sourceMappingURL=add-eslint.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"add-eslint.js","
|
|
1
|
+
{"version":3,"file":"add-eslint.js","names":[],"sources":["../../../../../../../../../../packages/nx-plugin/src/generators/app/lib/add-eslint.ts"],"sourcesContent":["import { Tree } from '@nx/devkit';\nimport { NormalizedOptions } from '../generator';\n\nexport async function addEslint(\n tree: Tree,\n majorNxVersion: number,\n options: NormalizedOptions,\n): Promise<void> {\n const linterOptions = {\n // needed to not depend on linter package\n linter: 'eslint' as any,\n project: options.projectName,\n eslintFilePatterns: [`${options.projectRoot}/**/*.{ts,html}`],\n skipFormat: true,\n };\n if (majorNxVersion >= 16) {\n await (\n await import(\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n '@nx/eslint'\n )\n ).lintProjectGenerator(tree, linterOptions);\n } else {\n await (\n await import(\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n '@nrwl/linter'\n )\n ).lintProjectGenerator(tree, linterOptions);\n }\n}\n"],"mappings":";AAGA,eAAsB,UACpB,MACA,gBACA,SACe;CACf,MAAM,gBAAgB;EAEpB,QAAQ;EACR,SAAS,QAAQ;EACjB,oBAAoB,CAAC,GAAG,QAAQ,YAAY,iBAAiB;EAC7D,YAAY;EACb;AACD,KAAI,kBAAkB,GACpB,QACE,MAAM,OAGJ,eAEF,qBAAqB,MAAM,cAAc;KAE3C,QACE,MAAM,OAGJ,iBAEF,qBAAqB,MAAM,cAAc"}
|
|
@@ -1,19 +1,18 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
const devkit_1 = require("@nx/devkit");
|
|
5
|
-
const node_path_1 = require("node:path");
|
|
1
|
+
import { generateFiles } from "@nx/devkit";
|
|
2
|
+
import { join } from "node:path";
|
|
3
|
+
//#region packages/nx-plugin/src/generators/app/lib/add-files.ts
|
|
6
4
|
function addFiles(tree, options, majorAngularVersion) {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
(0, devkit_1.generateFiles)(tree, (0, node_path_1.join)(__dirname, '..', 'files', 'root'), '.', templateOptions);
|
|
17
|
-
}
|
|
5
|
+
const isNx = tree.exists("/nx.json");
|
|
6
|
+
const templateOptions = {
|
|
7
|
+
...options,
|
|
8
|
+
template: "",
|
|
9
|
+
tsconfig: isNx ? "tsconfig.base.json" : "tsconfig.json",
|
|
10
|
+
majorAngularVersion
|
|
11
|
+
};
|
|
12
|
+
generateFiles(tree, join(__dirname, "..", "files", "template-angular"), options.projectRoot, templateOptions);
|
|
13
|
+
if (!tree.exists("/angular.json") && !tree.exists("/tsconfig.base.json")) generateFiles(tree, join(__dirname, "..", "files", "root"), ".", templateOptions);
|
|
18
14
|
}
|
|
15
|
+
//#endregion
|
|
16
|
+
export { addFiles };
|
|
17
|
+
|
|
19
18
|
//# sourceMappingURL=add-files.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"add-files.js","
|
|
1
|
+
{"version":3,"file":"add-files.js","names":[],"sources":["../../../../../../../../../../packages/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,eACE,MACA,KAAK,WAAW,MAAM,SAAS,mBAAmB,EAClD,QAAQ,aACR,gBACD;AAED,KAAI,CAAC,KAAK,OAAO,gBAAgB,IAAI,CAAC,KAAK,OAAO,sBAAsB,CACtE,eACE,MACA,KAAK,WAAW,MAAM,SAAS,OAAO,EACtC,KACA,gBACD"}
|
|
@@ -1,16 +1,17 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
const devkit_1 = require("@nx/devkit");
|
|
5
|
-
const node_path_1 = require("node:path");
|
|
1
|
+
import { generateFiles } from "@nx/devkit";
|
|
2
|
+
import { join } from "node:path";
|
|
3
|
+
//#region packages/nx-plugin/src/generators/app/lib/add-home-page.ts
|
|
6
4
|
function addHomePage(tree, options, majorAngularVersion) {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
5
|
+
const templateOptions = {
|
|
6
|
+
...options,
|
|
7
|
+
template: "",
|
|
8
|
+
majorAngularVersion
|
|
9
|
+
};
|
|
10
|
+
generateFiles(tree, join(__dirname, "..", "files", "index-page"), options.projectRoot, templateOptions);
|
|
11
|
+
const pageDirectory = options.addTailwind ? "tailwind" : "css";
|
|
12
|
+
generateFiles(tree, join(__dirname, "..", "files", "welcome-components", pageDirectory), options.projectRoot, templateOptions);
|
|
15
13
|
}
|
|
14
|
+
//#endregion
|
|
15
|
+
export { addHomePage };
|
|
16
|
+
|
|
16
17
|
//# sourceMappingURL=add-home-page.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"add-home-page.js","
|
|
1
|
+
{"version":3,"file":"add-home-page.js","names":[],"sources":["../../../../../../../../../../packages/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,eACE,MACA,KAAK,WAAW,MAAM,SAAS,aAAa,EAC5C,QAAQ,aACR,gBACD;CAED,MAAM,gBAAgB,QAAQ,cAAc,aAAa;AAEzD,eACE,MACA,KAAK,WAAW,MAAM,SAAS,sBAAsB,cAAc,EACnE,QAAQ,aACR,gBACD"}
|
|
@@ -1,34 +1,22 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
exports.setupTailwindGenerator = setupTailwindGenerator;
|
|
5
|
-
const devkit_1 = require("@nx/devkit");
|
|
6
|
-
const add_tailwind_helpers_1 = require("./add-tailwind-helpers");
|
|
1
|
+
import { addTailwindConfigFile, addTailwindConfigPathToProject, addTailwindRequiredPackages, detectTailwindInstalledVersion, normalizeOptions, updateApplicationStyles } from "./add-tailwind-helpers.js";
|
|
2
|
+
import { formatFiles, readProjectConfiguration } from "@nx/devkit";
|
|
3
|
+
//#region packages/nx-plugin/src/generators/app/lib/add-tailwind-config.ts
|
|
7
4
|
async function addTailwindConfig(tree, projectName) {
|
|
8
|
-
|
|
9
|
-
project: projectName,
|
|
10
|
-
});
|
|
5
|
+
await setupTailwindGenerator(tree, { project: projectName });
|
|
11
6
|
}
|
|
12
7
|
async function setupTailwindGenerator(tree, rawOptions) {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
if (project.projectType === 'application') {
|
|
24
|
-
(0, add_tailwind_helpers_1.updateApplicationStyles)(tree, options, project);
|
|
25
|
-
}
|
|
26
|
-
else if (project.projectType === 'library') {
|
|
27
|
-
(0, add_tailwind_helpers_1.addTailwindConfigPathToProject)(tree, options, project);
|
|
28
|
-
}
|
|
29
|
-
if (!options.skipFormat) {
|
|
30
|
-
await (0, devkit_1.formatFiles)(tree);
|
|
31
|
-
}
|
|
32
|
-
return installTask;
|
|
8
|
+
const options = normalizeOptions(rawOptions);
|
|
9
|
+
const project = readProjectConfiguration(tree, options.project);
|
|
10
|
+
detectTailwindInstalledVersion(tree);
|
|
11
|
+
let installTask = () => {};
|
|
12
|
+
if (!options.skipPackageJson) installTask = addTailwindRequiredPackages(tree);
|
|
13
|
+
addTailwindConfigFile(tree, options, project);
|
|
14
|
+
if (project.projectType === "application") updateApplicationStyles(tree, options, project);
|
|
15
|
+
else if (project.projectType === "library") addTailwindConfigPathToProject(tree, options, project);
|
|
16
|
+
if (!options.skipFormat) await formatFiles(tree);
|
|
17
|
+
return installTask;
|
|
33
18
|
}
|
|
19
|
+
//#endregion
|
|
20
|
+
export { addTailwindConfig, setupTailwindGenerator };
|
|
21
|
+
|
|
34
22
|
//# sourceMappingURL=add-tailwind-config.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"add-tailwind-config.js","
|
|
1
|
+
{"version":3,"file":"add-tailwind-config.js","names":[],"sources":["../../../../../../../../../../packages/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 addTailwindConfigFile,\n addTailwindConfigPathToProject,\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 addTailwindConfigFile(tree, options, project);\n\n if (project.projectType === 'application') {\n updateApplicationStyles(tree, options, project);\n } else if (project.projectType === 'library') {\n addTailwindConfigPathToProject(tree, options, project);\n }\n\n if (!options.skipFormat) {\n await formatFiles(tree);\n }\n\n return installTask;\n}\n"],"mappings":";;;AAeA,eAAsB,kBACpB,MACA,aACe;AACf,OAAM,uBAAuB,MAAM,EACjC,SAAS,aACV,CAAC;;AAeJ,eAAsB,uBACpB,MACA,YAC4B;CAC5B,MAAM,UAAU,iBAAiB,WAAW;CAC5C,MAAM,UAAU,yBAAyB,MAAM,QAAQ,QAAQ;AAG/D,gCAA+B,KAAK;CAGpC,IAAI,oBAAuC;AAC3C,KAAI,CAAC,QAAQ,gBACX,eAAc,4BAA4B,KAAK;AAGjD,uBAAsB,MAAM,SAAS,QAAQ;AAE7C,KAAI,QAAQ,gBAAgB,cAC1B,yBAAwB,MAAM,SAAS,QAAQ;UACtC,QAAQ,gBAAgB,UACjC,gCAA+B,MAAM,SAAS,QAAQ;AAGxD,KAAI,CAAC,QAAQ,WACX,OAAM,YAAY,KAAK;AAGzB,QAAO"}
|