@azure-net/cli 2.3.62 → 4.0.0-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/.prettierrc +7 -0
- package/bin/azure-net.js +247 -157
- package/bin/azure-net.ts +253 -0
- package/eslint.config.js +19 -0
- package/package.json +12 -5
- package/src/commands/generate/generateCrudBase.js +95 -114
- package/src/commands/generate/generateCrudPresenter.js +135 -142
- package/src/commands/generate/generateModule.js +21 -21
- package/src/commands/generate/generateModuleBase.js +92 -114
- package/src/commands/generate/generateModulePresenter.js +73 -80
- package/src/commands/generate/generatePresenter.js +38 -44
- package/src/commands/generate/generateRepository.js +41 -47
- package/src/commands/generate/generateSchema.js +74 -70
- package/src/commands/generate/generateService.js +32 -37
- package/src/commands/generate/index.js +0 -5
- package/src/generate/layers/generateRepository.js +124 -0
- package/src/generate/layers/generateRepositoryMethod.js +102 -0
- package/src/generate/layers/generateUseCases.js +50 -0
- package/src/generate/layers/repositoryShared.js +569 -0
- package/src/generate/module/generateDomain.js +146 -0
- package/src/generate/module/generateDomain.ts +147 -0
- package/src/generate/module/generateModule.js +84 -0
- package/src/generate/module/generateModule.ts +84 -0
- package/src/generate/module/generatePresenter.js +419 -0
- package/src/generate/module/generatePresenter.ts +442 -0
- package/src/generate/module/generateRepository.js +144 -0
- package/src/generate/module/generateRepository.ts +158 -0
- package/src/generate/module/generateSchemaFromType.js +320 -0
- package/src/generate/module/generateSchemaFromType.ts +325 -0
- package/src/generate/module/generateTypesJson.js +252 -0
- package/src/generate/module/generateTypesJson.ts +259 -0
- package/src/generate/module/generateUseCases.js +67 -0
- package/src/generate/module/generateUseCases.ts +67 -0
- package/src/generate/module/repositoryModuleShared.js +598 -0
- package/src/generate/ui/generateComponent.js +98 -0
- package/src/generate/ui/generateComponent.ts +100 -0
- package/src/generate/ui/generateDesignComponent.js +71 -0
- package/src/generate/ui/generateDesignComponent.ts +71 -0
- package/src/generate/ui/generateWidget.js +71 -0
- package/src/generate/ui/generateWidget.ts +71 -0
- package/src/init/initAliases.js +159 -0
- package/src/init/initAliases.ts +167 -0
- package/src/init/initEdges.js +74 -0
- package/src/init/initEdges.ts +74 -0
- package/src/init/initStructure.js +122 -0
- package/src/init/initStructure.ts +124 -0
- package/src/install/installFresh.js +101 -0
- package/src/install/installFresh.ts +101 -0
- package/src/plugins/addLint.js +257 -0
- package/src/plugins/addLint.ts +274 -0
- package/src/plugins/index.js +1 -0
- package/src/plugins/index.ts +1 -0
- package/src/scaffolds/createCoreMiddleware.js +27 -0
- package/src/scaffolds/createCoreMiddleware.ts +27 -0
- package/src/scaffolds/createCoreSchema.js +141 -0
- package/src/scaffolds/createCoreSchema.ts +142 -0
- package/src/scaffolds/createDatasource.js +173 -0
- package/src/scaffolds/createDatasource.ts +175 -0
- package/src/scaffolds/createDatasourceProvider.js +164 -0
- package/src/scaffolds/createDatasourceProvider.ts +175 -0
- package/src/scaffolds/createMiddleware.js +105 -0
- package/src/scaffolds/createMiddleware.ts +105 -0
- package/src/scaffolds/createPresenterFactory.js +112 -0
- package/src/scaffolds/createPresenterFactory.ts +114 -0
- package/src/scaffolds/createResponse.js +64 -0
- package/src/scaffolds/createResponse.ts +64 -0
- package/src/scaffolds/createSchemaRule.js +40 -0
- package/src/scaffolds/createSchemaRule.ts +42 -0
- package/src/scaffolds/createTranslationManager.js +78 -0
- package/src/scaffolds/createTranslationManager.ts +78 -0
- package/src/scaffolds/index.js +9 -0
- package/src/scaffolds/index.ts +9 -0
- package/src/utils/contextUtils.js +56 -49
- package/src/utils/fileUtils.js +72 -84
- package/src/utils/loadConfig.js +57 -13
- package/tsconfig.json +19 -0
- package/src/commands/generate/generateComponent.js +0 -53
- package/src/commands/generate/generateDatasource.js +0 -84
- package/src/commands/generate/generateDesignComponent.js +0 -53
- package/src/commands/generate/generateResponse.js +0 -41
- package/src/commands/generate/generateWidget.js +0 -53
- package/src/commands/init/index.js +0 -9
- package/src/commands/init/initAliases.js +0 -52
- package/src/commands/init/initEdges.js +0 -42
- package/src/commands/init/initLint.js +0 -138
- package/src/commands/init/initMiddleware.js +0 -21
- package/src/commands/init/initPresenter.js +0 -25
- package/src/commands/init/initSchema.js +0 -22
- package/src/commands/init/initStructure.js +0 -140
- package/src/commands/init/initTranslations.js +0 -59
- package/src/commands/init/migrateStructure.js +0 -144
|
@@ -0,0 +1,259 @@
|
|
|
1
|
+
import fs from 'node:fs/promises';
|
|
2
|
+
import path from 'node:path';
|
|
3
|
+
import prompts from 'prompts';
|
|
4
|
+
import { selectContext } from './repositoryModuleShared.js';
|
|
5
|
+
|
|
6
|
+
type InterfaceDeclaration = {
|
|
7
|
+
name: string;
|
|
8
|
+
openBraceIndex: number;
|
|
9
|
+
closeBraceIndex: number;
|
|
10
|
+
body: string;
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
const isValidIdentifier = (value: string): boolean => /^[A-Za-z_$][A-Za-z0-9_$]*$/.test(value);
|
|
14
|
+
|
|
15
|
+
const toPropertyName = (key: string): string => (isValidIdentifier(key) ? key : `'${String(key).replace(/'/g, "\\'")}'`);
|
|
16
|
+
|
|
17
|
+
const getIndent = (level: number): string => '\t'.repeat(level);
|
|
18
|
+
|
|
19
|
+
const normalizeObjectInput = (rawValue: unknown): string => {
|
|
20
|
+
let input = String(rawValue ?? '').trim();
|
|
21
|
+
if (input.endsWith(';')) {
|
|
22
|
+
input = input.slice(0, -1).trim();
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
const openCurly = (input.match(/\{/g) ?? []).length;
|
|
26
|
+
const closeCurly = (input.match(/\}/g) ?? []).length;
|
|
27
|
+
if (openCurly > closeCurly) {
|
|
28
|
+
input += '}'.repeat(openCurly - closeCurly);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
return input;
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
const parseObjectInput = (rawValue: unknown): Record<string, unknown> => {
|
|
35
|
+
const input = normalizeObjectInput(rawValue);
|
|
36
|
+
if (!input.length) {
|
|
37
|
+
throw new Error('Input is empty');
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
try {
|
|
41
|
+
const parsed = JSON.parse(input);
|
|
42
|
+
if (!parsed || typeof parsed !== 'object' || Array.isArray(parsed)) {
|
|
43
|
+
throw new Error('Input root must be an object');
|
|
44
|
+
}
|
|
45
|
+
return parsed as Record<string, unknown>;
|
|
46
|
+
} catch {
|
|
47
|
+
// fallback to JS object literal
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
const parsed = new Function(`"use strict"; return (${input});`)();
|
|
51
|
+
if (!parsed || typeof parsed !== 'object' || Array.isArray(parsed)) {
|
|
52
|
+
throw new Error('Input root must be an object');
|
|
53
|
+
}
|
|
54
|
+
return parsed as Record<string, unknown>;
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
const stringifyType = (value: unknown, level = 1): string => {
|
|
58
|
+
if (value === null) return 'null';
|
|
59
|
+
|
|
60
|
+
const valueType = typeof value;
|
|
61
|
+
if (valueType === 'string') return 'string';
|
|
62
|
+
if (valueType === 'number') return Number.isFinite(value as number) ? 'number' : 'unknown';
|
|
63
|
+
if (valueType === 'boolean') return 'boolean';
|
|
64
|
+
if (valueType === 'bigint') return 'bigint';
|
|
65
|
+
if (valueType === 'undefined') return 'undefined';
|
|
66
|
+
|
|
67
|
+
if (Array.isArray(value)) {
|
|
68
|
+
if (!value.length) return 'unknown[]';
|
|
69
|
+
|
|
70
|
+
const itemTypes = Array.from(new Set(value.map((item) => stringifyType(item, level + 1))));
|
|
71
|
+
if (itemTypes.length === 1) {
|
|
72
|
+
const single = itemTypes[0] ?? 'unknown';
|
|
73
|
+
if (single.includes('\n')) return `Array<${single}>`;
|
|
74
|
+
return `${single}[]`;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
const union = itemTypes.join(' | ');
|
|
78
|
+
if (union.includes('\n')) return `Array<${union}>`;
|
|
79
|
+
return `(${union})[]`;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
if (valueType === 'object') {
|
|
83
|
+
const entries = Object.entries(value as Record<string, unknown>);
|
|
84
|
+
if (!entries.length) return 'Record<string, unknown>';
|
|
85
|
+
|
|
86
|
+
const lines = entries.map(([entryKey, entryValue]) => {
|
|
87
|
+
const propertyType = stringifyType(entryValue, level + 1);
|
|
88
|
+
return `${getIndent(level + 1)}${toPropertyName(entryKey)}: ${propertyType};`;
|
|
89
|
+
});
|
|
90
|
+
|
|
91
|
+
return `{\n${lines.join('\n')}\n${getIndent(level)}}`;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
return 'unknown';
|
|
95
|
+
};
|
|
96
|
+
|
|
97
|
+
const findInterfaceDeclaration = (content: string): InterfaceDeclaration | null => {
|
|
98
|
+
const declarationMatch = content.match(/export\s+interface\s+([A-Za-z0-9_]+)\s*\{/);
|
|
99
|
+
if (!declarationMatch || declarationMatch.index === undefined) return null;
|
|
100
|
+
|
|
101
|
+
const name = declarationMatch[1] ?? 'Interface';
|
|
102
|
+
const openBraceIndex = content.indexOf('{', declarationMatch.index);
|
|
103
|
+
if (openBraceIndex === -1) return null;
|
|
104
|
+
|
|
105
|
+
let depth = 0;
|
|
106
|
+
let closeBraceIndex = -1;
|
|
107
|
+
for (let index = openBraceIndex; index < content.length; index += 1) {
|
|
108
|
+
const char = content[index];
|
|
109
|
+
if (char === '{') depth += 1;
|
|
110
|
+
if (char === '}') {
|
|
111
|
+
depth -= 1;
|
|
112
|
+
if (depth === 0) {
|
|
113
|
+
closeBraceIndex = index;
|
|
114
|
+
break;
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
if (closeBraceIndex === -1) return null;
|
|
120
|
+
|
|
121
|
+
const body = content.slice(openBraceIndex + 1, closeBraceIndex);
|
|
122
|
+
return {
|
|
123
|
+
name,
|
|
124
|
+
openBraceIndex,
|
|
125
|
+
closeBraceIndex,
|
|
126
|
+
body
|
|
127
|
+
};
|
|
128
|
+
};
|
|
129
|
+
|
|
130
|
+
const extractExistingRootKeys = (body: string): Set<string> => {
|
|
131
|
+
const keys = new Set<string>();
|
|
132
|
+
const keyRegex = /^\s*([A-Za-z_$][A-Za-z0-9_$]*)\??\s*:/gm;
|
|
133
|
+
let match: RegExpExecArray | null;
|
|
134
|
+
while ((match = keyRegex.exec(body)) !== null) {
|
|
135
|
+
const key = match[1];
|
|
136
|
+
if (key) keys.add(key);
|
|
137
|
+
}
|
|
138
|
+
return keys;
|
|
139
|
+
};
|
|
140
|
+
|
|
141
|
+
const listDomains = async (contextName: string): Promise<string[]> => {
|
|
142
|
+
const domainRoot = path.join(process.cwd(), 'src', 'app', contextName, 'layers', 'domain');
|
|
143
|
+
try {
|
|
144
|
+
const items = await fs.readdir(domainRoot, { withFileTypes: true });
|
|
145
|
+
return items.filter((item) => item.isDirectory()).map((item) => item.name);
|
|
146
|
+
} catch {
|
|
147
|
+
return [];
|
|
148
|
+
}
|
|
149
|
+
};
|
|
150
|
+
|
|
151
|
+
const listModelFiles = async (contextName: string, domainName: string): Promise<Array<{ name: string; path: string }>> => {
|
|
152
|
+
const modelRoot = path.join(process.cwd(), 'src', 'app', contextName, 'layers', 'domain', domainName, 'model');
|
|
153
|
+
try {
|
|
154
|
+
const files = await fs.readdir(modelRoot);
|
|
155
|
+
return files
|
|
156
|
+
.filter((fileName) => fileName.endsWith('.ts') && fileName !== 'index.ts')
|
|
157
|
+
.map((fileName) => ({
|
|
158
|
+
name: fileName.replace(/\.ts$/, ''),
|
|
159
|
+
path: path.join(modelRoot, fileName)
|
|
160
|
+
}));
|
|
161
|
+
} catch {
|
|
162
|
+
return [];
|
|
163
|
+
}
|
|
164
|
+
};
|
|
165
|
+
|
|
166
|
+
export default async function generateTypesJson(): Promise<void> {
|
|
167
|
+
const contextName = await selectContext('Select context for model update:');
|
|
168
|
+
if (!contextName) {
|
|
169
|
+
process.exitCode = 1;
|
|
170
|
+
return;
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
const domains = await listDomains(contextName);
|
|
174
|
+
if (!domains.length) {
|
|
175
|
+
console.error(`❌ No domains found in context "${contextName}".`);
|
|
176
|
+
process.exitCode = 1;
|
|
177
|
+
return;
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
const { domainName } = await prompts({
|
|
181
|
+
type: 'select',
|
|
182
|
+
name: 'domainName',
|
|
183
|
+
message: 'Select domain:',
|
|
184
|
+
choices: domains.map((item) => ({ title: item, value: item })),
|
|
185
|
+
initial: 0
|
|
186
|
+
});
|
|
187
|
+
|
|
188
|
+
if (!domainName) {
|
|
189
|
+
process.exitCode = 1;
|
|
190
|
+
return;
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
const models = await listModelFiles(contextName, String(domainName));
|
|
194
|
+
if (!models.length) {
|
|
195
|
+
console.error(`❌ No model files found in domain "${domainName}".`);
|
|
196
|
+
process.exitCode = 1;
|
|
197
|
+
return;
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
const { modelPath } = await prompts({
|
|
201
|
+
type: 'select',
|
|
202
|
+
name: 'modelPath',
|
|
203
|
+
message: 'Select model:',
|
|
204
|
+
choices: models.map((item) => ({ title: item.name, value: item.path })),
|
|
205
|
+
initial: 0
|
|
206
|
+
});
|
|
207
|
+
|
|
208
|
+
if (!modelPath) {
|
|
209
|
+
process.exitCode = 1;
|
|
210
|
+
return;
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
const { rawJson } = await prompts({
|
|
214
|
+
type: 'text',
|
|
215
|
+
name: 'rawJson',
|
|
216
|
+
message: 'Paste JSON or JS object (single line):',
|
|
217
|
+
validate: (value: string) => {
|
|
218
|
+
try {
|
|
219
|
+
parseObjectInput(value);
|
|
220
|
+
return true;
|
|
221
|
+
} catch {
|
|
222
|
+
return 'Invalid JSON/JS object';
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
});
|
|
226
|
+
|
|
227
|
+
if (!rawJson) {
|
|
228
|
+
process.exitCode = 1;
|
|
229
|
+
return;
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
const parsedJson = parseObjectInput(rawJson);
|
|
233
|
+
const content = await fs.readFile(String(modelPath), 'utf-8');
|
|
234
|
+
const interfaceDeclaration = findInterfaceDeclaration(content);
|
|
235
|
+
if (!interfaceDeclaration) {
|
|
236
|
+
console.error(`❌ Unable to parse interface in ${modelPath}`);
|
|
237
|
+
process.exitCode = 1;
|
|
238
|
+
return;
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
const existingKeys = extractExistingRootKeys(interfaceDeclaration.body);
|
|
242
|
+
const generatedLines = Object.entries(parsedJson)
|
|
243
|
+
.filter(([key]) => !existingKeys.has(key))
|
|
244
|
+
.map(([key, value]) => `${getIndent(1)}${toPropertyName(key)}: ${stringifyType(value, 1)};`);
|
|
245
|
+
|
|
246
|
+
if (!generatedLines.length) {
|
|
247
|
+
console.log('ℹ️ No new keys to add. Model already contains all JSON keys.');
|
|
248
|
+
return;
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
const trimmedBody = interfaceDeclaration.body.trimEnd();
|
|
252
|
+
const bodyPrefix = trimmedBody.length ? `${trimmedBody}\n` : '';
|
|
253
|
+
const newBody = `${bodyPrefix}${generatedLines.join('\n')}\n`;
|
|
254
|
+
|
|
255
|
+
const updatedContent = `${content.slice(0, interfaceDeclaration.openBraceIndex + 1)}${newBody}${content.slice(interfaceDeclaration.closeBraceIndex)}`;
|
|
256
|
+
await fs.writeFile(String(modelPath), updatedContent, 'utf-8');
|
|
257
|
+
|
|
258
|
+
console.log(`✅ Model updated: ${modelPath}`);
|
|
259
|
+
}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import prompts from 'prompts';
|
|
2
|
+
import {
|
|
3
|
+
createUseCasesForRepository,
|
|
4
|
+
getAvailableTsNames,
|
|
5
|
+
getConfigState,
|
|
6
|
+
resolveContextAlias,
|
|
7
|
+
resolveDomainForRepository,
|
|
8
|
+
resolveRepositoriesPath,
|
|
9
|
+
selectContext
|
|
10
|
+
} from './repositoryModuleShared.js';
|
|
11
|
+
|
|
12
|
+
export default async function generateUseCases() {
|
|
13
|
+
const contextName = await selectContext('Select context for UseCases:');
|
|
14
|
+
if (!contextName) {
|
|
15
|
+
process.exitCode = 1;
|
|
16
|
+
return;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
const repositoriesPath = resolveRepositoriesPath(contextName);
|
|
20
|
+
const repositories = await getAvailableTsNames(repositoriesPath);
|
|
21
|
+
if (!repositories.length) {
|
|
22
|
+
console.error(`❌ No repositories found in ${repositoriesPath}`);
|
|
23
|
+
process.exitCode = 1;
|
|
24
|
+
return;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
const { repositoryName } = await prompts({
|
|
28
|
+
type: 'select',
|
|
29
|
+
name: 'repositoryName',
|
|
30
|
+
message: 'Select repository:',
|
|
31
|
+
choices: repositories.map((item) => ({ title: item, value: item })),
|
|
32
|
+
initial: 0
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
if (!repositoryName) {
|
|
36
|
+
process.exitCode = 1;
|
|
37
|
+
return;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
const { contexts } = await getConfigState();
|
|
41
|
+
const contextAlias = resolveContextAlias(contexts, contextName);
|
|
42
|
+
const domainName = await resolveDomainForRepository({
|
|
43
|
+
contextName,
|
|
44
|
+
contextAlias,
|
|
45
|
+
repositoryName: String(repositoryName)
|
|
46
|
+
});
|
|
47
|
+
|
|
48
|
+
if (!domainName) {
|
|
49
|
+
console.error('❌ Unable to resolve domain from repository imports.');
|
|
50
|
+
process.exitCode = 1;
|
|
51
|
+
return;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
const created = await createUseCasesForRepository({
|
|
55
|
+
contextName,
|
|
56
|
+
contextAlias,
|
|
57
|
+
domainName,
|
|
58
|
+
repositoryName: String(repositoryName)
|
|
59
|
+
});
|
|
60
|
+
|
|
61
|
+
if (!created) {
|
|
62
|
+
process.exitCode = 1;
|
|
63
|
+
return;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
console.log(`✅ UseCases generated for ${repositoryName}`);
|
|
67
|
+
}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import prompts from 'prompts';
|
|
2
|
+
import {
|
|
3
|
+
createUseCasesForRepository,
|
|
4
|
+
getAvailableTsNames,
|
|
5
|
+
getConfigState,
|
|
6
|
+
resolveContextAlias,
|
|
7
|
+
resolveDomainForRepository,
|
|
8
|
+
resolveRepositoriesPath,
|
|
9
|
+
selectContext
|
|
10
|
+
} from './repositoryModuleShared.js';
|
|
11
|
+
|
|
12
|
+
export default async function generateUseCases(): Promise<void> {
|
|
13
|
+
const contextName = await selectContext('Select context for UseCases:');
|
|
14
|
+
if (!contextName) {
|
|
15
|
+
process.exitCode = 1;
|
|
16
|
+
return;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
const repositoriesPath = resolveRepositoriesPath(contextName);
|
|
20
|
+
const repositories = await getAvailableTsNames(repositoriesPath);
|
|
21
|
+
if (!repositories.length) {
|
|
22
|
+
console.error(`❌ No repositories found in ${repositoriesPath}`);
|
|
23
|
+
process.exitCode = 1;
|
|
24
|
+
return;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
const { repositoryName } = await prompts({
|
|
28
|
+
type: 'select',
|
|
29
|
+
name: 'repositoryName',
|
|
30
|
+
message: 'Select repository:',
|
|
31
|
+
choices: repositories.map((item) => ({ title: item, value: item })),
|
|
32
|
+
initial: 0
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
if (!repositoryName) {
|
|
36
|
+
process.exitCode = 1;
|
|
37
|
+
return;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
const { contexts } = await getConfigState();
|
|
41
|
+
const contextAlias = resolveContextAlias(contexts, contextName);
|
|
42
|
+
const domainName = await resolveDomainForRepository({
|
|
43
|
+
contextName,
|
|
44
|
+
contextAlias,
|
|
45
|
+
repositoryName: String(repositoryName)
|
|
46
|
+
});
|
|
47
|
+
|
|
48
|
+
if (!domainName) {
|
|
49
|
+
console.error('❌ Unable to resolve domain from repository imports.');
|
|
50
|
+
process.exitCode = 1;
|
|
51
|
+
return;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
const created = await createUseCasesForRepository({
|
|
55
|
+
contextName,
|
|
56
|
+
contextAlias,
|
|
57
|
+
domainName,
|
|
58
|
+
repositoryName: String(repositoryName)
|
|
59
|
+
});
|
|
60
|
+
|
|
61
|
+
if (!created) {
|
|
62
|
+
process.exitCode = 1;
|
|
63
|
+
return;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
console.log(`✅ UseCases generated for ${repositoryName}`);
|
|
67
|
+
}
|