@domain-first/project-structure 1.0.0 → 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 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 '../../../../../${'shared' === boundedContextFolder.name ? '' : '../'}shared/wiring/env-branched-wire'
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 '../../../infrastructure/application-ports/${implementation}/wire-${fileName}'`).join('\n')}
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},
@@ -644,7 +643,7 @@ import { EndpointGenerator } from '@domain-first/handlers-rest'
644
643
  export class ${endpointNaming.ClassName} {
645
644
  constructor(private readonly endpointGenerator: EndpointGenerator) {}
646
645
 
647
- get logic() {
646
+ private get logic() {
648
647
  return () => {}
649
648
  }
650
649
 
@@ -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 '../../../../../${'shared' === boundedContextFolder.name ? '' : '../'}shared/wiring/env-branched-wire'
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 '../../../infrastructure/application-ports/${implementation}/wire-${fileName}'`).join('\n')}
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},
@@ -614,7 +613,7 @@ import { EndpointGenerator } from '@domain-first/handlers-rest'
614
613
  export class ${endpointNaming.ClassName} {
615
614
  constructor(private readonly endpointGenerator: EndpointGenerator) {}
616
615
 
617
- get logic() {
616
+ private get logic() {
618
617
  return () => {}
619
618
  }
620
619
 
@@ -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) {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@domain-first/project-structure",
3
3
  "description": "Build and manage your Domain-First project structure with CLI",
4
- "version": "1.0.0",
4
+ "version": "1.0.2",
5
5
  "type": "module",
6
6
  "repository": {
7
7
  "type": "git",