@ng-doc/add 15.0.0-beta.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (70) hide show
  1. package/README.md +11 -0
  2. package/package.json +18 -0
  3. package/schematics/collection.json +16 -0
  4. package/schematics/index.d.ts +0 -0
  5. package/schematics/index.js +3 -0
  6. package/schematics/index.js.map +1 -0
  7. package/schematics/ng-add/constants/app-component-content.d.ts +1 -0
  8. package/schematics/ng-add/constants/app-component-content.js +15 -0
  9. package/schematics/ng-add/constants/app-component-content.js.map +1 -0
  10. package/schematics/ng-add/constants/assets.d.ts +5 -0
  11. package/schematics/ng-add/constants/assets.js +21 -0
  12. package/schematics/ng-add/constants/assets.js.map +1 -0
  13. package/schematics/ng-add/constants/modules.d.ts +10 -0
  14. package/schematics/ng-add/constants/modules.js +37 -0
  15. package/schematics/ng-add/constants/modules.js.map +1 -0
  16. package/schematics/ng-add/constants/styles.d.ts +1 -0
  17. package/schematics/ng-add/constants/styles.js +5 -0
  18. package/schematics/ng-add/constants/styles.js.map +1 -0
  19. package/schematics/ng-add/constants/version.d.ts +1 -0
  20. package/schematics/ng-add/constants/version.js +6 -0
  21. package/schematics/ng-add/constants/version.js.map +1 -0
  22. package/schematics/ng-add/index.d.ts +12 -0
  23. package/schematics/ng-add/index.js +49 -0
  24. package/schematics/ng-add/index.js.map +1 -0
  25. package/schematics/ng-add/schema.d.ts +3 -0
  26. package/schematics/ng-add/schema.js +3 -0
  27. package/schematics/ng-add/schema.js.map +1 -0
  28. package/schematics/ng-add/schema.json +16 -0
  29. package/schematics/ng-add/steps/add-assets.d.ts +8 -0
  30. package/schematics/ng-add/steps/add-assets.js +33 -0
  31. package/schematics/ng-add/steps/add-assets.js.map +1 -0
  32. package/schematics/ng-add/steps/add-git-ignore.d.ts +7 -0
  33. package/schematics/ng-add/steps/add-git-ignore.js +24 -0
  34. package/schematics/ng-add/steps/add-git-ignore.js.map +1 -0
  35. package/schematics/ng-add/steps/add-layout.d.ts +7 -0
  36. package/schematics/ng-add/steps/add-layout.js +38 -0
  37. package/schematics/ng-add/steps/add-layout.js.map +1 -0
  38. package/schematics/ng-add/steps/add-ng-doc-modules.d.ts +7 -0
  39. package/schematics/ng-add/steps/add-ng-doc-modules.js +44 -0
  40. package/schematics/ng-add/steps/add-ng-doc-modules.js.map +1 -0
  41. package/schematics/ng-add/steps/add-styles.d.ts +8 -0
  42. package/schematics/ng-add/steps/add-styles.js +33 -0
  43. package/schematics/ng-add/steps/add-styles.js.map +1 -0
  44. package/schematics/ng-add/steps/add-tsconfig-paths.d.ts +7 -0
  45. package/schematics/ng-add/steps/add-tsconfig-paths.js +61 -0
  46. package/schematics/ng-add/steps/add-tsconfig-paths.js.map +1 -0
  47. package/schematics/ng-add/steps/replace-builders.d.ts +7 -0
  48. package/schematics/ng-add/steps/replace-builders.js +51 -0
  49. package/schematics/ng-add/steps/replace-builders.js.map +1 -0
  50. package/schematics/ng-add/utils/add-unique-import.d.ts +7 -0
  51. package/schematics/ng-add/utils/add-unique-import.js +37 -0
  52. package/schematics/ng-add/utils/add-unique-import.js.map +1 -0
  53. package/schematics/ng-add/utils/create-angular-json.d.ts +4 -0
  54. package/schematics/ng-add/utils/create-angular-json.js +38 -0
  55. package/schematics/ng-add/utils/create-angular-json.js.map +1 -0
  56. package/schematics/ng-add/utils/create-git-ignore.d.ts +4 -0
  57. package/schematics/ng-add/utils/create-git-ignore.js +12 -0
  58. package/schematics/ng-add/utils/create-git-ignore.js.map +1 -0
  59. package/schematics/ng-add/utils/create-ts-configs.d.ts +4 -0
  60. package/schematics/ng-add/utils/create-ts-configs.js +21 -0
  61. package/schematics/ng-add/utils/create-ts-configs.js.map +1 -0
  62. package/schematics/ng-add/utils/get-app-template-path.d.ts +12 -0
  63. package/schematics/ng-add/utils/get-app-template-path.js +35 -0
  64. package/schematics/ng-add/utils/get-app-template-path.js.map +1 -0
  65. package/schematics/ng-add/utils/get-initializer.d.ts +8 -0
  66. package/schematics/ng-add/utils/get-initializer.js +27 -0
  67. package/schematics/ng-add/utils/get-initializer.js.map +1 -0
  68. package/schematics/ng-add/utils/get-project.d.ts +8 -0
  69. package/schematics/ng-add/utils/get-project.js +15 -0
  70. package/schematics/ng-add/utils/get-project.js.map +1 -0
