@domain-first/project-structure 1.0.1 → 1.0.2
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/dist/index.cjs +7 -5
- package/dist/index.js +7 -5
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -323,8 +323,7 @@ const scaffoldNewApplicationPort = async (boundedContextFolder)=>{
|
|
|
323
323
|
const wiringFolder = boundedContextFolder.subitem([
|
|
324
324
|
'wiring',
|
|
325
325
|
'application',
|
|
326
|
-
'ports'
|
|
327
|
-
naming.fileName
|
|
326
|
+
'ports'
|
|
328
327
|
]);
|
|
329
328
|
const infraFolder = boundedContextFolder.subitem([
|
|
330
329
|
'wiring',
|
|
@@ -383,11 +382,11 @@ export const wire${currentNaming.ClassName} = wireClass(
|
|
|
383
382
|
`.trim());
|
|
384
383
|
}
|
|
385
384
|
if (ConfigFile.Instance.data.domainFirstPackages.includes('@domain-first/wire')) wiringFolder.createFile(`wire-${naming.fileName}.ts`, `
|
|
386
|
-
import { envBranchedWire } from '
|
|
385
|
+
import { envBranchedWire } from '../../../../${'shared' === boundedContextFolder.name ? '' : '../'}shared/wiring/env-branched-wire'
|
|
387
386
|
${implementationTypes.map((x)=>({
|
|
388
387
|
naming: new UnknownFormatNaming(`${x}-${naming.fileName}`),
|
|
389
388
|
implementation: x
|
|
390
|
-
})).map(({ naming: { ClassName, fileName }, implementation })=>`import { wire${ClassName} } from '
|
|
389
|
+
})).map(({ naming: { ClassName, fileName }, implementation })=>`import { wire${ClassName} } from '../../infrastructure/application-ports/${implementation}/wire-${fileName}'`).join('\n')}
|
|
391
390
|
|
|
392
391
|
export const wire${naming.ClassName} = envBranchedWire({
|
|
393
392
|
test: wire${new UnknownFormatNaming(`${implementationTypes.at(-1)}-${naming.fileName}`).ClassName},
|
|
@@ -874,10 +873,13 @@ const main = async ()=>{
|
|
|
874
873
|
]);
|
|
875
874
|
const layer = await (0, prompts_namespaceObject.select)({
|
|
876
875
|
message: 'Layer:',
|
|
877
|
-
choices: [
|
|
876
|
+
choices: specificContext ? [
|
|
878
877
|
'Domain',
|
|
879
878
|
'Application',
|
|
880
879
|
'Presentation'
|
|
880
|
+
] : [
|
|
881
|
+
'Domain',
|
|
882
|
+
'Application'
|
|
881
883
|
]
|
|
882
884
|
});
|
|
883
885
|
if ('Domain' === layer) {
|
package/dist/index.js
CHANGED
|
@@ -293,8 +293,7 @@ const scaffoldNewApplicationPort = async (boundedContextFolder)=>{
|
|
|
293
293
|
const wiringFolder = boundedContextFolder.subitem([
|
|
294
294
|
'wiring',
|
|
295
295
|
'application',
|
|
296
|
-
'ports'
|
|
297
|
-
naming.fileName
|
|
296
|
+
'ports'
|
|
298
297
|
]);
|
|
299
298
|
const infraFolder = boundedContextFolder.subitem([
|
|
300
299
|
'wiring',
|
|
@@ -353,11 +352,11 @@ export const wire${currentNaming.ClassName} = wireClass(
|
|
|
353
352
|
`.trim());
|
|
354
353
|
}
|
|
355
354
|
if (ConfigFile.Instance.data.domainFirstPackages.includes('@domain-first/wire')) wiringFolder.createFile(`wire-${naming.fileName}.ts`, `
|
|
356
|
-
import { envBranchedWire } from '
|
|
355
|
+
import { envBranchedWire } from '../../../../${'shared' === boundedContextFolder.name ? '' : '../'}shared/wiring/env-branched-wire'
|
|
357
356
|
${implementationTypes.map((x)=>({
|
|
358
357
|
naming: new UnknownFormatNaming(`${x}-${naming.fileName}`),
|
|
359
358
|
implementation: x
|
|
360
|
-
})).map(({ naming: { ClassName, fileName }, implementation })=>`import { wire${ClassName} } from '
|
|
359
|
+
})).map(({ naming: { ClassName, fileName }, implementation })=>`import { wire${ClassName} } from '../../infrastructure/application-ports/${implementation}/wire-${fileName}'`).join('\n')}
|
|
361
360
|
|
|
362
361
|
export const wire${naming.ClassName} = envBranchedWire({
|
|
363
362
|
test: wire${new UnknownFormatNaming(`${implementationTypes.at(-1)}-${naming.fileName}`).ClassName},
|
|
@@ -844,10 +843,13 @@ const main = async ()=>{
|
|
|
844
843
|
]);
|
|
845
844
|
const layer = await prompts_select({
|
|
846
845
|
message: 'Layer:',
|
|
847
|
-
choices: [
|
|
846
|
+
choices: specificContext ? [
|
|
848
847
|
'Domain',
|
|
849
848
|
'Application',
|
|
850
849
|
'Presentation'
|
|
850
|
+
] : [
|
|
851
|
+
'Domain',
|
|
852
|
+
'Application'
|
|
851
853
|
]
|
|
852
854
|
});
|
|
853
855
|
if ('Domain' === layer) {
|