Skip to content

Commit 78761d6

Browse files
authored
Refactor/remove gulp (#54)
1 parent dc8e993 commit 78761d6

20 files changed

+2482
-6505
lines changed

.babelrc

-8
This file was deleted.

.eslintrc

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"extends": "xo-space",
3+
"rules": {
4+
"semi": [2, "never"],
5+
"no-return-assign": "off",
6+
"no-unused-expressions": "off",
7+
"no-new-func": "off",
8+
"no-multi-assign": "off",
9+
"no-mixed-operators": "off",
10+
"max-params": "off",
11+
"no-script-url": "off",
12+
"camelcase": "off",
13+
"no-warning-comments": "off"
14+
}
15+
}

.eslintrc.yml

-15
This file was deleted.

.travis.yml

-4
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,3 @@ cache:
99
- ./node_modules
1010
install:
1111
- npm install
12-
- npm install [email protected]
13-
- npm install -g [email protected]
14-
script:
15-
- gulp lint

CONTRIBUTING.md

+7-7
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
# Contributing to the development of `docsify-cli`
22

3-
* Fork the repository on Github.
4-
* Clone the repository locally.
5-
* Make your changes to the code.
6-
* Run `npm install`.
7-
* Run `gulp lint`.
8-
* Commit your changes with a message following the [`conventional-changelog-angular` commit message convention](https://github.com/conventional-changelog/conventional-changelog/blob/master/packages/conventional-changelog-angular/convention.md).
9-
* Push to Github and open a pull request.
3+
- Fork the repository on Github.
4+
- Clone the repository locally.
5+
- Make your changes to the code.
6+
- Run `npm install`.
7+
- Run `npm link` to install docsify cli in to globall.
8+
- Commit your changes with a message following the [`conventional-changelog-angular` commit message convention](https://github.com/conventional-changelog/conventional-changelog/blob/master/packages/conventional-changelog-angular/convention.md).
9+
- Push to Github and open a pull request.

bin/docsify

+110-108
Original file line numberDiff line numberDiff line change
@@ -1,124 +1,126 @@
11
#!/usr/bin/env node
22

3-
'use strict'
3+
"use strict";
44

5-
const pkg = require('../package.json')
6-
const run = require('../lib')
7-
const chalk = require('chalk')
8-
const updateNotifier = require('update-notifier')
5+
const pkg = require("../package.json");
6+
const run = require("../lib");
7+
const chalk = require("chalk");
8+
const updateNotifier = require("update-notifier");
99

10-
updateNotifier({ pkg: pkg }).notify()
10+
updateNotifier({ pkg: pkg }).notify();
1111

12-
const Locales = require('../tools/locales')
13-
const y18n = new Locales()
12+
const Locales = require("../tools/locales");
13+
const y18n = new Locales();
1414

15-
require('yargonaut')
16-
.style('yellow', 'required')
17-
.helpStyle('green')
18-
.errorsStyle('red.bold')
15+
require("yargonaut")
16+
.style("yellow", "required")
17+
.helpStyle("green")
18+
.errorsStyle("red.bold");
1919

20-
var yargs = require('yargs')
21-
.usage(chalk.bold(y18n.__('usage') + ': docsify <init|serve> <path>'))
20+
const yargs = require("yargs")
21+
.usage(chalk.bold(y18n.__("usage") + ": docsify <init|serve> <path>"))
2222
.command({
23-
command: 'init <path>',
24-
alias: 'i',
25-
desc: chalk.gray(y18n.__('init')),
26-
builder: (yargs) => yargs.options({
27-
'local': {
28-
alias: 'l',
29-
default: false,
30-
desc: chalk.gray(y18n.__('init.local')),
31-
nargs: 0,
32-
requiresArg: false,
33-
type: 'boolean'
34-
},
35-
'theme': {
36-
alias: 't',
37-
default: 'vue',
38-
desc: chalk.gray(y18n.__('init.theme')),
39-
choices: ['vue', 'buble', 'dark', 'pure'],
40-
nargs: 1,
41-
requiresArg: true,
42-
type: 'string'
43-
}
44-
}),
45-
handler: (argv) => run.init(argv.path, argv.local, argv.theme)
23+
command: "init [path]",
24+
alias: "i",
25+
desc: chalk.gray(y18n.__("init")),
26+
builder: yargs =>
27+
yargs.options({
28+
local: {
29+
alias: "l",
30+
default: false,
31+
desc: chalk.gray(y18n.__("init.local")),
32+
nargs: 0,
33+
requiresArg: false,
34+
type: "boolean"
35+
},
36+
theme: {
37+
alias: "t",
38+
default: "vue",
39+
desc: chalk.gray(y18n.__("init.theme")),
40+
choices: ["vue", "buble", "dark", "pure"],
41+
nargs: 1,
42+
requiresArg: true,
43+
type: "string"
44+
}
45+
}),
46+
handler: argv => run.init(argv.path, argv.local, argv.theme)
4647
})
4748
.command({
48-
command: 'serve [path]',
49-
alias: 's',
50-
desc: chalk.gray(y18n.__('serve')),
51-
builder: (yargs) => yargs.options({
52-
'open': {
53-
alias: 'o',
54-
default: false,
55-
desc: chalk.gray(y18n.__('serve.open')),
56-
nargs: 0,
57-
requiresArg: false,
58-
type: 'boolean'
59-
},
60-
'port': {
61-
alias: 'p',
62-
default: 3000,
63-
desc: chalk.gray(y18n.__('serve.port')),
64-
nargs: 1,
65-
requiresArg: true,
66-
type: 'number'
67-
},
68-
'livereload-port': {
69-
alias: 'P',
70-
default: 35729,
71-
desc: chalk.gray(y18n.__('livereload.port')),
72-
nargs: 1,
73-
requiresArg: true,
74-
type: 'number'
75-
},
76-
'index-name': {
77-
alias: 'i',
78-
desc: chalk.gray(y18n.__('serve.indexname')),
79-
nargs: 1,
80-
requiresArg: true,
81-
type: 'string'
82-
}
83-
}),
84-
handler: (argv) => run.serve(argv.path, argv.open, argv.port, argv.P, argv.i)
49+
command: "serve [path]",
50+
alias: "s",
51+
desc: chalk.gray(y18n.__("serve")),
52+
builder: yargs =>
53+
yargs.options({
54+
open: {
55+
alias: "o",
56+
default: false,
57+
desc: chalk.gray(y18n.__("serve.open")),
58+
nargs: 0,
59+
requiresArg: false,
60+
type: "boolean"
61+
},
62+
port: {
63+
alias: "p",
64+
default: 3000,
65+
desc: chalk.gray(y18n.__("serve.port")),
66+
nargs: 1,
67+
requiresArg: true,
68+
type: "number"
69+
},
70+
"livereload-port": {
71+
alias: "P",
72+
default: 35729,
73+
desc: chalk.gray(y18n.__("livereload.port")),
74+
nargs: 1,
75+
requiresArg: true,
76+
type: "number"
77+
},
78+
"index-name": {
79+
alias: "i",
80+
desc: chalk.gray(y18n.__("serve.indexname")),
81+
nargs: 1,
82+
requiresArg: true,
83+
type: "string"
84+
}
85+
}),
86+
handler: argv => run.serve(argv.path, argv.open, argv.port, argv.P, argv.i)
8587
})
8688
.command({
87-
command: 'start <path>',
88-
desc: chalk.gray(y18n.__('start')),
89-
builder: (yargs) => yargs.options({
90-
'config': {
91-
alias: 'c',
92-
default: false,
93-
desc: chalk.gray(y18n.__('start.config')),
94-
nargs: 0,
95-
requiresArg: false,
96-
type: 'string'
97-
},
98-
'port': {
99-
alias: 'p',
100-
default: 4000,
101-
desc: chalk.gray(y18n.__('start.port')),
102-
nargs: 1,
103-
requiresArg: true,
104-
type: 'number'
105-
}
106-
}),
107-
handler: (argv) => run.start(argv.path, argv.config, argv.port)
89+
command: "start <path>",
90+
desc: chalk.gray(y18n.__("start")),
91+
builder: yargs =>
92+
yargs.options({
93+
config: {
94+
alias: "c",
95+
default: false,
96+
desc: chalk.gray(y18n.__("start.config")),
97+
nargs: 0,
98+
requiresArg: false,
99+
type: "string"
100+
},
101+
port: {
102+
alias: "p",
103+
default: 4000,
104+
desc: chalk.gray(y18n.__("start.port")),
105+
nargs: 1,
106+
requiresArg: true,
107+
type: "number"
108+
}
109+
}),
110+
handler: argv => run.start(argv.path, argv.config, argv.port)
108111
})
109112
.help()
110-
.option('help', {
111-
alias: 'h',
112-
type: 'boolean',
113-
desc: chalk.gray(y18n.__('help')),
114-
group: chalk.green(y18n.__('group.globaloptions'))
113+
.option("help", {
114+
alias: "h",
115+
type: "boolean",
116+
desc: chalk.gray(y18n.__("help")),
117+
group: chalk.green(y18n.__("group.globaloptions"))
115118
})
116-
.version('\ndocsify-cli version:\n ' + pkg.version + '\n')
117-
.option('version', {
118-
alias: 'v',
119-
type: 'boolean',
120-
desc: chalk.gray(y18n.__('version')),
121-
group: chalk.green(y18n.__('group.globaloptions'))
119+
.version("\ndocsify-cli version:\n " + pkg.version + "\n")
120+
.option("version", {
121+
alias: "v",
122+
type: "boolean",
123+
desc: chalk.gray(y18n.__("version")),
124+
group: chalk.green(y18n.__("group.globaloptions"))
122125
})
123-
.epilog(chalk.gray(y18n.__('epilog')))
124-
.argv
126+
.epilog(chalk.gray(y18n.__("epilog"))).argv;

gulpfile.babel.js

-48
This file was deleted.

0 commit comments

Comments
 (0)