feat(cli): helper messages

This commit is contained in:
LongYinan 2020-12-23 22:43:43 +08:00
parent 9e73837635
commit 2f4d3142cf
No known key found for this signature in database
GPG key ID: C3666B7FC82ADAD7
5 changed files with 14 additions and 2 deletions

View file

@ -11,6 +11,10 @@ import { readFileAsync, writeFileAsync } from './utils'
const debug = debugFactory('artifacts') const debug = debugFactory('artifacts')
export class ArtifactsCommand extends Command { export class ArtifactsCommand extends Command {
static usage = Command.Usage({
description: 'Copy artifacts from Github Actions into specified dir',
})
@Command.String('-d,--dir') @Command.String('-d,--dir')
sourceDir = 'artifacts' sourceDir = 'artifacts'

View file

@ -14,7 +14,7 @@ const debug = debugFactory('build')
export class BuildCommand extends Command { export class BuildCommand extends Command {
static usage = Command.Usage({ static usage = Command.Usage({
description: 'Copy native module into specified dir', description: 'Build and copy native module into specified dir',
}) })
@Command.Boolean(`--platform`) @Command.Boolean(`--platform`)

View file

@ -13,6 +13,10 @@ import { writeFileAsync } from './utils'
const debug = debugFactory('create-npm-dir') const debug = debugFactory('create-npm-dir')
export class CreateNpmDirCommand extends Command { export class CreateNpmDirCommand extends Command {
static usage = Command.Usage({
description: 'Create npm packages dir for platforms',
})
@Command.String('-t,--target') @Command.String('-t,--target')
targetDir!: string targetDir!: string

View file

@ -10,7 +10,7 @@ import { PrePublishCommand } from './pre-publish'
import { VersionCommand } from './version' import { VersionCommand } from './version'
const cli = new Cli({ const cli = new Cli({
binaryName: 'bin', binaryName: 'napi',
binaryVersion: require('../package.json').version, binaryVersion: require('../package.json').version,
}) })

View file

@ -11,6 +11,10 @@ import { updatePackageJson } from './update-package'
const debug = debugFactory('version') const debug = debugFactory('version')
export class VersionCommand extends Command { export class VersionCommand extends Command {
static usage = Command.Usage({
description: 'Update versions in created npm dir',
})
static async updatePackageJson(prefix: string, configFileName?: string) { static async updatePackageJson(prefix: string, configFileName?: string) {
const { version, platforms } = getNapiConfig(configFileName) const { version, platforms } = getNapiConfig(configFileName)
for (const platformDetail of platforms) { for (const platformDetail of platforms) {