vovk-cli 0.0.1-beta.43 → 0.0.1-beta.45

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.
@@ -9,4 +9,4 @@ export default function newModule({ projectInfo, what, moduleNameWithOptionalSeg
9
9
  noSegmentUpdate?: boolean;
10
10
  overwrite?: boolean;
11
11
  empty?: boolean;
12
- }): Promise<void>;
12
+ }): Promise<undefined>;
@@ -53,7 +53,8 @@ export default async function newModule({ projectInfo, what, moduleNameWithOptio
53
53
  }
54
54
  const segment = segments.find((s) => s.segmentName === segmentName);
55
55
  if (!segment) {
56
- return log.error(`Unable to create module: ${formatLoggedSegmentName(segmentName)} not found. Run ${chalkHighlightThing(`npx vovk new segment${segmentName ? ` ${segmentName}` : ''}`)} to create it`);
56
+ log.error(`Unable to create module: ${formatLoggedSegmentName(segmentName)} not found. Run ${chalkHighlightThing(`npx vovk new segment${segmentName ? ` ${segmentName}` : ''}`)} to create it`);
57
+ return process.exit(1);
57
58
  }
58
59
  for (const type of what) {
59
60
  const templatePath = templates[type];
@@ -82,7 +83,8 @@ export default async function newModule({ projectInfo, what, moduleNameWithOptio
82
83
  const prettiedCode = await prettify(code, absoluteModulePath);
83
84
  if (!dryRun) {
84
85
  if (!overwrite && (await getFileSystemEntryType(absoluteModulePath))) {
85
- return log.error(`File ${chalkHighlightThing(absoluteModulePath)} already exists, skipping this "${chalkHighlightThing(type)}". You can use --overwrite flag to overwrite it.`);
86
+ log.error(`File ${chalkHighlightThing(absoluteModulePath)} already exists, skipping this "${chalkHighlightThing(type)}". You can use --overwrite flag to overwrite it.`);
87
+ return process.exit(1);
86
88
  }
87
89
  else {
88
90
  await fs.mkdir(absoluteModuleDir, { recursive: true });
@@ -5,4 +5,4 @@ export default function newSegment({ projectInfo, segmentName, isStaticSegment,
5
5
  isStaticSegment?: boolean;
6
6
  overwrite?: boolean;
7
7
  dryRun?: boolean;
8
- }): Promise<void>;
8
+ }): Promise<undefined>;
@@ -12,7 +12,8 @@ export default async function newSegment({ projectInfo, segmentName, isStaticSeg
12
12
  }
13
13
  const absoluteSegmentRoutePath = path.join(apiDirAbsolutePath, segmentName, '[[...vovk]]/route.ts');
14
14
  if (!overwrite && (await getFileSystemEntryType(absoluteSegmentRoutePath))) {
15
- return log.error(`Unable to create new segment. ${formatLoggedSegmentName(segmentName, { upperFirst: true })} already exists. You can use --overwrite flag to overwrite it.`);
15
+ log.error(`Unable to create new segment. ${formatLoggedSegmentName(segmentName, { upperFirst: true })} already exists. You can use --overwrite flag to overwrite it.`);
16
+ return process.exit(1);
16
17
  }
17
18
  const code = await prettify(`import { initSegment${isStaticSegment ? ', generateStaticAPI' : ''} } from 'vovk';
18
19
 
@@ -37,5 +38,5 @@ ${segmentName ? ` segmentName: '${segmentName}',\n` : ''} emitSchema: true,
37
38
  }
38
39
  log.info(`${chalk.green('Created')} ${formatLoggedSegmentName(segmentName, { isStatic: isStaticSegment })} at ${absoluteSegmentRoutePath}.`);
39
40
  const dir = chalk.cyanBright([segmentName, 'thing'].filter(Boolean).join('/'));
40
- log.info(`Run ${chalkHighlightThing(`npx vovk new service controller ${dir}`)} to create a new controller with a service at ${path.join(config.modulesDir, dir)} folder for this segment`);
41
+ log.info(`Run ${chalkHighlightThing(`npx vovk new service controller ${dir}`)} to create a new controller with a service at ./${path.join(config.modulesDir, dir)} folder for this segment`);
41
42
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vovk-cli",
3
- "version": "0.0.1-beta.43",
3
+ "version": "0.0.1-beta.45",
4
4
  "bin": {
5
5
  "vovk": "./dist/index.mjs"
6
6
  },