@po-ui/ng-schematics 14.0.0 → 14.1.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 (46) hide show
  1. package/README.md +5 -5
  2. package/build-component/build-component.d.ts +3 -3
  3. package/build-component/build-component.js +86 -86
  4. package/build-component/index.d.ts +2 -2
  5. package/build-component/index.js +18 -18
  6. package/build-component/schema.d.ts +34 -34
  7. package/build-component/schema.js +2 -2
  8. package/build-file/build-file.d.ts +3 -3
  9. package/build-file/build-file.js +33 -33
  10. package/build-file/file-options.interface.d.ts +16 -16
  11. package/build-file/file-options.interface.js +2 -2
  12. package/build-file/index.d.ts +2 -2
  13. package/build-file/index.js +18 -18
  14. package/build-target-options/asset-specification.interface.d.ts +21 -21
  15. package/build-target-options/asset-specification.interface.js +2 -2
  16. package/build-target-options/build-target-options.d.ts +7 -7
  17. package/build-target-options/build-target-options.js +37 -37
  18. package/build-target-options/index.d.ts +2 -2
  19. package/build-target-options/index.js +18 -18
  20. package/index.d.ts +7 -7
  21. package/index.js +23 -23
  22. package/module/index.d.ts +1 -1
  23. package/module/index.js +17 -17
  24. package/module/module.d.ts +15 -15
  25. package/module/module.js +128 -128
  26. package/package-config/index.d.ts +2 -2
  27. package/package-config/index.js +18 -18
  28. package/package-config/package-config.d.ts +12 -12
  29. package/package-config/package-config.js +70 -70
  30. package/package-config/update-dependencies.interface.d.ts +7 -7
  31. package/package-config/update-dependencies.interface.js +2 -2
  32. package/package.json +25 -25
  33. package/po-ui-ng-schematics-14.1.0.tgz +0 -0
  34. package/project/index.d.ts +1 -1
  35. package/project/index.js +17 -17
  36. package/project/project.d.ts +9 -9
  37. package/project/project.js +61 -61
  38. package/replace/index.d.ts +1 -1
  39. package/replace/index.js +17 -17
  40. package/replace/replace.d.ts +13 -13
  41. package/replace/replace.js +28 -28
  42. package/utils/index.d.ts +1 -1
  43. package/utils/index.js +17 -17
  44. package/utils/supported-css-extensions.d.ts +1 -1
  45. package/utils/supported-css-extensions.js +4 -4
  46. package/po-ui-ng-schematics-14.0.0.tgz +0 -0
