feat: add manifest to package
MODIFY
src/generators/app.ts
src/generators/app.ts
@@ -7,6 +7,7 @@ import * as path from 'path'
import * as Generator from 'yeoman-generator'
import yosay = require('yosay')
+const nps = require('nps-utils')
const sortPjson = require('sort-pjson')
const fixpack = require('fixpack')
const debug = require('debug')('generator-anycli')
@@ -243,6 +244,9 @@ class App extends Generator {
this.pjson.scripts.build = 'rm -rf lib && tsc'
this.pjson.scripts.prepublishOnly = 'yarn run build'
}
+ if (['plugin', 'multi'].includes(this.type)) {
+ this.pjson.scripts.prepublishOnly = nps.series(this.pjson.scripts.prepublishOnly, 'anycli-dev manifest > .anycli.manifest.json')
+ }
this.pjson.keywords = defaults.keywords || [this.type === 'plugin' ? 'anycli-plugin' : 'anycli']
this.pjson.homepage = defaults.homepage || `https://github.com/${this.pjson.repository}`
this.pjson.bugs = defaults.bugs || `https://github.com/${this.pjson.repository}/issues`
@@ -368,6 +372,7 @@ class App extends Generator {
'cli-ux',
)
devDependencies.push(
+ '@anycli/dev-cli',
'@anycli/engine',
'@anycli/config',
'@anycli/plugin-help',
@@ -375,6 +380,7 @@ class App extends Generator {
break
case 'multi':
dependencies.push(
+ '@anycli/dev-cli',
'@anycli/engine',
'@anycli/config',
'@anycli/command',

MODIFY
test/run.js
test/run.js
@@ -54,6 +54,7 @@ module.exports = file => {
sh.exec('yarn test')
sh.exec('node ./bin/run')
sh.exec('node ./bin/run --help')
+ sh.exec('yarn run prepublishOnly')
break
case 'single':
build(cmd, name)
@@ -70,6 +71,7 @@ module.exports = file => {
sh.exec('node ./bin/run hello')
sh.exec('node ./bin/run help hello')
sh.exec('node ./bin/run hello --help')
+ sh.exec('yarn run prepublishOnly')
break
case 'command':
build('plugin', name)
@@ -79,6 +81,7 @@ module.exports = file => {
sh.exec('node ./bin/run foo:bar:baz')
sh.exec('node ./bin/run help foo:bar:baz')
sh.exec('node ./bin/run foo:bar:baz --help')
+ sh.exec('yarn run prepublishOnly')
break
}
})

feat: add manifest to package