@ng-atomic/schematics 16.1.0 → 16.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/collection.json +5 -0
- package/package.json +1 -1
- package/src/atomic-component/files/__name@dasherize__/ng-package.json.template +0 -3
- package/src/atomic-component/index.d.ts +2 -0
- package/src/atomic-component/index.js +21 -3
- package/src/atomic-component/index.js.map +1 -1
- package/src/atomic-component/schema.d.ts +2 -0
- package/src/atomic-component/schema.json +10 -0
package/collection.json
CHANGED
|
@@ -40,6 +40,11 @@
|
|
|
40
40
|
"factory": "./src/atomic-component/index#frame",
|
|
41
41
|
"schema": "./src/atomic-component/schema.json"
|
|
42
42
|
},
|
|
43
|
+
"sheet": {
|
|
44
|
+
"description": "Create a sheet",
|
|
45
|
+
"factory": "./src/atomic-component/index#sheet",
|
|
46
|
+
"schema": "./src/atomic-component/schema.json"
|
|
47
|
+
},
|
|
43
48
|
"page": {
|
|
44
49
|
"description": "Create a page",
|
|
45
50
|
"factory": "./src/page/index#page",
|
package/package.json
CHANGED
|
@@ -1,10 +1,7 @@
|
|
|
1
1
|
{
|
|
2
|
-
"$schema": "../../../../../../../node_modules/ng-packagr/ng-package.schema.json",
|
|
3
|
-
"dest": "../../../dist/packages/@ng-atomic/components",
|
|
4
2
|
"lib": {
|
|
5
3
|
"entryFile": "index.ts",
|
|
6
4
|
"styleIncludePaths": [
|
|
7
|
-
"../../../../../../node_modules",
|
|
8
5
|
"../../../styles"
|
|
9
6
|
]
|
|
10
7
|
}
|
|
@@ -6,3 +6,5 @@ export declare const molecule: (options: Schema) => Rule;
|
|
|
6
6
|
export declare const organism: (options: Schema) => Rule;
|
|
7
7
|
export declare const template: (options: Schema) => Rule;
|
|
8
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,23 +1,37 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.frame = exports.template = exports.organism = exports.molecule = exports.atom = exports.atomicComponent = void 0;
|
|
3
|
+
exports.dialog = exports.sheet = exports.frame = exports.template = exports.organism = exports.molecule = exports.atom = exports.atomicComponent = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const schematics_1 = require("@angular-devkit/schematics");
|
|
6
6
|
const strings = tslib_1.__importStar(require("@angular-devkit/core/src/utils/strings"));
|
|
7
7
|
const parse_name_1 = require("@schematics/angular/utility/parse-name");
|
|
8
8
|
const workspace_1 = require("@schematics/angular/utility/workspace");
|
|
9
9
|
const path_1 = require("path");
|
|
10
|
+
const lodash_1 = require("lodash");
|
|
10
11
|
const atomicComponent = (options) => async (host, _) => {
|
|
11
12
|
options.prefix || (options.prefix = `${options.type}s`);
|
|
12
13
|
options.path = (0, path_1.join)(await (0, workspace_1.createDefaultPath)(host, options.project), options?.path ?? '');
|
|
13
14
|
const { name, path, type, project, standalone } = options = { ...options, ...(0, parse_name_1.parseName)(options.path, options.name) };
|
|
14
|
-
const
|
|
15
|
+
const opt = (0, lodash_1.omit)(options, ['styleHeader', 'useTypeAsExtension', 'story', 'ngPackage']);
|
|
16
|
+
const { styleHeader, useTypeAsExtension } = options;
|
|
15
17
|
const componentExt = useTypeAsExtension ? type : 'component';
|
|
16
18
|
const scssPath = `${path}/${name}/${name}.${componentExt}.scss`;
|
|
17
19
|
return (0, schematics_1.chain)([
|
|
18
20
|
options.standalone ? (0, schematics_1.noop)() : (0, schematics_1.externalSchematic)('@schematics/angular', 'module', { name, path, project }),
|
|
19
21
|
(0, schematics_1.externalSchematic)('@schematics/angular', 'component', { ...opt, type: componentExt, export: true }),
|
|
20
|
-
(0, schematics_1.mergeWith)((0, schematics_1.apply)((0, schematics_1.url)('./files'), [
|
|
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
|
+
])),
|
|
21
35
|
(0, schematics_1.schematic)('style-header', { ...options, styleHeader, name, type, path: scssPath }),
|
|
22
36
|
]);
|
|
23
37
|
};
|
|
@@ -32,4 +46,8 @@ const template = (options) => (0, exports.atomicComponent)(({ ...options, type:
|
|
|
32
46
|
exports.template = template;
|
|
33
47
|
const frame = (options) => (0, exports.atomicComponent)(({ ...options, type: 'frame' }));
|
|
34
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;
|
|
35
53
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../packages/@ng-atomic/schematics/src/atomic-component/index.ts"],"names":[],"mappings":";;;;AAAA,
|
|
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,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AAC9F,MAAM,QAAQ,GAAG,CAAC,OAAe,EAAQ,EAAE,CAAC,IAAA,uBAAe,EAAC,CAAC,EAAC,GAAG,OAAO,EAAE,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"}
|
|
@@ -135,6 +135,16 @@
|
|
|
135
135
|
"type": "boolean",
|
|
136
136
|
"default": true,
|
|
137
137
|
"x-user-analytics": "ep.ng_standalone"
|
|
138
|
+
},
|
|
139
|
+
"story": {
|
|
140
|
+
"description": "When true, creates a storybook file for the component.",
|
|
141
|
+
"type": "boolean",
|
|
142
|
+
"default": false
|
|
143
|
+
},
|
|
144
|
+
"ngPackage": {
|
|
145
|
+
"description": "When true, creates a ng-package file for the component.",
|
|
146
|
+
"type": "boolean",
|
|
147
|
+
"default": true
|
|
138
148
|
}
|
|
139
149
|
},
|
|
140
150
|
"required": [
|