package/README.md CHANGED
@@ -1,5 +1,5 @@
1
- # PO UI Schematics
2
-
3
- Biblioteca para construção de schematics, com objetivo de compartilhar fontes
4
- em comum entre os ng-add, ng-generate e ng-update.
5
-
1
+ # PO UI Schematics
2
+
3
+ Biblioteca para construção de schematics, com objetivo de compartilhar fontes
4
+ em comum entre os ng-add, ng-generate e ng-update.
5
+
@@ -1,3 +1,3 @@
1
- import { Rule } from '@angular-devkit/schematics';
2
- import { Schema as ComponentOptions } from './schema';
3
- export declare function buildComponent(options: ComponentOptions): Rule;
1
+ import { Rule } from '@angular-devkit/schematics';
2
+ import { Schema as ComponentOptions } from './schema';
3
+ export declare function buildComponent(options: ComponentOptions): Rule;
@@ -1,87 +1,87 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.buildComponent = void 0;
4
- const schematics_1 = require("@angular-devkit/schematics");
5
- const find_module_1 = require("@schematics/angular/utility/find-module");
6
- const core_1 = require("@angular-devkit/core");
7
- const parse_name_1 = require("@schematics/angular/utility/parse-name");
8
- const validation_1 = require("@schematics/angular/utility/validation");
9
- const supported_css_extensions_1 = require("../utils/supported-css-extensions");
10
- const project_1 = require("../project");
11
- const module_1 = require("../module");
12
- function buildComponent(options) {
13
- return (host) => {
14
- var _a;
15
- const workspace = (_a = (0, project_1.getWorkspaceConfigGracefully)(host)) !== null && _a !== void 0 ? _a : {};
16
- const project = (0, project_1.getProjectFromWorkspace)(workspace, options.project);
17
- if (options.path === undefined && project) {
18
- options.path = (0, project_1.getDefaultPath)(project);
19
- }
20
- options.module = (0, find_module_1.findModuleFromOptions)(host, options);
21
- const parsedPath = (0, parse_name_1.parseName)(options.path, options.name);
22
- options.name = parsedPath.name;
23
- options.path = parsedPath.path;
24
- options.selector = buildSelector(options, (project && project.prefix) || '');
25
- if (!supported_css_extensions_1.supportedCssExtensions.includes(options.style)) {
26
- options.style = 'css';
27
- }
28
- validateName(options.name);
29
- (0, validation_1.validateHtmlSelector)(options.selector);
30
- const templateSource = (0, schematics_1.apply)((0, schematics_1.url)('./files'), [
31
- options.routing ? (0, schematics_1.noop)() : (0, schematics_1.filter)(path => !path.endsWith('-routing.module.ts.template')),
32
- options.createModule ? (0, schematics_1.noop)() : (0, schematics_1.filter)(path => !path.endsWith('.module.ts.template')),
33
- options.skipTests ? (0, schematics_1.filter)(path => !path.endsWith('.spec.ts.template')) : (0, schematics_1.noop)(),
34
- (0, schematics_1.applyTemplates)(Object.assign(Object.assign({}, core_1.strings), options)),
35
- (0, schematics_1.move)(null, parsedPath.path)
36
- ]);
37
- return (0, schematics_1.chain)([
38
- options.createModule ? addImportToModule(options) : addDeclarationToModule(options),
39
- (0, schematics_1.mergeWith)(templateSource)
40
- ]);
41
- };
42
- }
43
- exports.buildComponent = buildComponent;
44
- function validateName(name) {
45
- if (name && /^\d/.test(name)) {
46
- throw new schematics_1.SchematicsException(core_1.tags.oneLine `name (${name})
47
- can not start with a digit.`);
48
- }
49
- }
50
- function buildSelector(options, projectPrefix) {
51
- let selector = core_1.strings.dasherize(options.name);
52
- if (options.prefix) {
53
- selector = `${options.prefix}-${selector}`;
54
- }
55
- else if (options.prefix === undefined && projectPrefix) {
56
- selector = `${projectPrefix}-${selector}`;
57
- }
58
- return selector;
59
- }
60
- function addImportToModule(options) {
61
- return (tree) => {
62
- if (!options.module || options.routing) {
63
- return tree;
64
- }
65
- const modulePath = options.module;
66
- const componentModulePath = (0, core_1.normalize)(`/${options.path}/` + core_1.strings.dasherize(options.name) + '/' + core_1.strings.dasherize(options.name) + '.module');
67
- const relativePath = (0, find_module_1.buildRelativePath)(modulePath, componentModulePath);
68
- const classifiedModuleName = core_1.strings.classify(`${options.name}Module`);
69
- return (0, module_1.addModuleImportToModule)(tree, modulePath, classifiedModuleName, relativePath);
70
- };
71
- }
72
- function addDeclarationToModule(options) {
73
- return (tree) => {
74
- if (!options.module) {
75
- return tree;
76
- }
77
- const modulePath = options.module;
78
- const componentPath = (0, core_1.normalize)(`/${options.path}/` + core_1.strings.dasherize(options.name) + '/' + core_1.strings.dasherize(options.name) + '.component');
79
- const relativePath = (0, find_module_1.buildRelativePath)(modulePath, componentPath);
80
- const classifiedName = core_1.strings.classify(`${options.name}Component`);
81
- (0, module_1.addDeclarationComponentToModule)(tree, modulePath, classifiedName, relativePath);
82
- if (options.export) {
83
- (0, module_1.addExportComponentToModule)(tree, modulePath, classifiedName, relativePath);
84
- }
85
- };
86
- }
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.buildComponent = void 0;
4
+ const schematics_1 = require("@angular-devkit/schematics");
5
+ const find_module_1 = require("@schematics/angular/utility/find-module");
6
+ const core_1 = require("@angular-devkit/core");
7
+ const parse_name_1 = require("@schematics/angular/utility/parse-name");
8
+ const validation_1 = require("@schematics/angular/utility/validation");
9
+ const supported_css_extensions_1 = require("../utils/supported-css-extensions");
10
+ const project_1 = require("../project");
11
+ const module_1 = require("../module");
12
+ function buildComponent(options) {
13
+ return (host) => {
14
+ var _a;
15
+ const workspace = (_a = (0, project_1.getWorkspaceConfigGracefully)(host)) !== null && _a !== void 0 ? _a : {};
16
+ const project = (0, project_1.getProjectFromWorkspace)(workspace, options.project);
17
+ if (options.path === undefined && project) {
18
+ options.path = (0, project_1.getDefaultPath)(project);
19
+ }
20
+ options.module = (0, find_module_1.findModuleFromOptions)(host, options);
21
+ const parsedPath = (0, parse_name_1.parseName)(options.path, options.name);
22
+ options.name = parsedPath.name;
23
+ options.path = parsedPath.path;
24
+ options.selector = buildSelector(options, (project && project.prefix) || '');
25
+ if (!supported_css_extensions_1.supportedCssExtensions.includes(options.style)) {
26
+ options.style = 'css';
27
+ }
28
+ validateName(options.name);
29
+ (0, validation_1.validateHtmlSelector)(options.selector);
30
+ const templateSource = (0, schematics_1.apply)((0, schematics_1.url)('./files'), [
31
+ options.routing ? (0, schematics_1.noop)() : (0, schematics_1.filter)(path => !path.endsWith('-routing.module.ts.template')),
32
+ options.createModule ? (0, schematics_1.noop)() : (0, schematics_1.filter)(path => !path.endsWith('.module.ts.template')),
33
+ options.skipTests ? (0, schematics_1.filter)(path => !path.endsWith('.spec.ts.template')) : (0, schematics_1.noop)(),
34
+ (0, schematics_1.applyTemplates)(Object.assign(Object.assign({}, core_1.strings), options)),
35
+ (0, schematics_1.move)(null, parsedPath.path)
36
+ ]);
37
+ return (0, schematics_1.chain)([
38
+ options.createModule ? addImportToModule(options) : addDeclarationToModule(options),
39
+ (0, schematics_1.mergeWith)(templateSource)
40
+ ]);
41
+ };
42
+ }
43
+ exports.buildComponent = buildComponent;
44
+ function validateName(name) {
45
+ if (name && /^\d/.test(name)) {
46
+ throw new schematics_1.SchematicsException(core_1.tags.oneLine `name (${name})
47
+ can not start with a digit.`);
48
+ }
49
+ }
50
+ function buildSelector(options, projectPrefix) {
51
+ let selector = core_1.strings.dasherize(options.name);
52
+ if (options.prefix) {
53
+ selector = `${options.prefix}-${selector}`;
54
+ }
55
+ else if (options.prefix === undefined && projectPrefix) {
56
+ selector = `${projectPrefix}-${selector}`;
57
+ }
58
+ return selector;
59
+ }
60
+ function addImportToModule(options) {
61
+ return (tree) => {
62
+ if (!options.module || options.routing) {
63
+ return tree;
64
+ }
65
+ const modulePath = options.module;
66
+ const componentModulePath = (0, core_1.normalize)(`/${options.path}/` + core_1.strings.dasherize(options.name) + '/' + core_1.strings.dasherize(options.name) + '.module');
67
+ const relativePath = (0, find_module_1.buildRelativePath)(modulePath, componentModulePath);
68
+ const classifiedModuleName = core_1.strings.classify(`${options.name}Module`);
69
+ return (0, module_1.addModuleImportToModule)(tree, modulePath, classifiedModuleName, relativePath);
70
+ };
71
+ }
72
+ function addDeclarationToModule(options) {
73
+ return (tree) => {
74
+ if (!options.module) {
75
+ return tree;
76
+ }
77
+ const modulePath = options.module;
78
+ const componentPath = (0, core_1.normalize)(`/${options.path}/` + core_1.strings.dasherize(options.name) + '/' + core_1.strings.dasherize(options.name) + '.component');
79
+ const relativePath = (0, find_module_1.buildRelativePath)(modulePath, componentPath);
80
+ const classifiedName = core_1.strings.classify(`${options.name}Component`);
81
+ (0, module_1.addDeclarationComponentToModule)(tree, modulePath, classifiedName, relativePath);
82
+ if (options.export) {
83
+ (0, module_1.addExportComponentToModule)(tree, modulePath, classifiedName, relativePath);
84
+ }
85
+ };
86
+ }
87
87
  //# sourceMappingURL=build-component.js.map
