@azure-net/cli 2.2.5 → 2.2.7
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,6 +1,6 @@
|
|
|
1
1
|
import prompts from 'prompts';
|
|
2
2
|
import path from 'path';
|
|
3
|
-
import {
|
|
3
|
+
import {selectContext, getContextPath, toPascalCase, getAvailableFiles, toKebabCase} from '../../utils/contextUtils.js';
|
|
4
4
|
import { writeIfNotExists, updateCoreIndex } from '../../utils/fileUtils.js';
|
|
5
5
|
|
|
6
6
|
const presenterWithCoreTemplate = `import { {{corePresenter}} } from '$core/presenters';
|
|
@@ -58,7 +58,7 @@ export default async function generatePresenter() {
|
|
|
58
58
|
});
|
|
59
59
|
|
|
60
60
|
const pascalName = toPascalCase(name);
|
|
61
|
-
const moduleLower = pascalName
|
|
61
|
+
const moduleLower = toKebabCase(pascalName);
|
|
62
62
|
const contextPath = getContextPath(context);
|
|
63
63
|
const modulePath = path.join(contextPath, 'delivery', moduleLower);
|
|
64
64
|
const filePath = path.join(modulePath, `${pascalName}Presenter.ts`);
|
|
@@ -5,9 +5,8 @@ import { selectContext, getContextPath, toPascalCase, getAvailableFiles } from '
|
|
|
5
5
|
import { writeIfNotExists, updateIndexTs } from '../../utils/fileUtils.js';
|
|
6
6
|
|
|
7
7
|
const schemaWithCoreTemplate = `import { {{coreSchema}} } from '\$core/schemas';
|
|
8
|
-
import type { I{{name}}Request } from '\${{context}}/domain/{{entityLower}}';
|
|
9
8
|
|
|
10
|
-
export const {{name}}Schema = {{coreSchema}}
|
|
9
|
+
export const {{name}}Schema = {{coreSchema}}()
|
|
11
10
|
\t.rules((rules) => ({
|
|
12
11
|
\t\t// Add validation rules here
|
|
13
12
|
\t}))
|
|
@@ -15,11 +14,10 @@ export const {{name}}Schema = {{coreSchema}}<I{{name}}Request>()
|
|
|
15
14
|
|
|
16
15
|
const schemaWithPackageTemplate = `import { createSchemaFactory } from '@azure-net/kit';
|
|
17
16
|
import { createRules, validationMessagesI18n } from '@azure-net/kit/schema';
|
|
18
|
-
import type { I{{name}}Request } from '\${{context}}/domain/{{entityLower}}';
|
|
19
17
|
|
|
20
18
|
const Schema = createSchemaFactory(createRules(validationMessagesI18n));
|
|
21
19
|
|
|
22
|
-
export const {{name}}Schema = Schema
|
|
20
|
+
export const {{name}}Schema = Schema()
|
|
23
21
|
\t.rules((rules) => ({
|
|
24
22
|
\t\t// Add validation rules here
|
|
25
23
|
\t}))
|