@ng-doc/app 15.0.0-beta.6 → 15.0.0-beta.8
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/esm2020/classes/root-page/root-page.mjs +1 -1
- package/esm2020/components/api-list/api-list.component.mjs +1 -1
- package/esm2020/components/api-list/index.mjs +1 -1
- package/esm2020/components/code/index.mjs +1 -1
- package/esm2020/components/index.mjs +1 -1
- package/esm2020/components/kind-icon/kind-icon.component.mjs +1 -1
- package/esm2020/components/navbar/index.mjs +1 -1
- package/esm2020/components/navbar/navbar.component.mjs +3 -3
- package/esm2020/components/navbar/navbar.module.mjs +1 -1
- package/esm2020/components/page/index.mjs +1 -1
- package/esm2020/components/page/page.component.mjs +3 -3
- package/esm2020/components/page/page.module.mjs +1 -1
- package/esm2020/components/page-map/page-map-element/page-map-element.component.mjs +1 -1
- package/esm2020/components/playground/index.mjs +1 -1
- package/esm2020/components/root/index.mjs +1 -1
- package/esm2020/components/root/root.component.mjs +3 -3
- package/esm2020/components/root/root.module.mjs +1 -1
- package/esm2020/components/search/search.component.mjs +3 -3
- package/esm2020/components/search/search.module.mjs +1 -1
- package/esm2020/components/sidebar/index.mjs +1 -1
- package/esm2020/components/sidebar/sidebar.component.mjs +1 -1
- package/esm2020/directives/code-highlighter/code-highlighter.directive.mjs +1 -1
- package/esm2020/directives/code-highlighter/code-highlighter.module.mjs +1 -1
- package/esm2020/directives/code-highlighter/index.mjs +1 -1
- package/esm2020/helpers/as-boolean/as-boolean.mjs +1 -1
- package/esm2020/helpers/is-external-link/is-external-link.mjs +1 -1
- package/esm2020/index.mjs +1 -1
- package/esm2020/interfaces/context.mjs +1 -1
- package/esm2020/interfaces/demo-assets.mjs +1 -1
- package/esm2020/interfaces/navigation.mjs +1 -1
- package/esm2020/interfaces/processor-options.mjs +1 -1
- package/esm2020/modules/index.mjs +1 -1
- package/esm2020/modules/root/index.mjs +1 -1
- package/esm2020/modules/root/ng-doc.module.mjs +6 -4
- package/esm2020/processors/code-processor/index.mjs +1 -1
- package/esm2020/processors/demo-processor/index.mjs +1 -1
- package/esm2020/processors/html-processor/index.mjs +1 -1
- package/esm2020/processors/playground-processor/index.mjs +1 -1
- package/esm2020/services/index.mjs +1 -1
- package/esm2020/services/sidebar/index.mjs +1 -1
- package/esm2020/services/sidebar/sidebar.service.mjs +1 -1
- package/esm2020/tokens/context.mjs +1 -1
- package/esm2020/type-controls/type-alias-control/type-alias-control.component.mjs +1 -1
- package/fesm2015/ng-doc-app-classes-root-page.mjs.map +1 -1
- package/fesm2015/ng-doc-app-components-api-list.mjs.map +1 -1
- package/fesm2015/ng-doc-app-components-kind-icon.mjs.map +1 -1
- package/fesm2015/ng-doc-app-components-navbar.mjs +2 -2
- package/fesm2015/ng-doc-app-components-navbar.mjs.map +1 -1
- package/fesm2015/ng-doc-app-components-page-map.mjs.map +1 -1
- package/fesm2015/ng-doc-app-components-page.mjs +2 -2
- package/fesm2015/ng-doc-app-components-page.mjs.map +1 -1
- package/fesm2015/ng-doc-app-components-root.mjs +2 -2
- package/fesm2015/ng-doc-app-components-root.mjs.map +1 -1
- package/fesm2015/ng-doc-app-components-search.mjs +2 -2
- package/fesm2015/ng-doc-app-components-search.mjs.map +1 -1
- package/fesm2015/ng-doc-app-components-sidebar.mjs.map +1 -1
- package/fesm2015/ng-doc-app-directives-code-highlighter.mjs.map +1 -1
- package/fesm2015/ng-doc-app-helpers-as-boolean.mjs.map +1 -1
- package/fesm2015/ng-doc-app-helpers-is-external-link.mjs.map +1 -1
- package/fesm2015/ng-doc-app-modules-root.mjs +5 -3
- package/fesm2015/ng-doc-app-modules-root.mjs.map +1 -1
- package/fesm2015/ng-doc-app-services-sidebar.mjs.map +1 -1
- package/fesm2015/ng-doc-app-tokens.mjs.map +1 -1
- package/fesm2015/ng-doc-app-type-controls-type-alias-control.mjs.map +1 -1
- package/fesm2020/ng-doc-app-classes-root-page.mjs.map +1 -1
- package/fesm2020/ng-doc-app-components-api-list.mjs.map +1 -1
- package/fesm2020/ng-doc-app-components-kind-icon.mjs.map +1 -1
- package/fesm2020/ng-doc-app-components-navbar.mjs +2 -2
- package/fesm2020/ng-doc-app-components-navbar.mjs.map +1 -1
- package/fesm2020/ng-doc-app-components-page-map.mjs.map +1 -1
- package/fesm2020/ng-doc-app-components-page.mjs +2 -2
- package/fesm2020/ng-doc-app-components-page.mjs.map +1 -1
- package/fesm2020/ng-doc-app-components-root.mjs +2 -2
- package/fesm2020/ng-doc-app-components-root.mjs.map +1 -1
- package/fesm2020/ng-doc-app-components-search.mjs +2 -2
- package/fesm2020/ng-doc-app-components-search.mjs.map +1 -1
- package/fesm2020/ng-doc-app-components-sidebar.mjs.map +1 -1
- package/fesm2020/ng-doc-app-directives-code-highlighter.mjs.map +1 -1
- package/fesm2020/ng-doc-app-helpers-as-boolean.mjs.map +1 -1
- package/fesm2020/ng-doc-app-helpers-is-external-link.mjs.map +1 -1
- package/fesm2020/ng-doc-app-modules-root.mjs +5 -3
- package/fesm2020/ng-doc-app-modules-root.mjs.map +1 -1
- package/fesm2020/ng-doc-app-services-sidebar.mjs.map +1 -1
- package/fesm2020/ng-doc-app-tokens.mjs.map +1 -1
- package/fesm2020/ng-doc-app-type-controls-type-alias-control.mjs.map +1 -1
- package/modules/root/ng-doc.module.d.ts +3 -1
- package/package.json +1 -1
- package/schematics/collection.json +0 -10
- package/schematics/index.d.ts +0 -0
- package/schematics/index.js +0 -2
- package/schematics/index.js.map +0 -1
- package/schematics/ng-add/constants/app-component-content.d.ts +0 -1
- package/schematics/ng-add/constants/app-component-content.js +0 -15
- package/schematics/ng-add/constants/app-component-content.js.map +0 -1
- package/schematics/ng-add/constants/assets.d.ts +0 -5
- package/schematics/ng-add/constants/assets.js +0 -21
- package/schematics/ng-add/constants/assets.js.map +0 -1
- package/schematics/ng-add/constants/modules.d.ts +0 -9
- package/schematics/ng-add/constants/modules.js +0 -32
- package/schematics/ng-add/constants/modules.js.map +0 -1
- package/schematics/ng-add/constants/styles.d.ts +0 -1
- package/schematics/ng-add/constants/styles.js +0 -9
- package/schematics/ng-add/constants/styles.js.map +0 -1
- package/schematics/ng-add/constants/version.d.ts +0 -1
- package/schematics/ng-add/constants/version.js +0 -6
- package/schematics/ng-add/constants/version.js.map +0 -1
- package/schematics/ng-add/index.d.ts +0 -7
- package/schematics/ng-add/index.js +0 -34
- package/schematics/ng-add/index.js.map +0 -1
- package/schematics/ng-add/schema.d.ts +0 -3
- package/schematics/ng-add/schema.js +0 -3
- package/schematics/ng-add/schema.js.map +0 -1
- package/schematics/ng-add/schema.json +0 -16
- package/schematics/ng-add/steps/add-assets.d.ts +0 -8
- package/schematics/ng-add/steps/add-assets.js +0 -31
- package/schematics/ng-add/steps/add-assets.js.map +0 -1
- package/schematics/ng-add/steps/add-layout.d.ts +0 -7
- package/schematics/ng-add/steps/add-layout.js +0 -47
- package/schematics/ng-add/steps/add-layout.js.map +0 -1
- package/schematics/ng-add/steps/add-ng-doc-modules.d.ts +0 -7
- package/schematics/ng-add/steps/add-ng-doc-modules.js +0 -53
- package/schematics/ng-add/steps/add-ng-doc-modules.js.map +0 -1
- package/schematics/ng-add/steps/add-styles.d.ts +0 -8
- package/schematics/ng-add/steps/add-styles.js +0 -31
- package/schematics/ng-add/steps/add-styles.js.map +0 -1
- package/schematics/ng-add/steps/replace-builders.d.ts +0 -8
- package/schematics/ng-add/steps/replace-builders.js +0 -36
- package/schematics/ng-add/steps/replace-builders.js.map +0 -1
- package/schematics/ng-add/testing/ng-add.spec.d.ts +0 -1
- package/schematics/ng-add/testing/ng-add.spec.js +0 -156
- package/schematics/ng-add/testing/ng-add.spec.js.map +0 -1
- package/schematics/ng-add/utils/add-unique-import.d.ts +0 -7
- package/schematics/ng-add/utils/add-unique-import.js +0 -37
- package/schematics/ng-add/utils/add-unique-import.js.map +0 -1
- package/schematics/ng-add/utils/create-angular-json.d.ts +0 -4
- package/schematics/ng-add/utils/create-angular-json.js +0 -36
- package/schematics/ng-add/utils/create-angular-json.js.map +0 -1
- package/schematics/ng-add/utils/get-app-template-path.d.ts +0 -12
- package/schematics/ng-add/utils/get-app-template-path.js +0 -35
- package/schematics/ng-add/utils/get-app-template-path.js.map +0 -1
- package/schematics/ng-add/utils/get-initializer.d.ts +0 -8
- package/schematics/ng-add/utils/get-initializer.js +0 -27
- package/schematics/ng-add/utils/get-initializer.js.map +0 -1
- package/schematics/ng-add/utils/get-project.d.ts +0 -8
- package/schematics/ng-add/utils/get-project.js +0 -16
- package/schematics/ng-add/utils/get-project.js.map +0 -1
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ngAdd = void 0;
|
|
4
|
-
const schematics_1 = require("@angular-devkit/schematics");
|
|
5
|
-
const tasks_1 = require("@angular-devkit/schematics/tasks");
|
|
6
|
-
const ng_morph_1 = require("ng-morph");
|
|
7
|
-
const version_1 = require("./constants/version");
|
|
8
|
-
const add_assets_1 = require("./steps/add-assets");
|
|
9
|
-
const add_layout_1 = require("./steps/add-layout");
|
|
10
|
-
const add_ng_doc_modules_1 = require("./steps/add-ng-doc-modules");
|
|
11
|
-
const add_styles_1 = require("./steps/add-styles");
|
|
12
|
-
const replace_builders_1 = require("./steps/replace-builders");
|
|
13
|
-
/**
|
|
14
|
-
*
|
|
15
|
-
* @param options
|
|
16
|
-
*/
|
|
17
|
-
function ngAdd(options) {
|
|
18
|
-
return (tree, context) => {
|
|
19
|
-
(0, ng_morph_1.setActiveProject)((0, ng_morph_1.createProject)(tree, '/', ['**/*.ts', '**/*.json']));
|
|
20
|
-
(0, ng_morph_1.addPackageJsonDependency)(tree, { name: `@ng-doc/builder`, version: version_1.NG_DOC_VERSION });
|
|
21
|
-
(0, ng_morph_1.addPackageJsonDependency)(tree, { name: `@ng-doc/ui-kit`, version: version_1.NG_DOC_VERSION });
|
|
22
|
-
(0, ng_morph_1.addPackageJsonDependency)(tree, { name: `@ng-doc/core`, version: version_1.NG_DOC_VERSION });
|
|
23
|
-
context.addTask(new tasks_1.NodePackageInstallTask(), []);
|
|
24
|
-
return (0, schematics_1.chain)([
|
|
25
|
-
(0, replace_builders_1.replaceBuilders)(options, context),
|
|
26
|
-
(0, add_styles_1.addStyles)(options, context),
|
|
27
|
-
(0, add_assets_1.addAssets)(options, context),
|
|
28
|
-
(0, add_ng_doc_modules_1.addNgDocModules)(options),
|
|
29
|
-
(0, add_layout_1.addLayout)(options),
|
|
30
|
-
]);
|
|
31
|
-
};
|
|
32
|
-
}
|
|
33
|
-
exports.ngAdd = ngAdd;
|
|
34
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../libs/app/schematics/ng-add/index.ts"],"names":[],"mappings":";;;AAAA,2DAA+E;AAC/E,4DAAwE;AACxE,uCAAmF;AAEnF,iDAAmD;AAEnD,mDAA6C;AAC7C,mDAA6C;AAC7C,mEAA2D;AAC3D,mDAA6C;AAC7C,+DAAyD;AAEzD;;;GAGG;AACH,SAAgB,KAAK,CAAC,OAAe;IACpC,OAAO,CAAC,IAAU,EAAE,OAAyB,EAAE,EAAE;QAChD,IAAA,2BAAgB,EAAC,IAAA,wBAAa,EAAC,IAAI,EAAE,GAAG,EAAE,CAAC,SAAS,EAAE,WAAW,CAAC,CAAC,CAAC,CAAC;QAErE,IAAA,mCAAwB,EAAC,IAAI,EAAE,EAAC,IAAI,EAAE,iBAAiB,EAAE,OAAO,EAAE,wBAAc,EAAC,CAAC,CAAC;QACnF,IAAA,mCAAwB,EAAC,IAAI,EAAE,EAAC,IAAI,EAAE,gBAAgB,EAAE,OAAO,EAAE,wBAAc,EAAC,CAAC,CAAC;QAClF,IAAA,mCAAwB,EAAC,IAAI,EAAE,EAAC,IAAI,EAAE,cAAc,EAAE,OAAO,EAAE,wBAAc,EAAC,CAAC,CAAC;QAEhF,OAAO,CAAC,OAAO,CAAC,IAAI,8BAAsB,EAAE,EAAE,EAAE,CAAC,CAAC;QAElD,OAAO,IAAA,kBAAK,EAAC;YACZ,IAAA,kCAAe,EAAC,OAAO,EAAE,OAAO,CAAC;YACjC,IAAA,sBAAS,EAAC,OAAO,EAAE,OAAO,CAAC;YAC3B,IAAA,sBAAS,EAAC,OAAO,EAAE,OAAO,CAAC;YAC3B,IAAA,oCAAe,EAAC,OAAO,CAAC;YACxB,IAAA,sBAAS,EAAC,OAAO,CAAC;SAClB,CAAC,CAAC;IACJ,CAAC,CAAC;AACH,CAAC;AAlBD,sBAkBC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"schema.js","sourceRoot":"","sources":["../../../../../libs/app/schematics/ng-add/schema.ts"],"names":[],"mappings":""}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"$schema": "http://json-schema.org/draft-07/schema",
|
|
3
|
-
"$id": "ng-doc-ng-add",
|
|
4
|
-
"title": "NgDoc ng-add",
|
|
5
|
-
"type": "object",
|
|
6
|
-
"properties": {
|
|
7
|
-
"project": {
|
|
8
|
-
"type": "string",
|
|
9
|
-
"description": "The name of the project.",
|
|
10
|
-
"$default": {
|
|
11
|
-
"$source": "projectName"
|
|
12
|
-
}
|
|
13
|
-
}
|
|
14
|
-
},
|
|
15
|
-
"required": []
|
|
16
|
-
}
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.addAssets = void 0;
|
|
4
|
-
const schematics_1 = require("@angular/cdk/schematics");
|
|
5
|
-
const workspace_1 = require("@schematics/angular/utility/workspace");
|
|
6
|
-
const assets_1 = require("../constants/assets");
|
|
7
|
-
const get_project_1 = require("../utils/get-project");
|
|
8
|
-
/**
|
|
9
|
-
*
|
|
10
|
-
* @param options
|
|
11
|
-
* @param context
|
|
12
|
-
*/
|
|
13
|
-
function addAssets(options, context) {
|
|
14
|
-
return (0, workspace_1.updateWorkspace)((workspace) => {
|
|
15
|
-
context.logger.info(`[INFO]: Adding global assets...`);
|
|
16
|
-
const project = (0, get_project_1.getProject)(options, workspace);
|
|
17
|
-
if (!project) {
|
|
18
|
-
context.logger.warn(`[WARNING]: Target project not found.`);
|
|
19
|
-
return;
|
|
20
|
-
}
|
|
21
|
-
const targetOptions = (0, schematics_1.getProjectTargetOptions)(project, 'build');
|
|
22
|
-
const assets = targetOptions['assets'];
|
|
23
|
-
if (!assets) {
|
|
24
|
-
targetOptions['assets'] = assets_1.NG_DOC_ASSETS;
|
|
25
|
-
return;
|
|
26
|
-
}
|
|
27
|
-
targetOptions['assets'] = Array.from(new Set([...assets_1.NG_DOC_ASSETS, ...assets]));
|
|
28
|
-
});
|
|
29
|
-
}
|
|
30
|
-
exports.addAssets = addAssets;
|
|
31
|
-
//# sourceMappingURL=add-assets.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"add-assets.js","sourceRoot":"","sources":["../../../../../../libs/app/schematics/ng-add/steps/add-assets.ts"],"names":[],"mappings":";;;AAAA,wDAAgE;AAGhE,qEAA8G;AAE9G,gDAAkD;AAElD,sDAAgD;AAEhD;;;;GAIG;AACH,SAAgB,SAAS,CAAC,OAAe,EAAE,OAAyB;IACnE,OAAO,IAAA,2BAAe,EAAC,CAAC,SAA8B,EAAE,EAAE;QACzD,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,iCAAiC,CAAC,CAAC;QAEvD,MAAM,OAAO,GAAkC,IAAA,wBAAU,EAAC,OAAO,EAAE,SAAS,CAAC,CAAC;QAE9E,IAAI,CAAC,OAAO,EAAE;YACb,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,sCAAsC,CAAC,CAAC;YAC5D,OAAO;SACP;QAED,MAAM,aAAa,GAA8B,IAAA,oCAAuB,EAAC,OAAO,EAAE,OAAO,CAAC,CAAC;QAE3F,MAAM,MAAM,GAA0B,aAAa,CAAC,QAAQ,CAA0B,CAAC;QAEvF,IAAI,CAAC,MAAM,EAAE;YACZ,aAAa,CAAC,QAAQ,CAAC,GAAG,sBAAa,CAAC;YACxC,OAAO;SACP;QAED,aAAa,CAAC,QAAQ,CAAC,GAAG,KAAK,CAAC,IAAI,CAAC,IAAI,GAAG,CAAC,CAAC,GAAG,sBAAa,EAAE,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC;IAC9E,CAAC,CAAC,CAAC;AACJ,CAAC;AAtBD,8BAsBC"}
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.addLayout = void 0;
|
|
13
|
-
const schematics_1 = require("@angular/cdk/schematics");
|
|
14
|
-
const workspace_1 = require("@nrwl/workspace");
|
|
15
|
-
const app_component_content_1 = require("../constants/app-component-content");
|
|
16
|
-
const get_app_template_path_1 = require("../utils/get-app-template-path");
|
|
17
|
-
const get_project_1 = require("../utils/get-project");
|
|
18
|
-
/**
|
|
19
|
-
*
|
|
20
|
-
* @param options
|
|
21
|
-
*/
|
|
22
|
-
function addLayout(options) {
|
|
23
|
-
return (tree, context) => __awaiter(this, void 0, void 0, function* () {
|
|
24
|
-
context.logger.info(`[INFO]: Adding NgDocLayour to the root component...`);
|
|
25
|
-
const workspace = yield (0, workspace_1.getWorkspace)(tree);
|
|
26
|
-
const project = (0, get_project_1.getProject)(options, workspace);
|
|
27
|
-
if (!project) {
|
|
28
|
-
return;
|
|
29
|
-
}
|
|
30
|
-
const buildOptions = (0, schematics_1.getProjectTargetOptions)(project, 'build');
|
|
31
|
-
const appTemplatePath = (0, get_app_template_path_1.getAppTemplatePath)(tree, buildOptions['main']);
|
|
32
|
-
if (!appTemplatePath) {
|
|
33
|
-
context.logger.error('Could not find the default main template file for this project.');
|
|
34
|
-
return;
|
|
35
|
-
}
|
|
36
|
-
const html = tree.read(appTemplatePath);
|
|
37
|
-
if (html) {
|
|
38
|
-
const recorder = tree.beginUpdate(appTemplatePath);
|
|
39
|
-
recorder.remove(0, html.length);
|
|
40
|
-
recorder.insertLeft(0, app_component_content_1.APP_COMPONENT_CONTENT);
|
|
41
|
-
tree.commitUpdate(recorder);
|
|
42
|
-
context.logger.info(`Content of the app component was replaced with ng-doc layout.`);
|
|
43
|
-
}
|
|
44
|
-
});
|
|
45
|
-
}
|
|
46
|
-
exports.addLayout = addLayout;
|
|
47
|
-
//# sourceMappingURL=add-layout.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"add-layout.js","sourceRoot":"","sources":["../../../../../../libs/app/schematics/ng-add/steps/add-layout.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,wDAAgE;AAIhE,+CAA6C;AAE7C,8EAAyE;AAEzE,0EAAkE;AAClE,sDAAgD;AAEhD;;;GAGG;AACH,SAAgB,SAAS,CAAC,OAAe;IACxC,OAAO,CAAO,IAAU,EAAE,OAAyB,EAAE,EAAE;QACtD,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,qDAAqD,CAAC,CAAC;QAE3E,MAAM,SAAS,GAAwB,MAAM,IAAA,wBAAY,EAAC,IAAI,CAAC,CAAC;QAChE,MAAM,OAAO,GAAkC,IAAA,wBAAU,EAAC,OAAO,EAAE,SAAS,CAAC,CAAC;QAE9E,IAAI,CAAC,OAAO,EAAE;YACb,OAAO;SACP;QAED,MAAM,YAAY,GAA8B,IAAA,oCAAuB,EAAC,OAAO,EAAE,OAAO,CAAC,CAAC;QAE1F,MAAM,eAAe,GAAuB,IAAA,0CAAkB,EAAC,IAAI,EAAE,YAAY,CAAC,MAAM,CAAW,CAAC,CAAC;QAErG,IAAI,CAAC,eAAe,EAAE;YACrB,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,iEAAiE,CAAC,CAAC;YAExF,OAAO;SACP;QAED,MAAM,IAAI,GAAkB,IAAI,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC;QAEvD,IAAI,IAAI,EAAE;YACT,MAAM,QAAQ,GAAmB,IAAI,CAAC,WAAW,CAAC,eAAe,CAAC,CAAC;YAEnE,QAAQ,CAAC,MAAM,CAAC,CAAC,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC;YAChC,QAAQ,CAAC,UAAU,CAAC,CAAC,EAAE,6CAAqB,CAAC,CAAC;YAC9C,IAAI,CAAC,YAAY,CAAC,QAAQ,CAAC,CAAC;YAE5B,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,+DAA+D,CAAC,CAAC;SACrF;IACF,CAAC,CAAA,CAAC;AACH,CAAC;AAjCD,8BAiCC"}
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.addNgDocModules = void 0;
|
|
13
|
-
const schematics_1 = require("@angular/cdk/schematics");
|
|
14
|
-
const workspace_1 = require("@schematics/angular/utility/workspace");
|
|
15
|
-
const ng_morph_1 = require("ng-morph");
|
|
16
|
-
const modules_1 = require("../constants/modules");
|
|
17
|
-
const add_unique_import_1 = require("../utils/add-unique-import");
|
|
18
|
-
const get_project_1 = require("../utils/get-project");
|
|
19
|
-
/**
|
|
20
|
-
*
|
|
21
|
-
* @param options
|
|
22
|
-
*/
|
|
23
|
-
function addNgDocModules(options) {
|
|
24
|
-
return (tree, context) => __awaiter(this, void 0, void 0, function* () {
|
|
25
|
-
context.logger.info(`[INFO]: Adding NgDoc modules to the root module...`);
|
|
26
|
-
const workspace = yield (0, workspace_1.getWorkspace)(tree);
|
|
27
|
-
const project = (0, get_project_1.getProject)(options, workspace);
|
|
28
|
-
if (!project) {
|
|
29
|
-
context.logger.warn('[WARNING]: Target project not found in current workspace');
|
|
30
|
-
return;
|
|
31
|
-
}
|
|
32
|
-
const buildOptions = (0, schematics_1.getProjectTargetOptions)(project, 'build');
|
|
33
|
-
(0, ng_morph_1.setActiveProject)((0, ng_morph_1.createProject)(tree, '/', ['**/*.ts', '**/*.json']));
|
|
34
|
-
const mainModule = (0, ng_morph_1.getMainModule)(buildOptions['main']);
|
|
35
|
-
importMainModules(mainModule);
|
|
36
|
-
(0, ng_morph_1.saveActiveProject)();
|
|
37
|
-
});
|
|
38
|
-
}
|
|
39
|
-
exports.addNgDocModules = addNgDocModules;
|
|
40
|
-
/**
|
|
41
|
-
*
|
|
42
|
-
* @param mainModule
|
|
43
|
-
*/
|
|
44
|
-
function importMainModules(mainModule) {
|
|
45
|
-
const mainModulePath = mainModule.getSourceFile().getFilePath();
|
|
46
|
-
modules_1.MAIN_MODULES.forEach((module) => {
|
|
47
|
-
(0, ng_morph_1.addImportToNgModule)(mainModule, module.initializer, { unique: true });
|
|
48
|
-
module.imports.forEach((moduleImport) => {
|
|
49
|
-
(0, add_unique_import_1.addUniqueImport)(mainModulePath, moduleImport.name, moduleImport.path);
|
|
50
|
-
});
|
|
51
|
-
});
|
|
52
|
-
}
|
|
53
|
-
//# sourceMappingURL=add-ng-doc-modules.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"add-ng-doc-modules.js","sourceRoot":"","sources":["../../../../../../libs/app/schematics/ng-add/steps/add-ng-doc-modules.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,wDAAgE;AAIhE,qEAAmE;AACnE,uCAOkB;AAElB,kDAA8E;AAE9E,kEAA2D;AAC3D,sDAAgD;AAEhD;;;GAGG;AACH,SAAgB,eAAe,CAAC,OAAe;IAC9C,OAAO,CAAO,IAAU,EAAE,OAAyB,EAAE,EAAE;QACtD,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,oDAAoD,CAAC,CAAC;QAE1E,MAAM,SAAS,GAAwB,MAAM,IAAA,wBAAY,EAAC,IAAI,CAAC,CAAC;QAChE,MAAM,OAAO,GAAkC,IAAA,wBAAU,EAAC,OAAO,EAAE,SAAS,CAAC,CAAC;QAE9E,IAAI,CAAC,OAAO,EAAE;YACb,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,0DAA0D,CAAC,CAAC;YAChF,OAAO;SACP;QAED,MAAM,YAAY,GAA8B,IAAA,oCAAuB,EAAC,OAAO,EAAE,OAAO,CAAC,CAAC;QAE1F,IAAA,2BAAgB,EAAC,IAAA,wBAAa,EAAC,IAAI,EAAE,GAAG,EAAE,CAAC,SAAS,EAAE,WAAW,CAAC,CAAC,CAAC,CAAC;QAErE,MAAM,UAAU,GAAqB,IAAA,wBAAa,EAAC,YAAY,CAAC,MAAM,CAAW,CAAC,CAAC;QAEnF,iBAAiB,CAAC,UAAU,CAAC,CAAC;QAE9B,IAAA,4BAAiB,GAAE,CAAC;IACrB,CAAC,CAAA,CAAC;AACH,CAAC;AAtBD,0CAsBC;AAED;;;GAGG;AACH,SAAS,iBAAiB,CAAC,UAA4B;IACtD,MAAM,cAAc,GAAW,UAAU,CAAC,aAAa,EAAE,CAAC,WAAW,EAAE,CAAC;IAExE,sBAAY,CAAC,OAAO,CAAC,CAAC,MAAoB,EAAE,EAAE;QAC7C,IAAA,8BAAmB,EAAC,UAAU,EAAE,MAAM,CAAC,WAAW,EAAE,EAAC,MAAM,EAAE,IAAI,EAAC,CAAC,CAAC;QAEpE,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,YAA0B,EAAE,EAAE;YACrD,IAAA,mCAAe,EAAC,cAAc,EAAE,YAAY,CAAC,IAAI,EAAE,YAAY,CAAC,IAAI,CAAC,CAAC;QACvE,CAAC,CAAC,CAAC;IACJ,CAAC,CAAC,CAAC;AACJ,CAAC"}
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.addStyles = void 0;
|
|
4
|
-
const schematics_1 = require("@angular/cdk/schematics");
|
|
5
|
-
const workspace_1 = require("@schematics/angular/utility/workspace");
|
|
6
|
-
const styles_1 = require("../constants/styles");
|
|
7
|
-
const get_project_1 = require("../utils/get-project");
|
|
8
|
-
/**
|
|
9
|
-
*
|
|
10
|
-
* @param options
|
|
11
|
-
* @param context
|
|
12
|
-
*/
|
|
13
|
-
function addStyles(options, context) {
|
|
14
|
-
return (0, workspace_1.updateWorkspace)((workspace) => {
|
|
15
|
-
context.logger.info(`[INFO]: Adding global styles...`);
|
|
16
|
-
const project = (0, get_project_1.getProject)(options, workspace);
|
|
17
|
-
if (!project) {
|
|
18
|
-
context.logger.warn(`[WARNING]: Target project not found.`);
|
|
19
|
-
return;
|
|
20
|
-
}
|
|
21
|
-
const targetOptions = (0, schematics_1.getProjectTargetOptions)(project, 'build');
|
|
22
|
-
const styles = targetOptions['styles'];
|
|
23
|
-
if (!styles) {
|
|
24
|
-
targetOptions['styles'] = styles_1.NG_DOC_STYLES;
|
|
25
|
-
return;
|
|
26
|
-
}
|
|
27
|
-
targetOptions['styles'] = Array.from(new Set([...styles_1.NG_DOC_STYLES, ...styles]));
|
|
28
|
-
});
|
|
29
|
-
}
|
|
30
|
-
exports.addStyles = addStyles;
|
|
31
|
-
//# sourceMappingURL=add-styles.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"add-styles.js","sourceRoot":"","sources":["../../../../../../libs/app/schematics/ng-add/steps/add-styles.ts"],"names":[],"mappings":";;;AAAA,wDAAgE;AAGhE,qEAA8G;AAE9G,gDAAkD;AAElD,sDAAgD;AAEhD;;;;GAIG;AACH,SAAgB,SAAS,CAAC,OAAe,EAAE,OAAyB;IACnE,OAAO,IAAA,2BAAe,EAAC,CAAC,SAA8B,EAAE,EAAE;QACzD,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,iCAAiC,CAAC,CAAC;QAEvD,MAAM,OAAO,GAAkC,IAAA,wBAAU,EAAC,OAAO,EAAE,SAAS,CAAC,CAAC;QAE9E,IAAI,CAAC,OAAO,EAAE;YACb,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,sCAAsC,CAAC,CAAC;YAC5D,OAAO;SACP;QAED,MAAM,aAAa,GAA8B,IAAA,oCAAuB,EAAC,OAAO,EAAE,OAAO,CAAC,CAAC;QAE3F,MAAM,MAAM,GAA0B,aAAa,CAAC,QAAQ,CAA0B,CAAC;QAEvF,IAAI,CAAC,MAAM,EAAE;YACZ,aAAa,CAAC,QAAQ,CAAC,GAAG,sBAAa,CAAC;YACxC,OAAO;SACP;QAED,aAAa,CAAC,QAAQ,CAAC,GAAG,KAAK,CAAC,IAAI,CAAC,IAAI,GAAG,CAAC,CAAC,GAAG,sBAAa,EAAE,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC;IAC9E,CAAC,CAAC,CAAC;AACJ,CAAC;AAtBD,8BAsBC"}
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.replaceBuilders = void 0;
|
|
4
|
-
const workspace_1 = require("@schematics/angular/utility/workspace");
|
|
5
|
-
const get_project_1 = require("../utils/get-project");
|
|
6
|
-
/**
|
|
7
|
-
*
|
|
8
|
-
* @param options
|
|
9
|
-
* @param context
|
|
10
|
-
*/
|
|
11
|
-
function replaceBuilders(options, context) {
|
|
12
|
-
return (0, workspace_1.updateWorkspace)((workspace) => {
|
|
13
|
-
context.logger.info(`[INFO]: Replacing default builders...`);
|
|
14
|
-
const project = (0, get_project_1.getProject)(options, workspace);
|
|
15
|
-
if (!project) {
|
|
16
|
-
context.logger.warn(`[WARNING]: Target project not found.`);
|
|
17
|
-
return;
|
|
18
|
-
}
|
|
19
|
-
const buildTarget = project.targets.get('build');
|
|
20
|
-
const serveTarget = project.targets.get('serve');
|
|
21
|
-
if (buildTarget) {
|
|
22
|
-
buildTarget.builder = '@ng-doc/builder:browser';
|
|
23
|
-
}
|
|
24
|
-
else {
|
|
25
|
-
context.logger.warn(`[WARNING]: "build" target was not found, please add builder manually.`);
|
|
26
|
-
}
|
|
27
|
-
if (serveTarget) {
|
|
28
|
-
serveTarget.builder = '@ng-doc/builder:dev-server';
|
|
29
|
-
}
|
|
30
|
-
else {
|
|
31
|
-
context.logger.warn(`[WARNING]: "serve" target was not found, please add builder manually.`);
|
|
32
|
-
}
|
|
33
|
-
});
|
|
34
|
-
}
|
|
35
|
-
exports.replaceBuilders = replaceBuilders;
|
|
36
|
-
//# sourceMappingURL=replace-builders.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"replace-builders.js","sourceRoot":"","sources":["../../../../../../libs/app/schematics/ng-add/steps/replace-builders.ts"],"names":[],"mappings":";;;AACA,qEAK+C;AAG/C,sDAAgD;AAEhD;;;;GAIG;AACH,SAAgB,eAAe,CAAC,OAAe,EAAE,OAAyB;IACzE,OAAO,IAAA,2BAAe,EAAC,CAAC,SAA8B,EAAE,EAAE;QACzD,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,uCAAuC,CAAC,CAAC;QAE7D,MAAM,OAAO,GAAkC,IAAA,wBAAU,EAAC,OAAO,EAAE,SAAS,CAAC,CAAC;QAE9E,IAAI,CAAC,OAAO,EAAE;YACb,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,sCAAsC,CAAC,CAAC;YAC5D,OAAO;SACP;QAED,MAAM,WAAW,GAAiC,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;QAC/E,MAAM,WAAW,GAAiC,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;QAE/E,IAAI,WAAW,EAAE;YAChB,WAAW,CAAC,OAAO,GAAG,yBAAyB,CAAC;SAChD;aAAM;YACN,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,uEAAuE,CAAC,CAAC;SAC7F;QAED,IAAI,WAAW,EAAE;YAChB,WAAW,CAAC,OAAO,GAAG,4BAA4B,CAAC;SACnD;aAAM;YACN,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,uEAAuE,CAAC,CAAC;SAC7F;IACF,CAAC,CAAC,CAAC;AACJ,CAAC;AA1BD,0CA0BC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,156 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
const schematics_1 = require("@angular-devkit/schematics");
|
|
13
|
-
const testing_1 = require("@angular-devkit/schematics/testing");
|
|
14
|
-
const ng_morph_1 = require("ng-morph");
|
|
15
|
-
const path_1 = require("path");
|
|
16
|
-
const app_component_content_1 = require("../constants/app-component-content");
|
|
17
|
-
const version_1 = require("../constants/version");
|
|
18
|
-
const create_angular_json_1 = require("../utils/create-angular-json");
|
|
19
|
-
const collectionPath = (0, path_1.join)(__dirname, '../../collection.json');
|
|
20
|
-
describe('ng-add', () => {
|
|
21
|
-
let host;
|
|
22
|
-
let runner;
|
|
23
|
-
beforeEach(() => {
|
|
24
|
-
host = new testing_1.UnitTestTree(new schematics_1.HostTree());
|
|
25
|
-
runner = new testing_1.SchematicTestRunner('schematics', collectionPath);
|
|
26
|
-
(0, ng_morph_1.setActiveProject)((0, ng_morph_1.createProject)(host));
|
|
27
|
-
(0, ng_morph_1.createSourceFile)('package.json', '{"dependencies": {"@angular/core": "~13.0.0"}}');
|
|
28
|
-
(0, create_angular_json_1.createAngularJson)();
|
|
29
|
-
createMainFiles();
|
|
30
|
-
(0, ng_morph_1.saveActiveProject)();
|
|
31
|
-
});
|
|
32
|
-
it('should add main modules in package.json', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
33
|
-
const options = {
|
|
34
|
-
project: '',
|
|
35
|
-
};
|
|
36
|
-
const tree = yield runner.runSchematicAsync('ng-add', options, host).toPromise();
|
|
37
|
-
expect(tree.readContent('package.json')).toEqual(`{
|
|
38
|
-
"dependencies": {
|
|
39
|
-
"@angular/core": "~13.0.0",
|
|
40
|
-
"@ng-doc/builder": "${version_1.NG_DOC_VERSION}",
|
|
41
|
-
"@ng-doc/core": "${version_1.NG_DOC_VERSION}",
|
|
42
|
-
"@ng-doc/ui-kit": "${version_1.NG_DOC_VERSION}"
|
|
43
|
-
}
|
|
44
|
-
}`);
|
|
45
|
-
}));
|
|
46
|
-
it('should replace content of the app components template', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
47
|
-
const options = {
|
|
48
|
-
project: '',
|
|
49
|
-
};
|
|
50
|
-
const tree = yield runner.runSchematicAsync('ng-add', options, host).toPromise();
|
|
51
|
-
expect(tree.readContent('test/app/app.template.html')).toEqual(app_component_content_1.APP_COMPONENT_CONTENT);
|
|
52
|
-
}));
|
|
53
|
-
it('should add NgDoc modules', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
54
|
-
const options = {
|
|
55
|
-
project: '',
|
|
56
|
-
};
|
|
57
|
-
const tree = yield runner.runSchematicAsync('ng-add', options, host).toPromise();
|
|
58
|
-
expect(tree.readContent('test/app/app.module.ts'))
|
|
59
|
-
.toEqual(`import { NgDocUiKitRootModule } from "@ng-doc/ui-kit";
|
|
60
|
-
import { NgDocModule } from "@ng-doc/app";
|
|
61
|
-
import { NG_DOC_ROUTING, NgDocGeneratedModule } from "@ng-doc/builder/generated";
|
|
62
|
-
import { RouterModule } from "@angular/router";
|
|
63
|
-
import { BrowserAnimationsModule } from "@angular/platform-browser/animations";
|
|
64
|
-
import {NgModule} from '@angular/core';
|
|
65
|
-
import {AppComponent} from './app.component';
|
|
66
|
-
|
|
67
|
-
@NgModule({declarations: [AppComponent],
|
|
68
|
-
imports: [BrowserAnimationsModule, RouterModule.forRoot(NG_DOC_ROUTING), NgDocModule.forRoot(), NgDocUiKitRootModule.forRoot(), NgDocGeneratedModule.forRoot()]
|
|
69
|
-
})
|
|
70
|
-
export class AppModule {}
|
|
71
|
-
`);
|
|
72
|
-
}));
|
|
73
|
-
it('should update angular.json', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
74
|
-
const options = {
|
|
75
|
-
project: '',
|
|
76
|
-
};
|
|
77
|
-
const tree = yield runner.runSchematicAsync('ng-add', options, host).toPromise();
|
|
78
|
-
expect(tree.readContent('angular.json')).toEqual(`
|
|
79
|
-
{
|
|
80
|
-
"version": 1,
|
|
81
|
-
"defaultProject": "demo",
|
|
82
|
-
"projects": {
|
|
83
|
-
"demo": {
|
|
84
|
-
\t"root": ".",
|
|
85
|
-
"architect": {
|
|
86
|
-
"build": {
|
|
87
|
-
"options": {
|
|
88
|
-
"main": "test/main.ts",
|
|
89
|
-
"styles": [
|
|
90
|
-
"@ng-doc/app/styles/global.scss",
|
|
91
|
-
"highlight.js/styles/default.css",
|
|
92
|
-
"highlight.js/styles/vs.css"
|
|
93
|
-
],
|
|
94
|
-
"assets": [
|
|
95
|
-
{
|
|
96
|
-
"glob": "**/*",
|
|
97
|
-
"input": "./node_modules/@ng-doc/ui-kit/assets",
|
|
98
|
-
"output": "assets"
|
|
99
|
-
},
|
|
100
|
-
{
|
|
101
|
-
"glob": "**/*",
|
|
102
|
-
"input": "./node_modules/@ng-doc/app/assets",
|
|
103
|
-
"output": "assets"
|
|
104
|
-
},
|
|
105
|
-
{
|
|
106
|
-
"glob": "**/*",
|
|
107
|
-
"input": "./node_modules/@ng-doc/builder/generated/assets",
|
|
108
|
-
"output": "assets"
|
|
109
|
-
}
|
|
110
|
-
]
|
|
111
|
-
},
|
|
112
|
-
"configurations": {
|
|
113
|
-
\t"production": {
|
|
114
|
-
\t\t"sourceMap": true,
|
|
115
|
-
\t\t\t\t\t"optimization": true,
|
|
116
|
-
\t\t\t\t\t"buildOptimizer": true,
|
|
117
|
-
\t\t\t\t\t"aot": true
|
|
118
|
-
\t}
|
|
119
|
-
},
|
|
120
|
-
"builder": "@ng-doc/builder:browser"
|
|
121
|
-
}
|
|
122
|
-
}
|
|
123
|
-
}
|
|
124
|
-
}
|
|
125
|
-
}`);
|
|
126
|
-
}));
|
|
127
|
-
});
|
|
128
|
-
/**
|
|
129
|
-
*
|
|
130
|
-
*/
|
|
131
|
-
function createMainFiles() {
|
|
132
|
-
(0, ng_morph_1.createSourceFile)('test/main.ts', `import {platformBrowserDynamic} from '@angular/platform-browser-dynamic';
|
|
133
|
-
import {AppModule} from './app/app.module';
|
|
134
|
-
import {environment} from './environments/environment';
|
|
135
|
-
|
|
136
|
-
if (environment.production) {
|
|
137
|
-
enableProdMode();
|
|
138
|
-
}
|
|
139
|
-
platformBrowserDynamic()
|
|
140
|
-
.bootstrapModule(AppModule)
|
|
141
|
-
.catch(err => console.log(err));
|
|
142
|
-
`);
|
|
143
|
-
(0, ng_morph_1.createSourceFile)('test/app/app.module.ts', `import {NgModule} from '@angular/core';
|
|
144
|
-
import {AppComponent} from './app.component';
|
|
145
|
-
|
|
146
|
-
@NgModule({declarations: [AppComponent]})
|
|
147
|
-
export class AppModule {}
|
|
148
|
-
`);
|
|
149
|
-
(0, ng_morph_1.createSourceFile)('test/app/app.component.ts', `import {Component} from '@angular/core';
|
|
150
|
-
import {AppComponent} from './app.component';
|
|
151
|
-
|
|
152
|
-
@Component({templateUrl: './app.template.html'})
|
|
153
|
-
export class AppComponent {}`);
|
|
154
|
-
(0, ng_morph_1.createSourceFile)('test/app/app.template.html', `<app></app>`);
|
|
155
|
-
}
|
|
156
|
-
//# sourceMappingURL=ng-add.spec.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ng-add.spec.js","sourceRoot":"","sources":["../../../../../../libs/app/schematics/ng-add/testing/ng-add.spec.ts"],"names":[],"mappings":"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"}
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.addUniqueImport = void 0;
|
|
4
|
-
const ng_morph_1 = require("ng-morph");
|
|
5
|
-
/**
|
|
6
|
-
*
|
|
7
|
-
* @param filePath
|
|
8
|
-
* @param namedImport
|
|
9
|
-
* @param moduleSpecifier
|
|
10
|
-
*/
|
|
11
|
-
function addUniqueImport(filePath, namedImport, moduleSpecifier) {
|
|
12
|
-
const existingNamedImport = (0, ng_morph_1.getImports)(filePath, {
|
|
13
|
-
namedImports: namedImport,
|
|
14
|
-
moduleSpecifier,
|
|
15
|
-
});
|
|
16
|
-
if (existingNamedImport.length) {
|
|
17
|
-
return;
|
|
18
|
-
}
|
|
19
|
-
const existingDeclaration = (0, ng_morph_1.getImports)(filePath, {
|
|
20
|
-
moduleSpecifier,
|
|
21
|
-
});
|
|
22
|
-
if (existingDeclaration.length) {
|
|
23
|
-
const modules = existingDeclaration[0]
|
|
24
|
-
.getNamedImports()
|
|
25
|
-
.map((namedImport) => namedImport.getText());
|
|
26
|
-
(0, ng_morph_1.editImports)(existingDeclaration[0], () => ({
|
|
27
|
-
namedImports: [...modules, namedImport],
|
|
28
|
-
}));
|
|
29
|
-
return;
|
|
30
|
-
}
|
|
31
|
-
(0, ng_morph_1.addImports)(filePath, {
|
|
32
|
-
moduleSpecifier: moduleSpecifier,
|
|
33
|
-
namedImports: [namedImport],
|
|
34
|
-
});
|
|
35
|
-
}
|
|
36
|
-
exports.addUniqueImport = addUniqueImport;
|
|
37
|
-
//# sourceMappingURL=add-unique-import.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"add-unique-import.js","sourceRoot":"","sources":["../../../../../../libs/app/schematics/ng-add/utils/add-unique-import.ts"],"names":[],"mappings":";;;AAAA,uCAAiG;AAEjG;;;;;GAKG;AACH,SAAgB,eAAe,CAAC,QAAgB,EAAE,WAAmB,EAAE,eAAuB;IAC7F,MAAM,mBAAmB,GAAwB,IAAA,qBAAU,EAAC,QAAQ,EAAE;QACrE,YAAY,EAAE,WAAW;QACzB,eAAe;KACf,CAAC,CAAC;IAEH,IAAI,mBAAmB,CAAC,MAAM,EAAE;QAC/B,OAAO;KACP;IAED,MAAM,mBAAmB,GAAwB,IAAA,qBAAU,EAAC,QAAQ,EAAE;QACrE,eAAe;KACf,CAAC,CAAC;IAEH,IAAI,mBAAmB,CAAC,MAAM,EAAE;QAC/B,MAAM,OAAO,GAAa,mBAAmB,CAAC,CAAC,CAAC;aAC9C,eAAe,EAAE;aACjB,GAAG,CAAC,CAAC,WAA4B,EAAE,EAAE,CAAC,WAAW,CAAC,OAAO,EAAE,CAAC,CAAC;QAE/D,IAAA,sBAAW,EAAC,mBAAmB,CAAC,CAAC,CAAC,EAAE,GAAG,EAAE,CAAC,CAAC;YAC1C,YAAY,EAAE,CAAC,GAAG,OAAO,EAAE,WAAW,CAAC;SACvC,CAAC,CAAC,CAAC;QAEJ,OAAO;KACP;IAED,IAAA,qBAAU,EAAC,QAAQ,EAAE;QACpB,eAAe,EAAE,eAAe;QAChC,YAAY,EAAE,CAAC,WAAW,CAAC;KAC3B,CAAC,CAAC;AACJ,CAAC;AA9BD,0CA8BC"}
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.createAngularJson = void 0;
|
|
4
|
-
const ng_morph_1 = require("ng-morph");
|
|
5
|
-
/**
|
|
6
|
-
*
|
|
7
|
-
*/
|
|
8
|
-
function createAngularJson() {
|
|
9
|
-
(0, ng_morph_1.createSourceFile)('angular.json', `
|
|
10
|
-
{
|
|
11
|
-
"version": 1,
|
|
12
|
-
"defaultProject": "demo",
|
|
13
|
-
"projects": {
|
|
14
|
-
"demo": {
|
|
15
|
-
"root": ".",
|
|
16
|
-
"architect": {
|
|
17
|
-
"build": {
|
|
18
|
-
"options": {
|
|
19
|
-
"main": "test/main.ts"
|
|
20
|
-
},
|
|
21
|
-
"configurations": {
|
|
22
|
-
"production": {
|
|
23
|
-
"sourceMap": true,
|
|
24
|
-
"optimization": true,
|
|
25
|
-
"buildOptimizer": true,
|
|
26
|
-
"aot": true
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
}`);
|
|
34
|
-
}
|
|
35
|
-
exports.createAngularJson = createAngularJson;
|
|
36
|
-
//# sourceMappingURL=create-angular-json.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"create-angular-json.js","sourceRoot":"","sources":["../../../../../../libs/app/schematics/ng-add/utils/create-angular-json.ts"],"names":[],"mappings":";;;AAAA,uCAA0C;AAE1C;;GAEG;AACH,SAAgB,iBAAiB;IAChC,IAAA,2BAAgB,EACf,cAAc,EACd;;;;;;;;;;;;;;;;;;;;;;;;EAwBA,CACA,CAAC;AACH,CAAC;AA7BD,8CA6BC"}
|