Skip to content
This repository was archived by the owner on Dec 1, 2020. It is now read-only.

Commit d74366c

Browse files
committed
🆙 update: fix docs generator
1 parent c756cbc commit d74366c

File tree

4 files changed

+8
-11
lines changed

4 files changed

+8
-11
lines changed

generator/index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ module.exports = (api, options, rootOptions) => {
1818
api.extendPackage({
1919
scripts: {
2020
'demo': 'vue-cli-service demo',
21-
'docs:serve': 'vue-cli-service docs --mode serve',
21+
'docs:serve': 'vue-cli-service docs --mode dev',
2222
'docs:build': 'vue-cli-service docs --mode build'
2323
},
2424
sideeffects: false,

index.js

+5-8
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,9 @@ const debug = require('debug')('vue-cli-plugin-p11n:service')
33
module.exports = (api, options) => {
44
debug('options', options)
55

6-
const build = require('./lib/build/command')(api)
7-
api.registerCommand('build', build.opts, build.fn)
8-
9-
const demo = require('./lib/demo/command')(api)
10-
api.registerCommand('demo', demo.opts, demo.fn)
11-
12-
const docs = require('./lib/docs/command')(api)
13-
api.registerCommand('docs', docs.opts, docs.fn)
6+
const commands = ['build', 'demo', 'docs']
7+
commands.forEach(command => {
8+
const target = require(`./lib/${command}/command`)(api)
9+
api.registerCommand(command, target.opts, target.fn)
10+
})
1411
}

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@
5252
},
5353
"scripts": {
5454
"changelog": "conventional-changelog -i CHANGELOG.md -s -n ./node_modules/git-commit-message-convention/convention.js",
55-
"clean": "rimraf tests/e2e/projects/*",
55+
"clean": "rimraf coverage tests/e2e/projects/*",
5656
"lint": "eslint --fix --ext .js .",
5757
"release": "conventional-github-releaser -n ./node_modules/git-commit-message-convention/convention.js",
5858
"test": "npm run test:unit",

tests/unit/generators/docs.spec.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ test('docs', async () => {
2929
}])
3030

3131
// check pkg
32-
expect(pkg.scripts['docs:serve']).toMatch('vue-cli-service docs --mode serve')
32+
expect(pkg.scripts['docs:serve']).toMatch('vue-cli-service docs --mode dev')
3333
expect(pkg.scripts['docs:build']).toMatch('vue-cli-service docs --mode build')
3434

3535
// check files

0 commit comments

Comments
 (0)