@nx/angular 23.0.0-beta.1 → 23.0.0-beta.3
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/generators.d.ts +0 -1
- package/generators.d.ts.map +1 -1
- package/generators.js +0 -1
- package/generators.json +0 -6
- package/package.json +10 -10
- package/src/generators/application/application.d.ts.map +1 -1
- package/src/generators/application/application.js +0 -8
- package/src/generators/application/schema.d.ts +0 -1
- package/src/generators/application/schema.json +0 -5
- package/src/generators/host/schema.d.ts +0 -1
- package/src/generators/host/schema.json +0 -5
- package/src/generators/library/lib/normalized-schema.d.ts +0 -1
- package/src/generators/library/lib/normalized-schema.d.ts.map +1 -1
- package/src/generators/library/lib/validate-options.d.ts.map +1 -1
- package/src/generators/library/lib/validate-options.js +0 -3
- package/src/generators/library/library.d.ts.map +1 -1
- package/src/generators/library/library.js +0 -8
- package/src/generators/library/schema.d.ts +0 -1
- package/src/generators/library/schema.json +0 -5
- package/src/generators/remote/schema.d.ts +0 -1
- package/src/generators/remote/schema.json +0 -5
- package/src/generators/utils/add-vitest.js +1 -1
- package/src/utils/backward-compatible-versions.d.ts.map +1 -1
- package/src/utils/backward-compatible-versions.js +0 -2
- package/src/utils/versions.d.ts +0 -1
- package/src/utils/versions.d.ts.map +1 -1
- package/src/utils/versions.js +1 -2
- package/tailwind.d.ts +2 -3
- package/tailwind.d.ts.map +1 -1
- package/tailwind.js +10 -4
- package/src/generators/setup-tailwind/files/v2/tailwind.config.js__tmpl__ +0 -18
- package/src/generators/setup-tailwind/files/v3/tailwind.config.js__tmpl__ +0 -14
- package/src/generators/setup-tailwind/lib/add-tailwind-config.d.ts +0 -4
- package/src/generators/setup-tailwind/lib/add-tailwind-config.d.ts.map +0 -1
- package/src/generators/setup-tailwind/lib/add-tailwind-config.js +0 -17
- package/src/generators/setup-tailwind/lib/add-tailwind-required-packages.d.ts +0 -3
- package/src/generators/setup-tailwind/lib/add-tailwind-required-packages.d.ts.map +0 -1
- package/src/generators/setup-tailwind/lib/add-tailwind-required-packages.js +0 -13
- package/src/generators/setup-tailwind/lib/detect-tailwind-installed-version.d.ts +0 -3
- package/src/generators/setup-tailwind/lib/detect-tailwind-installed-version.d.ts.map +0 -1
- package/src/generators/setup-tailwind/lib/detect-tailwind-installed-version.js +0 -18
- package/src/generators/setup-tailwind/lib/index.d.ts +0 -7
- package/src/generators/setup-tailwind/lib/index.d.ts.map +0 -1
- package/src/generators/setup-tailwind/lib/index.js +0 -9
- package/src/generators/setup-tailwind/lib/normalize-options.d.ts +0 -3
- package/src/generators/setup-tailwind/lib/normalize-options.d.ts.map +0 -1
- package/src/generators/setup-tailwind/lib/normalize-options.js +0 -9
- package/src/generators/setup-tailwind/lib/update-application-styles.d.ts +0 -4
- package/src/generators/setup-tailwind/lib/update-application-styles.d.ts.map +0 -1
- package/src/generators/setup-tailwind/lib/update-application-styles.js +0 -53
- package/src/generators/setup-tailwind/lib/validate-build-target.d.ts +0 -4
- package/src/generators/setup-tailwind/lib/validate-build-target.d.ts.map +0 -1
- package/src/generators/setup-tailwind/lib/validate-build-target.js +0 -24
- package/src/generators/setup-tailwind/schema.d.ts +0 -11
- package/src/generators/setup-tailwind/schema.json +0 -42
- package/src/generators/setup-tailwind/setup-tailwind.d.ts +0 -5
- package/src/generators/setup-tailwind/setup-tailwind.d.ts.map +0 -1
- package/src/generators/setup-tailwind/setup-tailwind.js +0 -32
package/generators.d.ts
CHANGED
|
@@ -20,7 +20,6 @@ export * from './src/generators/scam-to-standalone/scam-to-standalone';
|
|
|
20
20
|
export * from './src/generators/scam/scam';
|
|
21
21
|
export * from './src/generators/setup-mf/setup-mf';
|
|
22
22
|
export * from './src/generators/setup-ssr/setup-ssr';
|
|
23
|
-
export * from './src/generators/setup-tailwind/setup-tailwind';
|
|
24
23
|
export * from './src/generators/stories/stories';
|
|
25
24
|
export * from './src/generators/storybook-configuration/storybook-configuration';
|
|
26
25
|
export * from './src/generators/web-worker/web-worker';
|
package/generators.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generators.d.ts","sourceRoot":"","sources":["../../../packages/angular/generators.ts"],"names":[],"mappings":"AAAA,cAAc,0CAA0C,CAAC;AACzD,cAAc,0CAA0C,CAAC;AACzD,cAAc,kDAAkD,CAAC;AACjE,cAAc,sCAAsC,CAAC;AACrD,cAAc,sCAAsC,CAAC;AACrD,cAAc,kDAAkD,CAAC;AACjE,cAAc,4BAA4B,CAAC;AAC3C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,8EAA8E,CAAC;AAC7F,cAAc,kCAAkC,CAAC;AACjD,cAAc,4BAA4B,CAAC;AAC3C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,wDAAwD,CAAC;AACvE,cAAc,kDAAkD,CAAC;AACjE,cAAc,4BAA4B,CAAC;AAC3C,cAAc,gCAAgC,CAAC;AAC/C,cAAc,gDAAgD,CAAC;AAC/D,cAAc,sCAAsC,CAAC;AACrD,cAAc,wDAAwD,CAAC;AACvE,cAAc,4BAA4B,CAAC;AAC3C,cAAc,oCAAoC,CAAC;AACnD,cAAc,sCAAsC,CAAC;AACrD,cAAc,
|
|
1
|
+
{"version":3,"file":"generators.d.ts","sourceRoot":"","sources":["../../../packages/angular/generators.ts"],"names":[],"mappings":"AAAA,cAAc,0CAA0C,CAAC;AACzD,cAAc,0CAA0C,CAAC;AACzD,cAAc,kDAAkD,CAAC;AACjE,cAAc,sCAAsC,CAAC;AACrD,cAAc,sCAAsC,CAAC;AACrD,cAAc,kDAAkD,CAAC;AACjE,cAAc,4BAA4B,CAAC;AAC3C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,8EAA8E,CAAC;AAC7F,cAAc,kCAAkC,CAAC;AACjD,cAAc,4BAA4B,CAAC;AAC3C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,wDAAwD,CAAC;AACvE,cAAc,kDAAkD,CAAC;AACjE,cAAc,4BAA4B,CAAC;AAC3C,cAAc,gCAAgC,CAAC;AAC/C,cAAc,gDAAgD,CAAC;AAC/D,cAAc,sCAAsC,CAAC;AACrD,cAAc,wDAAwD,CAAC;AACvE,cAAc,4BAA4B,CAAC;AAC3C,cAAc,oCAAoC,CAAC;AACnD,cAAc,sCAAsC,CAAC;AACrD,cAAc,kCAAkC,CAAC;AACjD,cAAc,kEAAkE,CAAC;AACjF,cAAc,wCAAwC,CAAC;AACvD,OAAO,EAAE,6BAA6B,EAAE,MAAM,kFAAkF,CAAC;AACjI,cAAc,gDAAgD,CAAC;AAC/D,cAAc,0BAA0B,CAAC"}
|
package/generators.js
CHANGED
|
@@ -24,7 +24,6 @@ tslib_1.__exportStar(require("./src/generators/scam-to-standalone/scam-to-standa
|
|
|
24
24
|
tslib_1.__exportStar(require("./src/generators/scam/scam"), exports);
|
|
25
25
|
tslib_1.__exportStar(require("./src/generators/setup-mf/setup-mf"), exports);
|
|
26
26
|
tslib_1.__exportStar(require("./src/generators/setup-ssr/setup-ssr"), exports);
|
|
27
|
-
tslib_1.__exportStar(require("./src/generators/setup-tailwind/setup-tailwind"), exports);
|
|
28
27
|
tslib_1.__exportStar(require("./src/generators/stories/stories"), exports);
|
|
29
28
|
tslib_1.__exportStar(require("./src/generators/storybook-configuration/storybook-configuration"), exports);
|
|
30
29
|
tslib_1.__exportStar(require("./src/generators/web-worker/web-worker"), exports);
|
package/generators.json
CHANGED
|
@@ -158,12 +158,6 @@
|
|
|
158
158
|
"schema": "./src/generators/setup-ssr/schema.json",
|
|
159
159
|
"description": "Generate Angular Universal (SSR) setup for an Angular application."
|
|
160
160
|
},
|
|
161
|
-
"setup-tailwind": {
|
|
162
|
-
"factory": "./src/generators/setup-tailwind/setup-tailwind",
|
|
163
|
-
"schema": "./src/generators/setup-tailwind/schema.json",
|
|
164
|
-
"description": "Configures Tailwind CSS for an application or a buildable/publishable library.",
|
|
165
|
-
"x-deprecated": "Generating Tailwind configuration is no longer maintained. This generator will be removed in Nx 23."
|
|
166
|
-
},
|
|
167
161
|
"stories": {
|
|
168
162
|
"factory": "./src/generators/stories/stories",
|
|
169
163
|
"schema": "./src/generators/stories/schema.json",
|
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nx/angular",
|
|
3
|
-
"version": "23.0.0-beta.
|
|
3
|
+
"version": "23.0.0-beta.3",
|
|
4
4
|
"private": false,
|
|
5
|
-
"description": "The Nx Plugin for Angular contains executors, generators, and utilities for managing Angular applications and libraries within an Nx workspace. It provides: \n\n- Integration with libraries such as Storybook, Jest, ESLint,
|
|
5
|
+
"description": "The Nx Plugin for Angular contains executors, generators, and utilities for managing Angular applications and libraries within an Nx workspace. It provides: \n\n- Integration with libraries such as Storybook, Jest, ESLint, Playwright and Cypress. \n\n- Generators to help scaffold code quickly (like: Micro Frontends, Libraries, both internal to your codebase and publishable to npm) \n\n- Single Component Application Modules (SCAMs) \n\n- NgRx helpers. \n\n- Utilities for automatic workspace refactoring.",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
8
8
|
"url": "https://github.com/nrwl/nx.git",
|
|
@@ -62,14 +62,14 @@
|
|
|
62
62
|
"migrations": "./migrations.json"
|
|
63
63
|
},
|
|
64
64
|
"dependencies": {
|
|
65
|
-
"@nx/devkit": "23.0.0-beta.
|
|
66
|
-
"@nx/eslint": "23.0.0-beta.
|
|
67
|
-
"@nx/js": "23.0.0-beta.
|
|
68
|
-
"@nx/module-federation": "23.0.0-beta.
|
|
69
|
-
"@nx/rspack": "23.0.0-beta.
|
|
70
|
-
"@nx/web": "23.0.0-beta.
|
|
71
|
-
"@nx/webpack": "23.0.0-beta.
|
|
72
|
-
"@nx/workspace": "23.0.0-beta.
|
|
65
|
+
"@nx/devkit": "23.0.0-beta.3",
|
|
66
|
+
"@nx/eslint": "23.0.0-beta.3",
|
|
67
|
+
"@nx/js": "23.0.0-beta.3",
|
|
68
|
+
"@nx/module-federation": "23.0.0-beta.3",
|
|
69
|
+
"@nx/rspack": "23.0.0-beta.3",
|
|
70
|
+
"@nx/web": "23.0.0-beta.3",
|
|
71
|
+
"@nx/webpack": "23.0.0-beta.3",
|
|
72
|
+
"@nx/workspace": "23.0.0-beta.3",
|
|
73
73
|
"@phenomnomnominal/tsquery": "~6.1.4",
|
|
74
74
|
"@typescript-eslint/type-utils": "^8.0.0",
|
|
75
75
|
"enquirer": "~2.3.6",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"application.d.ts","sourceRoot":"","sources":["../../../../../../packages/angular/src/generators/application/application.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,iBAAiB,EAKjB,IAAI,EAEL,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"application.d.ts","sourceRoot":"","sources":["../../../../../../packages/angular/src/generators/application/application.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,iBAAiB,EAKjB,IAAI,EAEL,MAAM,YAAY,CAAC;AA0BpB,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAEvC,wBAAsB,oBAAoB,CACxC,IAAI,EAAE,IAAI,EACV,MAAM,EAAE,MAAM,GACb,OAAO,CAAC,iBAAiB,CAAC,CA8H5B;AAED,eAAe,oBAAoB,CAAC"}
|
|
@@ -7,7 +7,6 @@ const js_1 = require("@nx/js");
|
|
|
7
7
|
const convert_to_rspack_1 = require("../convert-to-rspack/convert-to-rspack");
|
|
8
8
|
const init_1 = require("../init/init");
|
|
9
9
|
const setup_ssr_1 = require("../setup-ssr/setup-ssr");
|
|
10
|
-
const setup_tailwind_1 = require("../setup-tailwind/setup-tailwind");
|
|
11
10
|
const ensure_angular_dependencies_1 = require("../utils/ensure-angular-dependencies");
|
|
12
11
|
const validations_1 = require("../utils/validations");
|
|
13
12
|
const version_utils_1 = require("../utils/version-utils");
|
|
@@ -37,13 +36,6 @@ async function applicationGenerator(tree, schema) {
|
|
|
37
36
|
}
|
|
38
37
|
(0, lib_1.createProject)(tree, options);
|
|
39
38
|
await (0, lib_1.createFiles)(tree, options, rootOffset);
|
|
40
|
-
if (options.addTailwind) {
|
|
41
|
-
await (0, setup_tailwind_1.setupTailwindGenerator)(tree, {
|
|
42
|
-
project: options.name,
|
|
43
|
-
skipFormat: true,
|
|
44
|
-
skipPackageJson: options.skipPackageJson,
|
|
45
|
-
});
|
|
46
|
-
}
|
|
47
39
|
await (0, lib_1.addLinting)(tree, options);
|
|
48
40
|
await (0, lib_1.addUnitTestRunner)(tree, options);
|
|
49
41
|
const e2ePort = await (0, lib_1.addE2e)(tree, options);
|
|
@@ -138,11 +138,6 @@
|
|
|
138
138
|
"description": "Whether or not to configure the ESLint `parserOptions.project` option. We do not do this by default for lint performance reasons.",
|
|
139
139
|
"default": false
|
|
140
140
|
},
|
|
141
|
-
"addTailwind": {
|
|
142
|
-
"type": "boolean",
|
|
143
|
-
"description": "Whether to configure Tailwind CSS for the application.",
|
|
144
|
-
"default": false
|
|
145
|
-
},
|
|
146
141
|
"standalone": {
|
|
147
142
|
"description": "Generate an application that is setup to use standalone components.",
|
|
148
143
|
"type": "boolean",
|
|
@@ -154,11 +154,6 @@
|
|
|
154
154
|
"description": "Whether or not to configure the ESLint `parserOptions.project` option. We do not do this by default for lint performance reasons.",
|
|
155
155
|
"default": false
|
|
156
156
|
},
|
|
157
|
-
"addTailwind": {
|
|
158
|
-
"type": "boolean",
|
|
159
|
-
"description": "Whether to configure Tailwind CSS for the application.",
|
|
160
|
-
"default": false
|
|
161
|
-
},
|
|
162
157
|
"skipFormat": {
|
|
163
158
|
"description": "Skip formatting files.",
|
|
164
159
|
"type": "boolean",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"normalized-schema.d.ts","sourceRoot":"","sources":["../../../../../../../packages/angular/src/generators/library/lib/normalized-schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAC7D,OAAO,KAAK,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAErD,MAAM,WAAW,gBAAgB;IAC/B,cAAc,EAAE;QACd,SAAS,EAAE,MAAM,CAAC;QAClB,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,
|
|
1
|
+
{"version":3,"file":"normalized-schema.d.ts","sourceRoot":"","sources":["../../../../../../../packages/angular/src/generators/library/lib/normalized-schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAC7D,OAAO,KAAK,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAErD,MAAM,WAAW,gBAAgB;IAC/B,cAAc,EAAE;QACd,SAAS,EAAE,MAAM,CAAC;QAClB,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,UAAU,CAAC,EAAE,OAAO,CAAC;QACrB,aAAa,CAAC,EAAE,OAAO,CAAC;QACxB,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,SAAS,CAAC,EAAE,OAAO,CAAC;QACpB,WAAW,CAAC,EAAE,OAAO,CAAC;QACtB,UAAU,CAAC,EAAE,MAAM,CAAC;QACpB,IAAI,CAAC,EAAE,OAAO,CAAC;QACf,YAAY,CAAC,EAAE,OAAO,CAAC;QACvB,OAAO,CAAC,EAAE,OAAO,CAAC;QAClB,IAAI,CAAC,EAAE,OAAO,CAAC;QACf,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,MAAM,CAAC,EAAE,OAAO,CAAC;QACjB,eAAe,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;QACrC,uBAAuB,CAAC,EAAE,OAAO,CAAC;QAClC,UAAU,CAAC,EAAE,OAAO,CAAC;QACrB,eAAe,CAAC,EAAE,OAAO,CAAC;QAC1B,eAAe,CAAC,EAAE,OAAO,CAAC;QAC1B,YAAY,CAAC,EAAE,OAAO,CAAC;QACvB,UAAU,CAAC,EAAE,OAAO,CAAC;QACrB,MAAM,EAAE,MAAM,GAAG,UAAU,CAAC;QAC5B,cAAc,EAAE,cAAc,CAAC;QAC/B,MAAM,EAAE,MAAM,CAAC;QACf,QAAQ,EAAE,MAAM,CAAC;QACjB,WAAW,EAAE,MAAM,CAAC;QACpB,SAAS,EAAE,MAAM,CAAC;QAClB,UAAU,EAAE,MAAM,CAAC;QACnB,UAAU,EAAE,MAAM,CAAC;QACnB,UAAU,EAAE,MAAM,EAAE,CAAC;QACrB,qBAAqB,EAAE,MAAM,CAAC;QAC9B,uBAAuB,EAAE,MAAM,CAAC;QAChC,mBAAmB,EAAE,GAAG,GAAG,GAAG,CAAC;KAChC,CAAC;IACF,gBAAgB,EAAE;QAChB,IAAI,EAAE,MAAM,CAAC;QACb,UAAU,CAAC,EAAE,OAAO,CAAC;QACrB,YAAY,CAAC,EAAE,OAAO,CAAC;QACvB,WAAW,CAAC,EAAE,OAAO,CAAC;QACtB,cAAc,CAAC,EAAE,OAAO,CAAC;QACzB,iBAAiB,CAAC,EAAE,UAAU,GAAG,MAAM,GAAG,WAAW,CAAC;QACtD,eAAe,CAAC,EAAE,SAAS,GAAG,QAAQ,CAAC;QACvC,KAAK,CAAC,EAAE,KAAK,GAAG,MAAM,GAAG,MAAM,GAAG,MAAM,GAAG,MAAM,CAAC;QAClD,SAAS,CAAC,EAAE,OAAO,CAAC;QACpB,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,YAAY,CAAC,EAAE,OAAO,CAAC;QACvB,IAAI,CAAC,EAAE,OAAO,CAAC;QACf,IAAI,CAAC,EAAE,MAAM,CAAC;KACf,CAAC;CACH"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validate-options.d.ts","sourceRoot":"","sources":["../../../../../../../packages/angular/src/generators/library/lib/validate-options.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AAGvC,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AAExC,wBAAgB,eAAe,CAAC,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,GAAG,IAAI,
|
|
1
|
+
{"version":3,"file":"validate-options.d.ts","sourceRoot":"","sources":["../../../../../../../packages/angular/src/generators/library/lib/validate-options.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AAGvC,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AAExC,wBAAgB,eAAe,CAAC,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,GAAG,IAAI,CA6BjE"}
|
|
@@ -10,9 +10,6 @@ function validateOptions(tree, options) {
|
|
|
10
10
|
if (options.publishable === true && !options.importPath) {
|
|
11
11
|
throw new Error(`For publishable libs you have to provide a proper "--importPath" which needs to be a valid npm package name (e.g. my-awesome-lib or @myorg/my-lib)`);
|
|
12
12
|
}
|
|
13
|
-
if (options.addTailwind && !options.buildable && !options.publishable) {
|
|
14
|
-
throw new Error(`To use "--addTailwind" option, you have to set either "--buildable" or "--publishable".`);
|
|
15
|
-
}
|
|
16
13
|
if (options.unitTestRunner === test_runners_1.UnitTestRunner.VitestAngular) {
|
|
17
14
|
const { major: angularMajorVersion, version: angularVersion } = (0, version_utils_1.getInstalledAngularVersionInfo)(tree);
|
|
18
15
|
if (angularMajorVersion < 21) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"library.d.ts","sourceRoot":"","sources":["../../../../../../packages/angular/src/generators/library/library.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,iBAAiB,EAIjB,IAAI,EACL,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"library.d.ts","sourceRoot":"","sources":["../../../../../../packages/angular/src/generators/library/library.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,iBAAiB,EAIjB,IAAI,EACL,MAAM,YAAY,CAAC;AAuBpB,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAElC,wBAAsB,gBAAgB,CACpC,IAAI,EAAE,IAAI,EACV,MAAM,EAAE,MAAM,GACb,OAAO,CAAC,iBAAiB,CAAC,CAiE5B;AAoED,eAAe,gBAAgB,CAAC"}
|
|
@@ -9,7 +9,6 @@ const add_release_config_1 = require("@nx/js/src/generators/library/utils/add-re
|
|
|
9
9
|
const init_1 = tslib_1.__importDefault(require("../../generators/init/init"));
|
|
10
10
|
const test_runners_1 = require("../../utils/test-runners");
|
|
11
11
|
const add_linting_1 = tslib_1.__importDefault(require("../add-linting/add-linting"));
|
|
12
|
-
const setup_tailwind_1 = tslib_1.__importDefault(require("../setup-tailwind/setup-tailwind"));
|
|
13
12
|
const add_jest_1 = require("../utils/add-jest");
|
|
14
13
|
const add_vitest_1 = require("../utils/add-vitest");
|
|
15
14
|
const dependencies_1 = require("../utils/dependencies");
|
|
@@ -55,13 +54,6 @@ async function libraryGenerator(tree, schema) {
|
|
|
55
54
|
await (0, add_standalone_component_1.addStandaloneComponent)(tree, options);
|
|
56
55
|
}
|
|
57
56
|
await addLinting(tree, libraryOptions);
|
|
58
|
-
if (libraryOptions.addTailwind) {
|
|
59
|
-
await (0, setup_tailwind_1.default)(tree, {
|
|
60
|
-
project: libraryOptions.name,
|
|
61
|
-
skipFormat: true,
|
|
62
|
-
skipPackageJson: libraryOptions.skipPackageJson,
|
|
63
|
-
});
|
|
64
|
-
}
|
|
65
57
|
if ((libraryOptions.buildable || libraryOptions.publishable) &&
|
|
66
58
|
!libraryOptions.skipPackageJson) {
|
|
67
59
|
(0, devkit_1.addDependenciesToPackageJson)(tree, {}, {
|
|
@@ -112,11 +112,6 @@
|
|
|
112
112
|
"description": "Whether or not to configure the ESLint `parserOptions.project` option. We do not do this by default for lint performance reasons.",
|
|
113
113
|
"default": false
|
|
114
114
|
},
|
|
115
|
-
"addTailwind": {
|
|
116
|
-
"type": "boolean",
|
|
117
|
-
"description": "Whether to configure Tailwind CSS for the application. It can only be used with buildable and publishable libraries. Non-buildable libraries will use the application's Tailwind configuration.",
|
|
118
|
-
"default": false
|
|
119
|
-
},
|
|
120
115
|
"skipModule": {
|
|
121
116
|
"type": "boolean",
|
|
122
117
|
"description": "Whether to skip the creation of a default module when generating the library.",
|
|
@@ -148,11 +148,6 @@
|
|
|
148
148
|
"description": "Whether or not to configure the ESLint `parserOptions.project` option. We do not do this by default for lint performance reasons.",
|
|
149
149
|
"default": false
|
|
150
150
|
},
|
|
151
|
-
"addTailwind": {
|
|
152
|
-
"type": "boolean",
|
|
153
|
-
"description": "Whether to configure Tailwind CSS for the application.",
|
|
154
|
-
"default": false
|
|
155
|
-
},
|
|
156
151
|
"skipFormat": {
|
|
157
152
|
"description": "Skip formatting files.",
|
|
158
153
|
"type": "boolean",
|
|
@@ -47,7 +47,7 @@ async function addVitestAngular(tree, options) {
|
|
|
47
47
|
: '@angular/build:unit-test';
|
|
48
48
|
const project = (0, devkit_1.readProjectConfiguration)(tree, options.name);
|
|
49
49
|
project.targets ??= {};
|
|
50
|
-
project.targets.test = { executor, options: {} };
|
|
50
|
+
project.targets.test = { executor, options: { watch: false } };
|
|
51
51
|
(0, devkit_1.updateProjectConfiguration)(tree, options.name, project);
|
|
52
52
|
const nxJson = (0, devkit_1.readNxJson)(tree);
|
|
53
53
|
nxJson.targetDefaults ??= {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"backward-compatible-versions.d.ts","sourceRoot":"","sources":["../../../../../packages/angular/src/utils/backward-compatible-versions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,cAAc,MAAM,YAAY,CAAC;AAE7C,eAAO,MAAM,iBAAiB,uBAAwB,CAAC;AACvD,MAAM,MAAM,gBAAgB,GAAG,CAAC,OAAO,iBAAiB,CAAC,CAAC,MAAM,CAAC,CAAC;AAElE,MAAM,MAAM,mBAAmB,GAAG,OAAO,CACvC,MAAM,OAAO,cAAc,EAC3B,WAAW,CACZ,CAAC;AACF,MAAM,MAAM,UAAU,GAAG;IACvB,EAAE,EAAE,MAAM,CAAC,mBAAmB,EAAE,MAAM,CAAC,CAAC;IACxC,EAAE,EAAE,MAAM,CAAC,mBAAmB,EAAE,MAAM,CAAC,CAAC;IACxC,EAAE,EAAE,MAAM,CAAC,mBAAmB,GAAG,sBAAsB,EAAE,MAAM,CAAC,CAAC;CAClE,CAAC;AAEF,MAAM,MAAM,qBAAqB,GAAG,UAAU,CAAC,gBAAgB,CAAC,CAAC;AAEjE,eAAO,MAAM,0BAA0B,EAAE,
|
|
1
|
+
{"version":3,"file":"backward-compatible-versions.d.ts","sourceRoot":"","sources":["../../../../../packages/angular/src/utils/backward-compatible-versions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,cAAc,MAAM,YAAY,CAAC;AAE7C,eAAO,MAAM,iBAAiB,uBAAwB,CAAC;AACvD,MAAM,MAAM,gBAAgB,GAAG,CAAC,OAAO,iBAAiB,CAAC,CAAC,MAAM,CAAC,CAAC;AAElE,MAAM,MAAM,mBAAmB,GAAG,OAAO,CACvC,MAAM,OAAO,cAAc,EAC3B,WAAW,CACZ,CAAC;AACF,MAAM,MAAM,UAAU,GAAG;IACvB,EAAE,EAAE,MAAM,CAAC,mBAAmB,EAAE,MAAM,CAAC,CAAC;IACxC,EAAE,EAAE,MAAM,CAAC,mBAAmB,EAAE,MAAM,CAAC,CAAC;IACxC,EAAE,EAAE,MAAM,CAAC,mBAAmB,GAAG,sBAAsB,EAAE,MAAM,CAAC,CAAC;CAClE,CAAC;AAEF,MAAM,MAAM,qBAAqB,GAAG,UAAU,CAAC,gBAAgB,CAAC,CAAC;AAEjE,eAAO,MAAM,0BAA0B,EAAE,UAiExC,CAAC"}
|
|
@@ -23,7 +23,6 @@ exports.backwardCompatibleVersions = {
|
|
|
23
23
|
moduleFederationEnhancedVersion: '^0.21.2',
|
|
24
24
|
angularEslintVersion: '^20.3.0',
|
|
25
25
|
typescriptEslintVersion: '^7.16.0',
|
|
26
|
-
tailwindVersion: '^3.0.2',
|
|
27
26
|
postcssVersion: '^8.4.5',
|
|
28
27
|
postcssUrlVersion: '~10.1.3',
|
|
29
28
|
autoprefixerVersion: '^10.4.0',
|
|
@@ -56,7 +55,6 @@ exports.backwardCompatibleVersions = {
|
|
|
56
55
|
moduleFederationEnhancedVersion: '^0.9.0',
|
|
57
56
|
angularEslintVersion: '^19.2.0',
|
|
58
57
|
typescriptEslintVersion: '^7.16.0',
|
|
59
|
-
tailwindVersion: '^3.0.2',
|
|
60
58
|
postcssVersion: '^8.4.5',
|
|
61
59
|
postcssUrlVersion: '~10.1.3',
|
|
62
60
|
autoprefixerVersion: '^10.4.0',
|
package/src/utils/versions.d.ts
CHANGED
|
@@ -16,7 +16,6 @@ export declare const moduleFederationEnhancedVersion = "^2.1.0";
|
|
|
16
16
|
export declare const webpackMergeVersion = "^5.8.0";
|
|
17
17
|
export declare const angularEslintVersion = "^21.2.0";
|
|
18
18
|
export declare const typescriptEslintVersion = "^7.16.0";
|
|
19
|
-
export declare const tailwindVersion = "^3.0.2";
|
|
20
19
|
export declare const postcssVersion = "^8.4.5";
|
|
21
20
|
export declare const postcssUrlVersion = "~10.1.3";
|
|
22
21
|
export declare const autoprefixerVersion = "^10.4.0";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"versions.d.ts","sourceRoot":"","sources":["../../../../../packages/angular/src/utils/versions.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,SAAS,KAAwC,CAAC;AAE/D,eAAO,MAAM,cAAc,YAAY,CAAC;AACxC,eAAO,MAAM,oBAAoB,YAAY,CAAC;AAC9C,eAAO,MAAM,gBAAgB,YAAY,CAAC;AAC1C,eAAO,MAAM,WAAW,YAAY,CAAC;AACrC,eAAO,MAAM,WAAW,WAAW,CAAC;AACpC,eAAO,MAAM,aAAa,YAAY,CAAC;AACvC,eAAO,MAAM,YAAY,WAAW,CAAC;AAErC,eAAO,MAAM,WAAW,WAAW,CAAC;AACpC,eAAO,MAAM,gBAAgB,WAAW,CAAC;AACzC,eAAO,MAAM,cAAc,YAAY,CAAC;AACxC,eAAO,MAAM,mBAAmB,aAAa,CAAC;AAC9C,eAAO,MAAM,kBAAkB,WAAW,CAAC;AAC3C,eAAO,MAAM,2BAA2B,YAAY,CAAC;AACrD,eAAO,MAAM,+BAA+B,WAAW,CAAC;AACxD,eAAO,MAAM,mBAAmB,WAAW,CAAC;AAE5C,eAAO,MAAM,oBAAoB,YAAY,CAAC;AAC9C,eAAO,MAAM,uBAAuB,YAAY,CAAC;AACjD,eAAO,MAAM,
|
|
1
|
+
{"version":3,"file":"versions.d.ts","sourceRoot":"","sources":["../../../../../packages/angular/src/utils/versions.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,SAAS,KAAwC,CAAC;AAE/D,eAAO,MAAM,cAAc,YAAY,CAAC;AACxC,eAAO,MAAM,oBAAoB,YAAY,CAAC;AAC9C,eAAO,MAAM,gBAAgB,YAAY,CAAC;AAC1C,eAAO,MAAM,WAAW,YAAY,CAAC;AACrC,eAAO,MAAM,WAAW,WAAW,CAAC;AACpC,eAAO,MAAM,aAAa,YAAY,CAAC;AACvC,eAAO,MAAM,YAAY,WAAW,CAAC;AAErC,eAAO,MAAM,WAAW,WAAW,CAAC;AACpC,eAAO,MAAM,gBAAgB,WAAW,CAAC;AACzC,eAAO,MAAM,cAAc,YAAY,CAAC;AACxC,eAAO,MAAM,mBAAmB,aAAa,CAAC;AAC9C,eAAO,MAAM,kBAAkB,WAAW,CAAC;AAC3C,eAAO,MAAM,2BAA2B,YAAY,CAAC;AACrD,eAAO,MAAM,+BAA+B,WAAW,CAAC;AACxD,eAAO,MAAM,mBAAmB,WAAW,CAAC;AAE5C,eAAO,MAAM,oBAAoB,YAAY,CAAC;AAC9C,eAAO,MAAM,uBAAuB,YAAY,CAAC;AACjD,eAAO,MAAM,cAAc,WAAW,CAAC;AACvC,eAAO,MAAM,iBAAiB,YAAY,CAAC;AAC3C,eAAO,MAAM,mBAAmB,YAAY,CAAC;AAC7C,eAAO,MAAM,aAAa,WAAW,CAAC;AACtC,eAAO,MAAM,WAAW,WAAW,CAAC;AAEpC,eAAO,MAAM,wBAAwB,YAAY,CAAC;AAClD,eAAO,MAAM,gBAAgB,YAAY,CAAC;AAC1C,eAAO,MAAM,qBAAqB,WAAW,CAAC;AAE9C,eAAO,MAAM,aAAa,WAAW,CAAC;AACtC,eAAO,MAAM,YAAY,YAAY,CAAC;AAGtC,eAAO,MAAM,wBAAwB,aAAa,CAAC;AAEnD,eAAO,MAAM,wBAAwB,WAAW,CAAC"}
|
package/src/utils/versions.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.jsoncEslintParserVersion = exports.oxcProjectRuntimeVersion = exports.jsdomVersion = exports.vitestVersion = exports.jasmineMarblesVersion = exports.typesNodeVersion = exports.jestPresetAngularVersion = exports.lessVersion = exports.tsNodeVersion = exports.autoprefixerVersion = exports.postcssUrlVersion = exports.postcssVersion = exports.
|
|
3
|
+
exports.jsoncEslintParserVersion = exports.oxcProjectRuntimeVersion = exports.jsdomVersion = exports.vitestVersion = exports.jasmineMarblesVersion = exports.typesNodeVersion = exports.jestPresetAngularVersion = exports.lessVersion = exports.tsNodeVersion = exports.autoprefixerVersion = exports.postcssUrlVersion = exports.postcssVersion = exports.typescriptEslintVersion = exports.angularEslintVersion = exports.webpackMergeVersion = exports.moduleFederationEnhancedVersion = exports.moduleFederationNodeVersion = exports.browserSyncVersion = exports.typesExpressVersion = exports.expressVersion = exports.typesCorsVersion = exports.corsVersion = exports.tsLibVersion = exports.zoneJsVersion = exports.rxjsVersion = exports.ngrxVersion = exports.ngPackagrVersion = exports.angularDevkitVersion = exports.angularVersion = exports.nxVersion = void 0;
|
|
4
4
|
exports.nxVersion = require('../../package.json').version;
|
|
5
5
|
exports.angularVersion = '~21.2.0';
|
|
6
6
|
exports.angularDevkitVersion = '~21.2.0';
|
|
@@ -19,7 +19,6 @@ exports.moduleFederationEnhancedVersion = '^2.1.0';
|
|
|
19
19
|
exports.webpackMergeVersion = '^5.8.0';
|
|
20
20
|
exports.angularEslintVersion = '^21.2.0';
|
|
21
21
|
exports.typescriptEslintVersion = '^7.16.0';
|
|
22
|
-
exports.tailwindVersion = '^3.0.2';
|
|
23
22
|
exports.postcssVersion = '^8.4.5';
|
|
24
23
|
exports.postcssUrlVersion = '~10.1.3';
|
|
25
24
|
exports.autoprefixerVersion = '^10.4.0';
|
package/tailwind.d.ts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
4
|
-
* @param fileGlobPattern pass a custom glob pattern to be used
|
|
2
|
+
* @deprecated `@nx/angular/tailwind` will be removed in Nx 24. Migrate to Tailwind CSS v4 which no longer needs glob patterns.
|
|
3
|
+
* See: https://nx.dev/docs/technologies/angular/guides/using-tailwind-css-with-angular
|
|
5
4
|
*/
|
|
6
5
|
export declare function createGlobPatternsForDependencies(dirPath: string, fileGlobPattern?: string): string[];
|
|
7
6
|
//# sourceMappingURL=tailwind.d.ts.map
|
package/tailwind.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tailwind.d.ts","sourceRoot":"","sources":["../../../packages/angular/tailwind.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"tailwind.d.ts","sourceRoot":"","sources":["../../../packages/angular/tailwind.ts"],"names":[],"mappings":"AAIA;;;GAGG;AACH,wBAAgB,iCAAiC,CAC/C,OAAO,EAAE,MAAM,EACf,eAAe,GAAE,MAA4C,YA4B9D"}
|
package/tailwind.js
CHANGED
|
@@ -2,12 +2,18 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.createGlobPatternsForDependencies = createGlobPatternsForDependencies;
|
|
4
4
|
const generate_globs_1 = require("@nx/js/src/utils/generate-globs");
|
|
5
|
+
let hasWarned = false;
|
|
5
6
|
/**
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
* @param fileGlobPattern pass a custom glob pattern to be used
|
|
7
|
+
* @deprecated `@nx/angular/tailwind` will be removed in Nx 24. Migrate to Tailwind CSS v4 which no longer needs glob patterns.
|
|
8
|
+
* See: https://nx.dev/docs/technologies/angular/guides/using-tailwind-css-with-angular
|
|
9
9
|
*/
|
|
10
10
|
function createGlobPatternsForDependencies(dirPath, fileGlobPattern = '/**/!(*.stories|*.spec).{ts,html}') {
|
|
11
|
+
if (!hasWarned) {
|
|
12
|
+
hasWarned = true;
|
|
13
|
+
console.warn(`\nWARNING: "@nx/angular/tailwind" is deprecated and will be removed in Nx 24.\n` +
|
|
14
|
+
`Migrate to Tailwind CSS v4 which no longer needs glob patterns for content detection.\n` +
|
|
15
|
+
`See: https://nx.dev/docs/technologies/angular/guides/using-tailwind-css-with-angular\n`);
|
|
16
|
+
}
|
|
11
17
|
try {
|
|
12
18
|
return (0, generate_globs_1.createGlobPatternsForDependencies)(dirPath, fileGlobPattern);
|
|
13
19
|
}
|
|
@@ -19,7 +25,7 @@ function createGlobPatternsForDependencies(dirPath, fileGlobPattern = '/**/!(*.s
|
|
|
19
25
|
* autocomplete features, for example.
|
|
20
26
|
*
|
|
21
27
|
* In order to best support that use-case, we therefore do not hard error when the ProjectGraph is
|
|
22
|
-
*
|
|
28
|
+
* fundamentally unavailable in this tailwind-specific context.
|
|
23
29
|
*/
|
|
24
30
|
console.warn('\nWARNING: There was an error creating glob patterns, returning an empty array\n' +
|
|
25
31
|
`${e.message}\n`);
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
const { createGlobPatternsForDependencies } = require('@nx/angular/tailwind');
|
|
2
|
-
const { join } = require('path');
|
|
3
|
-
|
|
4
|
-
module.exports = {
|
|
5
|
-
mode: 'jit',
|
|
6
|
-
purge: [
|
|
7
|
-
join(__dirname, '<%= relativeSourceRoot %>/**/!(*.stories|*.spec).{ts,html}'),
|
|
8
|
-
...createGlobPatternsForDependencies(__dirname),
|
|
9
|
-
],
|
|
10
|
-
darkMode: false, // or 'media' or 'class'
|
|
11
|
-
theme: {
|
|
12
|
-
extend: {},
|
|
13
|
-
},
|
|
14
|
-
variants: {
|
|
15
|
-
extend: {},
|
|
16
|
-
},
|
|
17
|
-
plugins: [],
|
|
18
|
-
};
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
const { createGlobPatternsForDependencies } = require('@nx/angular/tailwind');
|
|
2
|
-
const { join } = require('path');
|
|
3
|
-
|
|
4
|
-
/** @type {import('tailwindcss').Config} */
|
|
5
|
-
module.exports = {
|
|
6
|
-
content: [
|
|
7
|
-
join(__dirname, '<%= relativeSourceRoot %>/**/!(*.stories|*.spec).{ts,html}'),
|
|
8
|
-
...createGlobPatternsForDependencies(__dirname),
|
|
9
|
-
],
|
|
10
|
-
theme: {
|
|
11
|
-
extend: {},
|
|
12
|
-
},
|
|
13
|
-
plugins: [],
|
|
14
|
-
};
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import { ProjectConfiguration, Tree } from '@nx/devkit';
|
|
2
|
-
import { GeneratorOptions } from '../schema';
|
|
3
|
-
export declare function addTailwindConfig(tree: Tree, options: GeneratorOptions, project: ProjectConfiguration, tailwindVersion: '2' | '3'): void;
|
|
4
|
-
//# sourceMappingURL=add-tailwind-config.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"add-tailwind-config.d.ts","sourceRoot":"","sources":["../../../../../../../packages/angular/src/generators/setup-tailwind/lib/add-tailwind-config.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,oBAAoB,EAEpB,IAAI,EACL,MAAM,YAAY,CAAC;AAGpB,OAAO,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAE7C,wBAAgB,iBAAiB,CAC/B,IAAI,EAAE,IAAI,EACV,OAAO,EAAE,gBAAgB,EACzB,OAAO,EAAE,oBAAoB,EAC7B,eAAe,EAAE,GAAG,GAAG,GAAG,GACzB,IAAI,CAsBN"}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.addTailwindConfig = addTailwindConfig;
|
|
4
|
-
const devkit_1 = require("@nx/devkit");
|
|
5
|
-
const ts_solution_setup_1 = require("@nx/js/src/utils/typescript/ts-solution-setup");
|
|
6
|
-
const path_1 = require("path");
|
|
7
|
-
function addTailwindConfig(tree, options, project, tailwindVersion) {
|
|
8
|
-
if (tree.exists((0, devkit_1.joinPathFragments)(project.root, 'tailwind.config.js'))) {
|
|
9
|
-
throw new Error((0, devkit_1.stripIndents) `The "tailwind.config.js" file already exists in the project "${options.project}". Are you sure this is the right project to set up Tailwind?
|
|
10
|
-
If you are sure, you can remove the existing file and re-run the generator.`);
|
|
11
|
-
}
|
|
12
|
-
const filesDir = tailwindVersion === '3' ? 'files/v3' : 'files/v2';
|
|
13
|
-
(0, devkit_1.generateFiles)(tree, (0, devkit_1.joinPathFragments)(__dirname, '..', filesDir), project.root, {
|
|
14
|
-
relativeSourceRoot: (0, path_1.relative)(project.root, (0, ts_solution_setup_1.getProjectSourceRoot)(project, tree)),
|
|
15
|
-
tmpl: '',
|
|
16
|
-
});
|
|
17
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"add-tailwind-required-packages.d.ts","sourceRoot":"","sources":["../../../../../../../packages/angular/src/generators/setup-tailwind/lib/add-tailwind-required-packages.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,iBAAiB,EACjB,IAAI,EACL,MAAM,YAAY,CAAC;AAGpB,wBAAgB,2BAA2B,CAAC,IAAI,EAAE,IAAI,GAAG,iBAAiB,CAWzE"}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.addTailwindRequiredPackages = addTailwindRequiredPackages;
|
|
4
|
-
const devkit_1 = require("@nx/devkit");
|
|
5
|
-
const version_utils_1 = require("../../utils/version-utils");
|
|
6
|
-
function addTailwindRequiredPackages(tree) {
|
|
7
|
-
const pkgVersions = (0, version_utils_1.versions)(tree);
|
|
8
|
-
return (0, devkit_1.addDependenciesToPackageJson)(tree, {}, {
|
|
9
|
-
autoprefixer: pkgVersions.autoprefixerVersion,
|
|
10
|
-
postcss: pkgVersions.postcssVersion,
|
|
11
|
-
tailwindcss: pkgVersions.tailwindVersion,
|
|
12
|
-
});
|
|
13
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"detect-tailwind-installed-version.d.ts","sourceRoot":"","sources":["../../../../../../../packages/angular/src/generators/setup-tailwind/lib/detect-tailwind-installed-version.ts"],"names":[],"mappings":"AAAA,OAAO,EAAY,IAAI,EAAE,MAAM,YAAY,CAAC;AAI5C,wBAAgB,8BAA8B,CAC5C,IAAI,EAAE,IAAI,GACT,GAAG,GAAG,GAAG,GAAG,SAAS,CAiBvB"}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.detectTailwindInstalledVersion = detectTailwindInstalledVersion;
|
|
4
|
-
const devkit_1 = require("@nx/devkit");
|
|
5
|
-
const semver_1 = require("@nx/devkit/src/utils/semver");
|
|
6
|
-
const semver_2 = require("semver");
|
|
7
|
-
function detectTailwindInstalledVersion(tree) {
|
|
8
|
-
const { dependencies, devDependencies } = (0, devkit_1.readJson)(tree, 'package.json');
|
|
9
|
-
const tailwindVersion = dependencies?.tailwindcss ?? devDependencies?.tailwindcss;
|
|
10
|
-
if (!tailwindVersion) {
|
|
11
|
-
return undefined;
|
|
12
|
-
}
|
|
13
|
-
const version = (0, semver_1.checkAndCleanWithSemver)(tree, 'tailwindcss', tailwindVersion);
|
|
14
|
-
if ((0, semver_2.lt)(version, '2.0.0')) {
|
|
15
|
-
throw new Error(`The Tailwind CSS version "${tailwindVersion}" is not supported. Please upgrade to v2.0.0 or higher.`);
|
|
16
|
-
}
|
|
17
|
-
return (0, semver_2.lt)(version, '3.0.0') ? '2' : '3';
|
|
18
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
export * from './add-tailwind-config';
|
|
2
|
-
export * from './add-tailwind-required-packages';
|
|
3
|
-
export * from './detect-tailwind-installed-version';
|
|
4
|
-
export * from './normalize-options';
|
|
5
|
-
export * from './update-application-styles';
|
|
6
|
-
export * from './validate-build-target';
|
|
7
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../packages/angular/src/generators/setup-tailwind/lib/index.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAC;AACtC,cAAc,kCAAkC,CAAC;AACjD,cAAc,qCAAqC,CAAC;AACpD,cAAc,qBAAqB,CAAC;AACpC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,yBAAyB,CAAC"}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const tslib_1 = require("tslib");
|
|
4
|
-
tslib_1.__exportStar(require("./add-tailwind-config"), exports);
|
|
5
|
-
tslib_1.__exportStar(require("./add-tailwind-required-packages"), exports);
|
|
6
|
-
tslib_1.__exportStar(require("./detect-tailwind-installed-version"), exports);
|
|
7
|
-
tslib_1.__exportStar(require("./normalize-options"), exports);
|
|
8
|
-
tslib_1.__exportStar(require("./update-application-styles"), exports);
|
|
9
|
-
tslib_1.__exportStar(require("./validate-build-target"), exports);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"normalize-options.d.ts","sourceRoot":"","sources":["../../../../../../../packages/angular/src/generators/setup-tailwind/lib/normalize-options.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,0BAA0B,EAAE,MAAM,WAAW,CAAC;AAE9E,wBAAgB,gBAAgB,CAC9B,OAAO,EAAE,gBAAgB,GACxB,0BAA0B,CAK5B"}
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import { ProjectConfiguration, Tree } from '@nx/devkit';
|
|
2
|
-
import { NormalizedGeneratorOptions } from '../schema';
|
|
3
|
-
export declare function updateApplicationStyles(tree: Tree, options: NormalizedGeneratorOptions, project: ProjectConfiguration): void;
|
|
4
|
-
//# sourceMappingURL=update-application-styles.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"update-application-styles.d.ts","sourceRoot":"","sources":["../../../../../../../packages/angular/src/generators/setup-tailwind/lib/update-application-styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,oBAAoB,EAEpB,IAAI,EACL,MAAM,YAAY,CAAC;AAEpB,OAAO,EAAE,0BAA0B,EAAE,MAAM,WAAW,CAAC;AAEvD,wBAAgB,uBAAuB,CACrC,IAAI,EAAE,IAAI,EACV,OAAO,EAAE,0BAA0B,EACnC,OAAO,EAAE,oBAAoB,GAC5B,IAAI,CA6BN"}
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.updateApplicationStyles = updateApplicationStyles;
|
|
4
|
-
const devkit_1 = require("@nx/devkit");
|
|
5
|
-
const ts_solution_setup_1 = require("@nx/js/src/utils/typescript/ts-solution-setup");
|
|
6
|
-
function updateApplicationStyles(tree, options, project) {
|
|
7
|
-
let stylesEntryPoint = options.stylesEntryPoint;
|
|
8
|
-
if (stylesEntryPoint && !tree.exists(stylesEntryPoint)) {
|
|
9
|
-
throw new Error(`The provided styles entry point "${stylesEntryPoint}" could not be found.`);
|
|
10
|
-
}
|
|
11
|
-
if (!stylesEntryPoint) {
|
|
12
|
-
stylesEntryPoint = findStylesEntryPoint(tree, options, project);
|
|
13
|
-
if (!stylesEntryPoint) {
|
|
14
|
-
throw new Error((0, devkit_1.stripIndents) `Could not find a styles entry point for project "${options.project}".
|
|
15
|
-
Please specify a styles entry point using the "--stylesEntryPoint" option.`);
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
const stylesEntryPointContent = tree.read(stylesEntryPoint, 'utf-8');
|
|
19
|
-
tree.write(stylesEntryPoint, (0, devkit_1.stripIndents) `@tailwind base;
|
|
20
|
-
@tailwind components;
|
|
21
|
-
@tailwind utilities;
|
|
22
|
-
|
|
23
|
-
${stylesEntryPointContent}`);
|
|
24
|
-
}
|
|
25
|
-
function findStylesEntryPoint(tree, options, project) {
|
|
26
|
-
const sourceRoot = (0, ts_solution_setup_1.getProjectSourceRoot)(project, tree);
|
|
27
|
-
// first check for common names
|
|
28
|
-
const possibleStylesEntryPoints = [
|
|
29
|
-
(0, devkit_1.joinPathFragments)(sourceRoot, 'styles.css'),
|
|
30
|
-
(0, devkit_1.joinPathFragments)(sourceRoot, 'styles.scss'),
|
|
31
|
-
(0, devkit_1.joinPathFragments)(sourceRoot, 'styles.sass'),
|
|
32
|
-
(0, devkit_1.joinPathFragments)(sourceRoot, 'styles.less'),
|
|
33
|
-
];
|
|
34
|
-
let stylesEntryPoint = possibleStylesEntryPoints.find((s) => tree.exists(s));
|
|
35
|
-
if (stylesEntryPoint) {
|
|
36
|
-
return stylesEntryPoint;
|
|
37
|
-
}
|
|
38
|
-
// then check for the specified styles in the build configuration if it exists
|
|
39
|
-
const styles = project.targets?.[options.buildTarget]?.options?.styles;
|
|
40
|
-
if (!styles) {
|
|
41
|
-
return undefined;
|
|
42
|
-
}
|
|
43
|
-
// find the first style that belongs to the project source
|
|
44
|
-
const style = styles.find((s) => typeof s === 'string'
|
|
45
|
-
? s.startsWith(project.root) && tree.exists(s)
|
|
46
|
-
: s.input.startsWith(project.root) &&
|
|
47
|
-
s.inject !== false &&
|
|
48
|
-
tree.exists(s.input));
|
|
49
|
-
if (!style) {
|
|
50
|
-
return undefined;
|
|
51
|
-
}
|
|
52
|
-
return typeof style === 'string' ? style : style.input;
|
|
53
|
-
}
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import { type ProjectConfiguration } from '@nx/devkit';
|
|
2
|
-
import type { NormalizedGeneratorOptions } from '../schema';
|
|
3
|
-
export declare function validateBuildTarget(options: NormalizedGeneratorOptions, project: ProjectConfiguration): void;
|
|
4
|
-
//# sourceMappingURL=validate-build-target.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"validate-build-target.d.ts","sourceRoot":"","sources":["../../../../../../../packages/angular/src/generators/setup-tailwind/lib/validate-build-target.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgB,KAAK,oBAAoB,EAAE,MAAM,YAAY,CAAC;AACrE,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,WAAW,CAAC;AAE5D,wBAAgB,mBAAmB,CACjC,OAAO,EAAE,0BAA0B,EACnC,OAAO,EAAE,oBAAoB,GAC5B,IAAI,CA+BN"}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.validateBuildTarget = validateBuildTarget;
|
|
4
|
-
const devkit_1 = require("@nx/devkit");
|
|
5
|
-
function validateBuildTarget(options, project) {
|
|
6
|
-
const buildTarget = project.targets?.[options.buildTarget];
|
|
7
|
-
if (!buildTarget) {
|
|
8
|
-
throw new Error((0, devkit_1.stripIndents) `The target "${options.buildTarget}" was not found for project "${options.project}".
|
|
9
|
-
If you are using a different build target, please provide it using the "--buildTarget" option.
|
|
10
|
-
If the project is not a buildable or publishable library, you don't need to setup TailwindCSS for it.`);
|
|
11
|
-
}
|
|
12
|
-
const supportedLibraryExecutors = [
|
|
13
|
-
'@angular-devkit/build-angular:ng-packagr',
|
|
14
|
-
'@angular/build:ng-packagr',
|
|
15
|
-
'@nx/angular:ng-packagr-lite',
|
|
16
|
-
'@nx/angular:package',
|
|
17
|
-
];
|
|
18
|
-
if (!supportedLibraryExecutors.includes(project.targets[options.buildTarget].executor)) {
|
|
19
|
-
throw new Error((0, devkit_1.stripIndents) `The build target for project "${options.project}" is using an unsupported executor "${buildTarget.executor}".
|
|
20
|
-
Supported executors are ${supportedLibraryExecutors
|
|
21
|
-
.map((e) => `"${e}"`)
|
|
22
|
-
.join(', ')}.`);
|
|
23
|
-
}
|
|
24
|
-
}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
export interface GeneratorOptions {
|
|
2
|
-
project: string;
|
|
3
|
-
buildTarget?: string;
|
|
4
|
-
skipFormat?: boolean;
|
|
5
|
-
stylesEntryPoint?: string;
|
|
6
|
-
skipPackageJson?: boolean;
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
export interface NormalizedGeneratorOptions extends GeneratorOptions {
|
|
10
|
-
buildTarget: string;
|
|
11
|
-
}
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"$schema": "https://json-schema.org/schema",
|
|
3
|
-
"$id": "NxAngularTailwindSetupGenerator",
|
|
4
|
-
"cli": "nx",
|
|
5
|
-
"title": "Configures Tailwind CSS for an application or a buildable/publishable library.",
|
|
6
|
-
"description": "Adds the Tailwind CSS configuration files for a given Angular project and installs, if needed, the packages required for Tailwind CSS to work.",
|
|
7
|
-
"type": "object",
|
|
8
|
-
"properties": {
|
|
9
|
-
"project": {
|
|
10
|
-
"type": "string",
|
|
11
|
-
"description": "The name of the project to add the Tailwind CSS setup for.",
|
|
12
|
-
"$default": {
|
|
13
|
-
"$source": "argv",
|
|
14
|
-
"index": 0
|
|
15
|
-
},
|
|
16
|
-
"x-prompt": "What project would you like to add the Tailwind CSS setup?"
|
|
17
|
-
},
|
|
18
|
-
"buildTarget": {
|
|
19
|
-
"type": "string",
|
|
20
|
-
"description": "The name of the target used to build the project. This option only applies to buildable/publishable libraries.",
|
|
21
|
-
"default": "build"
|
|
22
|
-
},
|
|
23
|
-
"skipFormat": {
|
|
24
|
-
"type": "boolean",
|
|
25
|
-
"description": "Skips formatting the workspace after the generator completes.",
|
|
26
|
-
"x-priority": "internal"
|
|
27
|
-
},
|
|
28
|
-
"stylesEntryPoint": {
|
|
29
|
-
"type": "string",
|
|
30
|
-
"description": "Path to the styles entry point relative to the workspace root. If not provided the generator will do its best to find it and it will error if it can't. This option only applies to applications."
|
|
31
|
-
},
|
|
32
|
-
"skipPackageJson": {
|
|
33
|
-
"type": "boolean",
|
|
34
|
-
"default": false,
|
|
35
|
-
"description": "Do not add dependencies to `package.json`.",
|
|
36
|
-
"x-priority": "internal"
|
|
37
|
-
}
|
|
38
|
-
},
|
|
39
|
-
"additionalProperties": false,
|
|
40
|
-
"required": ["project"],
|
|
41
|
-
"examplesFile": "../../../docs/setup-tailwind-examples.md"
|
|
42
|
-
}
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import { GeneratorCallback, Tree } from '@nx/devkit';
|
|
2
|
-
import { GeneratorOptions } from './schema';
|
|
3
|
-
export declare function setupTailwindGenerator(tree: Tree, rawOptions: GeneratorOptions): Promise<GeneratorCallback>;
|
|
4
|
-
export default setupTailwindGenerator;
|
|
5
|
-
//# sourceMappingURL=setup-tailwind.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"setup-tailwind.d.ts","sourceRoot":"","sources":["../../../../../../packages/angular/src/generators/setup-tailwind/setup-tailwind.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,iBAAiB,EAGjB,IAAI,EACL,MAAM,YAAY,CAAC;AASpB,OAAO,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAE5C,wBAAsB,sBAAsB,CAC1C,IAAI,EAAE,IAAI,EACV,UAAU,EAAE,gBAAgB,GAC3B,OAAO,CAAC,iBAAiB,CAAC,CAoC5B;AAED,eAAe,sBAAsB,CAAC"}
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.setupTailwindGenerator = setupTailwindGenerator;
|
|
4
|
-
const devkit_1 = require("@nx/devkit");
|
|
5
|
-
const lib_1 = require("./lib");
|
|
6
|
-
async function setupTailwindGenerator(tree, rawOptions) {
|
|
7
|
-
devkit_1.logger.warn(`The 'setup-tailwind' generator is deprecated. Generating Tailwind configuration is no longer maintained. This generator will be removed in Nx 23.`);
|
|
8
|
-
const options = (0, lib_1.normalizeOptions)(rawOptions);
|
|
9
|
-
const project = (0, devkit_1.readProjectConfiguration)(tree, options.project);
|
|
10
|
-
if (rawOptions.buildTarget && !project.targets?.[rawOptions.buildTarget]) {
|
|
11
|
-
throw new Error(`The provided target "${options.buildTarget}" was not found for project "${options.project}". Please provide a valid build target.`);
|
|
12
|
-
}
|
|
13
|
-
const tailwindInstalledVersion = (0, lib_1.detectTailwindInstalledVersion)(tree);
|
|
14
|
-
let installTask = () => { };
|
|
15
|
-
if (!options.skipPackageJson) {
|
|
16
|
-
if (tailwindInstalledVersion === undefined) {
|
|
17
|
-
installTask = (0, lib_1.addTailwindRequiredPackages)(tree);
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
(0, lib_1.addTailwindConfig)(tree, options, project, tailwindInstalledVersion ?? '3');
|
|
21
|
-
if (project.projectType === 'application') {
|
|
22
|
-
(0, lib_1.updateApplicationStyles)(tree, options, project);
|
|
23
|
-
}
|
|
24
|
-
else if (project.projectType === 'library') {
|
|
25
|
-
(0, lib_1.validateBuildTarget)(options, project);
|
|
26
|
-
}
|
|
27
|
-
if (!options.skipFormat) {
|
|
28
|
-
await (0, devkit_1.formatFiles)(tree);
|
|
29
|
-
}
|
|
30
|
-
return installTask;
|
|
31
|
-
}
|
|
32
|
-
exports.default = setupTailwindGenerator;
|