@alevnyacow/nzmt 0.10.2 → 0.11.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/bin/cli.js +18 -4
- package/package.json +1 -1
package/bin/cli.js
CHANGED
|
@@ -388,7 +388,7 @@ function generateStores(lowerCase, upperCase, withEntityPreset) {
|
|
|
388
388
|
|
|
389
389
|
fs.mkdirSync(folder, { recursive: true })
|
|
390
390
|
|
|
391
|
-
const withEntity = withEntityPreset ||
|
|
391
|
+
const withEntity = withEntityPreset || (options ?? []).includes('import-entity')
|
|
392
392
|
|
|
393
393
|
// Contract
|
|
394
394
|
|
|
@@ -743,10 +743,10 @@ function toKebabFromPascal(str) {
|
|
|
743
743
|
.toLowerCase()
|
|
744
744
|
}
|
|
745
745
|
|
|
746
|
-
function generateService(lowerCase, upperCase) {
|
|
746
|
+
function generateService(lowerCase, upperCase, store) {
|
|
747
747
|
const folder = config?.paths?.services ? path.resolve(process.cwd(), `${config.coreFolder}${config?.paths?.services}`, entityName) : path.resolve(process.cwd(), entityName);
|
|
748
748
|
|
|
749
|
-
const proxiedStore = options.find(x => x.startsWith('p:'))?.split(':')?.at(-1)
|
|
749
|
+
const proxiedStore = store || options.find(x => x.startsWith('p:'))?.split(':')?.at(-1)
|
|
750
750
|
if (proxiedStore && !proxiedStore.endsWith('Store')) {
|
|
751
751
|
throw 'Only stores can be proxied in services!'
|
|
752
752
|
}
|
|
@@ -933,4 +933,18 @@ if (command.toLowerCase() === 'controller' || command === 'c') {
|
|
|
933
933
|
var [lowerCase, upperCase] = camelizeVariants(entityName)
|
|
934
934
|
generateController(upperCase, lowerCase)
|
|
935
935
|
process.exit(0)
|
|
936
|
-
}
|
|
936
|
+
}
|
|
937
|
+
|
|
938
|
+
if (command.toLowerCase() === 'stored-entity' || command === 'se') {
|
|
939
|
+
var [lowerCase, upperCase] = camelizeVariants(entityName)
|
|
940
|
+
generateEntity(upperCase)
|
|
941
|
+
generateStores(lowerCase, upperCase, true)
|
|
942
|
+
process.exit(0)
|
|
943
|
+
}
|
|
944
|
+
|
|
945
|
+
if (command.toLowerCase() === 'crud-service') {
|
|
946
|
+
var [lowerCase, upperCase] = camelizeVariants(entityName)
|
|
947
|
+
generateEntity(upperCase)
|
|
948
|
+
generateStores(lowerCase, upperCase, true)
|
|
949
|
+
generateService(lowerCase, upperCase, upperCase + 'Store')
|
|
950
|
+
}
|