@magidoc/cli
Advanced tools
Comparing version 0.2.0 to 0.2.2
import { Command } from 'commander'; | ||
import { readFileSync } from 'fs'; | ||
import buildGenerateCommand from './generate/command.js'; | ||
import buildInitCommand from './init/command.js'; | ||
import buildGenerateCommand from './commands/generate/command.js'; | ||
import buildInitCommand from './commands/init/command.js'; | ||
const packageJson = JSON.parse(readFileSync('../package.json').toString()); | ||
const version = packageJson.version; | ||
if (!version) { | ||
throw new Error('Expected version to be defined in package.json. Could not extract version number, but it is required to fetch the right template versions.'); | ||
} | ||
const program = new Command() | ||
.name('Magidoc') | ||
.description('Magidoc CLI helps you to get started building GraphQL documentation websites.\n') | ||
.version(packageJson.version || 'unknown'); | ||
.description('Magidoc CLI helps you to get started building GraphQL documentation websites.') | ||
.version(version); | ||
buildGenerateCommand(program); | ||
@@ -12,0 +16,0 @@ buildInitCommand(program); |
@@ -5,3 +5,3 @@ { | ||
"private": false, | ||
"version": "0.2.0", | ||
"version": "0.2.2", | ||
"type": "module", | ||
@@ -12,3 +12,3 @@ "license": "MIT", | ||
"dependencies": { | ||
"@magidoc/rollup-plugin-fetch-gql-schema": "^0.2.0", | ||
"@magidoc/rollup-plugin-fetch-gql-schema": "^0.2.2", | ||
"commander": "^9.1.0" | ||
@@ -15,0 +15,0 @@ }, |
import { Command } from 'commander' | ||
import { readFileSync } from 'fs' | ||
import buildGenerateCommand from './generate/command' | ||
import buildInitCommand from './init/command' | ||
import buildGenerateCommand from './commands/generate/command' | ||
import buildInitCommand from './commands/init/command' | ||
@@ -10,8 +10,15 @@ const packageJson = JSON.parse(readFileSync('../package.json').toString()) as { | ||
const version: string = packageJson.version | ||
if (!version) { | ||
throw new Error( | ||
'Expected version to be defined in package.json. Could not extract version number, but it is required to fetch the right template versions.', | ||
) | ||
} | ||
const program = new Command() | ||
.name('Magidoc') | ||
.description( | ||
'Magidoc CLI helps you to get started building GraphQL documentation websites.\n', | ||
'Magidoc CLI helps you to get started building GraphQL documentation websites.', | ||
) | ||
.version(packageJson.version || 'unknown') | ||
.version(version) | ||
@@ -18,0 +25,0 @@ buildGenerateCommand(program) |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
16428
35
380