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

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.
@@ -53,7 +53,7 @@ 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, { upperFirst: true })} not found. Run ${chalkHighlightThing(`vovk new segment${segmentName ? ` ${segmentName}` : ''}`)} to create it`);
56
+ return log.error(`Unable to create module: ${formatLoggedSegmentName(segmentName)} not found. Run ${chalkHighlightThing(`npx vovk new segment${segmentName ? ` ${segmentName}` : ''}`)} to create it`);
57
57
  }
58
58
  for (const type of what) {
59
59
  const templatePath = templates[type];
@@ -82,7 +82,7 @@ export default async function newModule({ projectInfo, what, moduleNameWithOptio
82
82
  const prettiedCode = await prettify(code, absoluteModulePath);
83
83
  if (!dryRun) {
84
84
  if (!overwrite && (await getFileSystemEntryType(absoluteModulePath))) {
85
- log.warn(`File ${chalkHighlightThing(absoluteModulePath)} already exists, skipping this "${chalkHighlightThing(type)}". You can use --overwrite flag to overwrite it.`);
85
+ return log.error(`File ${chalkHighlightThing(absoluteModulePath)} already exists, skipping this "${chalkHighlightThing(type)}". You can use --overwrite flag to overwrite it.`);
86
86
  }
87
87
  else {
88
88
  await fs.mkdir(absoluteModuleDir, { recursive: true });
@@ -8,11 +8,11 @@ import chalk from 'chalk';
8
8
  export default async function newSegment({ projectInfo, segmentName, isStaticSegment, overwrite, dryRun, }) {
9
9
  const { apiDirAbsolutePath, log, config } = projectInfo;
10
10
  if (!apiDirAbsolutePath) {
11
- throw new Error('No API directory found. Please ensure you are in a Nest.js project.');
11
+ throw new Error('No API directory found. Please ensure you are in a Next.js project.');
12
12
  }
13
13
  const absoluteSegmentRoutePath = path.join(apiDirAbsolutePath, segmentName, '[[...vovk]]/route.ts');
14
14
  if (!overwrite && (await getFileSystemEntryType(absoluteSegmentRoutePath))) {
15
- throw new Error(`Unable to create new segment. ${formatLoggedSegmentName(segmentName, { upperFirst: true })} already exists. You can use --overwrite flag to overwrite it.`);
15
+ return log.error(`Unable to create new segment. ${formatLoggedSegmentName(segmentName, { upperFirst: true })} already exists. You can use --overwrite flag to overwrite it.`);
16
16
  }
17
17
  const code = await prettify(`import { initSegment${isStaticSegment ? ', generateStaticAPI' : ''} } from 'vovk';
18
18
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vovk-cli",
3
- "version": "0.0.1-beta.41",
3
+ "version": "0.0.1-beta.43",
4
4
  "bin": {
5
5
  "vovk": "./dist/index.mjs"
6
6
  },