@weig_3078/cli-demo 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.eslintignore +1 -0
- package/.eslintrc +73 -0
- package/README.md +1 -0
- package/bin/mvc.js +14 -0
- package/dist/mvc.js +135771 -0
- package/ejs-demo.js +29 -0
- package/lib/ConfigTransform.js +40 -0
- package/lib/Creator.js +29 -0
- package/lib/Generator.js +307 -0
- package/lib/PromptModuleAPI.js +13 -0
- package/lib/create.js +328 -0
- package/lib/generator/babel/index.js +15 -0
- package/lib/generator/linter/index.js +55 -0
- package/lib/generator/linter/template/.eslintrc.js +30 -0
- package/lib/generator/router/index.js +17 -0
- package/lib/generator/router/template/src/App.vue +33 -0
- package/lib/generator/router/template/src/router/index.js +30 -0
- package/lib/generator/router/template/src/views/About.vue +5 -0
- package/lib/generator/router/template/src/views/Home.vue +18 -0
- package/lib/generator/vue/index.js +20 -0
- package/lib/generator/vue/template/public/favicon.ico +0 -0
- package/lib/generator/vue/template/public/index.html +19 -0
- package/lib/generator/vue/template/src/App.vue +29 -0
- package/lib/generator/vue/template/src/assets/logo.png +0 -0
- package/lib/generator/vue/template/src/components/HelloWorld.vue +110 -0
- package/lib/generator/vue/template/src/main.js +8 -0
- package/lib/generator/vuex/index.js +13 -0
- package/lib/generator/vuex/template/src/store/index.js +15 -0
- package/lib/generator/webpack/index.js +27 -0
- package/lib/generator/webpack/template/build/base.config.js +68 -0
- package/lib/generator/webpack/template/build/dev.config.js +19 -0
- package/lib/generator/webpack/template/build/pro.config.js +16 -0
- package/lib/promptModules/babel.js +10 -0
- package/lib/promptModules/linter.js +48 -0
- package/lib/promptModules/router.js +19 -0
- package/lib/promptModules/vuex.js +8 -0
- package/lib/utils/clearConsole.js +13 -0
- package/lib/utils/codemods/injectImports.js +31 -0
- package/lib/utils/codemods/injectOptions.js +27 -0
- package/lib/utils/configTransforms.js +49 -0
- package/lib/utils/executeCommand.js +33 -0
- package/lib/utils/normalizeFilePaths.js +11 -0
- package/lib/utils/sortObject.js +32 -0
- package/lib/utils/stringifyJS.js +12 -0
- package/lib/utils/writeFileTree.js +12 -0
- package/package.json +53 -0
- package/rollup.config.cjs +43 -0
- package/scripts/verify-commit.js +24 -0
package/.eslintignore
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
lib/generator/*/template/
|
package/.eslintrc
ADDED
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
{
|
|
2
|
+
"parserOptions": {
|
|
3
|
+
"ecmaVersion": 2020
|
|
4
|
+
},
|
|
5
|
+
"env": {
|
|
6
|
+
"es6": true
|
|
7
|
+
},
|
|
8
|
+
"settings": {
|
|
9
|
+
"import/resolver": {
|
|
10
|
+
"alias": {
|
|
11
|
+
"map": [
|
|
12
|
+
["@", "./src"]
|
|
13
|
+
]
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
},
|
|
17
|
+
"extends": "airbnb-base",
|
|
18
|
+
"rules": {
|
|
19
|
+
"no-console": "off",
|
|
20
|
+
"array-element-newline": ["error", "consistent"],
|
|
21
|
+
"indent": ["error", 4, { "MemberExpression": 0, "SwitchCase": 1 }],
|
|
22
|
+
"quotes": ["error", "single", { "allowTemplateLiterals": true }],
|
|
23
|
+
"comma-dangle": ["error", "always-multiline"],
|
|
24
|
+
"semi": ["error", "never"],
|
|
25
|
+
"object-curly-spacing": ["error", "always"],
|
|
26
|
+
"max-len": ["error", 140],
|
|
27
|
+
"no-new": "off",
|
|
28
|
+
"linebreak-style": "off",
|
|
29
|
+
"import/extensions": "off",
|
|
30
|
+
"eol-last": "off",
|
|
31
|
+
"no-shadow": "off",
|
|
32
|
+
"no-unused-vars": "warn",
|
|
33
|
+
"import/no-cycle": "off",
|
|
34
|
+
"arrow-parens": "off",
|
|
35
|
+
"eqeqeq": "off",
|
|
36
|
+
"no-param-reassign": "off",
|
|
37
|
+
"import/prefer-default-export": "off",
|
|
38
|
+
"no-use-before-define": "off",
|
|
39
|
+
"no-continue": "off",
|
|
40
|
+
"prefer-destructuring": "off",
|
|
41
|
+
"no-plusplus": "off",
|
|
42
|
+
"prefer-const": "off",
|
|
43
|
+
"global-require": "off",
|
|
44
|
+
"no-prototype-builtins": "off",
|
|
45
|
+
"consistent-return": "off",
|
|
46
|
+
"vue/require-component-is": "off",
|
|
47
|
+
"prefer-template": "off",
|
|
48
|
+
"one-var-declaration-per-line": "off",
|
|
49
|
+
"one-var": "off",
|
|
50
|
+
"import/named": "off",
|
|
51
|
+
"object-curly-newline": "off",
|
|
52
|
+
"default-case": "off",
|
|
53
|
+
"space-infix-ops": "off",
|
|
54
|
+
"import/order": "off",
|
|
55
|
+
"no-trailing-spaces": "off",
|
|
56
|
+
"func-names": "off",
|
|
57
|
+
"radix": "off",
|
|
58
|
+
"no-unused-expressions": "off",
|
|
59
|
+
"no-underscore-dangle": "off",
|
|
60
|
+
"no-bitwise": "off",
|
|
61
|
+
"import/no-dynamic-require": "off",
|
|
62
|
+
"import/no-unresolved": "off",
|
|
63
|
+
"import/no-self-import": "off",
|
|
64
|
+
"import/no-extraneous-dependencies": "off",
|
|
65
|
+
"import/no-useless-path-segments": "off",
|
|
66
|
+
"import/newline-after-import": "off",
|
|
67
|
+
"no-path-concat": "off",
|
|
68
|
+
"guard-for-in": "off",
|
|
69
|
+
"no-restricted-syntax": "off",
|
|
70
|
+
"no-await-in-loop": "off",
|
|
71
|
+
"class-methods-use-this": "off"
|
|
72
|
+
}
|
|
73
|
+
}
|
package/README.md
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
脚手架demo
|
package/bin/mvc.js
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
const program = require('commander')
|
|
3
|
+
const create = require('../lib/create')
|
|
4
|
+
|
|
5
|
+
program
|
|
6
|
+
.version('0.1.0')
|
|
7
|
+
.command('create <name>')
|
|
8
|
+
.option('--skip-install', 'skip npm install')
|
|
9
|
+
.description('create a new project')
|
|
10
|
+
.action((name, cmd) => {
|
|
11
|
+
create(name, { skipInstall: !!cmd.skipInstall })
|
|
12
|
+
})
|
|
13
|
+
|
|
14
|
+
program.parse()
|