@ng-atomic/schematics 17.4.0 → 17.6.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.
Files changed (95) hide show
  1. package/collection.json +31 -24
  2. package/index.js +399 -0
  3. package/index.js.map +7 -0
  4. package/lib/_utilities/index.js +188 -0
  5. package/lib/_utilities/index.js.map +7 -0
  6. package/lib/atomic-component/index.js +96 -0
  7. package/lib/atomic-component/index.js.map +7 -0
  8. package/lib/ng-add/index.js +126 -0
  9. package/lib/ng-add/index.js.map +7 -0
  10. package/lib/page/index.js +256 -0
  11. package/lib/page/index.js.map +7 -0
  12. package/lib/pages/index.js +39 -0
  13. package/lib/pages/index.js.map +7 -0
  14. package/lib/setup/index.js +109 -0
  15. package/lib/setup/index.js.map +7 -0
  16. package/lib/style-header/index.js +56 -0
  17. package/lib/style-header/index.js.map +7 -0
  18. package/package.json +3 -5
  19. package/src/_utilities/add-path-to-routes.d.ts +0 -2
  20. package/src/_utilities/add-path-to-routes.js +0 -34
  21. package/src/_utilities/add-path-to-routes.js.map +0 -1
  22. package/src/_utilities/angular-config.d.ts +0 -4
  23. package/src/_utilities/angular-config.js +0 -23
  24. package/src/_utilities/angular-config.js.map +0 -1
  25. package/src/_utilities/index.d.ts +0 -4
  26. package/src/_utilities/index.js +0 -8
  27. package/src/_utilities/index.js.map +0 -1
  28. package/src/_utilities/overwrite.d.ts +0 -2
  29. package/src/_utilities/overwrite.js +0 -13
  30. package/src/_utilities/overwrite.js.map +0 -1
  31. package/src/_utilities/package-config.d.ts +0 -12
  32. package/src/_utilities/package-config.js +0 -47
  33. package/src/_utilities/package-config.js.map +0 -1
  34. package/src/_utilities/save-file.d.ts +0 -2
  35. package/src/_utilities/save-file.js +0 -11
  36. package/src/_utilities/save-file.js.map +0 -1
  37. package/src/_utilities/ts-config.d.ts +0 -2
  38. package/src/_utilities/ts-config.js +0 -15
  39. package/src/_utilities/ts-config.js.map +0 -1
  40. package/src/atomic-component/_test/example.atom.scss +0 -6
  41. package/src/atomic-component/_test/example.atom.ts +0 -16
  42. package/src/atomic-component/index.d.ts +0 -10
  43. package/src/atomic-component/index.js +0 -53
  44. package/src/atomic-component/index.js.map +0 -1
  45. package/src/atomic-component/index.spec.ts +0 -187
  46. package/src/atomic-component/schema.d.ts +0 -24
  47. package/src/atomic-component/schema.js +0 -3
  48. package/src/atomic-component/schema.js.map +0 -1
  49. package/src/index.d.ts +0 -6
  50. package/src/index.js +0 -10
  51. package/src/index.js.map +0 -1
  52. package/src/ng-add/index.d.ts +0 -3
  53. package/src/ng-add/index.js +0 -31
  54. package/src/ng-add/index.js.map +0 -1
  55. package/src/page/_test/example.module.ts +0 -26
  56. package/src/page/_test/example.page.scss +0 -6
  57. package/src/page/_test/example.page.ts +0 -15
  58. package/src/page/index.d.ts +0 -3
  59. package/src/page/index.js +0 -71
  60. package/src/page/index.js.map +0 -1
  61. package/src/page/index.spec.ts +0 -37
  62. package/src/pages/index.d.ts +0 -3
  63. package/src/pages/index.js +0 -15
  64. package/src/pages/index.js.map +0 -1
  65. package/src/pages/index.spec.ts +0 -17
  66. package/src/pages/schema.d.ts +0 -7
  67. package/src/pages/schema.js +0 -3
  68. package/src/pages/schema.js.map +0 -1
  69. package/src/setup/index.d.ts +0 -2
  70. package/src/setup/index.js +0 -18
  71. package/src/setup/index.js.map +0 -1
  72. package/src/setup/index.spec.ts +0 -37
  73. package/src/style-header/_test/example.scss +0 -6
  74. package/src/style-header/index.d.ts +0 -4
  75. package/src/style-header/index.js +0 -18
  76. package/src/style-header/index.js.map +0 -1
  77. package/src/style-header/index.spec.ts +0 -43
  78. package/src/style-header/schema.d.ts +0 -6
  79. package/src/style-header/schema.js +0 -3
  80. package/src/style-header/schema.js.map +0 -1
  81. /package/{src → lib}/atomic-component/files/__name@dasherize__/__name@dasherize__.stories.ts.template +0 -0
  82. /package/{src → lib}/atomic-component/files/__name@dasherize__/index.ts.template +0 -0
  83. /package/{src → lib}/atomic-component/files/__name@dasherize__/ng-package.json.template +0 -0
  84. /package/{src → lib}/atomic-component/schema.json +0 -0
  85. /package/{src → lib}/ng-add/schema.json +0 -0
  86. /package/{src → lib}/page/files/__name@dasherize__/__name@dasherize__.routes.ts.template +0 -0
  87. /package/{src → lib}/pages/files/__name@dasherize__/__name@dasherize__.routes.ts.template +0 -0
  88. /package/{src → lib}/pages/schema.json +0 -0
  89. /package/{src → lib}/setup/files/atomic/_atom.scss +0 -0
  90. /package/{src → lib}/setup/files/atomic/_component.scss +0 -0
  91. /package/{src → lib}/setup/files/atomic/_molecule.scss +0 -0
  92. /package/{src → lib}/setup/files/atomic/_organism.scss +0 -0
  93. /package/{src → lib}/setup/files/atomic/_page.scss +0 -0
  94. /package/{src → lib}/setup/files/atomic/_template.scss +0 -0
  95. /package/{src → lib}/style-header/schema.json +0 -0
