@rxap/plugin-angular 16.1.1-dev.3 → 16.2.0-dev.0
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 +14 -0
- package/README.md +1 -1
- package/package.json +15 -14
- package/src/generators/fix-schematic/generator.js +10 -2
- package/src/generators/fix-schematic/generator.js.map +1 -1
- package/src/generators/init/generator.js +1 -1
- package/src/generators/init/generator.js.map +1 -1
- package/src/generators/init-application/files/styles/_custom.scss +19 -0
- package/src/generators/init-application/files/styles/_utilities.scss +4 -0
- package/src/generators/init-application/generate-monolithic.d.ts +3 -0
- package/src/generators/init-application/generate-monolithic.js +40 -0
- package/src/generators/init-application/generate-monolithic.js.map +1 -0
- package/src/generators/init-application/generator.js +66 -46
- package/src/generators/init-application/generator.js.map +1 -1
- package/src/generators/init-application/schema.d.ts +1 -0
- package/src/generators/init-application/schema.json +4 -2
- package/src/generators/init-feature/generator.js +19 -10
- package/src/generators/init-feature/generator.js.map +1 -1
- package/src/generators/init-library/generator.js +24 -5
- package/src/generators/init-library/generator.js.map +1 -1
- package/src/generators/schematic/generator.js +5 -14
- package/src/generators/schematic/generator.js.map +1 -1
- package/src/lib/skip-project.d.ts +3 -1
- package/src/lib/skip-project.js.map +1 -1
- package/src/generators/init-application/files/monolithic/app/app.navigation.ts.template +0 -11
- package/src/generators/init-application/files/monolithic/app/app.routes.ts.template +0 -14
- package/src/generators/init-application/files/monolithic/app/layout.routes.ts.template +0 -32
- package/src/generators/init-feature/files/feature/__name__/routes.ts.template +0 -10
- package/src/lib/add-route.d.ts +0 -3
- package/src/lib/add-route.js +0 -27
- package/src/lib/add-route.js.map +0 -1
- package/src/lib/build-route-object.d.ts +0 -7
- package/src/lib/build-route-object.js +0 -18
- package/src/lib/build-route-object.js.map +0 -1
- package/src/lib/find-parent-route.d.ts +0 -2
- package/src/lib/find-parent-route.js +0 -54
- package/src/lib/find-parent-route.js.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,20 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
# [16.2.0-dev.0](https://gitlab.com/rxap/packages/compare/@rxap/plugin-angular@16.1.1-dev.3...@rxap/plugin-angular@16.2.0-dev.0) (2024-03-14)
|
|
7
|
+
|
|
8
|
+
### Bug Fixes
|
|
9
|
+
|
|
10
|
+
- enable cleanup on default ([9943cbf](https://gitlab.com/rxap/packages/commit/9943cbffc23dcd9208dc58bf9304419c3fa6be19))
|
|
11
|
+
- explicit trigger gitlab ci generators ([e9a7c4c](https://gitlab.com/rxap/packages/commit/e9a7c4cbb8876155bd16fd01558dfdeed22540c8))
|
|
12
|
+
- only execute application init logic ([f7ae4e2](https://gitlab.com/rxap/packages/commit/f7ae4e298f815c4a8116e725276d568bec2a9e14))
|
|
13
|
+
- support custom theme extensions ([9e3bf90](https://gitlab.com/rxap/packages/commit/9e3bf90f9abf37ad6ce99b04184f668ddb4f5601))
|
|
14
|
+
- use utility function ([590a715](https://gitlab.com/rxap/packages/commit/590a71551fb37a4e8d842e661da6f1698458a5a1))
|
|
15
|
+
|
|
16
|
+
### Features
|
|
17
|
+
|
|
18
|
+
- add CoerceLayoutRoutes function ([9523ccb](https://gitlab.com/rxap/packages/commit/9523ccb4702e1c1237358ad9149c3edd5febca9a))
|
|
19
|
+
|
|
6
20
|
## [16.1.1-dev.3](https://gitlab.com/rxap/packages/compare/@rxap/plugin-angular@16.1.1-dev.2...@rxap/plugin-angular@16.1.1-dev.3) (2024-03-11)
|
|
7
21
|
|
|
8
22
|
### Bug Fixes
|
package/README.md
CHANGED
|
@@ -19,7 +19,7 @@ yarn add @rxap/plugin-angular
|
|
|
19
19
|
```
|
|
20
20
|
**Install peer dependencies:**
|
|
21
21
|
```bash
|
|
22
|
-
yarn add @nx/angular@^16.5.0 @nx/devkit@^16.5.0 @rxap/generator-utilities@^1.1.1-dev.
|
|
22
|
+
yarn add @nx/angular@^16.5.0 @nx/devkit@^16.5.0 @rxap/generator-utilities@^1.1.1-dev.1 @rxap/plugin-application@^16.1.1-dev.2 @rxap/plugin-docker@* @rxap/plugin-library@^16.1.0-dev.5 @rxap/plugin-localazy@^16.1.1-dev.0 @rxap/plugin-utilities@^16.1.1-dev.2 @rxap/ts-morph@^1.1.0-dev.18 @rxap/utilities@^16.1.0-dev.7 @rxap/workspace-ts-morph@^16.0.2-dev.2 @rxap/workspace-utilities@^16.1.0-dev.1 nx@^16.5.0 ts-morph@^18.0.0 tslib@2.6.2
|
|
23
23
|
```
|
|
24
24
|
**Execute the init generator:**
|
|
25
25
|
```bash
|
package/package.json
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "16.
|
|
2
|
+
"version": "16.2.0-dev.0",
|
|
3
3
|
"name": "@rxap/plugin-angular",
|
|
4
4
|
"license": "GPL-3.0-or-later",
|
|
5
5
|
"dependencies": {
|
|
6
6
|
"@apidevtools/json-schema-ref-parser": "9.0.9",
|
|
7
|
+
"colors": "1.4.0",
|
|
7
8
|
"fs-extra": "11.1.1",
|
|
8
9
|
"glob": "10.3.10",
|
|
9
10
|
"handlebars": "4.7.7",
|
|
@@ -16,21 +17,21 @@
|
|
|
16
17
|
"peerDependencies": {
|
|
17
18
|
"@nx/angular": "^16.5.0",
|
|
18
19
|
"@nx/devkit": "^16.5.0",
|
|
19
|
-
"@rxap/generator-utilities": "^1.1.1-dev.
|
|
20
|
-
"@rxap/plugin-application": "^16.1.1-dev.
|
|
20
|
+
"@rxap/generator-utilities": "^1.1.1-dev.1",
|
|
21
|
+
"@rxap/plugin-application": "^16.1.1-dev.2",
|
|
22
|
+
"@rxap/plugin-docker": "*",
|
|
21
23
|
"@rxap/plugin-library": "^16.1.0-dev.5",
|
|
22
|
-
"@rxap/plugin-localazy": "^16.1.0",
|
|
24
|
+
"@rxap/plugin-localazy": "^16.1.1-dev.0",
|
|
23
25
|
"@rxap/plugin-utilities": "^16.1.1-dev.2",
|
|
24
26
|
"@rxap/ts-morph": "^1.1.0-dev.18",
|
|
25
27
|
"@rxap/utilities": "^16.1.0-dev.7",
|
|
26
|
-
"@rxap/workspace-ts-morph": "^16.0.2-dev.
|
|
27
|
-
"@rxap/workspace-utilities": "^16.1.0-dev.
|
|
28
|
+
"@rxap/workspace-ts-morph": "^16.0.2-dev.2",
|
|
29
|
+
"@rxap/workspace-utilities": "^16.1.0-dev.1",
|
|
28
30
|
"nx": "^16.5.0",
|
|
29
31
|
"ts-morph": "^18.0.0",
|
|
30
32
|
"tslib": "2.6.2",
|
|
31
33
|
"@rxap/generator-ts-morph": "1.0.2-dev.0",
|
|
32
|
-
"@rxap/node-utilities": "1.2.0-dev.0"
|
|
33
|
-
"@rxap/plugin-docker": "16.1.0-dev.3"
|
|
34
|
+
"@rxap/node-utilities": "1.2.0-dev.0"
|
|
34
35
|
},
|
|
35
36
|
"author": {
|
|
36
37
|
"name": "Merzough Münker",
|
|
@@ -56,7 +57,7 @@
|
|
|
56
57
|
"packageGroup": [
|
|
57
58
|
{
|
|
58
59
|
"package": "@rxap/generator-utilities",
|
|
59
|
-
"version": "1.1.1-dev.
|
|
60
|
+
"version": "1.1.1-dev.1"
|
|
60
61
|
},
|
|
61
62
|
{
|
|
62
63
|
"package": "@rxap/node-utilities",
|
|
@@ -64,7 +65,7 @@
|
|
|
64
65
|
},
|
|
65
66
|
{
|
|
66
67
|
"package": "@rxap/plugin-application",
|
|
67
|
-
"version": "16.1.1-dev.
|
|
68
|
+
"version": "16.1.1-dev.2"
|
|
68
69
|
},
|
|
69
70
|
{
|
|
70
71
|
"package": "@rxap/plugin-library",
|
|
@@ -72,7 +73,7 @@
|
|
|
72
73
|
},
|
|
73
74
|
{
|
|
74
75
|
"package": "@rxap/plugin-localazy",
|
|
75
|
-
"version": "16.1.0"
|
|
76
|
+
"version": "16.1.1-dev.0"
|
|
76
77
|
},
|
|
77
78
|
{
|
|
78
79
|
"package": "@rxap/plugin-utilities",
|
|
@@ -92,11 +93,11 @@
|
|
|
92
93
|
},
|
|
93
94
|
{
|
|
94
95
|
"package": "@rxap/workspace-ts-morph",
|
|
95
|
-
"version": "16.0.2-dev.
|
|
96
|
+
"version": "16.0.2-dev.2"
|
|
96
97
|
},
|
|
97
98
|
{
|
|
98
99
|
"package": "@rxap/workspace-utilities",
|
|
99
|
-
"version": "16.1.0-dev.
|
|
100
|
+
"version": "16.1.0-dev.1"
|
|
100
101
|
}
|
|
101
102
|
]
|
|
102
103
|
},
|
|
@@ -111,7 +112,7 @@
|
|
|
111
112
|
},
|
|
112
113
|
"schematics": "./generators.json",
|
|
113
114
|
"type": "commonjs",
|
|
114
|
-
"gitHead": "
|
|
115
|
+
"gitHead": "ed07f30b85b21d1521b602abd6932bba6029001c",
|
|
115
116
|
"main": "./src/index.js",
|
|
116
117
|
"types": "./src/index.d.ts"
|
|
117
118
|
}
|
|
@@ -3,17 +3,25 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.fixSchematicGenerator = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const generator_utilities_1 = require("@rxap/generator-utilities");
|
|
6
|
+
const workspace_utilities_1 = require("@rxap/workspace-utilities");
|
|
6
7
|
const path_1 = require("path");
|
|
7
8
|
function fixSchematicGenerator(tree, options) {
|
|
8
9
|
var _a, _b;
|
|
9
10
|
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
10
11
|
const projectRoot = (0, generator_utilities_1.GetProjectRoot)(tree, options.project);
|
|
11
|
-
const
|
|
12
|
+
const projectSourceRoot = (0, generator_utilities_1.GetProjectSourceRoot)(tree, options.project);
|
|
13
|
+
if (!projectSourceRoot) {
|
|
14
|
+
throw new Error(`Project source root not found for project ${options.project}`);
|
|
15
|
+
}
|
|
16
|
+
const schematicsSourceRoot = (0, path_1.join)(projectSourceRoot, 'schematics');
|
|
12
17
|
if (!tree.exists(schematicsSourceRoot)) {
|
|
13
18
|
console.warn(`The schematics source root ${schematicsSourceRoot} does not exists!`);
|
|
14
19
|
return;
|
|
15
20
|
}
|
|
16
|
-
|
|
21
|
+
if (!(0, workspace_utilities_1.HasProjectPackageJson)(tree, options.project)) {
|
|
22
|
+
throw new Error(`The project ${options.project} does not contains a package.json file!`);
|
|
23
|
+
}
|
|
24
|
+
const packageJson = (0, workspace_utilities_1.GetProjectPackageJson)(tree, options.project);
|
|
17
25
|
if (!packageJson.schematics) {
|
|
18
26
|
console.warn(`The package.json file does not contains schematics property!`);
|
|
19
27
|
return;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generator.js","sourceRoot":"","sources":["../../../../../../../packages/plugin/angular/src/generators/fix-schematic/generator.ts"],"names":[],"mappings":";;;;AACA,mEAImC;AACnC,+BAIc;AAGd,SAAsB,qBAAqB,CACzC,IAAU,EACV,OAAoC;;;QAEpC,MAAM,WAAW,GAAG,IAAA,oCAAc,EAAC,IAAI,EAAE,OAAO,CAAC,OAAO,CAAC,CAAC;QAC1D,MAAM,
|
|
1
|
+
{"version":3,"file":"generator.js","sourceRoot":"","sources":["../../../../../../../packages/plugin/angular/src/generators/fix-schematic/generator.ts"],"names":[],"mappings":";;;;AACA,mEAImC;AACnC,mEAGmC;AACnC,+BAIc;AAGd,SAAsB,qBAAqB,CACzC,IAAU,EACV,OAAoC;;;QAEpC,MAAM,WAAW,GAAG,IAAA,oCAAc,EAAC,IAAI,EAAE,OAAO,CAAC,OAAO,CAAC,CAAC;QAC1D,MAAM,iBAAiB,GAAG,IAAA,0CAAoB,EAAC,IAAI,EAAE,OAAO,CAAC,OAAO,CAAC,CAAC;QACtE,IAAI,CAAC,iBAAiB,EAAE;YACtB,MAAM,IAAI,KAAK,CAAC,6CAA8C,OAAO,CAAC,OAAQ,EAAE,CAAC,CAAC;SACnF;QACD,MAAM,oBAAoB,GAAG,IAAA,WAAI,EAAC,iBAAiB,EAAE,YAAY,CAAC,CAAC;QAEnE,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AAC,CAAC;QACtC,IAAI,CAAC,KAAK,CAAC,cAAc,EAAE,IAAI,CAAC,SAAS,CAAC,UAAU,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC;;CAEjE;AApFD,sDAoFC;AAED,kBAAe,qBAAqB,CAAC"}
|
|
@@ -29,7 +29,7 @@ function initGenerator(tree, options) {
|
|
|
29
29
|
yield (0, generator_1.default)(tree, Object.assign(Object.assign({}, options), { projects: [projectName], skipProjects: options.skipProjects }));
|
|
30
30
|
}
|
|
31
31
|
if (!options.skipProjects) {
|
|
32
|
-
console.log(`init project: ${projectName}`);
|
|
32
|
+
console.log(`init angular project: ${projectName}`);
|
|
33
33
|
// execute the add cypress if the project has components after the library/application init
|
|
34
34
|
// as the library init will remove the default components so that cypress is only added
|
|
35
35
|
// if the project has really any components
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generator.js","sourceRoot":"","sources":["../../../../../../../packages/plugin/angular/src/generators/init/generator.ts"],"names":[],"mappings":";;;;AAAA,uCAIoB;AACpB,mEAA0D;AAC1D,mEAGmC;AACnC,iGAA2F;AAC3F,yDAA+D;AAC/D,6DAAqE;AACrE,yDAA6D;AAG7D,SAAS,WAAW,CAAC,IAAU,EAAE,OAA4B,EAAE,OAA6B,EAAE,WAAmB;IAE/G,IAAI,IAAA,oCAAqB,EAAC,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,WAAW,CAAC,EAAE;QAC9D,OAAO,IAAI,CAAC;KACb;IAED,OAAO,KAAK,CAAC;AAEf,CAAC;AAED,SAAsB,aAAa,CAAC,IAAU,EAAE,OAA4B;;QAC1E,OAAO,CAAC,GAAG,CAAC,yBAAyB,EAAE,OAAO,CAAC,CAAC;QAEhD,KAAK,MAAM,CAAE,WAAW,EAAE,OAAO,CAAE,IAAI,IAAA,oBAAW,EAAC,IAAI,CAAC,CAAC,OAAO,EAAE,EAAE;YAElE,IAAI,WAAW,CAAC,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,WAAW,CAAC,EAAE;gBACpD,SAAS;aACV;YAED,IAAI,IAAA,sCAAgB,EAAC,OAAO,CAAC,EAAE;gBAC7B,MAAM,IAAA,mBAAoB,EAAC,IAAI,kCAExB,OAAO,KACV,QAAQ,EAAE,CAAE,WAAW,CAAE,EACzB,YAAY,EAAE,OAAO,CAAC,YAAY,IAErC,CAAC;aACH;YAED,IAAI,IAAA,0CAAoB,EAAC,OAAO,CAAC,EAAE;gBACjC,MAAM,IAAA,mBAAwB,EAAC,IAAI,kCAE5B,OAAO,KACV,QAAQ,EAAE,CAAE,WAAW,CAAE,EACzB,YAAY,EAAE,OAAO,CAAC,YAAY,IAErC,CAAC;aACH;YAED,IAAI,CAAC,OAAO,CAAC,YAAY,EAAE;gBAEzB,OAAO,CAAC,GAAG,CAAC,
|
|
1
|
+
{"version":3,"file":"generator.js","sourceRoot":"","sources":["../../../../../../../packages/plugin/angular/src/generators/init/generator.ts"],"names":[],"mappings":";;;;AAAA,uCAIoB;AACpB,mEAA0D;AAC1D,mEAGmC;AACnC,iGAA2F;AAC3F,yDAA+D;AAC/D,6DAAqE;AACrE,yDAA6D;AAG7D,SAAS,WAAW,CAAC,IAAU,EAAE,OAA4B,EAAE,OAA6B,EAAE,WAAmB;IAE/G,IAAI,IAAA,oCAAqB,EAAC,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,WAAW,CAAC,EAAE;QAC9D,OAAO,IAAI,CAAC;KACb;IAED,OAAO,KAAK,CAAC;AAEf,CAAC;AAED,SAAsB,aAAa,CAAC,IAAU,EAAE,OAA4B;;QAC1E,OAAO,CAAC,GAAG,CAAC,yBAAyB,EAAE,OAAO,CAAC,CAAC;QAEhD,KAAK,MAAM,CAAE,WAAW,EAAE,OAAO,CAAE,IAAI,IAAA,oBAAW,EAAC,IAAI,CAAC,CAAC,OAAO,EAAE,EAAE;YAElE,IAAI,WAAW,CAAC,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,WAAW,CAAC,EAAE;gBACpD,SAAS;aACV;YAED,IAAI,IAAA,sCAAgB,EAAC,OAAO,CAAC,EAAE;gBAC7B,MAAM,IAAA,mBAAoB,EAAC,IAAI,kCAExB,OAAO,KACV,QAAQ,EAAE,CAAE,WAAW,CAAE,EACzB,YAAY,EAAE,OAAO,CAAC,YAAY,IAErC,CAAC;aACH;YAED,IAAI,IAAA,0CAAoB,EAAC,OAAO,CAAC,EAAE;gBACjC,MAAM,IAAA,mBAAwB,EAAC,IAAI,kCAE5B,OAAO,KACV,QAAQ,EAAE,CAAE,WAAW,CAAE,EACzB,YAAY,EAAE,OAAO,CAAC,YAAY,IAErC,CAAC;aACH;YAED,IAAI,CAAC,OAAO,CAAC,YAAY,EAAE;gBAEzB,OAAO,CAAC,GAAG,CAAC,yBAA0B,WAAY,EAAE,CAAC,CAAC;gBAEtD,2FAA2F;gBAC3F,uFAAuF;gBACvF,2CAA2C;gBAC3C,IAAI,IAAA,mCAAa,EAAC,IAAI,EAAE,OAAO,CAAC,IAAI,CAAC,EAAE;oBACrC,MAAM,IAAA,gEAA6B,EAAC,IAAI,EAAE,OAAO,EAAE,WAAW,CAAC,CAAC;iBACjE;aAEF;SAEF;IAEH,CAAC;CAAA;AA5CD,sCA4CC;AAED,kBAAe,aAAa,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
@use '@angular/material' as mat;
|
|
2
|
+
|
|
3
|
+
@mixin theme($theme) {
|
|
4
|
+
$foreground: map-get($theme, foreground);
|
|
5
|
+
$background: map-get($theme, background);
|
|
6
|
+
$accent: map-get($theme, accent);
|
|
7
|
+
$primary: map-get($theme, primary);
|
|
8
|
+
$warn: map-get($theme, warn);
|
|
9
|
+
$isDark: map-get($theme, is-dark);
|
|
10
|
+
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
@mixin typography($theme) {
|
|
14
|
+
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
@mixin density($theme) {
|
|
18
|
+
|
|
19
|
+
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
@use '@angular/material' as mat;
|
|
2
2
|
@use 'palette' as palette;
|
|
3
|
+
@use 'custom' as custom;
|
|
3
4
|
|
|
4
5
|
@import "table";
|
|
5
6
|
@import 'loading-animation';
|
|
@@ -22,10 +23,12 @@
|
|
|
22
23
|
|
|
23
24
|
@mixin density($theme) {
|
|
24
25
|
@include mat.all-component-densities($theme);
|
|
26
|
+
@include custom.density($theme);
|
|
25
27
|
}
|
|
26
28
|
|
|
27
29
|
@mixin typography($theme) {
|
|
28
30
|
@include mat.all-component-typographies($theme);
|
|
31
|
+
@include custom.typography($theme);
|
|
29
32
|
}
|
|
30
33
|
|
|
31
34
|
@mixin base-theme() {
|
|
@@ -64,6 +67,7 @@
|
|
|
64
67
|
|
|
65
68
|
@mixin body-theme($theme) {
|
|
66
69
|
@include colors($theme);
|
|
70
|
+
@include custom.theme($theme);
|
|
67
71
|
}
|
|
68
72
|
|
|
69
73
|
@mixin init-theme(
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.generateMonolithic = void 0;
|
|
4
|
+
const devkit_1 = require("@nx/devkit");
|
|
5
|
+
const ts_morph_1 = require("@rxap/ts-morph");
|
|
6
|
+
const utilities_1 = require("@rxap/utilities");
|
|
7
|
+
const workspace_ts_morph_1 = require("@rxap/workspace-ts-morph");
|
|
8
|
+
const workspace_utilities_1 = require("@rxap/workspace-utilities");
|
|
9
|
+
const path_1 = require("path");
|
|
10
|
+
function generateMonolithic(tree, projectName, project, options) {
|
|
11
|
+
if (!project.sourceRoot) {
|
|
12
|
+
throw new Error(`Project source root not found for project ${projectName}`);
|
|
13
|
+
}
|
|
14
|
+
if (!tree.exists((0, path_1.join)(project.sourceRoot, 'assets', 'logo.png'))) {
|
|
15
|
+
if (tree.exists('logo.png')) {
|
|
16
|
+
tree.write((0, path_1.join)(project.sourceRoot, 'assets', 'logo.png'), tree.read('logo.png'));
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
(0, workspace_ts_morph_1.TsMorphAngularProjectTransform)(tree, {
|
|
20
|
+
project: projectName,
|
|
21
|
+
}, (_, [appSourceFile, layoutSourceFile, navigationSourceFile]) => {
|
|
22
|
+
(0, ts_morph_1.CoerceLayoutRoutes)(layoutSourceFile);
|
|
23
|
+
(0, ts_morph_1.CoerceAppRoutes)(appSourceFile, {
|
|
24
|
+
itemList: [
|
|
25
|
+
{
|
|
26
|
+
route: {
|
|
27
|
+
path: '',
|
|
28
|
+
loadChildren: './layout.routes'
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
]
|
|
32
|
+
});
|
|
33
|
+
(0, ts_morph_1.CoerceAppNavigation)(navigationSourceFile);
|
|
34
|
+
}, ['app/app.routes.ts?', 'app/layout.routes.ts?', 'app/app.navigation.ts?']);
|
|
35
|
+
if (options.overwrite) {
|
|
36
|
+
(0, devkit_1.generateFiles)(tree, (0, path_1.join)(__dirname, 'files', 'monolithic'), project.sourceRoot, Object.assign(Object.assign({}, options), { relativePathToWorkspaceRoot: (0, path_1.relative)(project.sourceRoot, ''), name: projectName.replace(/^user-interface-/, ''), classify: utilities_1.classify, prefix: (0, workspace_utilities_1.GetProjectPrefix)(tree, projectName, 'rxap') }));
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
exports.generateMonolithic = generateMonolithic;
|
|
40
|
+
//# sourceMappingURL=generate-monolithic.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generate-monolithic.js","sourceRoot":"","sources":["../../../../../../../packages/plugin/angular/src/generators/init-application/generate-monolithic.ts"],"names":[],"mappings":";;;AAAA,uCAIoB;AACpB,6CAIwB;AACxB,+CAA2C;AAC3C,iEAA0E;AAC1E,mEAA6D;AAC7D,+BAGc;AAGd,SAAgB,kBAAkB,CAAC,IAAU,EAAE,WAAmB,EAAE,OAA6B,EAAE,OAAuC;IAExI,IAAI,CAAC,OAAO,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,QAAQ,EAAR,oBAAQ,EACR,MAAM,EAAE,IAAA,sCAAgB,EAAC,IAAI,EAAE,WAAW,EAAE,MAAM,CAAC,IACnD,CAAC;KACJ;AAEH,CAAC;AAvCD,gDAuCC"}
|
|
@@ -5,6 +5,7 @@ const tslib_1 = require("tslib");
|
|
|
5
5
|
const devkit_1 = require("@nx/devkit");
|
|
6
6
|
const generator_utilities_1 = require("@rxap/generator-utilities");
|
|
7
7
|
const plugin_application_1 = require("@rxap/plugin-application");
|
|
8
|
+
const plugin_docker_1 = require("@rxap/plugin-docker");
|
|
8
9
|
const plugin_localazy_1 = require("@rxap/plugin-localazy");
|
|
9
10
|
const ts_morph_1 = require("@rxap/ts-morph");
|
|
10
11
|
const utilities_1 = require("@rxap/utilities");
|
|
@@ -13,6 +14,7 @@ const workspace_utilities_1 = require("@rxap/workspace-utilities");
|
|
|
13
14
|
const path_1 = require("path");
|
|
14
15
|
const ts_morph_2 = require("ts-morph");
|
|
15
16
|
const skip_project_1 = require("../../lib/skip-project");
|
|
17
|
+
const generate_monolithic_1 = require("./generate-monolithic");
|
|
16
18
|
function skipProject(tree, options, project, projectName) {
|
|
17
19
|
if ((0, skip_project_1.SkipNonAngularProject)(tree, options, project, projectName)) {
|
|
18
20
|
return true;
|
|
@@ -23,59 +25,62 @@ function skipProject(tree, options, project, projectName) {
|
|
|
23
25
|
return false;
|
|
24
26
|
}
|
|
25
27
|
function updateProjectTargets(project, options) {
|
|
26
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w;
|
|
27
|
-
var
|
|
28
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y;
|
|
29
|
+
var _z, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16, _17, _18;
|
|
28
30
|
(_a = project.targets) !== null && _a !== void 0 ? _a : (project.targets = {});
|
|
29
31
|
if (!project.targets['build']) {
|
|
30
32
|
throw new Error(`The project '${project.name}' has no build target`);
|
|
31
33
|
}
|
|
32
34
|
if (project.targets['docker']) {
|
|
33
|
-
(_b = (
|
|
34
|
-
(_c = (
|
|
35
|
+
(_b = (_z = project.targets['docker']).options) !== null && _b !== void 0 ? _b : (_z.options = {});
|
|
36
|
+
(_c = (_0 = project.targets['docker'].options).dockerfile) !== null && _c !== void 0 ? _c : (_0.dockerfile = 'shared/angular/Dockerfile');
|
|
35
37
|
}
|
|
36
38
|
(0, workspace_utilities_1.CoerceTarget)(project, 'serve', {
|
|
37
39
|
options: {
|
|
38
40
|
proxyConfig: 'shared/angular/proxy.conf.json',
|
|
39
41
|
},
|
|
40
42
|
}, workspace_utilities_1.Strategy.OVERWRITE);
|
|
41
|
-
(0, workspace_utilities_1.CoerceTarget)(project, 'config', {});
|
|
42
43
|
if (project.targets['extract-i18n']) {
|
|
43
44
|
if (options.i18n) {
|
|
44
45
|
(_d = options.languages) !== null && _d !== void 0 ? _d : (options.languages = []);
|
|
45
46
|
if (options.languages.length === 0) {
|
|
46
47
|
options.languages.push('en');
|
|
47
48
|
}
|
|
49
|
+
(_e = (_1 = project.targets['build']).configurations) !== null && _e !== void 0 ? _e : (_1.configurations = {});
|
|
48
50
|
if (options.overwrite) {
|
|
49
51
|
project.targets['build'].configurations.production.localize = options.languages;
|
|
50
52
|
}
|
|
51
53
|
else {
|
|
52
|
-
(
|
|
54
|
+
(_f = (_2 = project.targets['build'].configurations.production).localize) !== null && _f !== void 0 ? _f : (_2.localize = []);
|
|
53
55
|
project.targets['build'].configurations.production.localize.push(...options.languages);
|
|
54
56
|
project.targets['build'].configurations.production.localize
|
|
55
57
|
= project.targets['build'].configurations.production.localize.filter((0, utilities_1.unique)());
|
|
56
58
|
}
|
|
57
|
-
(
|
|
58
|
-
(
|
|
59
|
-
(
|
|
59
|
+
(_g = project.i18n) !== null && _g !== void 0 ? _g : (project.i18n = {});
|
|
60
|
+
(_h = (_3 = project.i18n).sourceLocale) !== null && _h !== void 0 ? _h : (_3.sourceLocale = 'en-US');
|
|
61
|
+
(_j = (_4 = project.i18n).locales) !== null && _j !== void 0 ? _j : (_4.locales = {});
|
|
60
62
|
for (const language of options.languages) {
|
|
61
|
-
(
|
|
63
|
+
(_k = (_5 = project.i18n.locales)[language]) !== null && _k !== void 0 ? _k : (_5[language] = {
|
|
62
64
|
translation: `${project.sourceRoot}/i18n/${language}.xlf`,
|
|
63
65
|
baseHref: `${language}/`,
|
|
64
66
|
});
|
|
65
67
|
}
|
|
66
68
|
}
|
|
67
|
-
|
|
69
|
+
if (!project.sourceRoot) {
|
|
70
|
+
throw new Error(`The project ${project.name} has no source root`);
|
|
71
|
+
}
|
|
72
|
+
(_l = (_6 = project.targets['extract-i18n']).options) !== null && _l !== void 0 ? _l : (_6.options = {});
|
|
68
73
|
project.targets['extract-i18n'].options.format = 'xliff2';
|
|
69
74
|
project.targets['extract-i18n'].options.outputPath = (0, path_1.join)(project.sourceRoot, 'i18n');
|
|
70
75
|
if (options.localazy) {
|
|
71
|
-
(
|
|
76
|
+
(_m = (_7 = project.targets)['localazy-download']) !== null && _m !== void 0 ? _m : (_7['localazy-download'] = {
|
|
72
77
|
executor: '@rxap/plugin-localazy:download',
|
|
73
78
|
options: (0, utilities_1.DeleteEmptyProperties)({
|
|
74
79
|
readKey: options.localazyReadKey,
|
|
75
80
|
workingDirectory: project.root,
|
|
76
81
|
}),
|
|
77
82
|
});
|
|
78
|
-
(
|
|
83
|
+
(_o = (_8 = project.targets)['localazy-upload']) !== null && _o !== void 0 ? _o : (_8['localazy-upload'] = {
|
|
79
84
|
executor: '@rxap/plugin-localazy:upload',
|
|
80
85
|
options: {
|
|
81
86
|
extractTarget: `${project.name}:extract-i18n`,
|
|
@@ -98,10 +103,10 @@ function updateProjectTargets(project, options) {
|
|
|
98
103
|
},
|
|
99
104
|
},
|
|
100
105
|
}, workspace_utilities_1.Strategy.OVERWRITE);
|
|
101
|
-
(
|
|
106
|
+
(_p = (_9 = project.targets['build']).options) !== null && _p !== void 0 ? _p : (_9.options = {});
|
|
102
107
|
project.targets['build'].options.sourceMap = true;
|
|
103
|
-
(
|
|
104
|
-
(
|
|
108
|
+
(_q = (_10 = project.targets['build'].options).assets) !== null && _q !== void 0 ? _q : (_10.assets = []);
|
|
109
|
+
(_r = (_11 = project.targets['build'].options).scripts) !== null && _r !== void 0 ? _r : (_11.scripts = []);
|
|
105
110
|
if (!project.targets['build'].options.scripts.includes('node_modules/marked/marked.min.js')) {
|
|
106
111
|
project.targets['build'].options.scripts.push('node_modules/marked/marked.min.js');
|
|
107
112
|
}
|
|
@@ -118,26 +123,29 @@ function updateProjectTargets(project, options) {
|
|
|
118
123
|
},
|
|
119
124
|
]);
|
|
120
125
|
// ensure the property polyfills are defined
|
|
121
|
-
(
|
|
126
|
+
(_s = (_12 = project.targets['build'].options).polyfills) !== null && _s !== void 0 ? _s : (_12.polyfills = []);
|
|
122
127
|
if (!Array.isArray(project.targets['build'].options.polyfills)) {
|
|
123
128
|
// ensure the property is an array
|
|
124
129
|
project.targets['build'].options.polyfills = ['zone.js'];
|
|
125
130
|
}
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
}
|
|
131
|
+
// always add the localize init polyfill as some rxap components use the i18n directive
|
|
132
|
+
(0, generator_utilities_1.CoerceAssets)(project.targets['build'].options.polyfills, ['@angular/localize/init']);
|
|
129
133
|
if (options.serviceWorker) {
|
|
134
|
+
if (!project.sourceRoot) {
|
|
135
|
+
throw new Error(`The project ${project.name} has no source root`);
|
|
136
|
+
}
|
|
130
137
|
(0, generator_utilities_1.CoerceAssets)(project.targets['build'].options.assets, [
|
|
131
138
|
(0, path_1.join)(project.sourceRoot, 'manifest.webmanifest'),
|
|
132
139
|
]);
|
|
133
|
-
(
|
|
134
|
-
(
|
|
140
|
+
(_t = (_13 = project.targets['build']).configurations) !== null && _t !== void 0 ? _t : (_13.configurations = {});
|
|
141
|
+
(_u = (_14 = project.targets['build'].configurations).production) !== null && _u !== void 0 ? _u : (_14.production = {});
|
|
135
142
|
project.targets['build'].configurations.production.serviceWorker = true;
|
|
136
|
-
(
|
|
143
|
+
(_v = (_15 = project.targets['build'].configurations.production).ngswConfigPath) !== null && _v !== void 0 ? _v : (_15.ngswConfigPath = 'shared/angular/ngsw-config.json');
|
|
137
144
|
}
|
|
138
|
-
(
|
|
139
|
-
(
|
|
140
|
-
|
|
145
|
+
(_w = (_16 = project.targets['build']).configurations) !== null && _w !== void 0 ? _w : (_16.configurations = {});
|
|
146
|
+
(_x = (_17 = project.targets['build'].configurations).production) !== null && _x !== void 0 ? _x : (_17.production = {});
|
|
147
|
+
(_y = (_18 = project.targets['build'].configurations.production).budgets) !== null && _y !== void 0 ? _y : (_18.budgets = []);
|
|
148
|
+
const budget = project.targets['build'].configurations.production.budgets.find((b) => b.type === 'initial');
|
|
141
149
|
const defaultWarning = '2mb';
|
|
142
150
|
const defaultError = '5mb';
|
|
143
151
|
if (!budget) {
|
|
@@ -196,9 +204,13 @@ function compareBudget(a, b) {
|
|
|
196
204
|
if (aUnit === 'mb') {
|
|
197
205
|
return bUnit === 'kb' ? 1 : -1;
|
|
198
206
|
}
|
|
207
|
+
return 0;
|
|
199
208
|
}
|
|
200
209
|
function updateTargetDefaults(tree, options) {
|
|
201
210
|
const nxJson = (0, devkit_1.readNxJson)(tree);
|
|
211
|
+
if (!nxJson) {
|
|
212
|
+
throw new Error('NxJson not found');
|
|
213
|
+
}
|
|
202
214
|
if (options.localazy) {
|
|
203
215
|
(0, workspace_utilities_1.CoerceTargetDefaultsDependency)(nxJson, 'build', 'localazy-download');
|
|
204
216
|
(0, workspace_utilities_1.CoerceTargetDefaultsDependency)(nxJson, 'localazy-upload', 'extract-i18n');
|
|
@@ -221,6 +233,9 @@ function updateTargetDefaults(tree, options) {
|
|
|
221
233
|
}
|
|
222
234
|
function updateGitIgnore(project, tree, options) {
|
|
223
235
|
if (options.i18n) {
|
|
236
|
+
if (!project.sourceRoot) {
|
|
237
|
+
throw new Error(`The project ${project.name} has no source root`);
|
|
238
|
+
}
|
|
224
239
|
const gitIgnorePath = (0, path_1.join)(project.sourceRoot, '.gitignore');
|
|
225
240
|
(0, generator_utilities_1.CoerceIgnorePattern)(tree, gitIgnorePath, [
|
|
226
241
|
'/i18n',
|
|
@@ -262,7 +277,7 @@ function assertMainStatements(sourceFile) {
|
|
|
262
277
|
const existingStatements = (_a = sourceFile.getStatements().map(s => s.getText())) !== null && _a !== void 0 ? _a : [];
|
|
263
278
|
for (const statement of statements) {
|
|
264
279
|
if (!existingStatements.includes(statement)) {
|
|
265
|
-
console.error(`Missing statement from main.ts: ${statement}`);
|
|
280
|
+
console.error(`Missing statement from angular main.ts: ${statement}`);
|
|
266
281
|
sourceFile.set({
|
|
267
282
|
statements: [
|
|
268
283
|
MAIN_APP_CREATION_STATEMENT,
|
|
@@ -316,9 +331,9 @@ function cleanup(tree, projectSourceRoot) {
|
|
|
316
331
|
.replace(/<.+-nx-welcome><\/.+-nx-welcome> /, '');
|
|
317
332
|
tree.write((0, path_1.join)(projectSourceRoot, 'app/app.component.html'), content);
|
|
318
333
|
}
|
|
319
|
-
function updateMainFile(tree, project, options) {
|
|
334
|
+
function updateMainFile(tree, projectName, project, options) {
|
|
320
335
|
(0, workspace_ts_morph_1.TsMorphAngularProjectTransform)(tree, {
|
|
321
|
-
project:
|
|
336
|
+
project: projectName,
|
|
322
337
|
// directory: '..' // to move from the apps/demo/src/app folder into the apps/demo/src folder
|
|
323
338
|
}, (project, [sourceFile]) => {
|
|
324
339
|
var _a;
|
|
@@ -356,7 +371,7 @@ function updateMainFile(tree, project, options) {
|
|
|
356
371
|
const statement = statements[i];
|
|
357
372
|
const lastStatement = i > 0 ? statements[i - 1] : null;
|
|
358
373
|
const nestStatement = i < statements.length - 1 ? statements[i + 1] : null;
|
|
359
|
-
const existingStatements = (_a = sourceFile.getStatements().map(s => s.getText())) !== null && _a !== void 0 ? _a : [];
|
|
374
|
+
const existingStatements = (_a = sourceFile.getStatements().map((s) => s.getText())) !== null && _a !== void 0 ? _a : [];
|
|
360
375
|
if (!existingStatements.includes(statement)) {
|
|
361
376
|
let index;
|
|
362
377
|
if (lastStatement) {
|
|
@@ -465,7 +480,7 @@ function updateTsConfig(tree, project, options) {
|
|
|
465
480
|
});
|
|
466
481
|
}
|
|
467
482
|
function initApplicationGenerator(tree, options) {
|
|
468
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
|
|
483
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q;
|
|
469
484
|
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
470
485
|
(_a = options.sentry) !== null && _a !== void 0 ? _a : (options.sentry = true);
|
|
471
486
|
(_b = options.openApi) !== null && _b !== void 0 ? _b : (options.openApi = false);
|
|
@@ -482,7 +497,13 @@ function initApplicationGenerator(tree, options) {
|
|
|
482
497
|
(_m = options.authentik) !== null && _m !== void 0 ? _m : (options.authentik = false);
|
|
483
498
|
(_o = options.oauth) !== null && _o !== void 0 ? _o : (options.oauth = false);
|
|
484
499
|
options.oauth = options.oauth || options.authentik;
|
|
500
|
+
(_p = options.project) !== null && _p !== void 0 ? _p : (options.project = undefined);
|
|
501
|
+
(_q = options.projects) !== null && _q !== void 0 ? _q : (options.projects = []);
|
|
502
|
+
if (options.project) {
|
|
503
|
+
(0, utilities_1.CoerceArrayItems)(options.projects, [options.project]);
|
|
504
|
+
}
|
|
485
505
|
console.log('angular application init generator:', options);
|
|
506
|
+
yield (0, plugin_application_1.ApplicationInitWorkspace)(tree, options);
|
|
486
507
|
yield (0, workspace_utilities_1.AddPackageJsonDependency)(tree, '@mdi/angular-material', 'latest', { soft: true });
|
|
487
508
|
yield (0, workspace_utilities_1.AddPackageJsonDependency)(tree, '@rxap/ngx-bootstrap', 'latest', { soft: true });
|
|
488
509
|
yield (0, workspace_utilities_1.AddPackageJsonDependency)(tree, 'ngx-logger', 'latest', { soft: true });
|
|
@@ -584,8 +605,8 @@ function initApplicationGenerator(tree, options) {
|
|
|
584
605
|
if (skipProject(tree, options, project, projectName)) {
|
|
585
606
|
continue;
|
|
586
607
|
}
|
|
587
|
-
console.log(`init project: ${projectName}`);
|
|
588
|
-
|
|
608
|
+
console.log(`init angular application project: ${projectName}`);
|
|
609
|
+
(0, plugin_application_1.ApplicationInitProject)(tree, projectName, project, options);
|
|
589
610
|
updateProjectTargets(project, options);
|
|
590
611
|
updateTags(project, options);
|
|
591
612
|
updateGitIgnore(project, tree, options);
|
|
@@ -635,6 +656,7 @@ function initApplicationGenerator(tree, options) {
|
|
|
635
656
|
},
|
|
636
657
|
]);
|
|
637
658
|
if (options.monolithic) {
|
|
659
|
+
providers.push('ProvidePubSub()');
|
|
638
660
|
providers.push('ProvideChangelog()');
|
|
639
661
|
importProvidersFrom.push('MarkdownModule.forRoot()');
|
|
640
662
|
(0, ts_morph_1.CoerceImports)(sourceFile, [
|
|
@@ -646,6 +668,10 @@ function initApplicationGenerator(tree, options) {
|
|
|
646
668
|
moduleSpecifier: 'ngx-markdown',
|
|
647
669
|
namedImports: ['MarkdownModule'],
|
|
648
670
|
},
|
|
671
|
+
{
|
|
672
|
+
moduleSpecifier: '@rxap/ngx-pub-sub',
|
|
673
|
+
namedImports: ['ProvidePubSub'],
|
|
674
|
+
},
|
|
649
675
|
]);
|
|
650
676
|
}
|
|
651
677
|
if (options.oauth) {
|
|
@@ -698,7 +724,10 @@ function initApplicationGenerator(tree, options) {
|
|
|
698
724
|
});
|
|
699
725
|
}, ['/app/app.config.ts']);
|
|
700
726
|
if (options.generateMain) {
|
|
701
|
-
updateMainFile(tree, project, options);
|
|
727
|
+
updateMainFile(tree, projectName, project, options);
|
|
728
|
+
}
|
|
729
|
+
if (!project.sourceRoot) {
|
|
730
|
+
throw new Error(`Project source root not found for project ${projectName}`);
|
|
702
731
|
}
|
|
703
732
|
if (options.cleanup) {
|
|
704
733
|
cleanup(tree, project.sourceRoot);
|
|
@@ -707,14 +736,7 @@ function initApplicationGenerator(tree, options) {
|
|
|
707
736
|
coerceLocalazyConfigFile(tree, project);
|
|
708
737
|
}
|
|
709
738
|
if (options.monolithic) {
|
|
710
|
-
|
|
711
|
-
if (tree.exists('logo.png')) {
|
|
712
|
-
tree.write((0, path_1.join)(project.sourceRoot, 'assets', 'logo.png'), tree.read('logo.png'));
|
|
713
|
-
}
|
|
714
|
-
}
|
|
715
|
-
if (options.overwrite) {
|
|
716
|
-
(0, devkit_1.generateFiles)(tree, (0, path_1.join)(__dirname, 'files', 'monolithic'), project.sourceRoot, Object.assign(Object.assign({}, options), { relativePathToWorkspaceRoot: (0, path_1.relative)(project.sourceRoot, ''), name: projectName.replace(/^user-interface-/, ''), classify: utilities_1.classify, prefix: (0, workspace_utilities_1.GetProjectPrefix)(tree, projectName, 'rxap') }));
|
|
717
|
-
}
|
|
739
|
+
(0, generate_monolithic_1.generateMonolithic)(tree, projectName, project, options);
|
|
718
740
|
}
|
|
719
741
|
if (options.serviceWorker) {
|
|
720
742
|
if (options.overwrite || !tree.exists((0, path_1.join)(project.sourceRoot, 'manifest.webmanifest'))) {
|
|
@@ -731,10 +753,8 @@ function initApplicationGenerator(tree, options) {
|
|
|
731
753
|
(0, devkit_1.updateProjectConfiguration)(tree, projectName, project);
|
|
732
754
|
}
|
|
733
755
|
}
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
}
|
|
737
|
-
yield (0, plugin_localazy_1.LocalazyGitlabCiGenerator)(tree, options);
|
|
756
|
+
yield (0, plugin_localazy_1.LocalazyGitlabCiGenerator)(tree, {});
|
|
757
|
+
yield (0, plugin_docker_1.DockerGitlabCiGenerator)(tree, {});
|
|
738
758
|
});
|
|
739
759
|
}
|
|
740
760
|
exports.initApplicationGenerator = initApplicationGenerator;
|