package/README.md ADDED
@@ -0,0 +1,11 @@
1
+ # add
2
+
3
+ This library was generated with [Nx](https://nx.dev).
4
+
5
+ ## Building
6
+
7
+ Run `nx build add` to build the library.
8
+
9
+ ## Running unit tests
10
+
11
+ Run `nx test add` to execute the unit tests via [Jest](https://jestjs.io).
package/package.json ADDED
@@ -0,0 +1,18 @@
1
+ {
2
+ "name": "@ng-doc/add",
3
+ "version": "15.0.0-beta.10",
4
+ "type": "commonjs",
5
+ "schematics": "./schematics/collection.json",
6
+ "ng-add": {
7
+ "save": true
8
+ },
9
+ "publishConfig": {
10
+ "access": "public"
11
+ },
12
+ "peerDependencies": {
13
+ "@angular/cdk": ">= 13.3.0",
14
+ "ng-morph": "^2.1.1"
15
+ },
16
+ "main": "./schematics/index.js",
17
+ "types": "./schematics/index.d.ts"
18
+ }
@@ -0,0 +1,16 @@
1
+ {
2
+ "$schema": "../../../node_modules/@angular-devkit/schematics/collection-schema.json",
3
+ "schematics": {
4
+ "ng-add": {
5
+ "description": "Add NgDoc library to the project.",
6
+ "factory": "./ng-add/index#ngAdd",
7
+ "schema": "./ng-add/schema.json"
8
+ },
9
+ "ng-add-setup-project": {
10
+ "private": true,
11
+ "description": "Sets up the project after dependencies have been installed",
12
+ "factory": "./ng-add/index#ngAddSetupProject",
13
+ "schema": "./ng-add/schema.json"
14
+ }
15
+ }
16
+ }
File without changes
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ // FAKE ENTRY POINT
3
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../libs/add/schematics/index.ts"],"names":[],"mappings":";AAAA,mBAAmB"}
@@ -0,0 +1 @@
1
+ export declare const APP_COMPONENT_CONTENT: string;
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.APP_COMPONENT_CONTENT = void 0;
4
+ exports.APP_COMPONENT_CONTENT = `
5
+ <ng-doc-root>
6
+ <ng-doc-navbar [leftContent]="leftContent">
7
+ <ng-template #leftContent>
8
+ <h3 style="margin: 0">MyAwesomeDoc</h3>
9
+ </ng-template>
10
+ </ng-doc-navbar>
11
+ <ng-doc-sidebar></ng-doc-sidebar>
12
+ <router-outlet></router-outlet>
13
+ </ng-doc-root>
14
+ `.trim();
15
+ //# sourceMappingURL=app-component-content.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"app-component-content.js","sourceRoot":"","sources":["../../../../../../libs/add/schematics/ng-add/constants/app-component-content.ts"],"names":[],"mappings":";;;AAAa,QAAA,qBAAqB,GAAW;;;;;;;;;;CAU5C,CAAC,IAAI,EAAE,CAAC"}
@@ -0,0 +1,5 @@
1
+ export declare const NG_DOC_ASSETS: Array<{
2
+ output: string;
3
+ input: string;
4
+ glob: string;
5
+ }>;
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.NG_DOC_ASSETS = void 0;
4
+ exports.NG_DOC_ASSETS = [
5
+ {
6
+ glob: '**/*',
7
+ input: './node_modules/@ng-doc/ui-kit/assets',
8
+ output: 'assets',
9
+ },
10
+ {
11
+ glob: '**/*',
12
+ input: './node_modules/@ng-doc/app/assets',
13
+ output: 'assets',
14
+ },
15
+ {
16
+ glob: '**/*',
17
+ input: './node_modules/@ng-doc/builder/generated/assets',
18
+ output: 'assets',
19
+ },
20
+ ];
21
+ //# sourceMappingURL=assets.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"assets.js","sourceRoot":"","sources":["../../../../../../libs/add/schematics/ng-add/constants/assets.ts"],"names":[],"mappings":";;;AAAa,QAAA,aAAa,GAAyD;IAClF;QACC,IAAI,EAAE,MAAM;QACZ,KAAK,EAAE,sCAAsC;QAC7C,MAAM,EAAE,QAAQ;KAChB;IACD;QACC,IAAI,EAAE,MAAM;QACZ,KAAK,EAAE,mCAAmC;QAC1C,MAAM,EAAE,QAAQ;KAChB;IACD;QACC,IAAI,EAAE,MAAM;QACZ,KAAK,EAAE,iDAAiD;QACxD,MAAM,EAAE,QAAQ;KAChB;CACD,CAAC"}
@@ -0,0 +1,10 @@
1
+ export declare const GENERATED_PATH: string;
2
+ export interface ImportModule {
3
+ initializer: string;
4
+ imports: EntityImport[];
5
+ }
6
+ export interface EntityImport {
7
+ name: string;
8
+ path: string;
9
+ }
10
+ export declare const MAIN_MODULES: readonly ImportModule[];
@@ -0,0 +1,37 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.MAIN_MODULES = exports.GENERATED_PATH = void 0;
4
+ exports.GENERATED_PATH = '@ng-doc/generated';
5
+ exports.MAIN_MODULES = [
6
+ {
7
+ initializer: 'BrowserAnimationsModule',
8
+ imports: [{ name: 'BrowserAnimationsModule', path: '@angular/platform-browser/animations' }],
9
+ },
10
+ {
11
+ initializer: 'NgDocNavbarModule',
12
+ imports: [{ name: 'NgDocNavbarModule', path: '@ng-doc/app/components/navbar' }],
13
+ },
14
+ {
15
+ initializer: 'NgDocSidebarModule',
16
+ imports: [{ name: 'NgDocSidebarModule', path: '@ng-doc/app/components/sidebar' }],
17
+ },
18
+ {
19
+ initializer: 'RouterModule.forRoot(NG_DOC_ROUTING)',
20
+ imports: [
21
+ { name: 'RouterModule', path: '@angular/router' },
22
+ {
23
+ name: 'NG_DOC_ROUTING',
24
+ path: exports.GENERATED_PATH,
25
+ },
26
+ ],
27
+ },
28
+ {
29
+ initializer: 'NgDocModule.forRoot()',
30
+ imports: [{ name: 'NgDocModule', path: '@ng-doc/app' }],
31
+ },
32
+ {
33
+ initializer: 'NgDocGeneratedModule.forRoot()',
34
+ imports: [{ name: 'NgDocGeneratedModule', path: exports.GENERATED_PATH }],
35
+ },
36
+ ];
37
+ //# sourceMappingURL=modules.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"modules.js","sourceRoot":"","sources":["../../../../../../libs/add/schematics/ng-add/constants/modules.ts"],"names":[],"mappings":";;;AAAa,QAAA,cAAc,GAAW,mBAAmB,CAAC;AAY7C,QAAA,YAAY,GAA4B;IACpD;QACC,WAAW,EAAE,yBAAyB;QACtC,OAAO,EAAE,CAAC,EAAC,IAAI,EAAE,yBAAyB,EAAE,IAAI,EAAE,sCAAsC,EAAC,CAAC;KAC1F;IACD;QACC,WAAW,EAAE,mBAAmB;QAChC,OAAO,EAAE,CAAC,EAAC,IAAI,EAAE,mBAAmB,EAAE,IAAI,EAAE,+BAA+B,EAAC,CAAC;KAC7E;IACD;QACC,WAAW,EAAE,oBAAoB;QACjC,OAAO,EAAE,CAAC,EAAC,IAAI,EAAE,oBAAoB,EAAE,IAAI,EAAE,gCAAgC,EAAC,CAAC;KAC/E;IACD;QACC,WAAW,EAAE,sCAAsC;QACnD,OAAO,EAAE;YACR,EAAC,IAAI,EAAE,cAAc,EAAE,IAAI,EAAE,iBAAiB,EAAC;YAC/C;gBACC,IAAI,EAAE,gBAAgB;gBACtB,IAAI,EAAE,sBAAc;aACpB;SACD;KACD;IACD;QACC,WAAW,EAAE,uBAAuB;QACpC,OAAO,EAAE,CAAC,EAAC,IAAI,EAAE,aAAa,EAAE,IAAI,EAAE,aAAa,EAAC,CAAC;KACrD;IACD;QACC,WAAW,EAAE,gCAAgC;QAC7C,OAAO,EAAE,CAAC,EAAC,IAAI,EAAE,sBAAsB,EAAE,IAAI,EAAE,sBAAc,EAAC,CAAC;KAC/D;CACD,CAAC"}
@@ -0,0 +1 @@
1
+ export declare const NG_DOC_STYLES: string[];
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.NG_DOC_STYLES = void 0;
4
+ exports.NG_DOC_STYLES = ['./node_modules/@ng-doc/app/styles/global.css'];
5
+ //# sourceMappingURL=styles.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"styles.js","sourceRoot":"","sources":["../../../../../../libs/add/schematics/ng-add/constants/styles.ts"],"names":[],"mappings":";;;AAAa,QAAA,aAAa,GAAa,CAAC,8CAA8C,CAAC,CAAC"}
@@ -0,0 +1 @@
1
+ export declare const NG_DOC_VERSION: string;
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.NG_DOC_VERSION = void 0;
4
+ const package_json_1 = require("../../../package.json");
5
+ exports.NG_DOC_VERSION = package_json_1.version;
6
+ //# sourceMappingURL=version.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"version.js","sourceRoot":"","sources":["../../../../../../libs/add/schematics/ng-add/constants/version.ts"],"names":[],"mappings":";;;AAAA,wDAA8C;AAEjC,QAAA,cAAc,GAAW,sBAAO,CAAC"}
@@ -0,0 +1,12 @@
1
+ import { Rule } from '@angular-devkit/schematics';
2
+ import { Schema } from './schema';
3
+ /**
4
+ *
5
+ * @param options
6
+ */
7
+ export declare function ngAdd(options: Schema): Rule;
8
+ /**
9
+ *
10
+ * @param options
11
+ */
12
+ export declare function ngAddSetupProject(options: Schema): Rule;
@@ -0,0 +1,49 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ngAddSetupProject = 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_git_ignore_1 = require("./steps/add-git-ignore");
10
+ const add_layout_1 = require("./steps/add-layout");
11
+ const add_ng_doc_modules_1 = require("./steps/add-ng-doc-modules");
12
+ const add_styles_1 = require("./steps/add-styles");
13
+ const add_tsconfig_paths_1 = require("./steps/add-tsconfig-paths");
14
+ const replace_builders_1 = require("./steps/replace-builders");
15
+ /**
16
+ *
17
+ * @param options
18
+ */
19
+ function ngAdd(options) {
20
+ return (tree, context) => {
21
+ (0, ng_morph_1.setActiveProject)((0, ng_morph_1.createProject)(tree, '/', ['**/*.ts', '**/*.json']));
22
+ (0, ng_morph_1.addPackageJsonDependency)(tree, { name: `@ng-doc/app`, version: version_1.NG_DOC_VERSION });
23
+ (0, ng_morph_1.addPackageJsonDependency)(tree, { name: `@ng-doc/builder`, version: version_1.NG_DOC_VERSION });
24
+ (0, ng_morph_1.addPackageJsonDependency)(tree, { name: `@ng-doc/ui-kit`, version: version_1.NG_DOC_VERSION });
25
+ (0, ng_morph_1.addPackageJsonDependency)(tree, { name: `@ng-doc/core`, version: version_1.NG_DOC_VERSION });
26
+ (0, ng_morph_1.removePackageJsonDependency)(tree, '@ng-doc/add');
27
+ context.addTask(new tasks_1.NodePackageInstallTask(), [
28
+ context.addTask(new tasks_1.RunSchematicTask('ng-add-setup-project', options)),
29
+ ]);
30
+ };
31
+ }
32
+ exports.ngAdd = ngAdd;
33
+ /**
34
+ *
35
+ * @param options
36
+ */
37
+ function ngAddSetupProject(options) {
38
+ return (0, schematics_1.chain)([
39
+ (0, replace_builders_1.replaceBuilders)(options),
40
+ (0, add_styles_1.addStyles)(options),
41
+ (0, add_assets_1.addAssets)(options),
42
+ (0, add_ng_doc_modules_1.addNgDocModules)(options),
43
+ (0, add_layout_1.addLayout)(options),
44
+ (0, add_tsconfig_paths_1.addTsconfigPaths)(options),
45
+ (0, add_git_ignore_1.addGitIgnore)()
46
+ ]);
47
+ }
48
+ exports.ngAddSetupProject = ngAddSetupProject;
49
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../libs/add/schematics/ng-add/index.ts"],"names":[],"mappings":";;;AAAA,2DAA+E;AAC/E,4DAA0F;AAC1F,uCAAgH;AAEhH,iDAAmD;AAEnD,mDAA6C;AAC7C,2DAAoD;AACpD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AAC;QAClB,IAAA,qCAAgB,EAAC,OAAO,CAAC;QACzB,IAAA,6BAAY,GAAE;KACd,CAAC,CAAC;AACJ,CAAC;AAVD,8CAUC"}
@@ -0,0 +1,3 @@
1
+ export interface Schema {
2
+ readonly project: string;
3
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=schema.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schema.js","sourceRoot":"","sources":["../../../../../libs/add/schematics/ng-add/schema.ts"],"names":[],"mappings":""}
@@ -0,0 +1,16 @@
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
+ }
@@ -0,0 +1,8 @@
1
+ import { Rule } from '@angular-devkit/schematics';
2
+ import { Schema } from '../schema';
3
+ /**
4
+ *
5
+ * @param options
6
+ * @param context
7
+ */
8
+ export declare function addAssets(options: Schema): Rule;
@@ -0,0 +1,33 @@
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) {
14
+ return async (tree, context) => {
15
+ return (0, workspace_1.updateWorkspace)((workspace) => {
16
+ context.logger.info(`[INFO]: Adding global assets...`);
17
+ const project = (0, get_project_1.getProject)(options, workspace);
18
+ if (!project) {
19
+ context.logger.warn(`[WARNING]: Target project not found.`);
20
+ return;
21
+ }
22
+ const targetOptions = (0, schematics_1.getProjectTargetOptions)(project, 'build');
23
+ const assets = targetOptions['assets'];
24
+ if (!assets) {
25
+ targetOptions['assets'] = assets_1.NG_DOC_ASSETS;
26
+ return;
27
+ }
28
+ targetOptions['assets'] = Array.from(new Set([...assets_1.NG_DOC_ASSETS, ...assets]));
29
+ });
30
+ };
31
+ }
32
+ exports.addAssets = addAssets;
33
+ //# sourceMappingURL=add-assets.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"add-assets.js","sourceRoot":"","sources":["../../../../../../libs/add/schematics/ng-add/steps/add-assets.ts"],"names":[],"mappings":";;;AAAA,wDAAgE;AAGhE,qEAA8G;AAE9G,gDAAkD;AAElD,sDAAgD;AAEhD;;;;GAIG;AACH,SAAgB,SAAS,CAAC,OAAe;IACxC,OAAO,KAAK,EAAE,IAAU,EAAE,OAAyB,EAAE,EAAE;QACtD,OAAO,IAAA,2BAAe,EAAC,CAAC,SAA8B,EAAE,EAAE;YACzD,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,iCAAiC,CAAC,CAAC;YAEvD,MAAM,OAAO,GAAkC,IAAA,wBAAU,EAAC,OAAO,EAAE,SAAS,CAAC,CAAC;YAE9E,IAAI,CAAC,OAAO,EAAE;gBACb,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,sCAAsC,CAAC,CAAC;gBAC5D,OAAO;aACP;YAED,MAAM,aAAa,GAA8B,IAAA,oCAAuB,EAAC,OAAO,EAAE,OAAO,CAAC,CAAC;YAE3F,MAAM,MAAM,GAA0B,aAAa,CAAC,QAAQ,CAA0B,CAAC;YAEvF,IAAI,CAAC,MAAM,EAAE;gBACZ,aAAa,CAAC,QAAQ,CAAC,GAAG,sBAAa,CAAC;gBACxC,OAAO;aACP;YAED,aAAa,CAAC,QAAQ,CAAC,GAAG,KAAK,CAAC,IAAI,CAAC,IAAI,GAAG,CAAC,CAAC,GAAG,sBAAa,EAAE,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC;QAC9E,CAAC,CAAC,CAAC;IACJ,CAAC,CAAA;AACF,CAAC;AAxBD,8BAwBC"}
@@ -0,0 +1,7 @@
1
+ import { Rule } from '@angular-devkit/schematics';
2
+ /**
3
+ *
4
+ * @param options
5
+ * @param context
6
+ */
7
+ export declare function addGitIgnore(): Rule;
@@ -0,0 +1,24 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.addGitIgnore = void 0;
4
+ const workspace_1 = require("@schematics/angular/utility/workspace");
5
+ /**
6
+ *
7
+ * @param options
8
+ * @param context
9
+ */
10
+ function addGitIgnore() {
11
+ return async (tree, context) => {
12
+ return (0, workspace_1.updateWorkspace)((workspace) => {
13
+ context.logger.info(`[INFO]: Adding .ng-doc folder to .gitignore...`);
14
+ const gitignore = tree.read('.gitignore');
15
+ if (!gitignore) {
16
+ context.logger.warn(`[WARNING]: .gitignore not found, please add ".ng-doc" folder into it manually.`);
17
+ return;
18
+ }
19
+ tree.overwrite('.gitignore', `${gitignore}\n\n# NgDoc files\n.ng-doc`);
20
+ });
21
+ };
22
+ }
23
+ exports.addGitIgnore = addGitIgnore;
24
+ //# sourceMappingURL=add-git-ignore.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"add-git-ignore.js","sourceRoot":"","sources":["../../../../../../libs/add/schematics/ng-add/steps/add-git-ignore.ts"],"names":[],"mappings":";;;AACA,qEAA2F;AAE3F;;;;GAIG;AACH,SAAgB,YAAY;IAC3B,OAAO,KAAK,EAAE,IAAU,EAAE,OAAyB,EAAE,EAAE;QACtD,OAAO,IAAA,2BAAe,EAAC,CAAC,SAA8B,EAAE,EAAE;YACzD,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,gDAAgD,CAAC,CAAC;YAEtE,MAAM,SAAS,GAAkB,IAAI,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;YAEzD,IAAI,CAAC,SAAS,EAAE;gBACf,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,gFAAgF,CAAC,CAAC;gBAEtG,OAAO;aACP;YAED,IAAI,CAAC,SAAS,CAAC,YAAY,EAAE,GAAG,SAAS,4BAA4B,CAAC,CAAA;QACvE,CAAC,CAAC,CAAC;IACJ,CAAC,CAAA;AACF,CAAC;AAhBD,oCAgBC"}
@@ -0,0 +1,7 @@
1
+ import { Rule } from '@angular-devkit/schematics';
2
+ import { Schema } from '../schema';
3
+ /**
4
+ *
5
+ * @param options
6
+ */
7
+ export declare function addLayout(options: Schema): Rule;
@@ -0,0 +1,38 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.addLayout = void 0;
4
+ const schematics_1 = require("@angular/cdk/schematics");
5
+ const workspace_1 = require("@nrwl/workspace");
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
+ const get_project_1 = require("../utils/get-project");
9
+ /**
10
+ *
11
+ * @param options
12
+ */
13
+ function addLayout(options) {
14
+ return async (tree, context) => {
15
+ context.logger.info(`[INFO]: Adding NgDocLayour to the root component...`);
16
+ const workspace = await (0, workspace_1.getWorkspace)(tree);
17
+ const project = (0, get_project_1.getProject)(options, workspace);
18
+ if (!project) {
19
+ return;
20
+ }
21
+ const buildOptions = (0, schematics_1.getProjectTargetOptions)(project, 'build');
22
+ const appTemplatePath = (0, get_app_template_path_1.getAppTemplatePath)(tree, buildOptions['main']);
23
+ if (!appTemplatePath) {
24
+ context.logger.error('Could not find the default main template file for this project.');
25
+ return;
26
+ }
27
+ const html = tree.read(appTemplatePath);
28
+ if (html) {
29
+ const recorder = tree.beginUpdate(appTemplatePath);
30
+ recorder.remove(0, html.length);
31
+ recorder.insertLeft(0, app_component_content_1.APP_COMPONENT_CONTENT);
32
+ tree.commitUpdate(recorder);
33
+ context.logger.info(`Content of the app component was replaced with ng-doc layout.`);
34
+ }
35
+ };
36
+ }
37
+ exports.addLayout = addLayout;
38
+ //# sourceMappingURL=add-layout.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"add-layout.js","source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iCC"}
@@ -0,0 +1,7 @@
1
+ import { Rule } from '@angular-devkit/schematics';
2
+ import { Schema } from '../schema';
3
+ /**
4
+ *
5
+ * @param options
6
+ */
7
+ export declare function addNgDocModules(options: Schema): Rule;
@@ -0,0 +1,44 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.addNgDocModules = void 0;
4
+ const schematics_1 = require("@angular/cdk/schematics");
5
+ const workspace_1 = require("@schematics/angular/utility/workspace");
6
+ const ng_morph_1 = require("ng-morph");
7
+ const modules_1 = require("../constants/modules");
8
+ const add_unique_import_1 = require("../utils/add-unique-import");
9
+ const get_project_1 = require("../utils/get-project");
10
+ /**
11
+ *
12
+ * @param options
13
+ */
14
+ function addNgDocModules(options) {
15
+ return async (tree, context) => {
16
+ context.logger.info(`[INFO]: Adding NgDoc modules to the root module...`);
17
+ const workspace = await (0, workspace_1.getWorkspace)(tree);
18
+ const project = (0, get_project_1.getProject)(options, workspace);
19
+ if (!project) {
20
+ context.logger.warn('[WARNING]: Target project not found in current workspace');
21
+ return;
22
+ }
23
+ const buildOptions = (0, schematics_1.getProjectTargetOptions)(project, 'build');
24
+ (0, ng_morph_1.setActiveProject)((0, ng_morph_1.createProject)(tree, '/', ['**/*.ts', '**/*.json']));
25
+ const mainModule = (0, ng_morph_1.getMainModule)(buildOptions['main']);
26
+ importMainModules(mainModule);
27
+ (0, ng_morph_1.saveActiveProject)();
28
+ };
29
+ }
30
+ exports.addNgDocModules = addNgDocModules;
31
+ /**
32
+ *
33
+ * @param mainModule
34
+ */
35
+ function importMainModules(mainModule) {
36
+ const mainModulePath = mainModule.getSourceFile().getFilePath();
37
+ modules_1.MAIN_MODULES.forEach((module) => {
38
+ (0, ng_morph_1.addImportToNgModule)(mainModule, module.initializer, { unique: true });
39
+ module.imports.forEach((moduleImport) => {
40
+ (0, add_unique_import_1.addUniqueImport)(mainModulePath, moduleImport.name, moduleImport.path);
41
+ });
42
+ });
43
+ }
44
+ //# sourceMappingURL=add-ng-doc-modules.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"add-ng-doc-modules.js","sourceRoot":"","sources":["../../../../../../libs/add/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,KAAK,EAAE,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,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"}
@@ -0,0 +1,8 @@
1
+ import { Rule } from '@angular-devkit/schematics';
2
+ import { Schema } from '../schema';
3
+ /**
4
+ *
5
+ * @param options
6
+ * @param context
7
+ */
8
+ export declare function addStyles(options: Schema): Rule;
@@ -0,0 +1,33 @@
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) {
14
+ return async (tree, context) => {
15
+ return (0, workspace_1.updateWorkspace)((workspace) => {
16
+ context.logger.info(`[INFO]: Adding global styles...`);
17
+ const project = (0, get_project_1.getProject)(options, workspace);
18
+ if (!project) {
19
+ context.logger.warn(`[WARNING]: Target project not found.`);
20
+ return;
21
+ }
22
+ const targetOptions = (0, schematics_1.getProjectTargetOptions)(project, 'build');
23
+ const styles = targetOptions['styles'];
24
+ if (!styles) {
25
+ targetOptions['styles'] = styles_1.NG_DOC_STYLES;
26
+ return;
27
+ }
28
+ targetOptions['styles'] = Array.from(new Set([...styles_1.NG_DOC_STYLES, ...styles]));
29
+ });
30
+ };
31
+ }
32
+ exports.addStyles = addStyles;
33
+ //# sourceMappingURL=add-styles.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"add-styles.js","sourceRoot":"","sources":["../../../../../../libs/add/schematics/ng-add/steps/add-styles.ts"],"names":[],"mappings":";;;AAAA,wDAAgE;AAGhE,qEAA8G;AAE9G,gDAAkD;AAElD,sDAAgD;AAEhD;;;;GAIG;AACH,SAAgB,SAAS,CAAC,OAAe;IACxC,OAAO,KAAK,EAAE,IAAU,EAAE,OAAyB,EAAE,EAAE;QACtD,OAAO,IAAA,2BAAe,EAAC,CAAC,SAA8B,EAAE,EAAE;YACzD,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,iCAAiC,CAAC,CAAC;YAEvD,MAAM,OAAO,GAAkC,IAAA,wBAAU,EAAC,OAAO,EAAE,SAAS,CAAC,CAAC;YAE9E,IAAI,CAAC,OAAO,EAAE;gBACb,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,sCAAsC,CAAC,CAAC;gBAC5D,OAAO;aACP;YAED,MAAM,aAAa,GAA8B,IAAA,oCAAuB,EAAC,OAAO,EAAE,OAAO,CAAC,CAAC;YAE3F,MAAM,MAAM,GAA0B,aAAa,CAAC,QAAQ,CAA0B,CAAC;YAEvF,IAAI,CAAC,MAAM,EAAE;gBACZ,aAAa,CAAC,QAAQ,CAAC,GAAG,sBAAa,CAAC;gBACxC,OAAO;aACP;YAED,aAAa,CAAC,QAAQ,CAAC,GAAG,KAAK,CAAC,IAAI,CAAC,IAAI,GAAG,CAAC,CAAC,GAAG,sBAAa,EAAE,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC;QAC9E,CAAC,CAAC,CAAC;IACJ,CAAC,CAAA;AACF,CAAC;AAxBD,8BAwBC"}
@@ -0,0 +1,7 @@
1
+ import { Rule } from '@angular-devkit/schematics';
2
+ import { Schema } from '../schema';
3
+ /**
4
+ *
5
+ * @param options
6
+ */
7
+ export declare function addTsconfigPaths(options: Schema): Rule;
@@ -0,0 +1,61 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.addTsconfigPaths = void 0;
4
+ const workspace_1 = require("@schematics/angular/utility/workspace");
5
+ const ng_morph_1 = require("ng-morph");
6
+ const path = require("path");
7
+ const modules_1 = require("../constants/modules");
8
+ const get_project_1 = require("../utils/get-project");
9
+ /**
10
+ *
11
+ * @param options
12
+ */
13
+ function addTsconfigPaths(options) {
14
+ return async (tree, context) => {
15
+ return (0, workspace_1.updateWorkspace)((workspace) => {
16
+ context.logger.info(`[INFO]: Adding tsconfig paths to ng-doc folder...`);
17
+ const project = (0, get_project_1.getProject)(options, workspace);
18
+ if (!project) {
19
+ context.logger.warn(`[WARNING]: Target project not found.`);
20
+ return;
21
+ }
22
+ const buildTarget = project.targets.get('build');
23
+ const serveTarget = project.targets.get('serve');
24
+ if (buildTarget) {
25
+ const tsConfigPath = buildTarget.options && buildTarget.options['tsConfig'];
26
+ tsConfigPath && updateTsConfigPaths(tree, String(tsConfigPath), options.project);
27
+ }
28
+ else {
29
+ context.logger.warn(`[WARNING]: "build" target was not found, please add paths to ".ng-doc" folder in your tsconfig.json file manually.`);
30
+ }
31
+ if (serveTarget) {
32
+ const tsConfigPath = serveTarget.options && serveTarget.options['tsConfig'];
33
+ tsConfigPath && updateTsConfigPaths(tree, String(tsConfigPath), options.project);
34
+ }
35
+ else {
36
+ context.logger.warn(`[WARNING]: "serve" target was not found, please add paths to ".ng-doc" folder in your tsconfig.json file manually.`);
37
+ }
38
+ });
39
+ };
40
+ }
41
+ exports.addTsconfigPaths = addTsconfigPaths;
42
+ /**
43
+ *
44
+ * @param tree
45
+ * @param path
46
+ * @param filePath
47
+ * @param projectName
48
+ */
49
+ function updateTsConfigPaths(tree, filePath, projectName) {
50
+ const json = new ng_morph_1.JSONFile(tree, filePath);
51
+ const paths = json.get(['compilerOptions', 'paths']);
52
+ const ext = json.get(['extends']);
53
+ if (paths || !ext) {
54
+ json.modify(['compilerOptions', 'paths', `${modules_1.GENERATED_PATH}`], [`.ng-doc/${projectName}/index.ts`]);
55
+ json.modify(['compilerOptions', 'paths', `${modules_1.GENERATED_PATH}/*`], [`.ng-doc/${projectName}/*`]);
56
+ }
57
+ else if (ext) {
58
+ updateTsConfigPaths(tree, path.join(path.dirname(filePath), ext), projectName);
59
+ }
60
+ }
61
+ //# sourceMappingURL=add-tsconfig-paths.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"add-tsconfig-paths.js","sourceRoot":"","sources":["../../../../../../libs/add/schematics/ng-add/steps/add-tsconfig-paths.ts"],"names":[],"mappings":";;;AACA,qEAK+C;AAC/C,uCAAkC;AAClC,6BAA6B;AAE7B,kDAAoD;AAEpD,sDAAgD;AAEhD;;;GAGG;AACH,SAAgB,gBAAgB,CAAC,OAAe;IAC/C,OAAO,KAAK,EAAE,IAAU,EAAE,OAAyB,EAAE,EAAE;QACtD,OAAO,IAAA,2BAAe,EAAC,CAAC,SAA8B,EAAE,EAAE;YACzD,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,mDAAmD,CAAC,CAAC;YAEzE,MAAM,OAAO,GAAkC,IAAA,wBAAU,EAAC,OAAO,EAAE,SAAS,CAAC,CAAC;YAE9E,IAAI,CAAC,OAAO,EAAE;gBACb,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,sCAAsC,CAAC,CAAC;gBAC5D,OAAO;aACP;YAED,MAAM,WAAW,GAAiC,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;YAC/E,MAAM,WAAW,GAAiC,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;YAE/E,IAAI,WAAW,EAAE;gBAChB,MAAM,YAAY,GACjB,WAAW,CAAC,OAAO,IAAK,WAAW,CAAC,OAAO,CAAC,UAAU,CAAY,CAAC;gBAEpE,YAAY,IAAI,mBAAmB,CAAC,IAAI,EAAE,MAAM,CAAC,YAAY,CAAC,EAAE,OAAO,CAAC,OAAO,CAAC,CAAC;aACjF;iBAAM;gBACN,OAAO,CAAC,MAAM,CAAC,IAAI,CAClB,oHAAoH,CACpH,CAAC;aACF;YAED,IAAI,W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';
2
+ import { Schema } from '../schema';
3
+ /**
4
+ *
5
+ * @param options
6
+ */
7
+ export declare function replaceBuilders(options: Schema): Rule;
@@ -0,0 +1,51 @@
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
+ */
10
+ function replaceBuilders(options) {
11
+ return async (tree, 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
+ Object.keys(buildTarget.configurations)
24
+ .forEach((config) => {
25
+ buildTarget.configurations[config].ngDoc = {
26
+ pages: project.sourceRoot
27
+ };
28
+ });
29
+ context.logger.info(`[INFO]: The page path for "build" target is set to "${project.sourceRoot}"`);
30
+ }
31
+ else {
32
+ context.logger.warn(`[WARNING]: "build" target was not found, please add @ng-doc builder manually.`);
33
+ }
34
+ if (serveTarget) {
35
+ serveTarget.builder = '@ng-doc/builder:dev-server';
36
+ Object.keys(serveTarget.configurations)
37
+ .forEach((config) => {
38
+ serveTarget.configurations[config].ngDoc = {
39
+ pages: project.sourceRoot
40
+ };
41
+ });
42
+ context.logger.info(`[INFO]: The page path for "serve" target is set to "${project.sourceRoot}"`);
43
+ }
44
+ else {
45
+ context.logger.warn(`[WARNING]: "serve" target was not found, please add @ng-doc builder manually.`);
46
+ }
47
+ });
48
+ };
49
+ }
50
+ exports.replaceBuilders = replaceBuilders;
51
+ //# sourceMappingURL=replace-builders.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"replace-builders.js","s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,CAAC,IAAI,CAAC,WAAW,CAAC,cAAqB,CAAC;qBAC5C,OAAO,CAAC,CAAC,MAAc,EAAE,EAAE;oBAC1B,WAAW,CAAC,cAAsB,CAAC,MAAM,CAAC,CAAC,KAAK,GAAG;wBACnD,KAAK,EAAE,OAAO,CAAC,UAAU;qBACzB,CAAA;gBACF,CAAC,CAAC,CAAC;gBACJ,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,uDAAuD,OAAO,CAAC,UAAU,GAAG,CAAC,CAAC;aAClG;iBAAM;gBACN,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,+EAA+E,CAAC,CAAC;aACrG;QACF,CAAC,CAAC,CAAC;IACJ,CAAC,CAAA;AACF,CAAC;AA5CD,0CA4CC"}
@@ -0,0 +1,7 @@
1
+ /**
2
+ *
3
+ * @param filePath
4
+ * @param namedImport
5
+ * @param moduleSpecifier
6
+ */
7
+ export declare function addUniqueImport(filePath: string, namedImport: string, moduleSpecifier: string): void;
@@ -0,0 +1,37 @@
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
@@ -0,0 +1 @@
1
+ {"version":3,"file":"add-unique-import.js","sourceRoot":"","sources":["../../../../../../libs/add/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"}
@@ -0,0 +1,4 @@
1
+ /**
2
+ *
3
+ */
4
+ export declare function createAngularJson(): void;
@@ -0,0 +1,38 @@
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
+ "sourceRoot": "src",
17
+ "architect": {
18
+ "build": {
19
+ "options": {
20
+ "main": "test/main.ts",
21
+ "tsConfig": "test/tsconfig.app.json",
22
+ },
23
+ "configurations": {
24
+ "production": {
25
+ "sourceMap": true,
26
+ "optimization": true,
27
+ "buildOptimizer": true,
28
+ "aot": true
29
+ }
30
+ }
31
+ }
32
+ }
33
+ }
34
+ }
35
+ }`);
36
+ }
37
+ exports.createAngularJson = createAngularJson;
38
+ //# sourceMappingURL=create-angular-json.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"create-angular-json.js","sourceRoot":"","sources":["../../../../../../libs/add/schematics/ng-add/utils/create-angular-json.ts"],"names":[],"mappings":";;;AAAA,uCAA0C;AAE1C;;GAEG;AACH,SAAgB,iBAAiB;IAChC,IAAA,2BAAgB,EACf,cAAc,EACd;;;;;;;;;;;;;;;;;;;;;;;;;;EA0BA,CACA,CAAC;AACH,CAAC;AA/BD,8CA+BC"}
@@ -0,0 +1,4 @@
1
+ /**
2
+ *
3
+ */
4
+ export declare function createGitIgnore(): void;
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.createGitIgnore = void 0;
4
+ const ng_morph_1 = require("ng-morph");
5
+ /**
6
+ *
7
+ */
8
+ function createGitIgnore() {
9
+ (0, ng_morph_1.createSourceFile)('.gitignore', `.cache`);
10
+ }
11
+ exports.createGitIgnore = createGitIgnore;
12
+ //# sourceMappingURL=create-git-ignore.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"create-git-ignore.js","sourceRoot":"","sources":["../../../../../../libs/add/schematics/ng-add/utils/create-git-ignore.ts"],"names":[],"mappings":";;;AAAA,uCAA0C;AAE1C;;GAEG;AACH,SAAgB,eAAe;IAC9B,IAAA,2BAAgB,EACf,YAAY,EACZ,QAAQ,CACR,CAAC;AACH,CAAC;AALD,0CAKC"}
@@ -0,0 +1,4 @@
1
+ /**
2
+ *
3
+ */
4
+ export declare function createTsConfigs(): void;
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.createTsConfigs = void 0;
4
+ const ng_morph_1 = require("ng-morph");
5
+ /**
6
+ *
7
+ */
8
+ function createTsConfigs() {
9
+ (0, ng_morph_1.createSourceFile)('test/tsconfig.app.json', `
10
+ {
11
+ "extends": "../tsconfig.json"
12
+ }
13
+ `);
14
+ (0, ng_morph_1.createSourceFile)('tsconfig.json', `{
15
+ "compilerOptions": {
16
+ "paths": {}
17
+ }
18
+ }`);
19
+ }
20
+ exports.createTsConfigs = createTsConfigs;
21
+ //# sourceMappingURL=create-ts-configs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"create-ts-configs.js","sourceRoot":"","sources":["../../../../../../libs/add/schematics/ng-add/utils/create-ts-configs.ts"],"names":[],"mappings":";;;AAAA,uCAA0C;AAE1C;;GAEG;AACH,SAAgB,eAAe;IAC9B,IAAA,2BAAgB,EACf,wBAAwB,EACxB;;;;CAID,CACC,CAAC;IAEF,IAAA,2BAAgB,EACf,eAAe,EACf;;;;EAIA,CACA,CAAC;AACH,CAAC;AAlBD,0CAkBC"}
@@ -0,0 +1,12 @@
1
+ /**
2
+ *
3
+ * @param tree
4
+ * @param mainPath
5
+ */
6
+ import { Tree } from '@angular-devkit/schematics';
7
+ /**
8
+ *
9
+ * @param tree
10
+ * @param mainPath
11
+ */
12
+ export declare function getAppTemplatePath(tree: Tree, mainPath: string): string | undefined;
@@ -0,0 +1,35 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getAppTemplatePath = void 0;
4
+ const ng_morph_1 = require("ng-morph");
5
+ const get_initializer_1 = require("./get-initializer");
6
+ /**
7
+ *
8
+ * @param tree
9
+ * @param mainPath
10
+ */
11
+ function getAppTemplatePath(tree, mainPath) {
12
+ (0, ng_morph_1.setActiveProject)((0, ng_morph_1.createProject)(tree, '/', ['**/*.ts', '**/*.json']));
13
+ const mainModule = (0, ng_morph_1.getMainModule)(mainPath);
14
+ const mainInitializer = (0, get_initializer_1.getInitializer)(mainModule, 'NgModule', 'declarations');
15
+ if (!ng_morph_1.Node.isArrayLiteralExpression(mainInitializer)) {
16
+ return;
17
+ }
18
+ const appIdentifier = mainInitializer.getElements()[0];
19
+ if (!ng_morph_1.Node.isIdentifier(appIdentifier)) {
20
+ return;
21
+ }
22
+ const appComponent = appIdentifier.getDefinitionNodes()[0];
23
+ if (!ng_morph_1.Node.isClassDeclaration(appComponent)) {
24
+ return;
25
+ }
26
+ const templateInitializer = (0, get_initializer_1.getInitializer)(appComponent, 'Component', 'templateUrl');
27
+ const appComponentPath = appComponent.getSourceFile().getFilePath().split('/');
28
+ const templateUrlPath = `${appComponentPath
29
+ .splice(0, appComponentPath.length - 1)
30
+ .join('/')}/${templateInitializer?.getText().replace(/['"]/g, '')}`;
31
+ (0, ng_morph_1.saveActiveProject)();
32
+ return templateUrlPath;
33
+ }
34
+ exports.getAppTemplatePath = getAppTemplatePath;
35
+ //# sourceMappingURL=get-app-template-path.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get-app-template-path.js","sourceRoot":"","sources":["../../../../../../libs/add/schematics/ng-add/utils/get-app-template-path.ts"],"names":[],"mappings":";;;AAMA,uCAQkB;AAElB,uDAAiD;AAEjD;;;;GAIG;AACH,SAAgB,kBAAkB,CAAC,IAAU,EAAE,QAAgB;IAC9D,IAAA,2BAAgB,EAAC,IAAA,wBAAa,EAAC,IAAI,EAAE,GAAG,EAAE,CAAC,SAAS,EAAE,WAAW,CAAC,CAAC,CAAC,CAAC;IAErE,MAAM,UAAU,GAAqB,IAAA,wBAAa,EAAC,QAAQ,CAAC,CAAC;IAC7D,MAAM,eAAe,GAA2B,IAAA,gCAAc,EAAC,UAAU,EAAE,UAAU,EAAE,cAAc,CAAC,CAAC;IAEvG,IAAI,CAAC,eAAI,CAAC,wBAAwB,CAAC,eAAe,CAAC,EAAE;QACpD,OAAO;KACP;IAED,MAAM,aAAa,GAA2B,eAAe,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC,CAAC;IAE/E,IAAI,CAAC,eAAI,CAAC,YAAY,CAAC,aAAa,CAAC,EAAE;QACtC,OAAO;KACP;IAED,MAAM,YAAY,GAAqB,aAAa,CAAC,kBAAkB,EAAE,CAAC,CAAC,CAAC,CAAC;IAE7E,IAAI,CAAC,eAAI,CAAC,kBAAkB,CAAC,YAAY,CAAC,EAAE;QAC3C,OAAO;KACP;IAED,MAAM,mBAAmB,GAA2B,IAAA,gCAAc,EAAC,YAAY,EAAE,WAAW,EAAE,aAAa,CAAC,CAAC;IAE7G,MAAM,gBAAgB,GAAa,YAAY,CAAC,aAAa,EAAE,CAAC,WAAW,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IAEzF,MAAM,eAAe,GAAW,GAAG,gBAAgB;SACjD,MAAM,CAAC,CAAC,EAAE,gBAAgB,CAAC,MAAM,GAAG,CAAC,CAAC;SACtC,IAAI,CAAC,GAAG,CAAC,IAAI,mBAAmB,EAAE,OAAO,EAAE,CAAC,OAAO,CAAC,OAAO,EAAE,EAAE,CAAC,EAAE,CAAC;IAErE,IAAA,4BAAiB,GAAE,CAAC;IAEpB,OAAO,eAAe,CAAC;AACxB,CAAC;AAjCD,gDAiCC"}
@@ -0,0 +1,8 @@
1
+ import { ClassDeclaration, Expression } from 'ng-morph';
2
+ /**
3
+ *
4
+ * @param classDeclaration
5
+ * @param decoratorName
6
+ * @param propertyName
7
+ */
8
+ export declare function getInitializer(classDeclaration: ClassDeclaration, decoratorName: string, propertyName: string): Expression | undefined;
@@ -0,0 +1,27 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getInitializer = void 0;
4
+ const ng_morph_1 = require("ng-morph");
5
+ /**
6
+ *
7
+ * @param classDeclaration
8
+ * @param decoratorName
9
+ * @param propertyName
10
+ */
11
+ function getInitializer(classDeclaration, decoratorName, propertyName) {
12
+ const decorator = classDeclaration.getDecorator(decoratorName);
13
+ if (!decorator) {
14
+ return;
15
+ }
16
+ const [metadata] = decorator.getArguments();
17
+ if (!ng_morph_1.Node.isObjectLiteralExpression(metadata)) {
18
+ return;
19
+ }
20
+ const property = metadata.getProperty(propertyName);
21
+ if (!ng_morph_1.Node.isPropertyAssignment(property)) {
22
+ return;
23
+ }
24
+ return property.getInitializer();
25
+ }
26
+ exports.getInitializer = getInitializer;
27
+ //# sourceMappingURL=get-initializer.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get-initializer.js","sourceRoot":"","sources":["../../../../../../libs/add/schematics/ng-add/utils/get-initializer.ts"],"names":[],"mappings":";;;AAAA,uCAAiG;AAEjG;;;;;GAKG;AACH,SAAgB,cAAc,CAC7B,gBAAkC,EAClC,aAAqB,EACrB,YAAoB;IAEpB,MAAM,SAAS,GAA0B,gBAAgB,CAAC,YAAY,CAAC,aAAa,CAAC,CAAC;IAEtF,IAAI,CAAC,SAAS,EAAE;QACf,OAAO;KACP;IAED,MAAM,CAAC,QAAQ,CAAC,GAAG,SAAS,CAAC,YAAY,EAAE,CAAC;IAE5C,IAAI,CAAC,eAAI,CAAC,yBAAyB,CAAC,QAAQ,CAAC,EAAE;QAC9C,OAAO;KACP;IAED,MAAM,QAAQ,GAAyC,QAAQ,CAAC,WAAW,CAAC,YAAY,CAAC,CAAC;IAE1F,IAAI,CAAC,eAAI,CAAC,oBAAoB,CAAC,QAAQ,CAAC,EAAE;QACzC,OAAO;KACP;IAED,OAAO,QAAQ,CAAC,cAAc,EAAE,CAAC;AAClC,CAAC;AAxBD,wCAwBC"}
@@ -0,0 +1,8 @@
1
+ import { ProjectDefinition, WorkspaceDefinition } from '@angular-devkit/core/src/workspace';
2
+ import { Schema } from '../schema';
3
+ /**
4
+ *
5
+ * @param options
6
+ * @param workspace
7
+ */
8
+ export declare function getProject(options: Schema, workspace: WorkspaceDefinition): ProjectDefinition | undefined;
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getProject = void 0;
4
+ /**
5
+ *
6
+ * @param options
7
+ * @param workspace
8
+ */
9
+ function getProject(options, workspace) {
10
+ const firstBuildableProjectName = Array.from(workspace.projects.entries()).find(([, project]) => project.targets.get('build'))?.[0];
11
+ const projectName = options.project || workspace.extensions['defaultProject']?.toString() || firstBuildableProjectName || '';
12
+ return workspace.projects.get(projectName);
13
+ }
14
+ exports.getProject = getProject;
15
+ //# sourceMappingURL=get-project.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get-project.js","sourceRoot":"","sources":["../../../../../../libs/add/schematics/ng-add/utils/get-project.ts"],"names":[],"mappings":";;;AAIA;;;;GAIG;AACH,SAAgB,UAAU,CAAC,OAAe,EAAE,SAA8B;IACzE,MAAM,yBAAyB,GAAuB,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,OAAO,EAAE,CAAC,CAAC,IAAI,CAClG,CAAC,CAAC,EAAE,OAAO,CAA8B,EAAE,EAAE,CAAC,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,CAC1E,EAAE,CAAC,CAAC,CAAC,CAAC;IAEP,MAAM,WAAW,GAChB,OAAO,CAAC,OAAO,IAAI,SAAS,CAAC,UAAU,CAAC,gBAAgB,CAAC,EAAE,QAAQ,EAAE,IAAI,yBAAyB,IAAI,EAAE,CAAC;IAC1G,OAAO,SAAS,CAAC,QAAQ,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC;AAC5C,CAAC;AARD,gCAQC"}