vovk-cli 0.0.1-draft.18 → 0.0.1-draft.19

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.d.mts CHANGED
@@ -1,7 +1,4 @@
1
1
  #!/usr/bin/env node
2
- import { Command } from 'commander';
3
2
  import type { VovkConfig, VovkDevEnv } from './types.mjs';
4
3
  import 'dotenv/config';
5
4
  export type { VovkConfig, VovkDevEnv };
6
- declare const program: Command;
7
- export declare function initProgram(p: typeof program, command: string): Command;
package/dist/index.mjs CHANGED
@@ -8,9 +8,9 @@ import getProjectInfo from './getProjectInfo/index.mjs';
8
8
  import generateClient from './generateClient.mjs';
9
9
  import locateSegments from './locateSegments.mjs';
10
10
  import { VovkDev } from './dev/index.mjs';
11
- import { Init } from './init/index.mjs';
12
11
  import newComponents from './new/index.mjs';
13
12
  import 'dotenv/config';
13
+ import initProgram from './initProgram.mjs';
14
14
  const program = new Command();
15
15
  const packageJSON = JSON.parse(readFileSync(path.join(import.meta.dirname, '../package.json'), 'utf-8'));
16
16
  program.name('vovk').description('Vovk CLI').version(packageJSON.version);
@@ -72,26 +72,6 @@ program
72
72
  const schema = (await import(path.join(schemaOutAbsolutePath, 'index.js')));
73
73
  await generateClient(projectInfo, segments, schema.default);
74
74
  });
75
- // reused at vovk-init
76
- export function initProgram(p, command) {
77
- return p
78
- .command(command + '[prefix]')
79
- .description('Initialize Vovk project')
80
- .option('-y, --yes', 'Skip all prompts and use default values')
81
- .option('--log-level <level>', 'Set log level', 'info')
82
- .option('--use-npm', 'Use npm as package manager')
83
- .option('--use-yarn', 'Use yarn as package manager')
84
- .option('--use-pnpm', 'Use pnpm as package manager')
85
- .option('--use-bun', 'Use bun as package manager')
86
- .option('--skip-install', 'Skip installing dependencies')
87
- .option('--update-ts-config', 'Update tsconfig.json')
88
- .option('--update-scripts <mode>', 'Update package.json scripts (implicit or explicit)')
89
- .option('--validation-library <library>', 'Validation library to use ("vovk-zod", "vovk-yup", "vovk-dto" or another). Set to "none" to skip validation')
90
- .option('--validate-on-client', 'Validate on client')
91
- .option('--channel <channel>', 'Channel to use for fetching packages', 'latest')
92
- .option('--dry-run', 'Do not write files to disk')
93
- .action((prefix = '.', options) => new Init().main(prefix, options));
94
- }
95
75
  initProgram(program, 'init ');
96
76
  program
97
77
  .command('new [components...]')
@@ -0,0 +1,2 @@
1
+ import { Command } from 'commander';
2
+ export default function initProgram(program: Command, command: string): Command;
@@ -0,0 +1,21 @@
1
+ // reused at vovk-init
2
+ import { Init } from './init/index.mjs';
3
+ export default function initProgram(program, command) {
4
+ return program
5
+ .command(command + '[prefix]')
6
+ .description('Initialize Vovk project')
7
+ .option('-y, --yes', 'Skip all prompts and use default values')
8
+ .option('--log-level <level>', 'Set log level', 'info')
9
+ .option('--use-npm', 'Use npm as package manager')
10
+ .option('--use-yarn', 'Use yarn as package manager')
11
+ .option('--use-pnpm', 'Use pnpm as package manager')
12
+ .option('--use-bun', 'Use bun as package manager')
13
+ .option('--skip-install', 'Skip installing dependencies')
14
+ .option('--update-ts-config', 'Update tsconfig.json')
15
+ .option('--update-scripts <mode>', 'Update package.json scripts (implicit or explicit)')
16
+ .option('--validation-library <library>', 'Validation library to use ("vovk-zod", "vovk-yup", "vovk-dto" or another). Set to "none" to skip validation')
17
+ .option('--validate-on-client', 'Validate on client')
18
+ .option('--channel <channel>', 'Channel to use for fetching packages', 'latest')
19
+ .option('--dry-run', 'Do not write files to disk')
20
+ .action((prefix = '.', options) => new Init().main(prefix, options));
21
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vovk-cli",
3
- "version": "0.0.1-draft.18",
3
+ "version": "0.0.1-draft.19",
4
4
  "bin": {
5
5
  "vovk": "./dist/index.mjs"
6
6
  },
@@ -35,7 +35,7 @@
35
35
  },
36
36
  "homepage": "https://vovk.dev",
37
37
  "peerDependencies": {
38
- "vovk": "^3.0.0-draft.19"
38
+ "vovk": "^3.0.0-draft.20"
39
39
  },
40
40
  "dependencies": {
41
41
  "@inquirer/prompts": "^7.0.1",