@@ -1,2 +1,2 @@
1
- export * from './build-component';
2
- export * from './schema';
1
+ export * from './build-component';
2
+ export * from './schema';
@@ -1,19 +1,19 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
- };
16
- Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./build-component"), exports);
18
- __exportStar(require("./schema"), exports);
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./build-component"), exports);
18
+ __exportStar(require("./schema"), exports);
19
19
  //# sourceMappingURL=index.js.map
@@ -1,34 +1,34 @@
1
- /**
2
- * Creates a new generic component definition in the given or default project.
3
- */
4
- export interface Schema {
5
- /**
6
- * When true, the declaring NgModule exports this component.
7
- */
8
- export?: boolean;
9
- /**
10
- * The declaring NgModule.
11
- */
12
- module?: string;
13
- /**
14
- * The name of the component.
15
- */
16
- name: string;
17
- /**
18
- * The path at which to create the component file, relative to the current workspace.
19
- * Default is a folder with the same name as the component in the project root.
20
- */
21
- path?: string;
22
- /** The prefix to apply to the generated component selector. */
23
- prefix?: string;
24
- /** The name of the project. */
25
- project?: string;
26
- /** The file extension to use for style files. */
27
- style?: string;
28
- /** When true, creates a routing module. */
29
- routing?: boolean;
30
- /** When true, does not create \"spec.ts\" test files for the app. */
31
- skipTests?: boolean;
32
- /** When true, create a component module. */
33
- createModule?: boolean;
34
- }
1
+ /**
2
+ * Creates a new generic component definition in the given or default project.
3
+ */
4
+ export interface Schema {
5
+ /**
6
+ * When true, the declaring NgModule exports this component.
7
+ */
8
+ export?: boolean;
9
+ /**
10
+ * The declaring NgModule.
11
+ */
12
+ module?: string;
13
+ /**
14
+ * The name of the component.
15
+ */
16
+ name: string;
17
+ /**
18
+ * The path at which to create the component file, relative to the current workspace.
19
+ * Default is a folder with the same name as the component in the project root.
20
+ */
21
+ path?: string;
22
+ /** The prefix to apply to the generated component selector. */
23
+ prefix?: string;
24
+ /** The name of the project. */
25
+ project?: string;
26
+ /** The file extension to use for style files. */
27
+ style?: string;
28
+ /** When true, creates a routing module. */
29
+ routing?: boolean;
30
+ /** When true, does not create \"spec.ts\" test files for the app. */
31
+ skipTests?: boolean;
32
+ /** When true, create a component module. */
33
+ createModule?: boolean;
34
+ }
@@ -1,3 +1,3 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  //# sourceMappingURL=schema.js.map
@@ -1,3 +1,3 @@
1
- import { Rule } from '@angular-devkit/schematics';
2
- import { FileOptions } from './file-options.interface';
3
- export declare function buildFile(options: FileOptions): Rule;
1
+ import { Rule } from '@angular-devkit/schematics';
2
+ import { FileOptions } from './file-options.interface';
3
+ export declare function buildFile(options: FileOptions): Rule;
@@ -1,34 +1,34 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.buildFile = void 0;
4
- const schematics_1 = require("@angular-devkit/schematics");
5
- const core_1 = require("@angular-devkit/core");
6
- const parse_name_1 = require("@schematics/angular/utility/parse-name");
7
- const project_1 = require("../project");
8
- function buildFile(options) {
9
- return (host) => {
10
- var _a;
11
- const workspace = (_a = (0, project_1.getWorkspaceConfigGracefully)(host)) !== null && _a !== void 0 ? _a : {};
12
- const project = (0, project_1.getProjectFromWorkspace)(workspace, options.project);
13
- if (options.path === undefined && project) {
14
- options.path = (0, project_1.getDefaultPath)(project);
15
- }
16
- const parsedPath = (0, parse_name_1.parseName)(options.path, options.name);
17
- options.name = parsedPath.name;
18
- options.path = parsedPath.path;
19
- validateName(options.name);
20
- const templateSource = (0, schematics_1.apply)((0, schematics_1.url)('./files'), [
21
- (0, schematics_1.applyTemplates)(Object.assign(Object.assign({}, core_1.strings), options)),
22
- (0, schematics_1.move)(null, parsedPath.path)
23
- ]);
24
- return (0, schematics_1.chain)([(0, schematics_1.mergeWith)(templateSource)]);
25
- };
26
- }
27
- exports.buildFile = buildFile;
28
- function validateName(name) {
29
- if (name && /^\d/.test(name)) {
30
- throw new schematics_1.SchematicsException(core_1.tags.oneLine `name (${name})
31
- can not start with a digit.`);
32
- }
33
- }
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.buildFile = void 0;
4
+ const schematics_1 = require("@angular-devkit/schematics");
5
+ const core_1 = require("@angular-devkit/core");
6
+ const parse_name_1 = require("@schematics/angular/utility/parse-name");
7
+ const project_1 = require("../project");
8
+ function buildFile(options) {
9
+ return (host) => {
10
+ var _a;
11
+ const workspace = (_a = (0, project_1.getWorkspaceConfigGracefully)(host)) !== null && _a !== void 0 ? _a : {};
12
+ const project = (0, project_1.getProjectFromWorkspace)(workspace, options.project);
13
+ if (options.path === undefined && project) {
14
+ options.path = (0, project_1.getDefaultPath)(project);
15
+ }
16
+ const parsedPath = (0, parse_name_1.parseName)(options.path, options.name);
17
+ options.name = parsedPath.name;
18
+ options.path = parsedPath.path;
19
+ validateName(options.name);
20
+ const templateSource = (0, schematics_1.apply)((0, schematics_1.url)('./files'), [
21
+ (0, schematics_1.applyTemplates)(Object.assign(Object.assign({}, core_1.strings), options)),
22
+ (0, schematics_1.move)(null, parsedPath.path)
23
+ ]);
24
+ return (0, schematics_1.chain)([(0, schematics_1.mergeWith)(templateSource)]);
25
+ };
26
+ }
27
+ exports.buildFile = buildFile;
28
+ function validateName(name) {
29
+ if (name && /^\d/.test(name)) {
30
+ throw new schematics_1.SchematicsException(core_1.tags.oneLine `name (${name})
31
+ can not start with a digit.`);
32
+ }
33
+ }
34
34
  //# sourceMappingURL=build-file.js.map
