@ngflow/ng-architect 1.0.5 → 1.0.6
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/package.json
CHANGED
|
@@ -1 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.default = default_1;
|
|
4
|
+
const schematics_1 = require("@angular-devkit/schematics");
|
|
5
|
+
const string_utils_1 = require("../utils/string-utils");
|
|
6
|
+
function default_1(options) {
|
|
7
|
+
const serviceKebab = (0, string_utils_1.toKebabCase)(options.name);
|
|
8
|
+
const servicePascal = (0, string_utils_1.toPascalCase)(options.name);
|
|
9
|
+
return (0, schematics_1.chain)([
|
|
10
|
+
(_tree, context) => {
|
|
11
|
+
context.logger.info(`✅ Creating service: ${servicePascal} (${serviceKebab})`);
|
|
12
|
+
},
|
|
13
|
+
(0, schematics_1.mergeWith)((0, schematics_1.apply)((0, schematics_1.url)('./files'), [
|
|
14
|
+
(0, schematics_1.template)({ serviceKebab, servicePascal, store: options.store })
|
|
15
|
+
]))
|
|
16
|
+
]);
|
|
17
|
+
}
|
|
1
18
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":""}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":";;AAYA,4BAcC;AA1BD,2DASoC;AACpC,wDAAkE;AAElE,mBAAwB,OAAY;IAClC,MAAM,YAAY,GAAG,IAAA,0BAAW,EAAC,OAAO,CAAC,IAAI,CAAC,CAAC;IAC/C,MAAM,aAAa,GAAG,IAAA,2BAAY,EAAC,OAAO,CAAC,IAAI,CAAC,CAAC;IAEjD,OAAO,IAAA,kBAAK,EAAC;QACX,CAAC,KAAW,EAAE,OAAyB,EAAE,EAAE;YACzC,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,uBAAuB,aAAa,KAAK,YAAY,GAAG,CAAC,CAAC;QAChF,CAAC;QACD,IAAA,sBAAS,EACP,IAAA,kBAAK,EAAC,IAAA,gBAAG,EAAC,SAAS,CAAC,EAAE;YACpB,IAAA,qBAAQ,EAAC,EAAE,YAAY,EAAE,aAAa,EAAE,KAAK,EAAE,OAAO,CAAC,KAAK,EAAE,CAAC;SAChE,CAAC,CACH;KACF,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Rule,
|
|
3
|
+
SchematicContext,
|
|
4
|
+
Tree,
|
|
5
|
+
apply,
|
|
6
|
+
chain,
|
|
7
|
+
mergeWith,
|
|
8
|
+
template,
|
|
9
|
+
url
|
|
10
|
+
} from '@angular-devkit/schematics';
|
|
11
|
+
import { toKebabCase, toPascalCase } from '../utils/string-utils';
|
|
12
|
+
|
|
13
|
+
export default function(options: any): Rule {
|
|
14
|
+
const serviceKebab = toKebabCase(options.name);
|
|
15
|
+
const servicePascal = toPascalCase(options.name);
|
|
16
|
+
|
|
17
|
+
return chain([
|
|
18
|
+
(_tree: Tree, context: SchematicContext) => {
|
|
19
|
+
context.logger.info(`✅ Creating service: ${servicePascal} (${serviceKebab})`);
|
|
20
|
+
},
|
|
21
|
+
mergeWith(
|
|
22
|
+
apply(url('./files'), [
|
|
23
|
+
template({ serviceKebab, servicePascal, store: options.store })
|
|
24
|
+
])
|
|
25
|
+
)
|
|
26
|
+
]);
|
|
27
|
+
}
|