Skip to content

Commit d3931b2

Browse files
committed
feat: gen done
1 parent 45ec94f commit d3931b2

25 files changed

+9496
-276
lines changed

.eslintignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
/public/bundle.js
2+
/public/index.html
3+
/npm
4+
/cdn
5+
**/*.html

.eslintrc.js

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
module.exports = {
2+
"env": {
3+
"browser": true,
4+
"es6": true,
5+
"node": true,
6+
"commonjs": true
7+
},
8+
"parserOptions": {
9+
"parser": "babel-eslint",
10+
"ecmaVersion": 2018,
11+
"ecmaFeatures": {
12+
"arrowFunctions": true,
13+
"classes": true,
14+
"modules": true,
15+
"defaultParams": true,
16+
"experimentalObjectRestSpread": true
17+
},
18+
"sourceType": "module",
19+
"parserOptions": {
20+
"allowImportExportEverywhere": true
21+
}
22+
},
23+
"globals": {
24+
"window": true,
25+
},
26+
"rules": {
27+
"no-extend-native": 0,
28+
"no-new": 0,
29+
"no-useless-escape": 0,
30+
"no-useless-constructor": 0,
31+
"no-trailing-spaces": ["error", { "skipBlankLines": true }],
32+
"indent": ["error", 4, {
33+
"SwitchCase": 1
34+
}],
35+
"space-infix-ops": ["error", {"int32Hint": false}],
36+
"space-before-function-paren": ["error", {
37+
"anonymous": "always",
38+
"named": "always",
39+
"asyncArrow": "always"
40+
}],
41+
"semi": ["error", "always"],
42+
"comma-dangle": 0,
43+
"no-console": 0,
44+
"no-debugger": 0,
45+
"id-length": 0,
46+
"eol-last": 0,
47+
"object-curly-spacing": ["error", "never"],
48+
"arrow-spacing": "error",
49+
"no-multiple-empty-lines": "error",
50+
"no-unused-vars": "error",
51+
"spaced-comment": "error",
52+
"quotes": ["error", "single", { "allowTemplateLiterals": true }],
53+
"no-unreachable": "error",
54+
"keyword-spacing": "error",
55+
"space-before-blocks": "error",
56+
"semi-spacing": "error",
57+
"comma-spacing": "error",
58+
"key-spacing": "error",
59+
"no-undef": "error",
60+
"prefer-const": "error"
61+
}
62+
}

.npmignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
1-
node_modules
1+
node_modules
2+
.eslintrc.js
3+
.eslintignore

bin/ebuild-count.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#!/usr/bin/env node
2+
3+
const count = require('count-code-line');
4+
5+
count();

bin/ebuild-gen.js

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
// const fs = require('fs');
2+
const path = require('path');
3+
const copydir = require('copy-dir');
4+
const {writeJsonIntoFile} = require('../scripts/eb-bin/utils');
5+
6+
7+
function main () {
8+
const currentPath = process.cwd();
9+
10+
const binPath = __dirname;
11+
12+
console.log(binPath, currentPath);
13+
14+
copydir.sync(
15+
path.resolve(binPath, '../scripts/github-workflow/eb-docs.yml'),
16+
path.resolve(binPath, './.github/workflows'),
17+
);
18+
19+
copydir.sync(
20+
path.resolve(binPath, '../scripts/github-workflow/eb-release.yml'),
21+
path.resolve(binPath, './.github/workflows'),
22+
);
23+
24+
copydir.sync(
25+
path.resolve(binPath, '../scripts/github-workflow/release-drafter.yml'),
26+
path.resolve(binPath, './.github'),
27+
);
28+
29+
copydir.sync(
30+
path.resolve(binPath, '../scripts/eb-bin'),
31+
path.resolve(binPath, './scripts'),
32+
);
33+
34+
35+
const pkg = require(path.resolve(currentPath, './package.json'));
36+
37+
if (!pkg) pkg.scripts = {};
38+
39+
pkg.scripts['eb:build'] = 'node ./scripts/eb-bin/build.js';
40+
pkg.scripts['eb:docs'] = 'node ./scripts/eb-bin/build-docs.js';
41+
pkg.scripts['eb:release'] = 'node ./scripts/eb-bin/push-release.js';
42+
pkg.scripts['eb:publish'] = 'node ./scripts/eb-bin/publish.js';
43+
pkg.scripts['eb:purge'] = 'node ./scripts/eb-bin/purge-cdn.js';
44+
pkg.scripts['eb:mono-init-pkg'] = 'node ./scripts/eb-bin/init-packages-info.js';
45+
pkg.scripts['eb:mono-init-pkg-dev'] = 'node ./scripts/eb-bin/init-packages-info.js dev';
46+
pkg.scripts['eb:mono-dep'] = 'node ./scripts/eb-bin/init-learn-dep.js';
47+
48+
writeJsonIntoFile(pkg, path.resolve(currentPath, './package.json'));
49+
}
50+
51+
main();

0 commit comments

Comments
 (0)