@rxap/plugin-angular 16.1.0-dev.1 → 16.1.0-dev.10
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/CHANGELOG.md +61 -0
- package/LICENSE.md +621 -0
- package/README.md +67 -1
- package/executors.json +14 -0
- package/generators.json +27 -0
- package/package.json +29 -15
- package/src/executors/check-ng-package/executor.d.ts +5 -0
- package/src/executors/check-ng-package/executor.js +24 -0
- package/src/executors/check-ng-package/executor.js.map +1 -0
- package/src/executors/check-ng-package/schema.d.ts +1 -0
- package/src/executors/check-ng-package/schema.json +9 -0
- package/src/executors/tailwind/executor.d.ts +5 -0
- package/src/executors/tailwind/executor.js +23 -0
- package/src/executors/tailwind/executor.js.map +1 -0
- package/src/executors/tailwind/schema.d.ts +6 -0
- package/src/executors/tailwind/schema.json +26 -0
- package/src/generators/fix-schematic/generator.js +56 -64
- package/src/generators/fix-schematic/generator.js.map +1 -1
- package/src/generators/fix-schematic/index.d.ts +2 -0
- package/src/generators/fix-schematic/index.js +5 -0
- package/src/generators/fix-schematic/index.js.map +1 -0
- package/src/generators/init/generator.js +23 -30
- package/src/generators/init/generator.js.map +1 -1
- package/src/generators/init/index.d.ts +2 -0
- package/src/generators/init/index.js +5 -0
- package/src/generators/init/index.js.map +1 -0
- package/src/generators/init-application/files/shared/angular.Dockerfile +3 -0
- package/src/generators/init-application/files/shared/configuration/.gitkeep +0 -0
- package/src/generators/init-application/generator.js +73 -78
- package/src/generators/init-application/generator.js.map +1 -1
- package/src/generators/init-application/index.d.ts +2 -0
- package/src/generators/init-application/index.js +5 -0
- package/src/generators/init-application/index.js.map +1 -0
- package/src/generators/init-library/generator.js +101 -55
- package/src/generators/init-library/generator.js.map +1 -1
- package/src/generators/init-library/index.d.ts +2 -0
- package/src/generators/init-library/index.js +5 -0
- package/src/generators/init-library/index.js.map +1 -0
- package/src/generators/schematic/generator.js +67 -77
- package/src/generators/schematic/generator.js.map +1 -1
- package/src/generators/schematic/index.d.ts +2 -0
- package/src/generators/schematic/index.js +5 -0
- package/src/generators/schematic/index.js.map +1 -0
- package/src/index.js +3 -9
- package/src/index.js.map +1 -1
- package/src/lib/skip-project.js +5 -10
- package/src/lib/skip-project.js.map +1 -1
- package/src/generators/init-application/files/shared/assets/Dockerfile +0 -5
- package/src/generators/init-application/files/shared/assets/nginx.conf +0 -74
package/README.md
CHANGED
|
@@ -9,6 +9,7 @@
|
|
|
9
9
|
|
|
10
10
|
- [Installation](#installation)
|
|
11
11
|
- [Generators](#generators)
|
|
12
|
+
- [Executors](#executors)
|
|
12
13
|
|
|
13
14
|
# Installation
|
|
14
15
|
|
|
@@ -18,7 +19,7 @@ yarn add @rxap/plugin-angular
|
|
|
18
19
|
```
|
|
19
20
|
**Install peer dependencies:**
|
|
20
21
|
```bash
|
|
21
|
-
yarn add @nx/devkit@^16.5.0 @rxap/generator-utilities@^1.0.1-dev.
|
|
22
|
+
yarn add @nx/devkit@^16.5.0 @rxap/generator-utilities@^1.1.0-dev.4 @rxap/plugin-localazy@^16.1.0-dev.3 @rxap/plugin-utilities@^16.1.0-dev.6 @rxap/schematics-ts-morph@^16.0.0-dev.10 @rxap/workspace-ts-morph@^0.1.0-dev.0 @rxap/workspace-utilities@^0.1.0-dev.3 nx@^16.5.0 ts-morph@^18.0.0
|
|
22
23
|
```
|
|
23
24
|
**Execute the init generator:**
|
|
24
25
|
```bash
|
|
@@ -60,3 +61,68 @@ yarn nx g @rxap/plugin-angular:fix-schematic
|
|
|
60
61
|
```bash
|
|
61
62
|
yarn nx g @rxap/plugin-angular:schematic
|
|
62
63
|
```
|
|
64
|
+
|
|
65
|
+
## init
|
|
66
|
+
> init generator
|
|
67
|
+
|
|
68
|
+
```bash
|
|
69
|
+
yarn nx g @rxap/plugin-angular:init
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
## init-application
|
|
73
|
+
> init-application generator
|
|
74
|
+
|
|
75
|
+
```bash
|
|
76
|
+
yarn nx g @rxap/plugin-angular:init-application
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
## init-library
|
|
80
|
+
> init-library generator
|
|
81
|
+
|
|
82
|
+
```bash
|
|
83
|
+
yarn nx g @rxap/plugin-angular:init-library
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
## fix-schematic
|
|
87
|
+
> fix-schematic generator
|
|
88
|
+
|
|
89
|
+
```bash
|
|
90
|
+
yarn nx g @rxap/plugin-angular:fix-schematic
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
## schematic
|
|
94
|
+
> Create a Schematic for a project.
|
|
95
|
+
|
|
96
|
+
```bash
|
|
97
|
+
yarn nx g @rxap/plugin-angular:schematic
|
|
98
|
+
```
|
|
99
|
+
# Executors
|
|
100
|
+
|
|
101
|
+
## tailwind
|
|
102
|
+
> tailwind executor
|
|
103
|
+
|
|
104
|
+
**project.json**
|
|
105
|
+
```json
|
|
106
|
+
{
|
|
107
|
+
"targets": {
|
|
108
|
+
"tailwind": {
|
|
109
|
+
"executor": "@rxap/plugin-angular:tailwind"
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
## check-ng-package
|
|
116
|
+
> check-ng-package executor
|
|
117
|
+
|
|
118
|
+
**project.json**
|
|
119
|
+
```json
|
|
120
|
+
{
|
|
121
|
+
"targets": {
|
|
122
|
+
"check-ng-package": {
|
|
123
|
+
"executor": "@rxap/plugin-angular:check-ng-package"
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
```
|
|
128
|
+
|
package/executors.json
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
{
|
|
2
|
+
"executors": {
|
|
3
|
+
"tailwind": {
|
|
4
|
+
"implementation": "./src/executors/tailwind/executor",
|
|
5
|
+
"schema": "./src/executors/tailwind/schema.json",
|
|
6
|
+
"description": "tailwind executor"
|
|
7
|
+
},
|
|
8
|
+
"check-ng-package": {
|
|
9
|
+
"implementation": "./src/executors/check-ng-package/executor",
|
|
10
|
+
"schema": "./src/executors/check-ng-package/schema.json",
|
|
11
|
+
"description": "check-ng-package executor"
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
}
|
package/generators.json
CHANGED
|
@@ -25,5 +25,32 @@
|
|
|
25
25
|
"schema": "./src/generators/schematic/schema.json",
|
|
26
26
|
"description": "Create a Schematic for a project."
|
|
27
27
|
}
|
|
28
|
+
},
|
|
29
|
+
"schematics": {
|
|
30
|
+
"init": {
|
|
31
|
+
"factory": "./src/generators/init/index",
|
|
32
|
+
"schema": "./src/generators/init/schema.json",
|
|
33
|
+
"description": "init generator"
|
|
34
|
+
},
|
|
35
|
+
"init-application": {
|
|
36
|
+
"factory": "./src/generators/init-application/index",
|
|
37
|
+
"schema": "./src/generators/init-application/schema.json",
|
|
38
|
+
"description": "init-application generator"
|
|
39
|
+
},
|
|
40
|
+
"init-library": {
|
|
41
|
+
"factory": "./src/generators/init-library/index",
|
|
42
|
+
"schema": "./src/generators/init-library/schema.json",
|
|
43
|
+
"description": "init-library generator"
|
|
44
|
+
},
|
|
45
|
+
"fix-schematic": {
|
|
46
|
+
"factory": "./src/generators/fix-schematic/index",
|
|
47
|
+
"schema": "./src/generators/fix-schematic/schema.json",
|
|
48
|
+
"description": "fix-schematic generator"
|
|
49
|
+
},
|
|
50
|
+
"schematic": {
|
|
51
|
+
"factory": "./src/generators/schematic/index",
|
|
52
|
+
"schema": "./src/generators/schematic/schema.json",
|
|
53
|
+
"description": "Create a Schematic for a project."
|
|
54
|
+
}
|
|
28
55
|
}
|
|
29
56
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rxap/plugin-angular",
|
|
3
|
-
"version": "16.1.0-dev.
|
|
4
|
-
"type": "
|
|
3
|
+
"version": "16.1.0-dev.10",
|
|
4
|
+
"type": "module",
|
|
5
5
|
"generators": "./generators.json",
|
|
6
6
|
"publishConfig": {
|
|
7
7
|
"access": "public",
|
|
@@ -32,42 +32,56 @@
|
|
|
32
32
|
},
|
|
33
33
|
"dependencies": {
|
|
34
34
|
"ignore": "^5.2.4",
|
|
35
|
+
"process": "0.11.10",
|
|
35
36
|
"semver": "^7.3.5",
|
|
36
|
-
"tslib": "2.6.1"
|
|
37
|
+
"tslib": "2.6.1",
|
|
38
|
+
"yaml": "2.3.1"
|
|
37
39
|
},
|
|
38
40
|
"peerDependencies": {
|
|
39
41
|
"@nx/devkit": "^16.5.0",
|
|
40
|
-
"@rxap/generator-utilities": "^1.0
|
|
41
|
-
"@rxap/
|
|
42
|
-
"@rxap/
|
|
43
|
-
"@rxap/
|
|
42
|
+
"@rxap/generator-utilities": "^1.1.0-dev.4",
|
|
43
|
+
"@rxap/plugin-localazy": "^16.1.0-dev.3",
|
|
44
|
+
"@rxap/plugin-utilities": "^16.1.0-dev.6",
|
|
45
|
+
"@rxap/schematics-ts-morph": "^16.0.0-dev.10",
|
|
46
|
+
"@rxap/workspace-ts-morph": "^0.1.0-dev.0",
|
|
47
|
+
"@rxap/workspace-utilities": "^0.1.0-dev.3",
|
|
44
48
|
"nx": "^16.5.0",
|
|
45
49
|
"ts-morph": "^18.0.0",
|
|
46
|
-
"@rxap/node-utilities": "1.0
|
|
47
|
-
"@rxap/schematics-utilities": "16.0.0-dev.
|
|
48
|
-
"@rxap/utilities": "16.0.0-dev.
|
|
50
|
+
"@rxap/node-utilities": "1.1.0-dev.2",
|
|
51
|
+
"@rxap/schematics-utilities": "16.0.0-dev.8",
|
|
52
|
+
"@rxap/utilities": "16.0.0-dev.10"
|
|
49
53
|
},
|
|
50
54
|
"nx-migrations": {
|
|
51
55
|
"packageGroup": [
|
|
52
56
|
{
|
|
53
57
|
"package": "@rxap/generator-utilities",
|
|
54
|
-
"version": "1.0
|
|
58
|
+
"version": "1.1.0-dev.4"
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
"package": "@rxap/plugin-localazy",
|
|
62
|
+
"version": "16.1.0-dev.3"
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
"package": "@rxap/plugin-utilities",
|
|
66
|
+
"version": "16.1.0-dev.6"
|
|
55
67
|
},
|
|
56
68
|
{
|
|
57
69
|
"package": "@rxap/schematics-ts-morph",
|
|
58
|
-
"version": "16.0.0-dev.
|
|
70
|
+
"version": "16.0.0-dev.10"
|
|
59
71
|
},
|
|
60
72
|
{
|
|
61
73
|
"package": "@rxap/workspace-ts-morph",
|
|
62
|
-
"version": "0.0
|
|
74
|
+
"version": "0.1.0-dev.0"
|
|
63
75
|
},
|
|
64
76
|
{
|
|
65
77
|
"package": "@rxap/workspace-utilities",
|
|
66
|
-
"version": "0.1.0-dev.
|
|
78
|
+
"version": "0.1.0-dev.3"
|
|
67
79
|
}
|
|
68
80
|
]
|
|
69
81
|
},
|
|
70
|
-
"
|
|
82
|
+
"executors": "./executors.json",
|
|
83
|
+
"schematics": "./generators.json",
|
|
84
|
+
"gitHead": "bbab80e59acbe435a02e69c9fec022780cf4640d",
|
|
71
85
|
"main": "./src/index.js",
|
|
72
86
|
"types": "./src/index.d.ts"
|
|
73
87
|
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { readFileFromProjectRoot } from '@rxap/plugin-utilities';
|
|
2
|
+
export default async function runExecutor(options, context) {
|
|
3
|
+
console.log('Executor ran for CheckNgPackage', options);
|
|
4
|
+
const ngPackage = JSON.parse(readFileFromProjectRoot(context, 'ng-package.json', true));
|
|
5
|
+
const { dependencies } = JSON.parse(readFileFromProjectRoot(context, 'package.json', true));
|
|
6
|
+
if (ngPackage.allowedNonPeerDependencies) {
|
|
7
|
+
const wrongPackages = [];
|
|
8
|
+
for (const packageName of ngPackage.allowedNonPeerDependencies) {
|
|
9
|
+
if (!dependencies[packageName]) {
|
|
10
|
+
wrongPackages.push(packageName);
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
if (wrongPackages.length) {
|
|
14
|
+
console.log(`\x1b[31mSome packages in the allowed non peer dependencies list are not in the package.json dependencies list:\x1b[0m\n - ${wrongPackages.join('\n - ')}`);
|
|
15
|
+
return {
|
|
16
|
+
success: false,
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
return {
|
|
21
|
+
success: true,
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
//# sourceMappingURL=executor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"executor.js","sourceRoot":"","sources":["../../../../../../../packages/plugin/angular/src/executors/check-ng-package/executor.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,uBAAuB,EAAE,MAAM,wBAAwB,CAAC;AAGjE,MAAM,CAAC,OAAO,CAAC,KAAK,UAAU,WAAW,CACvC,OAAqC,EACrC,OAAwB;IAExB,OAAO,CAAC,GAAG,CAAC,iCAAiC,EAAE,OAAO,CAAC,CAAC;IAExD,MAAM,SAAS,GAAG,IAAI,CAAC,KAAK,CAAC,uBAAuB,CAAC,OAAO,EAAE,iBAAiB,EAAE,IAAI,CAAC,CAAC,CAAC;IACxF,MAAM,EAAE,YAAY,EAAE,GAAG,IAAI,CAAC,KAAK,CAAC,uBAAuB,CAAC,OAAO,EAAE,cAAc,EAAE,IAAI,CAAC,CAAC,CAAC;IAE5F,IAAI,SAAS,CAAC,0BAA0B,EAAE;QACxC,MAAM,aAAa,GAAa,EAAE,CAAC;QACnC,KAAK,MAAM,WAAW,IAAI,SAAS,CAAC,0BAA0B,EAAE;YAC9D,IAAI,CAAC,YAAY,CAAC,WAAW,CAAC,EAAE;gBAC9B,aAAa,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;aACjC;SACF;QACD,IAAI,aAAa,CAAC,MAAM,EAAE;YACxB,OAAO,CAAC,GAAG,CAAC,6HAA8H,aAAa,CAAC,IAAI,CAC1J,OAAO,CAAE,EAAE,CAAC,CAAC;YACf,OAAO;gBACL,OAAO,EAAE,KAAK;aACf,CAAC;SACH;KACF;IAED,OAAO;QACL,OAAO,EAAE,IAAI;KACd,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export interface CheckNgPackageExecutorSchema {} // eslint-disable-line
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { GetProjectRoot } from '@rxap/plugin-utilities';
|
|
2
|
+
import run from 'nx/src/executors/run-commands/run-commands.impl';
|
|
3
|
+
export default async function runExecutor(options, context) {
|
|
4
|
+
console.log('Executor ran for Tailwind', options);
|
|
5
|
+
const projectRoot = GetProjectRoot(context);
|
|
6
|
+
const args = [
|
|
7
|
+
['config', options.config],
|
|
8
|
+
['input', options.input],
|
|
9
|
+
['output', options.output],
|
|
10
|
+
];
|
|
11
|
+
if (options.minify) {
|
|
12
|
+
args.push(['minify']);
|
|
13
|
+
}
|
|
14
|
+
const argsString = args.map(([key, value]) => value ? `--${key} ${value}` : `--${key}`).join(' ');
|
|
15
|
+
const command = `tailwindcss ${argsString}`;
|
|
16
|
+
console.log('command: ', command);
|
|
17
|
+
return run({
|
|
18
|
+
cwd: projectRoot,
|
|
19
|
+
command,
|
|
20
|
+
__unparsed__: [],
|
|
21
|
+
}, context);
|
|
22
|
+
}
|
|
23
|
+
//# sourceMappingURL=executor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"executor.js","sourceRoot":"","sources":["../../../../../../../packages/plugin/angular/src/executors/tailwind/executor.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AACxD,OAAO,GAAG,MAAM,iDAAiD,CAAC;AAGlE,MAAM,CAAC,OAAO,CAAC,KAAK,UAAU,WAAW,CAAC,OAA+B,EAAE,OAAwB;IACjG,OAAO,CAAC,GAAG,CAAC,2BAA2B,EAAE,OAAO,CAAC,CAAC;IAElD,MAAM,WAAW,GAAG,cAAc,CAAC,OAAO,CAAC,CAAC;IAE5C,MAAM,IAAI,GAAG;QACX,CAAE,QAAQ,EAAE,OAAO,CAAC,MAAM,CAAE;QAC5B,CAAE,OAAO,EAAE,OAAO,CAAC,KAAK,CAAE;QAC1B,CAAE,QAAQ,EAAE,OAAO,CAAC,MAAM,CAAE;KAC7B,CAAC;IAEF,IAAI,OAAO,CAAC,MAAM,EAAE;QAClB,IAAI,CAAC,IAAI,CAAC,CAAE,QAAQ,CAAE,CAAC,CAAC;KACzB;IAED,MAAM,UAAU,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,CAAE,GAAG,EAAE,KAAK,CAAE,EAAE,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC,KAAM,GAAI,IAAK,KAAM,EAAE,CAAC,CAAC,CAAC,KAAM,GAAI,EAAE,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IAE1G,MAAM,OAAO,GAAG,eAAgB,UAAW,EAAE,CAAC;IAE9C,OAAO,CAAC,GAAG,CAAC,WAAW,EAAE,OAAO,CAAC,CAAC;IAElC,OAAO,GAAG,CAAC;QACT,GAAG,EAAE,WAAW;QAChB,OAAO;QACP,YAAY,EAAE,EAAE;KACjB,EAAE,OAAO,CAAC,CAAC;AACd,CAAC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "http://json-schema.org/schema",
|
|
3
|
+
"version": 2,
|
|
4
|
+
"title": "Tailwind executor",
|
|
5
|
+
"description": "",
|
|
6
|
+
"type": "object",
|
|
7
|
+
"properties": {
|
|
8
|
+
"config": {
|
|
9
|
+
"type": "string",
|
|
10
|
+
"default": "tailwind.config.js"
|
|
11
|
+
},
|
|
12
|
+
"input": {
|
|
13
|
+
"type": "string",
|
|
14
|
+
"default": "src/styles/theme.scss"
|
|
15
|
+
},
|
|
16
|
+
"output": {
|
|
17
|
+
"type": "string",
|
|
18
|
+
"default": "theme.css"
|
|
19
|
+
},
|
|
20
|
+
"minify": {
|
|
21
|
+
"type": "boolean",
|
|
22
|
+
"default": false
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
"required": []
|
|
26
|
+
}
|
|
@@ -1,66 +1,58 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
const
|
|
5
|
-
const
|
|
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
|
-
console.
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
}
|
|
57
|
-
for (const [name, schematic] of Object.entries(schematics)) {
|
|
58
|
-
(_b = schematic['description']) !== null && _b !== void 0 ? _b : (schematic['description'] = `The ${name} schematic`);
|
|
59
|
-
}
|
|
60
|
-
console.log('Update collection file');
|
|
61
|
-
tree.write(collectionFile, JSON.stringify(collection, null, 2));
|
|
62
|
-
});
|
|
1
|
+
import { GetProjectRoot, GetProjectSourceRoot, VisitTree, } from '@rxap/generator-utilities';
|
|
2
|
+
import { dirname, join, relative, } from 'path';
|
|
3
|
+
export async function fixSchematicGenerator(tree, options) {
|
|
4
|
+
const projectRoot = GetProjectRoot(tree, options.project);
|
|
5
|
+
const schematicsSourceRoot = join(GetProjectSourceRoot(tree, options.project), 'schematics');
|
|
6
|
+
if (!tree.exists(schematicsSourceRoot)) {
|
|
7
|
+
console.warn(`The schematics source root ${schematicsSourceRoot} does not exists!`);
|
|
8
|
+
return;
|
|
9
|
+
}
|
|
10
|
+
const packageJson = JSON.parse(tree.read(join(projectRoot, 'package.json')).toString('utf-8'));
|
|
11
|
+
if (!packageJson.schematics) {
|
|
12
|
+
console.warn(`The package.json file does not contains schematics property!`);
|
|
13
|
+
return;
|
|
14
|
+
}
|
|
15
|
+
const collectionFile = join(projectRoot, packageJson.schematics);
|
|
16
|
+
if (!tree.exists(collectionFile)) {
|
|
17
|
+
console.warn(`The collection file ${collectionFile} does not exists!`);
|
|
18
|
+
return;
|
|
19
|
+
}
|
|
20
|
+
const collection = JSON.parse(tree.read(collectionFile).toString('utf-8'));
|
|
21
|
+
collection.schematics ??= {};
|
|
22
|
+
const { schematics } = collection;
|
|
23
|
+
const detectedSchemaJsonFiles = [];
|
|
24
|
+
for (const { path, isFile } of VisitTree(tree, schematicsSourceRoot)) {
|
|
25
|
+
if (isFile && path.endsWith('schema.json')) {
|
|
26
|
+
detectedSchemaJsonFiles.push('./' + relative(projectRoot, path));
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
const notDefinedSchematics = detectedSchemaJsonFiles
|
|
30
|
+
.filter(schemaJsonFile => !Object.values(schematics)
|
|
31
|
+
.some((schematic) => schematic.schema === schemaJsonFile));
|
|
32
|
+
console.log(`Not defined schematics: ${notDefinedSchematics.length}`);
|
|
33
|
+
if (notDefinedSchematics.length) {
|
|
34
|
+
console.log(` - ${notDefinedSchematics.join('\n - ')}`);
|
|
35
|
+
}
|
|
36
|
+
else {
|
|
37
|
+
console.log('All schematics are defined');
|
|
38
|
+
}
|
|
39
|
+
for (const schemaJsonFile of notDefinedSchematics) {
|
|
40
|
+
const basePath = dirname(schemaJsonFile);
|
|
41
|
+
const schematicName = basePath.split('/').pop();
|
|
42
|
+
if (schematics[schematicName]) {
|
|
43
|
+
console.warn(`The schematic ${schematicName} is already defined!`);
|
|
44
|
+
continue;
|
|
45
|
+
}
|
|
46
|
+
schematics[schematicName] = {
|
|
47
|
+
schema: schemaJsonFile,
|
|
48
|
+
factory: `${basePath}/index`,
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
for (const [name, schematic] of Object.entries(schematics)) {
|
|
52
|
+
schematic['description'] ??= `The ${name} schematic`;
|
|
53
|
+
}
|
|
54
|
+
console.log('Update collection file');
|
|
55
|
+
tree.write(collectionFile, JSON.stringify(collection, null, 2));
|
|
63
56
|
}
|
|
64
|
-
|
|
65
|
-
exports.default = fixSchematicGenerator;
|
|
57
|
+
export default fixSchematicGenerator;
|
|
66
58
|
//# sourceMappingURL=generator.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generator.js","sourceRoot":"","sources":["../../../../../../../packages/plugin/angular/src/generators/fix-schematic/generator.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"generator.js","sourceRoot":"","sources":["../../../../../../../packages/plugin/angular/src/generators/fix-schematic/generator.ts"],"names":[],"mappings":"AACA,OAAO,EACL,cAAc,EACd,oBAAoB,EACpB,SAAS,GACV,MAAM,2BAA2B,CAAC;AACnC,OAAO,EACL,OAAO,EACP,IAAI,EACJ,QAAQ,GACT,MAAM,MAAM,CAAC;AAGd,MAAM,CAAC,KAAK,UAAU,qBAAqB,CACzC,IAAU,EACV,OAAoC;IAEpC,MAAM,WAAW,GAAG,cAAc,CAAC,IAAI,EAAE,OAAO,CAAC,OAAO,CAAC,CAAC;IAC1D,MAAM,oBAAoB,GAAG,IAAI,CAAC,oBAAoB,CAAC,IAAI,EAAE,OAAO,CAAC,OAAO,CAAC,EAAE,YAAY,CAAC,CAAC;IAE7F,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,oBAAoB,CAAC,EAAE;QACtC,OAAO,CAAC,IAAI,CAAC,8BAA+B,oBAAqB,mBAAmB,CAAC,CAAC;QACtF,OAAO;KACR;IAED,MAAM,WAAW,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,cAAc,CAAC,CAAC,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC;IAE/F,IAAI,CAAC,WAAW,CAAC,UAAU,EAAE;QAC3B,OAAO,CAAC,IAAI,CAAC,8DAA8D,CAAC,CAAC;QAC7E,OAAO;KACR;IAED,MAAM,cAAc,GAAG,IAAI,CAAC,WAAW,EAAE,WAAW,CAAC,UAAU,CAAC,CAAC;IAEjE,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,cAAc,CAAC,EAAE;QAChC,OAAO,CAAC,IAAI,CAAC,uBAAwB,cAAe,mBAAmB,CAAC,CAAC;QACzE,OAAO;KACR;IAED,MAAM,UAAU,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC;IAE3E,UAAU,CAAC,UAAU,KAAK,EAAE,CAAC;IAE7B,MAAM,EAAE,UAAU,EAAE,GAAG,UAAU,CAAC;IAElC,MAAM,uBAAuB,GAAa,EAAE,CAAC;IAE7C,KAAK,MAAM,EACT,IAAI,EACJ,MAAM,EACP,IAAI,SAAS,CAAC,IAAI,EAAE,oBAAoB,CAAC,EAAE;QAC1C,IAAI,MAAM,IAAI,IAAI,CAAC,QAAQ,CAAC,aAAa,CAAC,EAAE;YAC1C,uBAAuB,CAAC,IAAI,CAAC,IAAI,GAAG,QAAQ,CAAC,WAAW,EAAE,IAAI,CAAC,CAAC,CAAC;SAClE;KACF;IAED,MAAM,oBAAoB,GAAa,uBAAuB;SAC3D,MAAM,CAAC,cAAc,CAAC,EAAE,CACvB,CAAC,MAAM,CAAC,MAAM,CAAC,UAAU,CAAC;SAClB,IAAI,CAAC,CAAC,SAAc,EAAE,EAAE,CAAC,SAAS,CAAC,MAAM,KAAK,cAAc,CAAC,CACtE,CAAC;IAEJ,OAAO,CAAC,GAAG,CAAC,2BAA4B,oBAAoB,CAAC,MAAO,EAAE,CAAC,CAAC;IACxE,IAAI,oBAAoB,CAAC,MAAM,EAAE;QAC/B,OAAO,CAAC,GAAG,CAAC,MAAO,oBAAoB,CAAC,IAAI,CAAC,OAAO,CAAE,EAAE,CAAC,CAAC;KAC3D;SAAM;QACL,OAAO,CAAC,GAAG,CAAC,4BAA4B,CAAC,CAAC;KAC3C;IAED,KAAK,MAAM,cAAc,IAAI,oBAAoB,EAAE;QACjD,MAAM,QAAQ,GAAG,OAAO,CAAC,cAAc,CAAC,CAAC;QACzC,MAAM,aAAa,GAAG,QAAQ,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,EAAG,CAAC;QACjD,IAAI,UAAU,CAAC,aAAa,CAAC,EAAE;YAC7B,OAAO,CAAC,IAAI,CAAC,iBAAkB,aAAc,sBAAsB,CAAC,CAAC;YACrE,SAAS;SACV;QACD,UAAU,CAAC,aAAa,CAAC,GAAG;YAC1B,MAAM,EAAE,cAAc;YACtB,OAAO,EAAE,GAAI,QAAS,QAAQ;SAC/B,CAAC;KACH;IAED,KAAK,MAAM,CAAE,IAAI,EAAE,SAAS,CAAE,IAAI,MAAM,CAAC,OAAO,CAAC,UAAU,CAAC,EAAE;QAC5D,SAAS,CAAC,aAAa,CAAC,KAAK,OAAQ,IAAK,YAAY,CAAC;KACxD;IAED,OAAO,CAAC,GAAG,CAAC,wBAAwB,CAAC,CAAC;IACtC,IAAI,CAAC,KAAK,CAAC,cAAc,EAAE,IAAI,CAAC,SAAS,CAAC,UAAU,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC;AAElE,CAAC;AAED,eAAe,qBAAqB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../packages/plugin/angular/src/generators/fix-schematic/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAChD,OAAO,SAAS,MAAM,aAAa,CAAC;AAEpC,MAAM,SAAS,GAAG,kBAAkB,CAAC,SAAS,CAAC,CAAC;AAChD,eAAe,SAAS,CAAC"}
|
|
@@ -1,38 +1,31 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
const generator_utilities_1 = require("@rxap/generator-utilities");
|
|
7
|
-
const skip_project_1 = require("../../lib/skip-project");
|
|
8
|
-
const generator_1 = require("../init-application/generator");
|
|
9
|
-
const generator_2 = require("../init-library/generator");
|
|
1
|
+
import { getProjects, } from '@nx/devkit';
|
|
2
|
+
import { CoerceCypressComponentTesting, HasComponents, } from '@rxap/generator-utilities';
|
|
3
|
+
import { SkipNonAngularProject } from '../../lib/skip-project';
|
|
4
|
+
import initApplicationGenerator from '../init-application/generator';
|
|
5
|
+
import initLibraryGenerator from '../init-library/generator';
|
|
10
6
|
function skipProject(tree, options, project, projectName) {
|
|
11
|
-
if (
|
|
7
|
+
if (SkipNonAngularProject(tree, options, project, projectName)) {
|
|
12
8
|
return true;
|
|
13
9
|
}
|
|
14
10
|
return false;
|
|
15
11
|
}
|
|
16
|
-
function initGenerator(tree, options) {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
continue;
|
|
22
|
-
}
|
|
23
|
-
console.log(`init project: ${projectName}`);
|
|
24
|
-
if ((0, generator_utilities_1.HasComponents)(tree, project.root)) {
|
|
25
|
-
yield (0, generator_utilities_1.CoerceCypressComponentTesting)(tree, project, projectName);
|
|
26
|
-
}
|
|
27
|
-
if (project.projectType === 'library') {
|
|
28
|
-
yield (0, generator_2.default)(tree, Object.assign(Object.assign({}, options), { projects: [projectName] }));
|
|
29
|
-
}
|
|
30
|
-
if (project.projectType === 'application') {
|
|
31
|
-
yield (0, generator_1.default)(tree, Object.assign(Object.assign({}, options), { projects: [projectName] }));
|
|
32
|
-
}
|
|
12
|
+
export async function initGenerator(tree, options) {
|
|
13
|
+
console.log('angular init generator:', options);
|
|
14
|
+
for (const [projectName, project] of getProjects(tree).entries()) {
|
|
15
|
+
if (skipProject(tree, options, project, projectName)) {
|
|
16
|
+
continue;
|
|
33
17
|
}
|
|
34
|
-
|
|
18
|
+
console.log(`init project: ${projectName}`);
|
|
19
|
+
if (HasComponents(tree, project.root)) {
|
|
20
|
+
await CoerceCypressComponentTesting(tree, project, projectName);
|
|
21
|
+
}
|
|
22
|
+
if (project.projectType === 'library') {
|
|
23
|
+
await initLibraryGenerator(tree, { ...options, projects: [projectName] });
|
|
24
|
+
}
|
|
25
|
+
if (project.projectType === 'application') {
|
|
26
|
+
await initApplicationGenerator(tree, { ...options, projects: [projectName] });
|
|
27
|
+
}
|
|
28
|
+
}
|
|
35
29
|
}
|
|
36
|
-
|
|
37
|
-
exports.default = initGenerator;
|
|
30
|
+
export default initGenerator;
|
|
38
31
|
//# sourceMappingURL=generator.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generator.js","sourceRoot":"","sources":["../../../../../../../packages/plugin/angular/src/generators/init/generator.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"generator.js","sourceRoot":"","sources":["../../../../../../../packages/plugin/angular/src/generators/init/generator.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,WAAW,GAGZ,MAAM,YAAY,CAAC;AACpB,OAAO,EACL,6BAA6B,EAC7B,aAAa,GACd,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,qBAAqB,EAAE,MAAM,wBAAwB,CAAC;AAC/D,OAAO,wBAAwB,MAAM,+BAA+B,CAAC;AACrE,OAAO,oBAAoB,MAAM,2BAA2B,CAAC;AAG7D,SAAS,WAAW,CAAC,IAAU,EAAE,OAA4B,EAAE,OAA6B,EAAE,WAAmB;IAE/G,IAAI,qBAAqB,CAAC,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,WAAW,CAAC,EAAE;QAC9D,OAAO,IAAI,CAAC;KACb;IAED,OAAO,KAAK,CAAC;AAEf,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,aAAa,CAAC,IAAU,EAAE,OAA4B;IAC1E,OAAO,CAAC,GAAG,CAAC,yBAAyB,EAAE,OAAO,CAAC,CAAC;IAEhD,KAAK,MAAM,CAAE,WAAW,EAAE,OAAO,CAAE,IAAI,WAAW,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,EAAE;QAElE,IAAI,WAAW,CAAC,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,WAAW,CAAC,EAAE;YACpD,SAAS;SACV;QAED,OAAO,CAAC,GAAG,CAAC,iBAAkB,WAAY,EAAE,CAAC,CAAC;QAE9C,IAAI,aAAa,CAAC,IAAI,EAAE,OAAO,CAAC,IAAI,CAAC,EAAE;YACrC,MAAM,6BAA6B,CAAC,IAAI,EAAE,OAAO,EAAE,WAAW,CAAC,CAAC;SACjE;QAED,IAAI,OAAO,CAAC,WAAW,KAAK,SAAS,EAAE;YACrC,MAAM,oBAAoB,CAAC,IAAI,EAAE,EAAE,GAAG,OAAO,EAAE,QAAQ,EAAE,CAAE,WAAW,CAAE,EAAE,CAAC,CAAC;SAC7E;QAED,IAAI,OAAO,CAAC,WAAW,KAAK,aAAa,EAAE;YACzC,MAAM,wBAAwB,CAAC,IAAI,EAAE,EAAE,GAAG,OAAO,EAAE,QAAQ,EAAE,CAAE,WAAW,CAAE,EAAE,CAAC,CAAC;SACjF;KAEF;AAEH,CAAC;AAED,eAAe,aAAa,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../packages/plugin/angular/src/generators/init/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAChD,OAAO,SAAS,MAAM,aAAa,CAAC;AAEpC,MAAM,SAAS,GAAG,kBAAkB,CAAC,SAAS,CAAC,CAAC;AAChD,eAAe,SAAS,CAAC"}
|
|
File without changes
|