@@ -1,23 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.addStyleIncludePath = exports.setDefaultCollection = exports.addSchematicsConfig = void 0;
4
- const tslib_1 = require("tslib");
5
- const lodash_get_1 = tslib_1.__importDefault(require("lodash.get"));
6
- const lodash_set_1 = tslib_1.__importDefault(require("lodash.set"));
7
- const overwrite_1 = require("./overwrite");
8
- const PACKAGE_NAME = '@ng-atomic/schematics';
9
- const addSchematicsConfig = ({ project, componentsDir }, type) => (host) => {
10
- const query = `projects.${project}.schematics.${PACKAGE_NAME}:${type}`;
11
- return (0, overwrite_1.overwrite)(host, 'angular.json', json => ((0, lodash_set_1.default)(json, query, { 'path': `${componentsDir}/${type}s` }), json));
12
- };
13
- exports.addSchematicsConfig = addSchematicsConfig;
14
- const setDefaultCollection = () => (host) => {
15
- return (0, overwrite_1.overwrite)(host, 'angular.json', json => ((0, lodash_set_1.default)(json, `cli.defaultCollection`, PACKAGE_NAME), json));
16
- };
17
- exports.setDefaultCollection = setDefaultCollection;
18
- const addStyleIncludePath = ({ project, stylesDir }) => (host) => {
19
- const query = `projects.${project}.architect.build.options.stylePreprocessorOptions.includePaths`;
20
- return (0, overwrite_1.overwrite)(host, 'angular.json', json => ((0, lodash_set_1.default)(json, query, [...new Set((0, lodash_get_1.default)(json, query)).add(stylesDir)]), json));
21
- };
22
- exports.addStyleIncludePath = addStyleIncludePath;
23
- //# sourceMappingURL=angular-config.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"angular-config.js","sourceRoot":"","sources":["../../../../../../packages/@ng-atomic/schematics/src/_utilities/angular-config.ts"],"names":[],"mappings":";;;;AACA,oEAA6B;AAC7B,oEAA6B;AAC7B,2CAAwC;AAExC,MAAM,YAAY,GAAG,uBAAuB,CAAC;AAEtC,MAAM,mBAAmB,GAAG,CAAC,EAAC,OAAO,EAAE,aAAa,EAAM,EAAE,IAAY,EAAE,EAAE,CAAC,CAAC,IAAU,EAAQ,EAAE;IACxG,MAAM,KAAK,GAAG,YAAY,OAAO,eAAe,YAAY,IAAI,IAAI,EAAE,CAAC;IACvE,OAAO,IAAA,qBAAS,EAAC,IAAI,EAAE,cAAc,EAAE,IAAI,CAAC,EAAE,CAAC,CAAC,IAAA,oBAAG,EAAC,IAAI,EAAE,KAAK,EAAE,EAAC,MAAM,EAAE,GAAG,aAAa,IAAI,IAAI,GAAG,EAAC,CAAC,EAAE,IAAI,CAAC,CAAC,CAAC;AACjH,CAAC,CAAC;AAHW,QAAA,mBAAmB,uBAG9B;AAEK,MAAM,oBAAoB,GAAG,GAAG,EAAE,CAAC,CAAC,IAAU,EAAE,EAAE;IACxD,OAAO,IAAA,qBAAS,EAAC,IAAI,EAAE,cAAc,EAAE,IAAI,CAAC,EAAE,CAAC,CAAC,IAAA,oBAAG,EAAC,IAAI,EAAE,uBAAuB,EAAE,YAAY,CAAC,EAAE,IAAI,CAAC,CAAC,CAAC;AAC1G,CAAC,CAAA;AAFY,QAAA,oBAAoB,wBAEhC;AAEM,MAAM,mBAAmB,GAAG,CAAC,EAAC,OAAO,EAAE,SAAS,EAAM,EAAE,EAAE,CAAC,CAAC,IAAU,EAAE,EAAE;IAChF,MAAM,KAAK,GAAG,YAAY,OAAO,gEAAgE,CAAC;IAClG,OAAO,IAAA,qBAAS,EAAC,IAAI,EAAE,cAAc,EAAE,IAAI,CAAC,EAAE,CAAC,CAAC,IAAA,oBAAG,EAAC,IAAI,EAAE,KAAK,EAAE,CAAC,GAAG,IAAI,GAAG,CAAC,IAAA,oBAAG,EAAC,IAAI,EAAE,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC,CAAC;AACzH,CAAC,CAAC;AAHW,QAAA,mBAAmB,uBAG9B"}
@@ -1,4 +0,0 @@
1
- export * from './add-path-to-routes';
2
- export * from './angular-config';
3
- export * from './package-config';
4
- export * from './ts-config';
@@ -1,8 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const tslib_1 = require("tslib");
4
- tslib_1.__exportStar(require("./add-path-to-routes"), exports);
5
- tslib_1.__exportStar(require("./angular-config"), exports);
6
- tslib_1.__exportStar(require("./package-config"), exports);
7
- tslib_1.__exportStar(require("./ts-config"), exports);
8
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../packages/@ng-atomic/schematics/src/_utilities/index.ts"],"names":[],"mappings":";;;AAAA,+DAAqC;AACrC,2DAAiC;AACjC,2DAAiC;AACjC,sDAA4B"}
@@ -1,2 +0,0 @@
1
- import { Tree } from '@angular-devkit/schematics';
2
- export declare function overwrite(host: Tree, file: string, callback: (json: object) => object): Tree;
@@ -1,13 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.overwrite = void 0;
4
- const jsonc_parser_1 = require("jsonc-parser");
5
- function overwrite(host, file, callback) {
6
- if (!host.exists(file))
7
- return host;
8
- const json = (0, jsonc_parser_1.parse)(host.read(file).toString('utf-8'));
9
- host.overwrite(file, JSON.stringify(callback(json), null, 2));
10
- return host;
11
- }
12
- exports.overwrite = overwrite;
13
- //# sourceMappingURL=overwrite.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"overwrite.js","sourceRoot":"","sources":["../../../../../../packages/@ng-atomic/schematics/src/_utilities/overwrite.ts"],"names":[],"mappings":";;;AAEA,+CAAqC;AAErC,SAAgB,SAAS,CAAC,IAAU,EAAE,IAAY,EAAE,QAAkC;IACrF,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC;QAAE,OAAO,IAAI,CAAC;IACpC,MAAM,IAAI,GAAG,IAAA,oBAAK,EAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAE,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC;IACvD,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC;IAC9D,OAAO,IAAI,CAAC;AACb,CAAC;AALD,8BAKC"}
@@ -1,12 +0,0 @@
1
- /**
2
- * @license
3
- * Copyright Google LLC All Rights Reserved.
4
- *
5
- * Use of this source code is governed by an MIT-style license that can be
6
- * found in the LICENSE file at https://angular.io/license
7
- */
8
- import { Tree } from '@angular-devkit/schematics';
9
- /** Adds a package to the package.json in the given host tree. */
10
- export declare function addPackageToPackageJson(host: Tree, pkg: string, version: string, dependencies?: string): Tree;
11
- /** Gets the version of the specified package by looking at the package.json in the given tree. */
12
- export declare function getPackageVersionFromPackageJson(tree: Tree, name: string): string | null;
@@ -1,47 +0,0 @@
1
- "use strict";
2
- /**
3
- * @license
4
- * Copyright Google LLC All Rights Reserved.
5
- *
6
- * Use of this source code is governed by an MIT-style license that can be
7
- * found in the LICENSE file at https://angular.io/license
8
- */
9
- Object.defineProperty(exports, "__esModule", { value: true });
10
- exports.getPackageVersionFromPackageJson = exports.addPackageToPackageJson = void 0;
11
- /**
12
- * Sorts the keys of the given object.
13
- * @returns A new object instance with sorted keys
14
- */
15
- function sortObjectByKeys(obj) {
16
- return Object.keys(obj).sort().reduce((result, key) => (result[key] = obj[key]) && result, {});
17
- }
18
- /** Adds a package to the package.json in the given host tree. */
19
- function addPackageToPackageJson(host, pkg, version, dependencies = 'dependencies') {
20
- if (host.exists('package.json')) {
21
- const sourceText = host.read('package.json').toString('utf-8');
22
- const json = JSON.parse(sourceText);
23
- if (!json[dependencies]) {
24
- json[dependencies] = {};
25
- }
26
- if (!json[dependencies][pkg]) {
27
- json[dependencies][pkg] = version;
28
- json[dependencies] = sortObjectByKeys(json[dependencies]);
29
- }
30
- host.overwrite('package.json', JSON.stringify(json, null, 2));
31
- }
32
- return host;
33
- }
34
- exports.addPackageToPackageJson = addPackageToPackageJson;
35
- /** Gets the version of the specified package by looking at the package.json in the given tree. */
36
- function getPackageVersionFromPackageJson(tree, name) {
37
- if (!tree.exists('package.json')) {
38
- return null;
39
- }
40
- const packageJson = JSON.parse(tree.read('package.json').toString('utf8'));
41
- if (packageJson.dependencies && packageJson.dependencies[name]) {
42
- return packageJson.dependencies[name];
43
- }
44
- return null;
45
- }
46
- exports.getPackageVersionFromPackageJson = getPackageVersionFromPackageJson;
47
- //# sourceMappingURL=package-config.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"package-config.js","sourceRoot":"","sources":["../../../../../../packages/@ng-atomic/schematics/src/_utilities/package-config.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;;AAIH;;;GAGG;AACH,SAAS,gBAAgB,CAAC,GAAW;IACnC,OAAO,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,CAAC,MAAM,CAAC,CAAC,MAAM,EAAE,GAAG,EAAE,EAAE,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,GAAG,GAAG,CAAC,GAAG,CAAC,CAAC,IAAI,MAAM,EAAE,EAAE,CAAC,CAAC;AACjG,CAAC;AAED,iEAAiE;AACjE,SAAgB,uBAAuB,CACtC,IAAU,EACV,GAAW,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1
- import { Tree } from '@angular-devkit/schematics';
2
- export declare function saveFile(host: Tree, path: string, callback: (str: string) => string): Tree;
@@ -1,11 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.saveFile = void 0;
4
- function saveFile(host, path, callback) {
5
- host.exists(path)
6
- ? host.overwrite(path, callback(host.read(path).toString('utf-8')))
7
- : host.create(path, callback(''));
8
- return host;
9
- }
10
- exports.saveFile = saveFile;
11
- //# sourceMappingURL=save-file.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"save-file.js","sourceRoot":"","sources":["../../../../../../packages/@ng-atomic/schematics/src/_utilities/save-file.ts"],"names":[],"mappings":";;;AAEA,SAAgB,QAAQ,CAAC,IAAU,EAAE,IAAY,EAAE,QAAiC;IACnF,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC;QAChB,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAE,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC;QACpE,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,EAAE,QAAQ,CAAC,EAAE,CAAC,CAAC,CAAC;IACnC,OAAO,IAAI,CAAC;AACb,CAAC;AALD,4BAKC"}
@@ -1,2 +0,0 @@
1
- import { Tree } from '@angular-devkit/schematics';
2
- export declare const addPathsToTsConfig: ({ componentsDir }: any) => (host: Tree) => import("@angular-devkit/schematics/src/tree/interface").Tree;
@@ -1,15 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.addPathsToTsConfig = void 0;
4
- const tslib_1 = require("tslib");
5
- const lodash_set_1 = tslib_1.__importDefault(require("lodash.set"));
6
- const overwrite_1 = require("./overwrite");
7
- const addPathsToTsConfig = ({ componentsDir }) => (host) => {
8
- return (0, overwrite_1.overwrite)(host, host.exists('tsconfig.base.json') ? 'tsconfig.base.json' : 'tsconfig.json', json => {
9
- (0, lodash_set_1.default)(json, `compilerOptions.paths.@components`, [componentsDir]);
10
- (0, lodash_set_1.default)(json, `compilerOptions.paths.@components/*`, [`${componentsDir}/*`]);
11
- return json;
12
- });
13
- };
14
- exports.addPathsToTsConfig = addPathsToTsConfig;
15
- //# sourceMappingURL=ts-config.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ts-config.js","sourceRoot":"","sources":["../../../../../../packages/@ng-atomic/schematics/src/_utilities/ts-config.ts"],"names":[],"mappings":";;;;AACA,oEAA6B;AAC7B,2CAAwC;AAEjC,MAAM,kBAAkB,GAAG,CAAC,EAAC,aAAa,EAAM,EAAE,EAAE,CAAC,CAAC,IAAU,EAAE,EAAE;IAC1E,OAAO,IAAA,qBAAS,EAAC,IAAI,EAAE,IAAI,CAAC,MAAM,CAAC,oBAAoB,CAAC,CAAC,CAAC,CAAC,oBAAoB,CAAC,CAAC,CAAC,eAAe,EAAE,IAAI,CAAC,EAAE;QACzG,IAAA,oBAAG,EAAC,IAAI,EAAE,mCAAmC,EAAE,CAAC,aAAa,CAAC,CAAC,CAAC;QAChE,IAAA,oBAAG,EAAC,IAAI,EAAE,qCAAqC,EAAE,CAAC,GAAG,aAAa,IAAI,CAAC,CAAC,CAAC;QACzE,OAAO,IAAI,CAAC;IACb,CAAC,CAAC,CAAC;AACJ,CAAC,CAAC;AANW,QAAA,kBAAkB,sBAM7B"}
@@ -1,6 +0,0 @@
1
- @use 'scoped-var/strict' as * with ($host: 'example');
2
- @use 'atomic/atom' as *;
3
-
4
- :host {
5
- @include atom($host);
6
- }
@@ -1,16 +0,0 @@
1
- import { ChangeDetectionStrategy, Component, OnInit } from '@angular/core';
2
-
3
- @Component({
4
- selector: 'atoms-example',
5
- templateUrl: './example.atom.html',
6
- styleUrls: ['./example.atom.scss'],
7
- changeDetection: ChangeDetectionStrategy.OnPush
8
- })
9
- export class ExampleAtom implements OnInit {
10
-
11
- constructor() { }
12
-
13
- ngOnInit(): void {
14
- }
15
-
16
- }
@@ -1,10 +0,0 @@
1
- import { Rule } from '@angular-devkit/schematics';
2
- import { Schema } from './schema';
3
- export declare const atomicComponent: (options: Schema) => Rule;
4
- export declare const atom: (options: Schema) => Rule;
5
- export declare const molecule: (options: Schema) => Rule;
6
- export declare const organism: (options: Schema) => Rule;
7
- export declare const template: (options: Schema) => Rule;
8
- export declare const frame: (options: Schema) => Rule;
9
- export declare const sheet: (options: Schema) => Rule;
10
- export declare const dialog: (options: Schema) => Rule;
@@ -1,53 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.dialog = exports.sheet = exports.frame = exports.template = exports.organism = exports.molecule = exports.atom = exports.atomicComponent = void 0;
4
- const tslib_1 = require("tslib");
5
- const schematics_1 = require("@angular-devkit/schematics");
6
- const strings = tslib_1.__importStar(require("@angular-devkit/core/src/utils/strings"));
7
- const parse_name_1 = require("@schematics/angular/utility/parse-name");
8
- const workspace_1 = require("@schematics/angular/utility/workspace");
9
- const path_1 = require("path");
10
- const lodash_1 = require("lodash");
11
- const atomicComponent = (options) => async (host, _) => {
12
- options.prefix || (options.prefix = `${options.type}s`);
13
- options.path = (0, path_1.join)(await (0, workspace_1.createDefaultPath)(host, options.project), options?.path ?? '');
14
- const { name, path, type, project, standalone } = options = { ...options, ...(0, parse_name_1.parseName)(options.path, options.name) };
15
- const opt = (0, lodash_1.omit)(options, ['styleHeader', 'useTypeAsExtension', 'story', 'ngPackage']);
16
- const { styleHeader, useTypeAsExtension } = options;
17
- const componentExt = useTypeAsExtension ? type : 'component';
18
- const scssPath = `${path}/${name}/${name}.${componentExt}.scss`;
19
- return (0, schematics_1.chain)([
20
- options.standalone ? (0, schematics_1.noop)() : (0, schematics_1.externalSchematic)('@schematics/angular', 'module', { name, path, project }),
21
- (0, schematics_1.externalSchematic)('@schematics/angular', 'component', { ...opt, type: componentExt, export: true }),
22
- (0, schematics_1.mergeWith)((0, schematics_1.apply)((0, schematics_1.url)('./files'), [
23
- (0, schematics_1.applyTemplates)({ ...strings, name, type: type ?? 'component', standalone }),
24
- (0, schematics_1.move)(path),
25
- (0, schematics_1.filter)(path => {
26
- if (path.endsWith('/index.ts'))
27
- return true;
28
- if (options.ngPackage && path.endsWith('/ng-package.json'))
29
- return true;
30
- if (options.story && path.endsWith('.stories.ts'))
31
- return true;
32
- return false;
33
- }),
34
- ])),
35
- (0, schematics_1.schematic)('style-header', { ...options, styleHeader, name, type, path: scssPath }),
36
- ]);
37
- };
38
- exports.atomicComponent = atomicComponent;
39
- const atom = (options) => (0, exports.atomicComponent)(({ ...options, type: 'atom' }));
40
- exports.atom = atom;
41
- const molecule = (options) => (0, exports.atomicComponent)(({ ...options, type: 'molecule' }));
42
- exports.molecule = molecule;
43
- const organism = (options) => (0, exports.atomicComponent)(({ ...options, type: 'organism' }));
44
- exports.organism = organism;
45
- const template = (options) => (0, exports.atomicComponent)(({ ...options, type: 'template' }));
46
- exports.template = template;
47
- const frame = (options) => (0, exports.atomicComponent)(({ ...options, type: 'frame' }));
48
- exports.frame = frame;
49
- const sheet = (options) => (0, exports.atomicComponent)(({ ...options, type: 'sheet' }));
50
- exports.sheet = sheet;
51
- const dialog = (options) => (0, exports.atomicComponent)(({ ...options, type: 'dialog' }));
52
- exports.dialog = dialog;
53
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../packages/@ng-atomic/schematics/src/atomic-component/index.ts"],"names":[],"mappings":";;;;AAAA,2DAMoC;AACpC,wFAAkE;AAClE,uEAAmE;AACnE,qEAA0E;AAC1E,+BAA4B;AAE5B,mCAA8B;AAEvB,MAAM,eAAe,GAAG,CAAC,OAAe,EAAQ,EAAE,CAAC,KAAK,EAAE,IAAU,EAAE,CAAmB,EAAE,EAAE;IACnG,OAAO,CAAC,MAAM,KAAd,OAAO,CAAC,MAAM,GAAK,GAAG,OAAO,CAAC,IAAI,GAAG,EAAC;IACtC,OAAO,CAAC,IAAI,GAAG,IA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E,IAAI,EAAE,UAAU,EAAC,CAAC,CAAC,CAAC;AAAxF,QAAA,QAAQ,YAAgF;AAC9F,MAAM,KAAK,GAAG,CAAC,OAAe,EAAQ,EAAE,CAAC,IAAA,uBAAe,EAAC,CAAC,EAAC,GAAG,OAAO,EAAE,IAAI,EAAE,OAAO,EAAC,CAAC,CAAC,CAAC;AAAlF,QAAA,KAAK,SAA6E;AACxF,MAAM,KAAK,GAAG,CAAC,OAAe,EAAQ,EAAE,CAAC,IAAA,uBAAe,EAAC,CAAC,EAAC,GAAG,OAAO,EAAE,IAAI,EAAE,OAAO,EAAC,CAAC,CAAC,CAAC;AAAlF,QAAA,KAAK,SAA6E;AACxF,MAAM,MAAM,GAAG,CAAC,OAAe,EAAQ,EAAE,CAAC,IAAA,uBAAe,EAAC,CAAC,EAAC,GAAG,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAC,CAAC,CAAC,CAAC;AAApF,QAAA,MAAM,UAA8E"}
@@ -1,187 +0,0 @@
1
- import { SchematicTestRunner, UnitTestTree } from '@angular-devkit/schematics/testing';
2
- import { readFileSync } from 'fs';
3
- import path from 'path';
4
- import { join } from 'path';
5
- import {
6
- buildExpectedFilePaths,
7
- createWorkspace,
8
- defaultWorkspaceOptions,
9
- defaultAppOptions,
10
- getTestProjectPath,
11
- createNxWorkspace,
12
- } from '../_testing';
13
-
14
- const COLLECTION_PATH = path.join(__dirname, '../../collection.json');
15
-
16
- describe('AtomicComponent Schematics', () => {
17
- const runner = new SchematicTestRunner('@ng-atomic/schematics', COLLECTION_PATH);
18
- let tree: UnitTestTree;
19
-
20
- describe('Angular Workspace', () => {
21
- beforeEach(async () => {
22
- tree = await createWorkspace(runner, tree);
23
- });
24
-
25
- it('should create atomic component files', async () => {
26
- const options = {project: 'app', path: '_shared/components', name: 'example'};
27
-
28
- const { files } = await runner.runSchematicAsync('atomic-component', options, tree).toPromise();
29
- expect(files).toContain('/projects/app/src/app/_shared/components/example/example.module.ts');
30
- expect(files).toContain('/projects/app/src/app/_shared/components/example/example.component.html');
31
- expect(files).toContain('/projects/app/src/app/_shared/components/example/example.component.scss');
32
- expect(files).toContain('/projects/app/src/app/_shared/components/example/example.component.spec.ts');
33
- expect(files).toContain('/projects/app/src/app/_shared/components/example/example.component.ts');
34
- expect(files).toContain('/projects/app/src/app/_shared/components/example/example.stories.ts');
35
- expect(files).toContain('/projects/app/src/app/_shared/components/example/index.ts');
36
- });
37
-
38
- it('should create atomic component files', async () => {
39
- tree = await runner.runSchematicAsync('atomic-component', {project: 'app', name: '_shared/components/first'}, tree).toPromise();
40
- tree = await runner.runSchematicAsync('atomic-component', {project: 'app', name: '_shared/components/second'}, tree).toPromise();
41
-
42
- const { files } = tree;
43
- expect(files).toContain('/projects/app/src/app/_shared/components/first/first.module.ts');
44
- expect(files).toContain('/projects/app/src/app/_shared/components/first/first.component.html');
45
- expect(files).toContain('/projects/app/src/app/_shared/components/first/first.component.scss');
46
- expect(files).toContain('/projects/app/src/app/_shared/components/first/first.component.spec.ts');
47
- expect(files).toContain('/projects/app/src/app/_shared/components/first/first.component.ts');
48
- expect(files).toContain('/projects/app/src/app/_shared/components/first/first.stories.ts');
49
- expect(files).toContain('/projects/app/src/app/_shared/components/first/index.ts');
50
-
51
- expect(files).toContain('/projects/app/src/app/_shared/components/second/second.module.ts');
52
- expect(files).toContain('/projects/app/src/app/_shared/components/second/second.component.html');
53
- expect(files).toContain('/projects/app/src/app/_shared/components/second/second.component.scss');
54
- expect(files).toContain('/projects/app/src/app/_shared/components/second/second.component.spec.ts');
55
- expect(files).toContain('/projects/app/src/app/_shared/components/second/second.component.ts');
56
- expect(files).toContain('/projects/app/src/app/_shared/components/second/second.stories.ts');
57
- expect(files).toContain('/projects/app/src/app/_shared/components/second/index.ts');
58
-
59
- // const source = tree.read('/projects/app/src/app/_shared/components/index.ts')!.toString('utf-8');
60
- // expect(source).toEqual(`export { FirstModule } from './first';\nexport { SecondModule } from './second';`);
61
- });
62
-
63
- it('should create atomic components files in app2', async () => {
64
- const options = {project: 'app2', name: '_shared/components/example'};
65
- const projectPath = getTestProjectPath(defaultWorkspaceOptions, {...defaultAppOptions, name: 'app2'});
66
- const expectedFilePaths = buildExpectedFilePaths(options.name, 'example', projectPath, 'component');
67
-
68
- const { files } = await runner.runSchematicAsync('atomic-component', options, tree).toPromise();
69
- expectedFilePaths.forEach(path => expect(files).toContain(path));
70
- });
71
-
72
- describe('given useTypeAsExtension is false', () => {
73
- it('should output `example.component.ts`', async () => {
74
- const options = {project: 'app2', name: '_shared/components/example', type: 'dialog', useTypeAsExtension: false};
75
- const projectPath = getTestProjectPath(defaultWorkspaceOptions, {...defaultAppOptions, name: 'app2'});
76
- const expectedFilePaths = buildExpectedFilePaths(options.name, 'example', projectPath, 'component');
77
-
78
- tree = await runner.runSchematicAsync('atomic-component', options, tree).toPromise();
79
- expectedFilePaths.forEach(path => expect(tree.files).toContain(path));
80
-
81
- const inputScss = tree.read('/projects/app2/src/app/_shared/components/example/example.component.scss').toString('utf-8');
82
- expect(inputScss.replace(/\s/g, '')).toEqual(`
83
- @use 'scoped-var/strict' as * with ($host: 'example');
84
- @use 'atomic/dialog' as *;
85
-
86
- :host {
87
- @include dialog($host);
88
- }
89
- `.replace(/\s/g, ''));
90
- });
91
- });
92
- });
93
-
94
- describe('Nx Workspace', () => {
95
- beforeEach(async () => {
96
- tree = await createNxWorkspace(runner, tree);
97
- });
98
-
99
- xit('', async () => {
100
- const options = {project: 'app', name: '_shared/components/extras/example'};
101
- // const options = {project: 'app', path: '_shared/components/extras', name: 'example'};
102
- const { files } = await runner.runSchematicAsync('atomic-component', options, tree).toPromise();
103
- expect(files).toContain('/apps/app/src/app/_shared/components/extras/example/example.module.ts');
104
- });
105
- });
106
-
107
- });
108
-
109
- describe('Atom Schematics', () => {
110
- const runner = new SchematicTestRunner('@ng-atomic/schematics', COLLECTION_PATH);
111
- let tree: UnitTestTree;
112
-
113
- beforeEach(async () => {
114
- tree = await createWorkspace(runner, tree);
115
- });
116
-
117
- it('should create atom files', async () => {
118
- const options = {project: 'app', name: '_shared/components/example'};
119
- const projectPath = getTestProjectPath(defaultWorkspaceOptions, {...defaultAppOptions, name: 'app'});
120
- const expectedFilePaths = buildExpectedFilePaths(options.name, 'example', projectPath, 'atom');
121
-
122
- const host = await runner.runSchematicAsync('atom', options, tree).toPromise();
123
- expectedFilePaths.forEach(path => expect(host.files.includes(path)).toBeTruthy());
124
-
125
- const inputTs = host.read('/projects/app/src/app/_shared/components/example/example.atom.ts').toString('utf-8');
126
- const expectedTs = readFileSync(join(__dirname, '_test/example.atom.ts')).toString();
127
- expect(inputTs.replace(/\s/g, '')).toEqual(expectedTs.replace(/\s/g, ''));
128
-
129
- const inputScss = host.read('/projects/app/src/app/_shared/components/example/example.atom.scss').toString('utf-8');
130
- const expectedScss = readFileSync(join(__dirname, '_test/example.atom.scss')).toString();
131
- expect(inputScss.replace(/\s/g, '')).toEqual(expectedScss.replace(/\s/g, ''));
132
- });
133
- });
134
-
135
- describe('Molecule Schematics', () => {
136
- const runner = new SchematicTestRunner('@ng-atomic/schematics', COLLECTION_PATH);
137
- let tree: UnitTestTree;
138
-
139
- beforeEach(async () => {
140
- tree = await createWorkspace(runner, tree);
141
- });
142
-
143
- it('should create molecule files', async () => {
144
- const options = {project: 'app', name: '_shared/components/example'};
145
- const projectPath = getTestProjectPath(defaultWorkspaceOptions, {...defaultAppOptions, name: 'app'});
146
- const expectedFilePaths = buildExpectedFilePaths(options.name, 'example', projectPath, 'molecule');
147
-
148
- const { files } = await runner.runSchematicAsync('molecule', options, tree).toPromise();
149
- expectedFilePaths.forEach(path => expect(files.includes(path)).toBeTruthy());
150
- });
151
- });
152
-
153
- describe('Organism Schematics', () => {
154
- const runner = new SchematicTestRunner('@ng-atomic/schematics', COLLECTION_PATH);
155
- let tree: UnitTestTree;
156
-
157
- beforeEach(async () => {
158
- tree = await createWorkspace(runner, tree);
159
- });
160
-
161
- it('should create organism files', async () => {
162
- const options = {project: 'app', name: '_shared/components/example'};
163
- const projectPath = getTestProjectPath(defaultWorkspaceOptions, {...defaultAppOptions, name: 'app'});
164
- const expectedFilePaths = buildExpectedFilePaths(options.name, 'example', projectPath, 'organism');
165
-
166
- const { files } = await runner.runSchematicAsync('organism', options, tree).toPromise();
167
- expectedFilePaths.forEach(path => expect(files.includes(path)).toBeTruthy());
168
- });
169
- });
170
-
171
- describe('Template Schematics', () => {
172
- const runner = new SchematicTestRunner('@ng-atomic/schematics', COLLECTION_PATH);
173
- let tree: UnitTestTree;
174
-
175
- beforeEach(async () => {
176
- tree = await createWorkspace(runner, tree);
177
- });
178
-
179
- it('should create template files', async () => {
180
- const options = {project: 'app', name: '_shared/components/example'};
181
- const projectPath = getTestProjectPath(defaultWorkspaceOptions, {...defaultAppOptions, name: 'app'});
182
- const expectedFilePaths = buildExpectedFilePaths(options.name, 'example', projectPath, 'template');
183
-
184
- const { files } = await runner.runSchematicAsync('template', options, tree).toPromise();
185
- expectedFilePaths.forEach(path => expect(files.includes(path)).toBeTruthy());
186
- });
187
- });
@@ -1,24 +0,0 @@
1
- export interface Schema {
2
- path?: string;
3
- project?: string;
4
- name?: string;
5
- displayBlock?: string;
6
- inlineTemplate?: string;
7
- viewEncapsulation?: "Emulated" | "Native" | "None" | "ShadowDom";
8
- changeDetection?: "Default" | "OnPush";
9
- prefix?: string;
10
- style?: string;
11
- type?: string;
12
- skipTests?: boolean;
13
- flat?: boolean;
14
- skipImport?: boolean;
15
- selector?: string;
16
- skipSelector?: boolean;
17
- module?: string;
18
- export?: boolean;
19
- styleHeader?: string;
20
- standalone?: boolean;
21
- useTypeAsExtension: boolean;
22
- story?: boolean;
23
- ngPackage?: boolean;
24
- }
@@ -1,3 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=schema.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"schema.js","sourceRoot":"","sources":["../../../../../../packages/@ng-atomic/schematics/src/atomic-component/schema.ts"],"names":[],"mappings":""}
package/src/index.d.ts DELETED
@@ -1,6 +0,0 @@
1
- export * from './atomic-component';
2
- export * from './ng-add';
3
- export * from './page';
4
- export * from './pages';
5
- export * from './setup';
6
- export * from './style-header';
package/src/index.js DELETED
@@ -1,10 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const tslib_1 = require("tslib");
4
- tslib_1.__exportStar(require("./atomic-component"), exports);
5
- tslib_1.__exportStar(require("./ng-add"), exports);
6
- tslib_1.__exportStar(require("./page"), exports);
7
- tslib_1.__exportStar(require("./pages"), exports);
8
- tslib_1.__exportStar(require("./setup"), exports);
9
- tslib_1.__exportStar(require("./style-header"), exports);
10
- //# sourceMappingURL=index.js.map
package/src/index.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../packages/@ng-atomic/schematics/src/index.ts"],"names":[],"mappings":";;;AAAA,6DAAmC;AACnC,mDAAyB;AACzB,iDAAuB;AACvB,kDAAwB;AACxB,kDAAwB;AACxB,yDAA+B"}
@@ -1,3 +0,0 @@
1
- import { Rule } from '@angular-devkit/schematics';
2
- export default function (options: any): Rule;
3
- export declare function getCustomWebpackVersion(ver: string): string;
@@ -1,31 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getCustomWebpackVersion = void 0;
4
- const tasks_1 = require("@angular-devkit/schematics/tasks");
5
- const _utilities_1 = require("../_utilities");
6
- function default_1(options) {
7
- return (host, context) => {
8
- const ngCoreVersionTag = (0, _utilities_1.getPackageVersionFromPackageJson)(host, '@angular/core');
9
- const angularDependencyVersion = ngCoreVersionTag || `0.0.0-NG`;
10
- if (angularDependencyVersion === '0.0.0-NG') {
11
- throw new Error('@angular/core version is not supported.');
12
- }
13
- (0, _utilities_1.addPackageToPackageJson)(host, '@ng-atomic/schematics', '^1.0.0', 'devDependencies');
14
- (0, _utilities_1.addPackageToPackageJson)(host, 'scoped-var', '^1.0.0', 'devDependencies');
15
- const installTaskId = context.addTask(new tasks_1.NodePackageInstallTask());
16
- // Set Up Angular Atomic Schematics
17
- context.addTask(new tasks_1.RunSchematicTask('setup', { ...options }), [installTaskId]);
18
- return host;
19
- };
20
- }
21
- exports.default = default_1;
22
- function getCustomWebpackVersion(ver) {
23
- const [major, minor, patch] = (ver.replace(/(\^|\~)/, '')).split('.');
24
- switch (major) {
25
- case '10': return '^0.1000.0';
26
- case '11': return '^0.1100.0';
27
- default: throw new Error('@angular/core version is not supported.');
28
- }
29
- }
30
- exports.getCustomWebpackVersion = getCustomWebpackVersion;
31
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../packages/@ng-atomic/schematics/src/ng-add/index.ts"],"names":[],"mappings":";;;AACA,4DAA4F;AAC5F,8CAA0F;AAE1F,mBAAwB,OAAY;IAClC,OAAO,CAAC,IAAU,EAAE,OAAyB,EAAE,EAAE;QAC/C,MAAM,gBAAgB,GAAG,IAAA,6CAAgC,EAAC,IAAI,EAAE,eAAe,CAAC,CAAC;QACjF,MAAM,wBAAwB,GAAG,gBAAgB,IAAI,UAAU,CAAC;QAEhE,IAAI,wBAAwB,KAAK,UAAU,EAAE;YAC3C,MAAM,IAAI,KAAK,CAAC,yCAAyC,CAAC,CAAC;SAC5D;QAEH,IAAA,oCAAuB,EAAC,IAAI,EAAE,uBAAuB,EAAE,QAAQ,EAAE,iBAAiB,CAAC,CAAC;QACpF,IAAA,oCAAuB,EAAC,IAAI,EAAE,YAAY,EAAE,QAAQ,EAAE,iBAAiB,CAAC,CAAC;QAEzE,MAAM,aAAa,GAAG,OAAO,CAAC,OAAO,CAAC,IAAI,8BAAsB,EAAE,CAAC,CAAC;QAEpE,mCAAmC;QACnC,OAAO,CAAC,OAAO,CAAC,IAAI,wBAAgB,CAAC,OAAO,EAAE,EAAC,GAAG,OAAO,EAAC,CAAC,EAAE,CAAC,aAAa,CAAC,CAAC,CAAA;QAE7E,OAAO,IAAI,CAAA;IACX,CAAC,CAAA;AACH,CAAC;AAnBD,4BAmBC;AAED,SAAgB,uBAAuB,CAAC,GAAW;IACjD,MAAM,CAAC,KAAK,EAAE,KAAK,EAAE,KAAK,CAAC,GAAG,CAAC,GAAG,CAAC,OAAO,CAAC,SAAS,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IACtE,QAAQ,KAAK,EAAE;QACb,KAAK,IAAI,CAAC,CAAC,OAAO,WAAW,CAAC;QAC9B,KAAK,IAAI,CAAC,CAAC,OAAO,WAAW,CAAC;QAC9B,OAAO,CAAC,CAAC,MAAM,IAAI,KAAK,CAAC,yCAAyC,CAAC,CAAC;KACrE;AACH,CAAC;AAPD,0DAOC"}
@@ -1,26 +0,0 @@
1
- import { NgModule } from '@angular/core';
2
- import { CommonModule } from '@angular/common';
3
- import { Routes, RouterModule } from '@angular/router';
4
- import { ExamplePage } from './example.page';
5
-
6
- const routes: Routes = [
7
- {
8
- path: '',
9
- component: ExamplePage,
10
- // loadChildren: () => import('./pages/pages.module').then(m => m.PagesModule)
11
- }
12
- ];
13
-
14
- @NgModule({
15
- declarations: [
16
- ExamplePage
17
- ],
18
- imports: [
19
- CommonModule,
20
- RouterModule.forChild(routes)
21
- ],
22
- exports: [
23
- ExamplePage
24
- ]
25
- })
26
- export class ExampleModule { }
@@ -1,6 +0,0 @@
1
- @use 'scoped-var/strict' as * with ($host:'example');
2
- @use 'atomic/page' as *;
3
-
4
- :host {
5
- @include page($host);
6
- }
@@ -1,15 +0,0 @@
1
- import { Component, OnInit } from '@angular/core';
2
-
3
- @Component({
4
- selector: 'pages-example',
5
- templateUrl: './example.page.html',
6
- styleUrls: ['./example.page.scss']
7
- })
8
- export class ExamplePage implements OnInit {
9
-
10
- constructor() { }
11
-
12
- ngOnInit(): void {
13
- }
14
-
15
- }
@@ -1,3 +0,0 @@
1
- import { Rule } from '@angular-devkit/schematics';
2
- import { Schema } from '../atomic-component/schema';
3
- export declare const page: (options: Schema) => Rule;