@ng-doc/add 22.0.0 → 22.2.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/LICENSE +21 -0
- package/package.json +2 -2
- package/schematics/ng-add/index.d.ts +2 -1
- package/schematics/ng-add/index.js +10 -4
- package/schematics/ng-add/index.js.map +1 -1
- package/schematics/ng-add/schema.json +1 -1
- package/schematics/ng-add/steps/add-assets.d.ts +1 -1
- package/schematics/ng-add/steps/add-assets.js +3 -2
- package/schematics/ng-add/steps/add-assets.js.map +1 -1
- package/schematics/ng-add/steps/add-js-dependencies.js +2 -1
- package/schematics/ng-add/steps/add-js-dependencies.js.map +1 -1
- package/schematics/ng-add/steps/add-layout.d.ts +3 -1
- package/schematics/ng-add/steps/add-layout.js +26 -13
- package/schematics/ng-add/steps/add-layout.js.map +1 -1
- package/schematics/ng-add/steps/add-ng-doc-app-config.d.ts +3 -1
- package/schematics/ng-add/steps/add-ng-doc-app-config.js +19 -11
- package/schematics/ng-add/steps/add-ng-doc-app-config.js.map +1 -1
- package/schematics/ng-add/steps/add-styles.js +2 -1
- package/schematics/ng-add/steps/add-styles.js.map +1 -1
- package/schematics/ng-add/steps/post-install.d.ts +2 -1
- package/schematics/ng-add/steps/post-install.js +7 -1
- package/schematics/ng-add/steps/post-install.js.map +1 -1
- package/schematics/ng-add/steps/raise-initial-budget.d.ts +2 -1
- package/schematics/ng-add/steps/raise-initial-budget.js +4 -2
- package/schematics/ng-add/steps/raise-initial-budget.js.map +1 -1
- package/schematics/ng-add/utils/get-build-options-target.d.ts +2 -1
- package/schematics/ng-add/utils/get-build-options-target.js +38 -3
- package/schematics/ng-add/utils/get-build-options-target.js.map +1 -1
- package/schematics/ng-add/utils/get-main-path.d.ts +10 -0
- package/schematics/ng-add/utils/get-main-path.js +31 -0
- package/schematics/ng-add/utils/get-main-path.js.map +1 -1
- package/schematics/ng-add/utils/layout-template.d.ts +40 -0
- package/schematics/ng-add/utils/layout-template.js +51 -0
- package/schematics/ng-add/utils/layout-template.js.map +1 -0
- package/schematics/ng-add/utils/select-engine.d.ts +24 -4
- package/schematics/ng-add/utils/select-engine.js +49 -7
- package/schematics/ng-add/utils/select-engine.js.map +1 -1
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2023 Aleksandr Skoropad
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NON INFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ng-doc/add",
|
|
3
|
-
"version": "22.
|
|
3
|
+
"version": "22.2.0",
|
|
4
4
|
"description": "Adds NgDoc to an Angular or Nx project with `ng add` and sets everything up for you.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"angular",
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
"access": "public"
|
|
31
31
|
},
|
|
32
32
|
"dependencies": {
|
|
33
|
-
"@ng-doc/builder": "22.
|
|
33
|
+
"@ng-doc/builder": "22.2.0",
|
|
34
34
|
"@angular/cdk": ">=22.0.0 < 23.0.0",
|
|
35
35
|
"@angular-devkit/schematics": ">=22.0.0 < 23.0.0",
|
|
36
36
|
"ng-morph": "4.9.0"
|
|
@@ -9,7 +9,8 @@ export declare function ngAdd(options: Schema): Rule;
|
|
|
9
9
|
* Sets up the project. It runs as a task before the install task of `ngAdd`, while `@ng-doc/add` is
|
|
10
10
|
* still installed. The styles, assets and providers are the same for both engines. The Vite engine then reads the build target, as it now is, into
|
|
11
11
|
* `vite.config.mjs` and the Vite targets (`@ng-doc/builder:vite-setup`); the legacy engine swaps
|
|
12
|
-
* the builders of the build and serve targets.
|
|
12
|
+
* the builders of the build and serve targets. A builder that is neither Angular's nor NgDoc's is
|
|
13
|
+
* kept, and the project generates its documentation with the `ng-doc` command.
|
|
13
14
|
* @param options - The `ng add` options.
|
|
14
15
|
*/
|
|
15
16
|
export declare function ngAddSetupProject(options: Schema): Rule;
|
|
@@ -42,7 +42,8 @@ function ngAdd(options) {
|
|
|
42
42
|
* Sets up the project. It runs as a task before the install task of `ngAdd`, while `@ng-doc/add` is
|
|
43
43
|
* still installed. The styles, assets and providers are the same for both engines. The Vite engine then reads the build target, as it now is, into
|
|
44
44
|
* `vite.config.mjs` and the Vite targets (`@ng-doc/builder:vite-setup`); the legacy engine swaps
|
|
45
|
-
* the builders of the build and serve targets.
|
|
45
|
+
* the builders of the build and serve targets. A builder that is neither Angular's nor NgDoc's is
|
|
46
|
+
* kept, and the project generates its documentation with the `ng-doc` command.
|
|
46
47
|
* @param options - The `ng add` options.
|
|
47
48
|
*/
|
|
48
49
|
function ngAddSetupProject(options) {
|
|
@@ -55,10 +56,15 @@ function ngAddSetupProject(options) {
|
|
|
55
56
|
const choice = (0, select_engine_1.selectEngine)(tree, project, options.engine, context.logger);
|
|
56
57
|
// The Vite targets hold no Angular build options: a second run must not add any to them.
|
|
57
58
|
const editBuildTarget = !(choice.engine === 'vite' && choice.existing);
|
|
58
|
-
context.logger.info(`[INFO]: Engine: ${choice.
|
|
59
|
+
context.logger.info(`[INFO]: Engine: ${choice.keptBuilder
|
|
60
|
+
? `the "ng-doc" command, next to "${choice.keptBuilder}"`
|
|
61
|
+
: choice.engine === 'vite'
|
|
62
|
+
? 'Vite (@ng-doc/builder:vite-application)'
|
|
63
|
+
: 'legacy (@ng-doc/builder:application)'}`);
|
|
59
64
|
return (0, schematics_1.chain)([
|
|
60
65
|
choice.engine === 'legacy' && choice.replaceBuilders ? (0, replace_builders_1.replaceBuilders)(options) : (0, schematics_1.noop)(),
|
|
61
|
-
// Only a project new to NgDoc: an existing one chose its budgets.
|
|
66
|
+
// Only a project new to NgDoc: an existing one chose its budgets. A kept builder runs
|
|
67
|
+
// Angular's builder with its budgets too.
|
|
62
68
|
choice.engine === 'legacy' && !choice.existing ? (0, raise_initial_budget_1.raiseInitialBudget)(options) : (0, schematics_1.noop)(),
|
|
63
69
|
editBuildTarget ? (0, add_styles_1.addStyles)(options) : (0, schematics_1.noop)(),
|
|
64
70
|
editBuildTarget ? (0, add_assets_1.addAssets)(options) : (0, schematics_1.noop)(),
|
|
@@ -76,7 +82,7 @@ function ngAddSetupProject(options) {
|
|
|
76
82
|
skipInstall: true,
|
|
77
83
|
})
|
|
78
84
|
: (0, schematics_1.noop)(),
|
|
79
|
-
(0, post_install_1.postInstall)(choice.engine),
|
|
85
|
+
(0, post_install_1.postInstall)(choice.engine, choice.keptBuilder),
|
|
80
86
|
]);
|
|
81
87
|
};
|
|
82
88
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../libs/add/schematics/ng-add/index.ts"],"names":[],"mappings":";;AAwCA,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C,CAAC,IAAA,yCAAkB,EAAC,OAAO,CAAC,CAAC,CAAC,CAAC,IAAA,iBAAI,GAAE;YACrF,eAAe,CAAC,CAAC,CAAC,IAAA,sBAAS,EAAC,OAAO,CAAC,CAAC,CAAC,CAAC,IAAA,iBAAI,GAAE;YAC7C,eAAe,CAAC,CAAC,CAAC,IAAA,sBAAS,EAAC,OAAO,CAAC,CAAC,CAAC,CAAC,IAAA,iBAAI,GAAE;YAC7C,eAAe,CAAC,CAAC,CAAC,IAAA,uCAAiB,EAAC,OAAO,CAAC,CAAC,CAAC,CAAC,IAAA,iBAAI,GAAE;YACrD,IAAA,yCAAiB,EAAC,OAAO,CAAC;YAC1B,IAAA,sBAAS,EAAC,OAAO,CAAC;YAClB,IAAA,qCAAgB,EAAC,OAAO,CAAC;YACzB,IAAA,wCAAiB,EAAC,OAAO,CAAC;YAC1B,IAAA,6BAAY,GAAE;YACd,2FAA2F;YAC3F,mFAAmF;YACnF,MAAM,CAAC,MAAM,KAAK,MAAM;gBACtB,CAAC,CAAC,IAAA,8BAAiB,EAAC,iBAAiB,EAAE,YAAY,EAAE;oBACjD,OAAO,EAAE,IAAA,iCAAc,EAAC,OAAO,EAAE,SAAS,CAAC;oBAC3C,WAAW,EAAE,IAAI;iBAClB,CAAC;gBACJ,CAAC,CAAC,IAAA,iBAAI,GAAE;YACV,IAAA,0BAAW,EAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,WAAW,CAAC;SAC/C,CAAC,CAAC;IACL,CAAC,CAAC;AACJ,CAAC"}
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
"engine": {
|
|
15
15
|
"type": "string",
|
|
16
16
|
"enum": ["vite", "legacy"],
|
|
17
|
-
"description": "The engine to set up: \"vite\" (the @ng-doc/builder:vite-application and vite-dev-server builders) or \"legacy\" (the @ng-doc/builder:application and dev-server builders). By default a standalone application on Angular's application builder gets the Vite engine; an NgModule application, or one on another builder, gets the legacy builders. A project that already uses NgDoc keeps its builders."
|
|
17
|
+
"description": "The engine to set up: \"vite\" (the @ng-doc/builder:vite-application and vite-dev-server builders) or \"legacy\" (the @ng-doc/builder:application and dev-server builders). By default a standalone application on Angular's application builder (or Nx's @nx/angular:application executor) gets the Vite engine; an NgModule application, or one on another builder, gets the legacy builders. A project that already uses NgDoc keeps its builders."
|
|
18
18
|
}
|
|
19
19
|
},
|
|
20
20
|
"required": []
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Rule } from '@angular-devkit/schematics';
|
|
2
2
|
import { Schema } from '../schema';
|
|
3
3
|
/**
|
|
4
|
-
* Adds the NgDoc assets to the build
|
|
4
|
+
* Adds the NgDoc assets to the target with the Angular build options (`getBuildOptionsTarget`). Entries that are already there are not added again.
|
|
5
5
|
* @param options - The `ng add` options.
|
|
6
6
|
*/
|
|
7
7
|
export declare function addAssets(options: Schema): Rule;
|
|
@@ -4,9 +4,10 @@ exports.addAssets = addAssets;
|
|
|
4
4
|
const schematics_1 = require("@angular/cdk/schematics");
|
|
5
5
|
const workspace_1 = require("@schematics/angular/utility/workspace");
|
|
6
6
|
const assets_1 = require("../constants/assets");
|
|
7
|
+
const get_build_options_target_1 = require("../utils/get-build-options-target");
|
|
7
8
|
const get_project_1 = require("../utils/get-project");
|
|
8
9
|
/**
|
|
9
|
-
* Adds the NgDoc assets to the build
|
|
10
|
+
* Adds the NgDoc assets to the target with the Angular build options (`getBuildOptionsTarget`). Entries that are already there are not added again.
|
|
10
11
|
* @param options - The `ng add` options.
|
|
11
12
|
*/
|
|
12
13
|
function addAssets(options) {
|
|
@@ -21,7 +22,7 @@ function addAssets(options) {
|
|
|
21
22
|
logger.error(`❌ Target project not found. Please add assets manually.`);
|
|
22
23
|
return;
|
|
23
24
|
}
|
|
24
|
-
const targetOptions = (0, schematics_1.getProjectTargetOptions)(project,
|
|
25
|
+
const targetOptions = (0, schematics_1.getProjectTargetOptions)(project, (0, get_build_options_target_1.getBuildOptionsTarget)(project));
|
|
25
26
|
const assets = targetOptions['assets'];
|
|
26
27
|
// Asset entries are objects, so they are compared by content: a second `ng add` run must
|
|
27
28
|
// not add them again.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"add-assets.js","sourceRoot":"","sources":["../../../../../../libs/add/schematics/ng-add/steps/add-assets.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"add-assets.js","sourceRoot":"","sources":["../../../../../../libs/add/schematics/ng-add/steps/add-assets.ts"],"names":[],"mappings":";;AAkBA,8BA2CC;AA7DD,wDAAkE;AAGlE,qEAI+C;AAE/C,gDAAqD;AAErD,gFAA0E;AAC1E,sDAAkD;AAElD;;;GAGG;AACH,SAAgB,SAAS,CAAC,OAAe;IACvC,OAAO,KAAK,EAAE,IAAU,EAAE,OAAyB,EAAE,EAAE;QACrD,OAAO,IAAA,2BAAe,EAAC,CAAC,SAA8B,EAAE,EAAE;YACxD,MAAM,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,WAAW,CAAC,YAAY,CAAC,CAAC;YAExD,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,uBAAuB,CAAC,CAAC;YAC7C,MAAM,CAAC,IAAI,CAAC,2CAA2C,CAAC,CAAC;YAEzD,IAAI,CAAC;gBACH,MAAM,OAAO,GAAkC,IAAA,wBAAU,EAAC,OAAO,EAAE,SAAS,CAAC,CAAC;gBAE9E,IAAI,CAAC,OAAO,EAAE,CAAC;oBACb,MAAM,CAAC,KAAK,CAAC,yDAAyD,CAAC,CAAC;oBAExE,OAAO;gBACT,CAAC;gBAED,MAAM,aAAa,GAA0C,IAAA,oCAAuB,EAClF,OAAO,EACP,IAAA,gDAAqB,EAAC,OAAO,CAAC,CAC/B,CAAC;gBAEF,MAAM,MAAM,GAA0B,aAAa,CAAC,QAAQ,CAA0B,CAAC;gBAEvF,yFAAyF;gBACzF,sBAAsB;gBACtB,MAAM,QAAQ,GAAgB,IAAI,GAAG,CACnC,CAAC,MAAM,IAAI,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,KAAgB,EAAE,EAAE,CAAC,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,CAChE,CAAC;gBAEF,aAAa,CAAC,QAAQ,CAAC,GAAG;oBACxB,GAAG,IAAA,uBAAc,EAAC,OAAO,EAAE,SAAS,CAAC,CAAC,MAAM,CAC1C,CAAC,KAAgB,EAAE,EAAE,CAAC,CAAC,QAAQ,CAAC,GAAG,CAAC,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,CAC3D;oBACD,GAAG,CAAC,MAAM,IAAI,EAAE,CAAC;iBAClB,CAAC;gBAEF,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;YACzB,CAAC;YAAC,OAAO,CAAC,EAAE,CAAC;gBACX,MAAM,CAAC,KAAK,CAAC,UAAU,CAAC,EAAE,CAAC,CAAC;YAC9B,CAAC;QACH,CAAC,CAAC,CAAC;IACL,CAAC,CAAC;AACJ,CAAC"}
|
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.addJsDependencies = addJsDependencies;
|
|
4
4
|
const schematics_1 = require("@angular/cdk/schematics");
|
|
5
5
|
const workspace_1 = require("@schematics/angular/utility/workspace");
|
|
6
|
+
const get_build_options_target_1 = require("../utils/get-build-options-target");
|
|
6
7
|
const get_project_1 = require("../utils/get-project");
|
|
7
8
|
/**
|
|
8
9
|
*
|
|
@@ -21,7 +22,7 @@ function addJsDependencies(options) {
|
|
|
21
22
|
logger.error(`❌ Target project not found. Please add "@ng-doc/core" library to "allowedCommonJsDependencies" manually.`);
|
|
22
23
|
return;
|
|
23
24
|
}
|
|
24
|
-
const targetOptions = (0, schematics_1.getProjectTargetOptions)(project,
|
|
25
|
+
const targetOptions = (0, schematics_1.getProjectTargetOptions)(project, (0, get_build_options_target_1.getBuildOptionsTarget)(project));
|
|
25
26
|
const jsDependencies = targetOptions['allowedCommonJsDependencies'];
|
|
26
27
|
targetOptions['allowedCommonJsDependencies'] = Array.from(new Set([...(jsDependencies ?? []), '@ng-doc/core']));
|
|
27
28
|
logger.info('✅ Done!');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"add-js-dependencies.js","sourceRoot":"","sources":["../../../../../../libs/add/schematics/ng-add/steps/add-js-dependencies.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"add-js-dependencies.js","sourceRoot":"","sources":["../../../../../../libs/add/schematics/ng-add/steps/add-js-dependencies.ts"],"names":[],"mappings":";;AAkBA,8CAqCC;AAvDD,wDAAkE;AAGlE,qEAI+C;AAG/C,gFAA0E;AAC1E,sDAAkD;AAElD;;;;GAIG;AACH,SAAgB,iBAAiB,CAAC,OAAe;IAC/C,OAAO,KAAK,EAAE,IAAU,EAAE,OAAyB,EAAE,EAAE;QACrD,OAAO,IAAA,2BAAe,EAAC,CAAC,SAA8B,EAAE,EAAE;YACxD,MAAM,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,WAAW,CAAC,qBAAqB,CAAC,CAAC;YAEjE,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,gCAAgC,CAAC,CAAC;YACtD,MAAM,CAAC,IAAI,CAAC,sEAAsE,CAAC,CAAC;YAEpF,IAAI,CAAC;gBACH,MAAM,OAAO,GAAkC,IAAA,wBAAU,EAAC,OAAO,EAAE,SAAS,CAAC,CAAC;gBAE9E,IAAI,CAAC,OAAO,EAAE,CAAC;oBACb,MAAM,CAAC,KAAK,CACV,0GAA0G,CAC3G,CAAC;oBAEF,OAAO;gBACT,CAAC;gBAED,MAAM,aAAa,GAA0C,IAAA,oCAAuB,EAClF,OAAO,EACP,IAAA,gDAAqB,EAAC,OAAO,CAAC,CAC/B,CAAC;gBACF,MAAM,cAAc,GAA0B,aAAa,CACzD,6BAA6B,CACL,CAAC;gBAE3B,aAAa,CAAC,6BAA6B,CAAC,GAAG,KAAK,CAAC,IAAI,CACvD,IAAI,GAAG,CAAC,CAAC,GAAG,CAAC,cAAc,IAAI,EAAE,CAAC,EAAE,cAAc,CAAC,CAAC,CACrD,CAAC;gBAEF,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;YACzB,CAAC;YAAC,OAAO,CAAC,EAAE,CAAC;gBACX,MAAM,CAAC,KAAK,CAAC,YAAY,CAAC,EAAE,CAAC,CAAC;YAChC,CAAC;QACH,CAAC,CAAC,CAAC;IACL,CAAC,CAAC;AACJ,CAAC"}
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { Rule } from '@angular-devkit/schematics';
|
|
2
2
|
import { Schema } from '../schema';
|
|
3
3
|
/**
|
|
4
|
-
*
|
|
4
|
+
* Puts the NgDoc layout in the root component's template when that template is Angular's
|
|
5
|
+
* `ng new` placeholder, empty or only a router outlet. A template that the application wrote,
|
|
6
|
+
* and an inline one, is never overwritten: the output says how to add the layout by hand.
|
|
5
7
|
* @param options - The `ng add` options.
|
|
6
8
|
*/
|
|
7
9
|
export declare function addLayout(options: Schema): Rule;
|
|
@@ -4,18 +4,21 @@ exports.addLayout = addLayout;
|
|
|
4
4
|
const workspace_1 = require("@schematics/angular/utility/workspace");
|
|
5
5
|
const ng_morph_1 = require("ng-morph");
|
|
6
6
|
const app_component_content_1 = require("../constants/app-component-content");
|
|
7
|
-
const get_app_template_path_1 = require("../utils/get-app-template-path");
|
|
8
7
|
const get_main_path_1 = require("../utils/get-main-path");
|
|
9
8
|
const get_project_1 = require("../utils/get-project");
|
|
9
|
+
const layout_template_1 = require("../utils/layout-template");
|
|
10
|
+
/** The guide for documentation under a route of an existing application. */
|
|
11
|
+
const LAZY_ROUTE_GUIDE = 'https://ng-doc.com/docs/customize/lazy-route';
|
|
10
12
|
/**
|
|
11
|
-
*
|
|
13
|
+
* Puts the NgDoc layout in the root component's template when that template is Angular's
|
|
14
|
+
* `ng new` placeholder, empty or only a router outlet. A template that the application wrote,
|
|
15
|
+
* and an inline one, is never overwritten: the output says how to add the layout by hand.
|
|
12
16
|
* @param options - The `ng add` options.
|
|
13
17
|
*/
|
|
14
18
|
function addLayout(options) {
|
|
15
19
|
return async (tree, context) => {
|
|
16
20
|
const logger = context.logger.createChild('add-layout');
|
|
17
21
|
context.logger.info(`[INFO]: Application layout`);
|
|
18
|
-
logger.info(`🔄 Replacing the content of the root component with NgDoc layout...`);
|
|
19
22
|
try {
|
|
20
23
|
const workspace = await (0, workspace_1.getWorkspace)(tree);
|
|
21
24
|
const project = (0, get_project_1.getProject)(options, workspace);
|
|
@@ -23,18 +26,28 @@ function addLayout(options) {
|
|
|
23
26
|
logger.error(`❌ Target project not found. Please replace the content of the root component with NgDoc layout manually.`);
|
|
24
27
|
return;
|
|
25
28
|
}
|
|
26
|
-
const mainPath = (0, get_main_path_1.
|
|
29
|
+
const mainPath = (0, get_main_path_1.getBootstrapPath)(tree, project);
|
|
27
30
|
// A project of its own: the one of an earlier step may hold edits that step did not save.
|
|
28
31
|
(0, ng_morph_1.setActiveProject)((0, ng_morph_1.createProject)(tree, '/', ['**/*.ts', '**/*.json']));
|
|
29
|
-
const
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
32
|
+
const template = (0, layout_template_1.getLayoutTemplate)(tree, mainPath);
|
|
33
|
+
switch (template.action) {
|
|
34
|
+
case 'replace':
|
|
35
|
+
logger.info(`🔄 Replacing the placeholder template of the root component with NgDoc layout...`);
|
|
36
|
+
tree.overwrite(template.path, app_component_content_1.APP_COMPONENT_CONTENT);
|
|
37
|
+
logger.info('✅ Done!');
|
|
38
|
+
break;
|
|
39
|
+
case 'has-layout':
|
|
40
|
+
logger.info('✅ The root component already renders the NgDoc layout.');
|
|
41
|
+
break;
|
|
42
|
+
case 'keep':
|
|
43
|
+
logger.warn([
|
|
44
|
+
`⚠️ The root component's template belongs to your application, so it was left as it is.`,
|
|
45
|
+
`Render the NgDoc layout where the documentation should be: in the root template, or in the component of a lazy documentation route (${LAZY_ROUTE_GUIDE}):`,
|
|
46
|
+
app_component_content_1.APP_COMPONENT_CONTENT,
|
|
47
|
+
].join('\n'));
|
|
48
|
+
break;
|
|
49
|
+
default:
|
|
50
|
+
logger.error('❌ Could not find the default main template file for the project. Please replace the content of the root component with NgDoc layout manually.');
|
|
38
51
|
}
|
|
39
52
|
}
|
|
40
53
|
catch (e) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"add-layout.js","sourceRoot":"","sources":["../../../../../../libs/add/schematics/ng-add/steps/add-layout.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"add-layout.js","sourceRoot":"","sources":["../../../../../../libs/add/schematics/ng-add/steps/add-layout.ts"],"names":[],"mappings":";;AAoBA,8BAwDC;AA1ED,qEAAqE;AACrE,uCAA+E;AAE/E,8EAA2E;AAE3E,0DAA0D;AAC1D,sDAAkD;AAClD,8DAA6E;AAE7E,4EAA4E;AAC5E,MAAM,gBAAgB,GAAW,8CAA8C,CAAC;AAEhF;;;;;GAKG;AACH,SAAgB,SAAS,CAAC,OAAe;IACvC,OAAO,KAAK,EAAE,IAAU,EAAE,OAAyB,EAAE,EAAE;QACrD,MAAM,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,WAAW,CAAC,YAAY,CAAC,CAAC;QAExD,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,4BAA4B,CAAC,CAAC;QAElD,IAAI,CAAC;YACH,MAAM,SAAS,GAAwB,MAAM,IAAA,wBAAY,EAAC,IAAI,CAAC,CAAC;YAChE,MAAM,OAAO,GAAkC,IAAA,wBAAU,EAAC,OAAO,EAAE,SAAS,CAAC,CAAC;YAE9E,IAAI,CAAC,OAAO,EAAE,CAAC;gBACb,MAAM,CAAC,KAAK,CACV,0GAA0G,CAC3G,CAAC;gBAEF,OAAO;YACT,CAAC;YAED,MAAM,QAAQ,GAAuB,IAAA,gCAAgB,EAAC,IAAI,EAAE,OAAO,CAAC,CAAC;YAErE,0FAA0F;YAC1F,IAAA,2BAAgB,EAAC,IAAA,wBAAa,EAAC,IAAI,EAAE,GAAG,EAAE,CAAC,SAAS,EAAE,WAAW,CAAC,CAAC,CAAC,CAAC;YAErE,MAAM,QAAQ,GAAmB,IAAA,mCAAiB,EAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;YAEnE,QAAQ,QAAQ,CAAC,MAAM,EAAE,CAAC;gBACxB,KAAK,SAAS;oBACZ,MAAM,CAAC,IAAI,CACT,kFAAkF,CACnF,CAAC;oBACF,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,IAAI,EAAE,6CAAqB,CAAC,CAAC;oBACrD,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;oBACvB,MAAM;gBACR,KAAK,YAAY;oBACf,MAAM,CAAC,IAAI,CAAC,wDAAwD,CAAC,CAAC;oBACtE,MAAM;gBACR,KAAK,MAAM;oBACT,MAAM,CAAC,IAAI,CACT;wBACE,wFAAwF;wBACxF,uIAAuI,gBAAgB,IAAI;wBAC3J,6CAAqB;qBACtB,CAAC,IAAI,CAAC,IAAI,CAAC,CACb,CAAC;oBACF,MAAM;gBACR;oBACE,MAAM,CAAC,KAAK,CACV,+IAA+I,CAChJ,CAAC;YACN,CAAC;QACH,CAAC;QAAC,OAAO,CAAC,EAAE,CAAC;YACX,MAAM,CAAC,KAAK,CAAC,YAAY,CAAC,EAAE,CAAC,CAAC;QAChC,CAAC;gBAAS,CAAC;YACT,IAAA,6BAAkB,GAAE,CAAC;QACvB,CAAC;IACH,CAAC,CAAC;AACJ,CAAC"}
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { Rule } from '@angular-devkit/schematics';
|
|
2
2
|
import { Schema } from '../schema';
|
|
3
3
|
/**
|
|
4
|
-
* Adds the NgDoc providers, the router and the layout components to the application.
|
|
4
|
+
* Adds the NgDoc providers, the router and the layout components to the application. The layout
|
|
5
|
+
* components are left out when `ng add` keeps the root template (see `addLayout`): the template
|
|
6
|
+
* would not use them.
|
|
5
7
|
*
|
|
6
8
|
* Calls that the application already has (`provideRouter`, `provideHttpClient`,
|
|
7
9
|
* `RouterModule.forRoot`) are extended rather than repeated, so the rule can run more than once.
|
|
@@ -11,8 +11,11 @@ const get_initializer_1 = require("../utils/get-initializer");
|
|
|
11
11
|
const get_main_path_1 = require("../utils/get-main-path");
|
|
12
12
|
const get_project_1 = require("../utils/get-project");
|
|
13
13
|
const get_root_module_1 = require("../utils/get-root-module");
|
|
14
|
+
const layout_template_1 = require("../utils/layout-template");
|
|
14
15
|
/**
|
|
15
|
-
* Adds the NgDoc providers, the router and the layout components to the application.
|
|
16
|
+
* Adds the NgDoc providers, the router and the layout components to the application. The layout
|
|
17
|
+
* components are left out when `ng add` keeps the root template (see `addLayout`): the template
|
|
18
|
+
* would not use them.
|
|
16
19
|
*
|
|
17
20
|
* Calls that the application already has (`provideRouter`, `provideHttpClient`,
|
|
18
21
|
* `RouterModule.forRoot`) are extended rather than repeated, so the rule can run more than once.
|
|
@@ -31,7 +34,7 @@ function addNgDocAppConfig(options) {
|
|
|
31
34
|
logger.error(`❌ Target project not found. Please configure your application manually.`);
|
|
32
35
|
return;
|
|
33
36
|
}
|
|
34
|
-
const mainPath = (0, get_main_path_1.
|
|
37
|
+
const mainPath = (0, get_main_path_1.getBootstrapPath)(tree, project);
|
|
35
38
|
const morphProject = (0, ng_morph_1.createProject)(tree, '/', ['**/*.ts', '**/*.json']);
|
|
36
39
|
// Angular CLI projects indent with two spaces; ts-morph defaults to four.
|
|
37
40
|
morphProject.manipulationSettings.set({ indentationText: ng_morph_1.IndentationText.TwoSpaces });
|
|
@@ -85,6 +88,7 @@ function arrayEdit(array, entries, logger) {
|
|
|
85
88
|
*/
|
|
86
89
|
function planEdits(tree, mainPath, logger) {
|
|
87
90
|
const bootstrapApplicationFn = (0, ng_morph_1.getBootstrapApplicationFn)(mainPath);
|
|
91
|
+
const keepsTemplate = (0, layout_template_1.getLayoutTemplate)(tree, mainPath).action === 'keep';
|
|
88
92
|
if (bootstrapApplicationFn) {
|
|
89
93
|
const appComponent = (0, get_app_component_1.getAppComponent)(tree, mainPath);
|
|
90
94
|
if (!appComponent) {
|
|
@@ -102,14 +106,18 @@ function planEdits(tree, mainPath, logger) {
|
|
|
102
106
|
}
|
|
103
107
|
return [
|
|
104
108
|
arrayEdit(providers, modules_1.STANDALONE_APP.providers, logger),
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
109
|
+
...(keepsTemplate
|
|
110
|
+
? []
|
|
111
|
+
: [
|
|
112
|
+
{
|
|
113
|
+
file: appComponent.getSourceFile(),
|
|
114
|
+
entries: modules_1.STANDALONE_APP.imports,
|
|
115
|
+
apply: () => modules_1.STANDALONE_APP.imports.map((component) => {
|
|
116
|
+
(0, ng_morph_1.addImportToComponent)(appComponent, component.initializer, { unique: true });
|
|
117
|
+
return 'unchanged';
|
|
118
|
+
}),
|
|
119
|
+
},
|
|
120
|
+
]),
|
|
113
121
|
];
|
|
114
122
|
}
|
|
115
123
|
if (!(0, get_root_module_1.getBootstrapModuleFn)(mainPath)) {
|
|
@@ -132,7 +140,7 @@ function planEdits(tree, mainPath, logger) {
|
|
|
132
140
|
const routerEdit = planRouterEdit(imports, router, logger);
|
|
133
141
|
return [
|
|
134
142
|
...(routerEdit ? [routerEdit] : []),
|
|
135
|
-
arrayEdit(imports, components, logger),
|
|
143
|
+
...(keepsTemplate ? [] : [arrayEdit(imports, components, logger)]),
|
|
136
144
|
arrayEdit(providers, modules_1.MODULE_APP.providers, logger),
|
|
137
145
|
];
|
|
138
146
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"add-ng-doc-app-config.js","sourceRoot":"","sources":["../../../../../../libs/add/schematics/ng-add/steps/add-ng-doc-app-config.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"add-ng-doc-app-config.js","sourceRoot":"","sources":["../../../../../../libs/add/schematics/ng-add/steps/add-ng-doc-app-config.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KAAK,EAAE,CAAC,CAAC;QACjE,CAAC;IACH,CAAC,CAAC,CAAC;IAEH,OAAO,SAAS,CAAC;AACnB,CAAC;AAED;;;;GAIG;AACH,SAAS,eAAe,CAAC,QAAgB,EAAE,OAAuB;IAChE,OAAO,CAAC,OAAO,CAAC,CAAC,YAA0B,EAAE,EAAE,CAC7C,IAAA,mCAAe,EAAC,QAAQ,EAAE,YAAY,CAAC,IAAI,EAAE,YAAY,CAAC,IAAI,CAAC,CAChE,CAAC;AACJ,CAAC;AAED;;;GAGG;AACH,SAAS,mBAAmB,CAAC,MAAwB;IACnD,MAAM,SAAS,GAAG,MAAM,CAAC,YAAY,CAAC,UAAU,CAAC,CAAC;IAElD,IAAI,CAAC,SAAS,EAAE,CAAC;QACf,OAAO,SAAS,CAAC;IACnB,CAAC;IAED,MAAM,CAAC,QAAQ,GAAG,SAAS,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC,GAAG,SAAS,CAAC,YAAY,EAAE,CAAC;IAE1E,OAAO,eAAI,CAAC,yBAAyB,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,SAAS,CAAC;AACzE,CAAC;AAED;;;GAGG;AACH,SAAS,gBAAgB,CACvB,OAA6C;IAE7C,IAAI,eAAI,CAAC,yBAAyB,CAAC,OAAO,CAAC,EAAE,CAAC;QAC5C,OAAO,OAAO,CAAC;IACjB,CAAC;IAED,MAAM,UAAU,GAAG,OAAO,CAAC,kBAAkB,EAAE,CAAC,CAAC,CAAC,CAAC;IAEnD,OAAO,UAAU,EAAE,iBAAiB,CAAC,qBAAU,CAAC,uBAAuB,CAAC,CAAC,CAAC,CAAC,CAAC;AAC9E,CAAC"}
|
|
@@ -4,6 +4,7 @@ exports.addStyles = addStyles;
|
|
|
4
4
|
const schematics_1 = require("@angular/cdk/schematics");
|
|
5
5
|
const workspace_1 = require("@schematics/angular/utility/workspace");
|
|
6
6
|
const styles_1 = require("../constants/styles");
|
|
7
|
+
const get_build_options_target_1 = require("../utils/get-build-options-target");
|
|
7
8
|
const get_project_1 = require("../utils/get-project");
|
|
8
9
|
/**
|
|
9
10
|
*
|
|
@@ -22,7 +23,7 @@ function addStyles(options) {
|
|
|
22
23
|
logger.error(`❌ Target project not found. Please add global NgDoc styles manually.`);
|
|
23
24
|
return;
|
|
24
25
|
}
|
|
25
|
-
const targetOptions = (0, schematics_1.getProjectTargetOptions)(project,
|
|
26
|
+
const targetOptions = (0, schematics_1.getProjectTargetOptions)(project, (0, get_build_options_target_1.getBuildOptionsTarget)(project));
|
|
26
27
|
const styles = targetOptions['styles'];
|
|
27
28
|
targetOptions['styles'] = Array.from(new Set([...styles_1.NG_DOC_STYLES, ...(styles ?? [])]));
|
|
28
29
|
logger.info('✅ Done!');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"add-styles.js","sourceRoot":"","sources":["../../../../../../libs/add/schematics/ng-add/steps/add-styles.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"add-styles.js","sourceRoot":"","sources":["../../../../../../libs/add/schematics/ng-add/steps/add-styles.ts"],"names":[],"mappings":";;AAmBA,8BA+BC;AAlDD,wDAAkE;AAGlE,qEAI+C;AAE/C,gDAAoD;AAEpD,gFAA0E;AAC1E,sDAAkD;AAElD;;;;GAIG;AACH,SAAgB,SAAS,CAAC,OAAe;IACvC,OAAO,KAAK,EAAE,IAAU,EAAE,OAAyB,EAAE,EAAE;QACrD,OAAO,IAAA,2BAAe,EAAC,CAAC,SAA8B,EAAE,EAAE;YACxD,MAAM,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,WAAW,CAAC,YAAY,CAAC,CAAC;YAExD,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,uBAAuB,CAAC,CAAC;YAC7C,MAAM,CAAC,IAAI,CAAC,wDAAwD,CAAC,CAAC;YAEtE,IAAI,CAAC;gBACH,MAAM,OAAO,GAAkC,IAAA,wBAAU,EAAC,OAAO,EAAE,SAAS,CAAC,CAAC;gBAE9E,IAAI,CAAC,OAAO,EAAE,CAAC;oBACb,MAAM,CAAC,KAAK,CAAC,sEAAsE,CAAC,CAAC;oBAErF,OAAO;gBACT,CAAC;gBAED,MAAM,aAAa,GAA0C,IAAA,oCAAuB,EAClF,OAAO,EACP,IAAA,gDAAqB,EAAC,OAAO,CAAC,CAC/B,CAAC;gBACF,MAAM,MAAM,GAA0B,aAAa,CAAC,QAAQ,CAA0B,CAAC;gBAEvF,aAAa,CAAC,QAAQ,CAAC,GAAG,KAAK,CAAC,IAAI,CAAC,IAAI,GAAG,CAAC,CAAC,GAAG,sBAAa,EAAE,GAAG,CAAC,MAAM,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;gBAErF,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;YACzB,CAAC;YAAC,OAAO,CAAC,EAAE,CAAC;gBACX,MAAM,CAAC,KAAK,CAAC,YAAY,CAAC,EAAE,CAAC,CAAC;YAChC,CAAC;QACH,CAAC,CAAC,CAAC;IACL,CAAC,CAAC;AACJ,CAAC"}
|
|
@@ -3,5 +3,6 @@ import { NgDocEngine } from '../schema';
|
|
|
3
3
|
/**
|
|
4
4
|
* Says what to do next.
|
|
5
5
|
* @param engine - The engine that was set up.
|
|
6
|
+
* @param keptBuilder - The project's own builder, when no NgDoc builder was set up.
|
|
6
7
|
*/
|
|
7
|
-
export declare function postInstall(engine: NgDocEngine): Rule;
|
|
8
|
+
export declare function postInstall(engine: NgDocEngine, keptBuilder?: string): Rule;
|
|
@@ -1,12 +1,18 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.postInstall = postInstall;
|
|
4
|
+
const select_engine_1 = require("../utils/select-engine");
|
|
4
5
|
/**
|
|
5
6
|
* Says what to do next.
|
|
6
7
|
* @param engine - The engine that was set up.
|
|
8
|
+
* @param keptBuilder - The project's own builder, when no NgDoc builder was set up.
|
|
7
9
|
*/
|
|
8
|
-
function postInstall(engine) {
|
|
10
|
+
function postInstall(engine, keptBuilder) {
|
|
9
11
|
return async (tree, context) => {
|
|
12
|
+
if (keptBuilder) {
|
|
13
|
+
context.logger.info(`[INFO]: Everything is done except the builders: "${keptBuilder}" was kept. Generate the files for the "@ng-doc/generated" path with the "ng-doc" command, run "ng serve" through "ng-doc dev" and skip the NgDoc packages in a federation configuration, as described in ${select_engine_1.KEEP_ANOTHER_BUILDER_URL}`);
|
|
14
|
+
return;
|
|
15
|
+
}
|
|
10
16
|
context.logger.info(`[INFO]: Everything is done! Files for the "@ng-doc/generated" path will be created when you start your application${engine === 'vite' ? ' with "ng serve" or build it with "ng build"' : ''}.`);
|
|
11
17
|
};
|
|
12
18
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"post-install.js","sourceRoot":"","sources":["../../../../../../libs/add/schematics/ng-add/steps/post-install.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"post-install.js","sourceRoot":"","sources":["../../../../../../libs/add/schematics/ng-add/steps/post-install.ts"],"names":[],"mappings":";;AAUA,kCAgBC;AAvBD,0DAAkE;AAElE;;;;GAIG;AACH,SAAgB,WAAW,CAAC,MAAmB,EAAE,WAAoB;IACnE,OAAO,KAAK,EAAE,IAAU,EAAE,OAAyB,EAAE,EAAE;QACrD,IAAI,WAAW,EAAE,CAAC;YAChB,OAAO,CAAC,MAAM,CAAC,IAAI,CACjB,oDAAoD,WAAW,6MAA6M,wCAAwB,EAAE,CACvS,CAAC;YAEF,OAAO;QACT,CAAC;QAED,OAAO,CAAC,MAAM,CAAC,IAAI,CACjB,qHACE,MAAM,KAAK,MAAM,CAAC,CAAC,CAAC,8CAA8C,CAAC,CAAC,CAAC,EACvE,GAAG,CACJ,CAAC;IACJ,CAAC,CAAC;AACJ,CAAC"}
|
|
@@ -13,7 +13,8 @@ export declare const NG_DOC_INITIAL_BUDGET = "5mb";
|
|
|
13
13
|
*/
|
|
14
14
|
export declare function budgetBytes(value: JsonValue | undefined): number | undefined;
|
|
15
15
|
/**
|
|
16
|
-
* Raises the `maximumError` of the `initial` budgets of the
|
|
16
|
+
* Raises the `maximumError` of the `initial` budgets of the target with the Angular build options
|
|
17
|
+
* (`getBuildOptionsTarget`) from the `ng new` default
|
|
17
18
|
* (1 MB) to {@link NG_DOC_INITIAL_BUDGET}. A budget the project set itself, warnings and other
|
|
18
19
|
* budgets are kept. The Vite engine has no budgets, and a project that already used NgDoc chose its
|
|
19
20
|
* own, so only the legacy setup of a project new to NgDoc runs this step.
|
|
@@ -4,6 +4,7 @@ exports.NG_DOC_INITIAL_BUDGET = void 0;
|
|
|
4
4
|
exports.budgetBytes = budgetBytes;
|
|
5
5
|
exports.raiseInitialBudget = raiseInitialBudget;
|
|
6
6
|
const workspace_1 = require("@schematics/angular/utility/workspace");
|
|
7
|
+
const get_build_options_target_1 = require("../utils/get-build-options-target");
|
|
7
8
|
const get_project_1 = require("../utils/get-project");
|
|
8
9
|
/**
|
|
9
10
|
* The `maximumError` of the `initial` budget that the legacy setup gives a new application. The
|
|
@@ -23,7 +24,8 @@ function budgetBytes(value) {
|
|
|
23
24
|
return match ? Number(match[1]) * UNITS[(match[2] ?? 'b').toLowerCase()] : undefined;
|
|
24
25
|
}
|
|
25
26
|
/**
|
|
26
|
-
* Raises the `maximumError` of the `initial` budgets of the
|
|
27
|
+
* Raises the `maximumError` of the `initial` budgets of the target with the Angular build options
|
|
28
|
+
* (`getBuildOptionsTarget`) from the `ng new` default
|
|
27
29
|
* (1 MB) to {@link NG_DOC_INITIAL_BUDGET}. A budget the project set itself, warnings and other
|
|
28
30
|
* budgets are kept. The Vite engine has no budgets, and a project that already used NgDoc chose its
|
|
29
31
|
* own, so only the legacy setup of a project new to NgDoc runs this step.
|
|
@@ -34,7 +36,7 @@ function raiseInitialBudget(options) {
|
|
|
34
36
|
return (0, workspace_1.updateWorkspace)((workspace) => {
|
|
35
37
|
const logger = context.logger.createChild('raise-initial-budget');
|
|
36
38
|
const project = (0, get_project_1.getProject)(options, workspace);
|
|
37
|
-
const build = project
|
|
39
|
+
const build = project && project.targets.get((0, get_build_options_target_1.getBuildOptionsTarget)(project));
|
|
38
40
|
const raised = [];
|
|
39
41
|
for (const [name, configuration] of [
|
|
40
42
|
['options', build?.options],
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"raise-initial-budget.js","sourceRoot":"","sources":["../../../../../../libs/add/schematics/ng-add/steps/raise-initial-budget.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"raise-initial-budget.js","sourceRoot":"","sources":["../../../../../../libs/add/schematics/ng-add/steps/raise-initial-budget.ts"],"names":[],"mappings":";;;AA6BA,kCAKC;AAUD,gDAgDC;AA1FD,qEAK+C;AAG/C,gFAA0E;AAC1E,sDAAkD;AAElD;;;;GAIG;AACU,QAAA,qBAAqB,GAAG,KAAK,CAAC;AAE3C,uEAAuE;AACvE,MAAM,qBAAqB,GAAW,IAAI,IAAI,CAAC,CAAC;AAEhD,MAAM,KAAK,GAA2B,EAAE,CAAC,EAAE,CAAC,EAAE,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE,IAAI,IAAI,CAAC,EAAE,EAAE,EAAE,IAAI,IAAI,CAAC,EAAE,CAAC;AAEvF;;;GAGG;AACH,SAAgB,WAAW,CAAC,KAA4B;IACtD,MAAM,KAAK,GACT,OAAO,KAAK,KAAK,QAAQ,CAAC,CAAC,CAAC,0CAA0C,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;IAE5F,OAAO,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,GAAG,CAAC,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;AACvF,CAAC;AAED;;;;;;;GAOG;AACH,SAAgB,kBAAkB,CAAC,OAAe;IAChD,O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C,CAAC;oBAEjD,OAAO,EAAE,GAAG,KAAK,EAAE,YAAY,EAAE,6BAAqB,EAAE,CAAC;gBAC3D,CAAC,CAAC,CAAC;gBAEH,0FAA0F;gBAC1F,+DAA+D;gBAC/D,IAAI,MAAM,CAAC,MAAM,GAAG,MAAM,EAAE,CAAC;oBAC3B,aAAa,CAAC,SAAS,CAAC,GAAG,IAAI,CAAC;gBAClC,CAAC;YACH,CAAC;YAED,IAAI,MAAM,CAAC,MAAM,EAAE,CAAC;gBAClB,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,iBAAiB,CAAC,CAAC;gBACvC,MAAM,CAAC,IAAI,CACT,2CAA2C,6BAAqB,SAAS,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,8DAA8D,CACzJ,CAAC;YACJ,CAAC;QACH,CAAC,CAAC,CAAC;IACL,CAAC,CAAC;AACJ,CAAC"}
|
|
@@ -11,7 +11,8 @@ export declare const LEGACY_BUILD_TARGET = "build-legacy";
|
|
|
11
11
|
/**
|
|
12
12
|
* The target that holds the application's Angular build options: `build`, or, once `build` runs
|
|
13
13
|
* the Vite engine (whose options are a Vite configuration file), `build-angular` of `ng add` or
|
|
14
|
-
* `build-legacy` of `migrate-to-vite`.
|
|
14
|
+
* `build-legacy` of `migrate-to-vite`. A `build` builder that runs Angular's builder from another
|
|
15
|
+
* target of the project, as native federation runs its `esbuild` target, has them on that target.
|
|
15
16
|
* @param project - The application project.
|
|
16
17
|
*/
|
|
17
18
|
export declare function getBuildOptionsTarget(project: ProjectDefinition): string;
|
|
@@ -11,17 +11,52 @@ exports.VITE_APPLICATION_BUILDER = '@ng-doc/builder:vite-application';
|
|
|
11
11
|
exports.ANGULAR_BUILD_TARGET = 'build-angular';
|
|
12
12
|
/** The target `migrate-to-vite` keeps the legacy build target in. */
|
|
13
13
|
exports.LEGACY_BUILD_TARGET = 'build-legacy';
|
|
14
|
+
/** Options through which a builder runs another target, as `project:target[:configuration]`. */
|
|
15
|
+
const DELEGATING_OPTIONS = ['target', 'buildTarget', 'browserTarget'];
|
|
16
|
+
/** Angular's builders that take the application's build options. */
|
|
17
|
+
const ANGULAR_BUILD_BUILDERS = [
|
|
18
|
+
'@angular/build:application',
|
|
19
|
+
'@angular-devkit/build-angular:application',
|
|
20
|
+
'@angular-devkit/build-angular:browser',
|
|
21
|
+
'@angular-devkit/build-angular:browser-esbuild',
|
|
22
|
+
];
|
|
14
23
|
/**
|
|
15
24
|
* The target that holds the application's Angular build options: `build`, or, once `build` runs
|
|
16
25
|
* the Vite engine (whose options are a Vite configuration file), `build-angular` of `ng add` or
|
|
17
|
-
* `build-legacy` of `migrate-to-vite`.
|
|
26
|
+
* `build-legacy` of `migrate-to-vite`. A `build` builder that runs Angular's builder from another
|
|
27
|
+
* target of the project, as native federation runs its `esbuild` target, has them on that target.
|
|
18
28
|
* @param project - The application project.
|
|
19
29
|
*/
|
|
20
30
|
function getBuildOptionsTarget(project) {
|
|
21
|
-
|
|
22
|
-
|
|
31
|
+
const build = project.targets.get('build');
|
|
32
|
+
if (build?.builder !== exports.VITE_APPLICATION_BUILDER) {
|
|
33
|
+
return delegatedBuildTarget(project) ?? 'build';
|
|
23
34
|
}
|
|
24
35
|
return ([exports.ANGULAR_BUILD_TARGET, exports.LEGACY_BUILD_TARGET].find((name) => project.targets.has(name)) ??
|
|
25
36
|
'build');
|
|
26
37
|
}
|
|
38
|
+
/**
|
|
39
|
+
* The target of the project that `build` runs Angular's builder through, if it runs one. Native
|
|
40
|
+
* federation names it in the configurations of `build`
|
|
41
|
+
* (`"production": {"target": "app:esbuild:production"}`).
|
|
42
|
+
* @param project - The application project.
|
|
43
|
+
*/
|
|
44
|
+
function delegatedBuildTarget(project) {
|
|
45
|
+
const build = project.targets.get('build');
|
|
46
|
+
const configurations = build?.configurations ?? {};
|
|
47
|
+
const defaultConfiguration = build?.defaultConfiguration;
|
|
48
|
+
const candidates = [
|
|
49
|
+
build?.options,
|
|
50
|
+
defaultConfiguration ? configurations[defaultConfiguration] : undefined,
|
|
51
|
+
...Object.values(configurations),
|
|
52
|
+
].flatMap((options) => DELEGATING_OPTIONS.map((option) => options?.[option]));
|
|
53
|
+
for (const value of candidates) {
|
|
54
|
+
const name = typeof value === 'string' ? value.split(':')[1] : undefined;
|
|
55
|
+
const builder = name ? project.targets.get(name)?.builder : undefined;
|
|
56
|
+
if (name && name !== 'build' && builder && ANGULAR_BUILD_BUILDERS.includes(builder)) {
|
|
57
|
+
return name;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
return undefined;
|
|
61
|
+
}
|
|
27
62
|
//# sourceMappingURL=get-build-options-target.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-build-options-target.js","sourceRoot":"","sources":["../../../../../../libs/add/schematics/ng-add/utils/get-build-options-target.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"get-build-options-target.js","sourceRoot":"","sources":["../../../../../../libs/add/schematics/ng-add/utils/get-build-options-target.ts"],"names":[],"mappings":";;;AAgCA,sDAWC;AAzCD,yDAAyD;AAC5C,QAAA,wBAAwB,GAAG,kCAAkC,CAAC;AAE3E;;;GAGG;AACU,QAAA,oBAAoB,GAAG,eAAe,CAAC;AAEpD,qEAAqE;AACxD,QAAA,mBAAmB,GAAG,cAAc,CAAC;AAElD,gGAAgG;AAChG,MAAM,kBAAkB,GAAa,CAAC,QAAQ,EAAE,aAAa,EAAE,eAAe,CAAC,CAAC;AAEhF,oEAAoE;AACpE,MAAM,sBAAsB,GAAa;IACvC,4BAA4B;IAC5B,2CAA2C;IAC3C,uCAAuC;IACvC,+CAA+C;CAChD,CAAC;AAEF;;;;;;GAMG;AACH,SAAgB,qBAAqB,CAAC,OAA0B;IAC9D,MAAM,KAAK,GAAG,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;IAE3C,IAAI,KAAK,EAAE,OAAO,KAAK,gCAAwB,EAAE,CAAC;QAChD,OAAO,oBAAoB,CAAC,OAAO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AAC,OAAO,CAAC,EAAE,CAAC;YACpF,OAAO,IAAI,CAAC;QACd,CAAC;IACH,CAAC;IAED,OAAO,SAAS,CAAC;AACnB,CAAC"}
|
|
@@ -1,6 +1,16 @@
|
|
|
1
1
|
import { ProjectDefinition } from '@angular-devkit/core/src/workspace';
|
|
2
|
+
import { Tree } from '@angular-devkit/schematics';
|
|
2
3
|
/**
|
|
3
4
|
* Returns the browser entry of the application (`browser`, or `main` of older builders).
|
|
4
5
|
* @param project - The application project.
|
|
5
6
|
*/
|
|
6
7
|
export declare function getMainPath(project: ProjectDefinition): string;
|
|
8
|
+
/**
|
|
9
|
+
* Returns the file that starts the application: the browser entry, or, when the entry starts
|
|
10
|
+
* nothing itself, the module it imports dynamically that does. The entry of a native federation
|
|
11
|
+
* application loads the federation manifest first, then imports `./bootstrap`, which calls
|
|
12
|
+
* `bootstrapApplication`.
|
|
13
|
+
* @param tree - The workspace tree.
|
|
14
|
+
* @param project - The application project.
|
|
15
|
+
*/
|
|
16
|
+
export declare function getBootstrapPath(tree: Tree, project: ProjectDefinition): string;
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getMainPath = getMainPath;
|
|
4
|
+
exports.getBootstrapPath = getBootstrapPath;
|
|
4
5
|
const schematics_1 = require("@angular/cdk/schematics");
|
|
6
|
+
const path_1 = require("path");
|
|
5
7
|
const get_build_options_target_1 = require("./get-build-options-target");
|
|
6
8
|
/**
|
|
7
9
|
* Returns the browser entry of the application (`browser`, or `main` of older builders).
|
|
@@ -11,4 +13,33 @@ function getMainPath(project) {
|
|
|
11
13
|
const buildOptions = (0, schematics_1.getProjectTargetOptions)(project, (0, get_build_options_target_1.getBuildOptionsTarget)(project));
|
|
12
14
|
return (buildOptions['main'] ?? buildOptions['browser']);
|
|
13
15
|
}
|
|
16
|
+
/** A call that starts the application. */
|
|
17
|
+
const BOOTSTRAP_CALL = /\bbootstrapApplication\s*\(|\.bootstrapModule\s*\(/;
|
|
18
|
+
/** A dynamic import of a relative module. */
|
|
19
|
+
const RELATIVE_DYNAMIC_IMPORT = /\bimport\(\s*['"](\.{1,2}\/[^'"]+)['"]\s*\)/g;
|
|
20
|
+
/**
|
|
21
|
+
* Returns the file that starts the application: the browser entry, or, when the entry starts
|
|
22
|
+
* nothing itself, the module it imports dynamically that does. The entry of a native federation
|
|
23
|
+
* application loads the federation manifest first, then imports `./bootstrap`, which calls
|
|
24
|
+
* `bootstrapApplication`.
|
|
25
|
+
* @param tree - The workspace tree.
|
|
26
|
+
* @param project - The application project.
|
|
27
|
+
*/
|
|
28
|
+
function getBootstrapPath(tree, project) {
|
|
29
|
+
const mainPath = getMainPath(project);
|
|
30
|
+
const main = mainPath ? tree.read(mainPath)?.toString('utf-8') : undefined;
|
|
31
|
+
if (main === undefined || BOOTSTRAP_CALL.test(main)) {
|
|
32
|
+
return mainPath;
|
|
33
|
+
}
|
|
34
|
+
for (const [, specifier] of main.matchAll(RELATIVE_DYNAMIC_IMPORT)) {
|
|
35
|
+
const base = path_1.posix.join(path_1.posix.dirname(mainPath), specifier);
|
|
36
|
+
const found = [base, `${base}.ts`, `${base}/index.ts`].find((path) => /\.ts$/.test(path) &&
|
|
37
|
+
tree.exists(path) &&
|
|
38
|
+
BOOTSTRAP_CALL.test(tree.read(path)?.toString('utf-8') ?? ''));
|
|
39
|
+
if (found) {
|
|
40
|
+
return found;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
return mainPath;
|
|
44
|
+
}
|
|
14
45
|
//# sourceMappingURL=get-main-path.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-main-path.js","sourceRoot":"","sources":["../../../../../../libs/add/schematics/ng-add/utils/get-main-path.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"get-main-path.js","sourceRoot":"","sources":["../../../../../../libs/add/schematics/ng-add/utils/get-main-path.ts"],"names":[],"mappings":";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AM,CAAC,IAAI,CAAC;YACjB,cAAc,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,QAAQ,CAAC,OAAO,CAAC,IAAI,EAAE,CAAC,CAChE,CAAC;QAEF,IAAI,KAAK,EAAE,CAAC;YACV,OAAO,KAAK,CAAC;QACf,CAAC;IACH,CAAC;IAED,OAAO,QAAQ,CAAC;AAClB,CAAC"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { Tree } from '@angular-devkit/schematics';
|
|
2
|
+
/**
|
|
3
|
+
* What `ng add` does with the root component's template:
|
|
4
|
+
* - `replace`: the template is Angular's `ng new` placeholder, empty or only a router outlet, so
|
|
5
|
+
* it is replaced with the NgDoc layout;
|
|
6
|
+
* - `has-layout`: it already renders `ng-doc-root`;
|
|
7
|
+
* - `keep`: it is the application's own (or inline), so it is left as it is and the layout is
|
|
8
|
+
* added by hand, for example in the component of a lazy documentation route;
|
|
9
|
+
* - `missing`: the root component or its template file can't be found.
|
|
10
|
+
*/
|
|
11
|
+
export type LayoutTemplateAction = 'replace' | 'has-layout' | 'keep' | 'missing';
|
|
12
|
+
/** A template that `ng add` replaces with the layout. */
|
|
13
|
+
interface ReplacedLayoutTemplate {
|
|
14
|
+
action: 'replace';
|
|
15
|
+
/** The template file. */
|
|
16
|
+
path: string;
|
|
17
|
+
}
|
|
18
|
+
/** A template that `ng add` leaves as it is, or that it can't find. */
|
|
19
|
+
interface KeptLayoutTemplate {
|
|
20
|
+
action: Exclude<LayoutTemplateAction, 'replace'>;
|
|
21
|
+
/** The template file, unless the template is inline or missing. */
|
|
22
|
+
path?: string;
|
|
23
|
+
}
|
|
24
|
+
/** The root component's template and what `ng add` does with it. */
|
|
25
|
+
export type LayoutTemplate = ReplacedLayoutTemplate | KeptLayoutTemplate;
|
|
26
|
+
/**
|
|
27
|
+
* Decides what `ng add` does with the root component's template. It never replaces a template
|
|
28
|
+
* that the application wrote: only Angular's `ng new` placeholder, an empty template or one that
|
|
29
|
+
* holds only a router outlet. An active ng-morph project must hold the application's sources.
|
|
30
|
+
* @param tree - The workspace tree.
|
|
31
|
+
* @param mainPath - Path of the application's main file.
|
|
32
|
+
*/
|
|
33
|
+
export declare function getLayoutTemplate(tree: Tree, mainPath: string | undefined): LayoutTemplate;
|
|
34
|
+
/**
|
|
35
|
+
* Whether a template holds nothing the application wrote: Angular's `ng new` placeholder, nothing
|
|
36
|
+
* at all, or only a router outlet (which the NgDoc layout keeps).
|
|
37
|
+
* @param content - The template.
|
|
38
|
+
*/
|
|
39
|
+
export declare function isPlaceholderTemplate(content: string): boolean;
|
|
40
|
+
export {};
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getLayoutTemplate = getLayoutTemplate;
|
|
4
|
+
exports.isPlaceholderTemplate = isPlaceholderTemplate;
|
|
5
|
+
const ng_morph_1 = require("ng-morph");
|
|
6
|
+
const get_app_component_1 = require("./get-app-component");
|
|
7
|
+
const get_app_template_path_1 = require("./get-app-template-path");
|
|
8
|
+
const get_initializer_1 = require("./get-initializer");
|
|
9
|
+
/** A line of the comment that `ng new` puts at the top of the placeholder template. */
|
|
10
|
+
const NG_NEW_PLACEHOLDER = 'is only a placeholder';
|
|
11
|
+
/**
|
|
12
|
+
* Decides what `ng add` does with the root component's template. It never replaces a template
|
|
13
|
+
* that the application wrote: only Angular's `ng new` placeholder, an empty template or one that
|
|
14
|
+
* holds only a router outlet. An active ng-morph project must hold the application's sources.
|
|
15
|
+
* @param tree - The workspace tree.
|
|
16
|
+
* @param mainPath - Path of the application's main file.
|
|
17
|
+
*/
|
|
18
|
+
function getLayoutTemplate(tree, mainPath) {
|
|
19
|
+
const appComponent = mainPath
|
|
20
|
+
? (0, get_app_component_1.getAppComponent)(tree, mainPath)
|
|
21
|
+
: undefined;
|
|
22
|
+
if (!mainPath || !ng_morph_1.Node.isClassDeclaration(appComponent)) {
|
|
23
|
+
return { action: 'missing' };
|
|
24
|
+
}
|
|
25
|
+
const inline = (0, get_initializer_1.getInitializer)(appComponent, 'Component', 'template');
|
|
26
|
+
if (inline) {
|
|
27
|
+
return { action: inline.getText().includes('<ng-doc-root') ? 'has-layout' : 'keep' };
|
|
28
|
+
}
|
|
29
|
+
const path = (0, get_app_template_path_1.getAppTemplatePath)(tree, mainPath);
|
|
30
|
+
const content = path ? tree.read(path)?.toString('utf-8') : undefined;
|
|
31
|
+
if (!path || content === undefined) {
|
|
32
|
+
return { action: 'missing' };
|
|
33
|
+
}
|
|
34
|
+
if (content.includes('<ng-doc-root')) {
|
|
35
|
+
return { action: 'has-layout', path };
|
|
36
|
+
}
|
|
37
|
+
return { action: isPlaceholderTemplate(content) ? 'replace' : 'keep', path };
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Whether a template holds nothing the application wrote: Angular's `ng new` placeholder, nothing
|
|
41
|
+
* at all, or only a router outlet (which the NgDoc layout keeps).
|
|
42
|
+
* @param content - The template.
|
|
43
|
+
*/
|
|
44
|
+
function isPlaceholderTemplate(content) {
|
|
45
|
+
if (content.includes(NG_NEW_PLACEHOLDER)) {
|
|
46
|
+
return true;
|
|
47
|
+
}
|
|
48
|
+
const markup = content.replace(/<!--[\s\S]*?-->/g, '').replace(/\s+/g, '');
|
|
49
|
+
return markup === '' || /^<router-outlet(\/>|><\/router-outlet>)$/.test(markup);
|
|
50
|
+
}
|
|
51
|
+
//# sourceMappingURL=layout-template.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"layout-template.js","sourceRoot":"","sources":["../../../../../../libs/add/schematics/ng-add/utils/layout-template.ts"],"names":[],"mappings":";;AA6CA,8CA2BC;AAOD,sDAQC;AAtFD,uCAA8D;AAE9D,2DAAsD;AACtD,mEAA6D;AAC7D,uDAAmD;AA8BnD,uFAAuF;AACvF,MAAM,kBAAkB,GAAG,uBAAuB,CAAC;AAEnD;;;;;;GAMG;AACH,S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qBAAqB,CAAC,OAAe;IACnD,IAAI,OAAO,CAAC,QAAQ,CAAC,kBAAkB,CAAC,EAAE,CAAC;QACzC,OAAO,IAAI,CAAC;IACd,CAAC;IAED,MAAM,MAAM,GAAW,OAAO,CAAC,OAAO,CAAC,kBAAkB,EAAE,EAAE,CAAC,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;IAEnF,OAAO,MAAM,KAAK,EAAE,IAAI,0CAA0C,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;AAClF,CAAC"}
|
|
@@ -4,6 +4,8 @@ import { Tree } from '@angular-devkit/schematics';
|
|
|
4
4
|
import { NgDocEngine } from '../schema';
|
|
5
5
|
/** The command that moves a project from the legacy builders to the Vite engine. */
|
|
6
6
|
export declare const MIGRATE_TO_VITE = "ng g @ng-doc/builder:migrate-to-vite";
|
|
7
|
+
/** The recipe for a project whose builder NgDoc must not replace. */
|
|
8
|
+
export declare const KEEP_ANOTHER_BUILDER_URL = "https://ng-doc.com/docs/build-and-deploy/dev-server-and-builds#keep-another-builder";
|
|
7
9
|
/** The engine `ng add` sets up, and whether the project already had it. */
|
|
8
10
|
export interface EngineChoice {
|
|
9
11
|
engine: NgDocEngine;
|
|
@@ -14,9 +16,25 @@ export interface EngineChoice {
|
|
|
14
16
|
* NgDoc builder is on another target keeps `build` and `serve` as they are.
|
|
15
17
|
*/
|
|
16
18
|
replaceBuilders: boolean;
|
|
19
|
+
/**
|
|
20
|
+
* The builder of `build` or `serve` that NgDoc doesn't replace (native federation, a custom
|
|
21
|
+
* builder). No NgDoc builder is set up then: the project generates its documentation with the
|
|
22
|
+
* `ng-doc` command next to that builder.
|
|
23
|
+
*/
|
|
24
|
+
keptBuilder?: string;
|
|
17
25
|
}
|
|
18
|
-
/**
|
|
26
|
+
/**
|
|
27
|
+
* The application builders whose options the Vite setup reads: Angular's, and Nx's executor that
|
|
28
|
+
* runs Angular's with the same options (the Vite setup reports the few options Nx adds).
|
|
29
|
+
*/
|
|
19
30
|
export declare const ANGULAR_APPLICATION_BUILDERS: string[];
|
|
31
|
+
/**
|
|
32
|
+
* Whether a builder is neither Angular's (or an Nx executor that runs it) nor NgDoc's: NgDoc doesn't
|
|
33
|
+
* know what it does, so it doesn't replace it. Native federation, for example, runs Angular's
|
|
34
|
+
* builder from another target and adds an import map to its output.
|
|
35
|
+
* @param builder - The builder of a target.
|
|
36
|
+
*/
|
|
37
|
+
export declare function isForeignBuilder(builder: string): boolean;
|
|
20
38
|
/**
|
|
21
39
|
* Whether the application bootstraps an NgModule (`bootstrapModule`) instead of a standalone
|
|
22
40
|
* component.
|
|
@@ -27,9 +45,11 @@ export declare function isNgModuleApp(tree: Tree, project: ProjectDefinition): b
|
|
|
27
45
|
/**
|
|
28
46
|
* Chooses the engine to set up. A project that already builds with NgDoc keeps its engine: `ng add`
|
|
29
47
|
* never switches it (the legacy builders move to the Vite engine with `migrate-to-vite`). A new
|
|
30
|
-
* standalone application
|
|
31
|
-
*
|
|
32
|
-
* legacy builders; `--engine vite` is refused for an NgModule
|
|
48
|
+
* standalone application on Angular's application builder (or Nx's executor that runs it) gets the
|
|
49
|
+
* Vite engine unless `--engine legacy` is passed; an NgModule application, or one whose `build`
|
|
50
|
+
* target uses another builder, gets the legacy builders; `--engine vite` is refused for an NgModule
|
|
51
|
+
* application. Without `--engine`, a
|
|
52
|
+
* `build` or `serve` builder that is neither Angular's nor NgDoc's is kept (`keptBuilder`).
|
|
33
53
|
* @param tree - The workspace tree.
|
|
34
54
|
* @param project - The application project.
|
|
35
55
|
* @param requested - The `--engine` option, if any.
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ANGULAR_APPLICATION_BUILDERS = exports.MIGRATE_TO_VITE = void 0;
|
|
3
|
+
exports.ANGULAR_APPLICATION_BUILDERS = exports.KEEP_ANOTHER_BUILDER_URL = exports.MIGRATE_TO_VITE = void 0;
|
|
4
|
+
exports.isForeignBuilder = isForeignBuilder;
|
|
4
5
|
exports.isNgModuleApp = isNgModuleApp;
|
|
5
6
|
exports.selectEngine = selectEngine;
|
|
6
7
|
const schematics_1 = require("@angular-devkit/schematics");
|
|
@@ -10,12 +11,39 @@ const get_main_path_1 = require("./get-main-path");
|
|
|
10
11
|
const get_root_module_1 = require("./get-root-module");
|
|
11
12
|
/** The command that moves a project from the legacy builders to the Vite engine. */
|
|
12
13
|
exports.MIGRATE_TO_VITE = 'ng g @ng-doc/builder:migrate-to-vite';
|
|
13
|
-
/**
|
|
14
|
+
/** The recipe for a project whose builder NgDoc must not replace. */
|
|
15
|
+
exports.KEEP_ANOTHER_BUILDER_URL = 'https://ng-doc.com/docs/build-and-deploy/dev-server-and-builds#keep-another-builder';
|
|
16
|
+
/**
|
|
17
|
+
* The application builders whose options the Vite setup reads: Angular's, and Nx's executor that
|
|
18
|
+
* runs Angular's with the same options (the Vite setup reports the few options Nx adds).
|
|
19
|
+
*/
|
|
14
20
|
exports.ANGULAR_APPLICATION_BUILDERS = [
|
|
15
21
|
'@angular/build:application',
|
|
16
22
|
'@angular-devkit/build-angular:application',
|
|
23
|
+
'@nx/angular:application',
|
|
17
24
|
];
|
|
18
25
|
const NG_DOC_BUILDER_PREFIX = '@ng-doc/builder:';
|
|
26
|
+
/** Angular's builders, which the legacy builders replace. */
|
|
27
|
+
const ANGULAR_BUILDER_PREFIXES = ['@angular/build:', '@angular-devkit/build-angular:'];
|
|
28
|
+
/**
|
|
29
|
+
* Nx's executors that run Angular's builders with the same options, so they are not foreign: the
|
|
30
|
+
* Vite setup reads the options of `application`, and the legacy builders replace them as they
|
|
31
|
+
* replace Angular's.
|
|
32
|
+
*/
|
|
33
|
+
const NX_ANGULAR_BUILDERS = [
|
|
34
|
+
'@nx/angular:application',
|
|
35
|
+
'@nx/angular:browser-esbuild',
|
|
36
|
+
'@nx/angular:dev-server',
|
|
37
|
+
];
|
|
38
|
+
/**
|
|
39
|
+
* Whether a builder is neither Angular's (or an Nx executor that runs it) nor NgDoc's: NgDoc doesn't
|
|
40
|
+
* know what it does, so it doesn't replace it. Native federation, for example, runs Angular's
|
|
41
|
+
* builder from another target and adds an import map to its output.
|
|
42
|
+
* @param builder - The builder of a target.
|
|
43
|
+
*/
|
|
44
|
+
function isForeignBuilder(builder) {
|
|
45
|
+
return (![...ANGULAR_BUILDER_PREFIXES, NG_DOC_BUILDER_PREFIX].some((prefix) => builder.startsWith(prefix)) && !NX_ANGULAR_BUILDERS.includes(builder));
|
|
46
|
+
}
|
|
19
47
|
/**
|
|
20
48
|
* Whether the application bootstraps an NgModule (`bootstrapModule`) instead of a standalone
|
|
21
49
|
* component.
|
|
@@ -25,7 +53,7 @@ const NG_DOC_BUILDER_PREFIX = '@ng-doc/builder:';
|
|
|
25
53
|
function isNgModuleApp(tree, project) {
|
|
26
54
|
// Without a build target there is no entry to look at; the setup reports the missing target.
|
|
27
55
|
const mainPath = project.targets.has('build')
|
|
28
|
-
? (0, get_main_path_1.
|
|
56
|
+
? (0, get_main_path_1.getBootstrapPath)(tree, project)
|
|
29
57
|
: undefined;
|
|
30
58
|
if (!mainPath || !tree.exists(mainPath)) {
|
|
31
59
|
return false;
|
|
@@ -41,9 +69,11 @@ function isNgModuleApp(tree, project) {
|
|
|
41
69
|
/**
|
|
42
70
|
* Chooses the engine to set up. A project that already builds with NgDoc keeps its engine: `ng add`
|
|
43
71
|
* never switches it (the legacy builders move to the Vite engine with `migrate-to-vite`). A new
|
|
44
|
-
* standalone application
|
|
45
|
-
*
|
|
46
|
-
* legacy builders; `--engine vite` is refused for an NgModule
|
|
72
|
+
* standalone application on Angular's application builder (or Nx's executor that runs it) gets the
|
|
73
|
+
* Vite engine unless `--engine legacy` is passed; an NgModule application, or one whose `build`
|
|
74
|
+
* target uses another builder, gets the legacy builders; `--engine vite` is refused for an NgModule
|
|
75
|
+
* application. Without `--engine`, a
|
|
76
|
+
* `build` or `serve` builder that is neither Angular's nor NgDoc's is kept (`keptBuilder`).
|
|
47
77
|
* @param tree - The workspace tree.
|
|
48
78
|
* @param project - The application project.
|
|
49
79
|
* @param requested - The `--engine` option, if any.
|
|
@@ -76,6 +106,18 @@ function selectEngine(tree, project, requested, logger) {
|
|
|
76
106
|
replaceBuilders: !!build?.startsWith(NG_DOC_BUILDER_PREFIX) || !!serve?.startsWith(NG_DOC_BUILDER_PREFIX),
|
|
77
107
|
};
|
|
78
108
|
}
|
|
109
|
+
// A builder NgDoc doesn't know is kept, unless `--engine` asks for NgDoc's builders. The
|
|
110
|
+
// documentation is then generated with the `ng-doc` command next to it.
|
|
111
|
+
const foreign = requested
|
|
112
|
+
? undefined
|
|
113
|
+
: [
|
|
114
|
+
['build', build],
|
|
115
|
+
['serve', serve],
|
|
116
|
+
].find((entry) => !!entry[1] && isForeignBuilder(entry[1]));
|
|
117
|
+
if (foreign) {
|
|
118
|
+
logger.info(`ℹ️ The "${foreign[0]}" target uses "${foreign[1]}", which NgDoc doesn't replace, so the "build" and "serve" builders were kept and no NgDoc builder was set up. Generate the documentation with the "ng-doc" command next to your builder: ${exports.KEEP_ANOTHER_BUILDER_URL}`);
|
|
119
|
+
return { engine: 'legacy', existing: false, replaceBuilders: false, keptBuilder: foreign[1] };
|
|
120
|
+
}
|
|
79
121
|
if (isNgModuleApp(tree, project)) {
|
|
80
122
|
if (requested === 'vite') {
|
|
81
123
|
throw new schematics_1.SchematicsException(`[NGDOC_ADD_ENGINE] "ng add" sets up the Vite engine for standalone applications (bootstrapApplication), and this application bootstraps an NgModule. Run "ng add @ng-doc/add --engine legacy", then "${exports.MIGRATE_TO_VITE}" if you want the Vite engine.`);
|
|
@@ -86,7 +128,7 @@ function selectEngine(tree, project, requested, logger) {
|
|
|
86
128
|
return { engine: 'legacy', existing: false, replaceBuilders: true };
|
|
87
129
|
}
|
|
88
130
|
// The Vite setup reads the options of Angular's application builder. Without `--engine`, another
|
|
89
|
-
// builder (a browser builder,
|
|
131
|
+
// builder (a browser builder, Nx's `browser-esbuild`) gets the legacy builders, as before; an
|
|
90
132
|
// explicit `--engine vite` goes on to the Vite setup, which refuses it and says why.
|
|
91
133
|
if (requested === undefined && !exports.ANGULAR_APPLICATION_BUILDERS.includes(build ?? '')) {
|
|
92
134
|
logger.info(`ℹ️ The "build" target uses ${build ? `"${build}"` : 'no builder'}, not Angular's application builder, so NgDoc uses the legacy builders.`);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"select-engine.js","sourceRoot":"","sources":["../../../../../../libs/add/schematics/ng-add/utils/select-engine.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"select-engine.js","sourceRoot":"","sources":["../../../../../../libs/add/schematics/ng-add/utils/select-engine.ts"],"names":[],"mappings":";;;AAmEA,4CAMC;AAQD,sCAiBC;AAeD,oCAwFC;AAvMD,2DAAuE;AACvE,uCAA+E;AAG/E,yEAAsE;AACtE,mDAAmD;AACnD,uDAAyD;AAEzD,oFAAoF;AACvE,QAAA,eAAe,GAAG,sCAAsC,CAAC;AAEtE,qEAAqE;AACxD,QAAA,wBAAwB,GACnC,qFAAqF,CAAC;AAoBxF;;;GAGG;AACU,QAAA,4BAA4B,GAAa;IACpD,4BAA4B;IAC5B,2CAA2C;IAC3C,yBAAyB;CAC1B,CAAC;AAEF,MAAM,qBAAqB,GAAG,kBAAkB,CAAC;AAEjD,6DAA6D;AAC7D,MAAM,wBAAwB,GAAa,CAAC,iBAAiB,EAAE,gCAAgC,CAAC,CAAC;AAEjG;;;;GAIG;AACH,MAAM,mBAAmB,GAAa;IACpC,yBAAyB;IACzB,6BAA6B;IAC7B,wBAAwB;CACzB,CAAC;AAEF;;;;;GAKG;AACH,SAAgB,gBAAgB,CAAC,OAAe;IAC9C,OAAO,CACL,CAAC,CAAC,GAAG,wBAAwB,EAAE,qBAAqB,CAAC,CAAC,IAAI,CAAC,CAAC,MAAc,EAAE,EAAE,CAC5E,OAAO,CAAC,UAAU,CAAC,MAAM,CAAC,CAC3B,IAAI,CAAC,mBA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