@@ -1,16 +1,16 @@
1
- /**
2
- * Creates a new generic file definition in the given or default project.
3
- */
4
- export interface FileOptions {
5
- /**
6
- * The name of the file.
7
- */
8
- name: string;
9
- /**
10
- * The path at which to create the file, relative to the current workspace.
11
- * Default is a folder with the same name as the file in the project root.
12
- */
13
- path?: string;
14
- /** The name of the project. */
15
- project?: string;
16
- }
1
+ /**
2
+ * Creates a new generic file definition in the given or default project.
3
+ */
4
+ export interface FileOptions {
5
+ /**
6
+ * The name of the file.
7
+ */
8
+ name: string;
9
+ /**
10
+ * The path at which to create the file, relative to the current workspace.
11
+ * Default is a folder with the same name as the file in the project root.
12
+ */
13
+ path?: string;
14
+ /** The name of the project. */
15
+ project?: string;
16
+ }
@@ -1,3 +1,3 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  //# sourceMappingURL=file-options.interface.js.map
@@ -1,2 +1,2 @@
1
- export * from './build-file';
2
- export * from './file-options.interface';
1
+ export * from './build-file';
2
+ export * from './file-options.interface';
@@ -1,19 +1,19 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
- };
16
- Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./build-file"), exports);
18
- __exportStar(require("./file-options.interface"), exports);
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./build-file"), exports);
18
+ __exportStar(require("./file-options.interface"), exports);
19
19
  //# sourceMappingURL=index.js.map
@@ -1,21 +1,21 @@
1
- /**
2
- * Each build target configuration can include an assets array that lists files or folders you want to copy as-is when building your project.
3
- */
4
- export interface AssetSpecification {
5
- /**
6
- * A node-glob using input as base directory.
7
- */
8
- glob?: string;
9
- /**
10
- * A path relative to the workspace root.
11
- */
12
- input?: string;
13
- /**
14
- * A path relative to outDir (default is dist/project-name).
15
- */
16
- output?: string;
17
- /**
18
- * A list of globs to exclude.
19
- */
20
- ignore?: Array<string>;
21
- }
1
+ /**
2
+ * Each build target configuration can include an assets array that lists files or folders you want to copy as-is when building your project.
3
+ */
4
+ export interface AssetSpecification {
5
+ /**
6
+ * A node-glob using input as base directory.
7
+ */
8
+ glob?: string;
9
+ /**
10
+ * A path relative to the workspace root.
11
+ */
12
+ input?: string;
13
+ /**
14
+ * A path relative to outDir (default is dist/project-name).
15
+ */
16
+ output?: string;
17
+ /**
18
+ * A list of globs to exclude.
19
+ */
20
+ ignore?: Array<string>;
21
+ }
@@ -1,3 +1,3 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  //# sourceMappingURL=asset-specification.interface.js.map
@@ -1,7 +1,7 @@
1
- import { Tree } from '@angular-devkit/schematics';
2
- import { WorkspaceProject, WorkspaceSchema } from '@schematics/angular/utility/workspace-models';
3
- import { AssetSpecification } from './asset-specification.interface';
4
- /** Add a file or asset in project workspace */
5
- export declare function configuringBuildTargets(options: any, optionsProperty: string, buildTargetElement: string | AssetSpecification): (tree: Tree) => Tree;
6
- /** Adds an entry to the given project target options. */
7
- export declare function addOptionToTarget(project: WorkspaceProject, targetName: 'test' | 'build', host: Tree, optionsProperty: string, optionPath: string | AssetSpecification, workspace: WorkspaceSchema): void;
1
+ import { Tree } from '@angular-devkit/schematics';
2
+ import { WorkspaceProject, WorkspaceSchema } from '@schematics/angular/utility/workspace-models';
3
+ import { AssetSpecification } from './asset-specification.interface';
4
+ /** Add a file or asset in project workspace */
5
+ export declare function configuringBuildTargets(options: any, optionsProperty: string, buildTargetElement: string | AssetSpecification): (tree: Tree) => Tree;
6
+ /** Adds an entry to the given project target options. */
7
+ export declare function addOptionToTarget(project: WorkspaceProject, targetName: 'test' | 'build', host: Tree, optionsProperty: string, optionPath: string | AssetSpecification, workspace: WorkspaceSchema): void;
@@ -1,38 +1,38 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.addOptionToTarget = exports.configuringBuildTargets = void 0;
4
- const project_1 = require("../project");
5
- /** Add a file or asset in project workspace */
6
- function configuringBuildTargets(options, optionsProperty, buildTargetElement) {
7
- return function (tree) {
8
- var _a;
9
- const workspace = (_a = (0, project_1.getWorkspaceConfigGracefully)(tree)) !== null && _a !== void 0 ? _a : {};
10
- const project = (0, project_1.getProjectFromWorkspace)(workspace, options.project);
11
- addOptionToTarget(project, 'build', tree, optionsProperty, buildTargetElement, workspace);
12
- addOptionToTarget(project, 'test', tree, optionsProperty, buildTargetElement, workspace);
13
- return tree;
14
- };
15
- }
16
- exports.configuringBuildTargets = configuringBuildTargets;
17
- /** Adds an entry to the given project target options. */
18
- function addOptionToTarget(project, targetName, host, optionsProperty, optionPath, workspace) {
19
- const targetOptions = (0, project_1.getProjectTargetOptions)(project, targetName);
20
- if (!targetOptions) {
21
- return;
22
- }
23
- if (!targetOptions[optionsProperty]) {
24
- targetOptions[optionsProperty] = [optionPath];
25
- }
26
- else {
27
- const existingPaths = targetOptions[optionsProperty].map((s) => (typeof s === 'string' ? s : s.input));
28
- for (const [, optionPathValue] of existingPaths.entries()) {
29
- if (optionPathValue === optionPath) {
30
- return;
31
- }
32
- }
33
- targetOptions[optionsProperty].unshift(optionPath);
34
- }
35
- host.overwrite('angular.json', JSON.stringify(workspace, null, 2));
36
- }
37
- exports.addOptionToTarget = addOptionToTarget;
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.addOptionToTarget = exports.configuringBuildTargets = void 0;
4
+ const project_1 = require("../project");
5
+ /** Add a file or asset in project workspace */
6
+ function configuringBuildTargets(options, optionsProperty, buildTargetElement) {
7
+ return function (tree) {
8
+ var _a;
9
+ const workspace = (_a = (0, project_1.getWorkspaceConfigGracefully)(tree)) !== null && _a !== void 0 ? _a : {};
10
+ const project = (0, project_1.getProjectFromWorkspace)(workspace, options.project);
11
+ addOptionToTarget(project, 'build', tree, optionsProperty, buildTargetElement, workspace);
12
+ addOptionToTarget(project, 'test', tree, optionsProperty, buildTargetElement, workspace);
13
+ return tree;
14
+ };
15
+ }
16
+ exports.configuringBuildTargets = configuringBuildTargets;
17
+ /** Adds an entry to the given project target options. */
18
+ function addOptionToTarget(project, targetName, host, optionsProperty, optionPath, workspace) {
19
+ const targetOptions = (0, project_1.getProjectTargetOptions)(project, targetName);
20
+ if (!targetOptions) {
21
+ return;
22
+ }
23
+ if (!targetOptions[optionsProperty]) {
24
+ targetOptions[optionsProperty] = [optionPath];
25
+ }
26
+ else {
27
+ const existingPaths = targetOptions[optionsProperty].map((s) => (typeof s === 'string' ? s : s.input));
28
+ for (const [, optionPathValue] of existingPaths.entries()) {
29
+ if (optionPathValue === optionPath) {
30
+ return;
31
+ }
32
+ }
33
+ targetOptions[optionsProperty].unshift(optionPath);
34
+ }
35
+ host.overwrite('angular.json', JSON.stringify(workspace, null, 2));
36
+ }
37
+ exports.addOptionToTarget = addOptionToTarget;
38
38
  //# sourceMappingURL=build-target-options.js.map
@@ -1,2 +1,2 @@
1
- export * from './build-target-options';
2
- export * from './asset-specification.interface';
1
+ export * from './build-target-options';
2
+ export * from './asset-specification.interface';