mazey 3.3.5 → 3.3.6
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/LICENSE +21 -21
- package/README.md +535 -568
- package/README_CN.md +334 -334
- package/examples/index.html +21 -21
- package/examples/index.ts +70 -50
- package/images/mazey-v1.4.39.svg +0 -0
- package/lib/index.cjs.js +2 -2
- package/lib/index.d.ts +0 -0
- package/lib/index.d.ts.map +0 -0
- package/lib/index.esm.js +2 -2
- package/lib/mazey.min.js +2 -2
- package/package.json +110 -109
- package/scripts/build-helper.js +17 -17
- package/scripts/dev.js +22 -19
- package/scripts/github-helper.js +110 -57
- package/scripts/release.js +7 -7
- package/scripts/webpack.config.dev.js +39 -39
- package/src/index.ts +1608 -1608
- package/src/{index.js → preview.js} +47 -47
- package/src/t.html +18 -0
package/package.json
CHANGED
|
@@ -1,109 +1,110 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "mazey",
|
|
3
|
-
"version": "3.3.
|
|
4
|
-
"description": "Mazey's library for front-end.",
|
|
5
|
-
"main": "lib/index.cjs.js",
|
|
6
|
-
"module": "lib/index.esm.js",
|
|
7
|
-
"typings": "lib/index.d.ts",
|
|
8
|
-
"mainEntryPointFilePath": "lib/index.d.ts",
|
|
9
|
-
"directories": {
|
|
10
|
-
"lib": "./lib"
|
|
11
|
-
},
|
|
12
|
-
"scripts": {
|
|
13
|
-
"dev": "webpack-dev-server --config ./scripts/webpack.config.dev.js --open",
|
|
14
|
-
"build": "rollup --config ./scripts/rollup.config.js",
|
|
15
|
-
"test": "jest",
|
|
16
|
-
"docs": "typedoc",
|
|
17
|
-
"lint-and-fix": "eslint ./src/index.ts --ext 'ts,tsx' --fix",
|
|
18
|
-
"preview": "npm run
|
|
19
|
-
"release": "npm run preview &&
|
|
20
|
-
},
|
|
21
|
-
"repository": {
|
|
22
|
-
"type": "git",
|
|
23
|
-
"url": "git+https://github.com/mazeyqian/mazey.git"
|
|
24
|
-
},
|
|
25
|
-
"keywords": [
|
|
26
|
-
"javascript",
|
|
27
|
-
"function",
|
|
28
|
-
"math",
|
|
29
|
-
"load",
|
|
30
|
-
"css",
|
|
31
|
-
"debounce",
|
|
32
|
-
"throttle",
|
|
33
|
-
"trim",
|
|
34
|
-
"clone",
|
|
35
|
-
"json",
|
|
36
|
-
"random",
|
|
37
|
-
"dom",
|
|
38
|
-
"style",
|
|
39
|
-
"url",
|
|
40
|
-
"hash",
|
|
41
|
-
"storage",
|
|
42
|
-
"cookie",
|
|
43
|
-
"calculate",
|
|
44
|
-
"formula",
|
|
45
|
-
"browser",
|
|
46
|
-
"performance",
|
|
47
|
-
"pwa",
|
|
48
|
-
"console"
|
|
49
|
-
],
|
|
50
|
-
"author": {
|
|
51
|
-
"name": "Mazey Chu",
|
|
52
|
-
"email": "mazeyqian@gmail.com",
|
|
53
|
-
"url": "https://blog.mazey.net"
|
|
54
|
-
},
|
|
55
|
-
"license": "MIT",
|
|
56
|
-
"bugs": {
|
|
57
|
-
"url": "https://github.com/mazeyqian/mazey/issues"
|
|
58
|
-
},
|
|
59
|
-
"homepage": "https://github.com/mazeyqian/mazey#readme",
|
|
60
|
-
"devDependencies": {
|
|
61
|
-
"@babel/core": "^7.8.4",
|
|
62
|
-
"@babel/plugin-proposal-class-properties": "^7.10.4",
|
|
63
|
-
"@babel/plugin-proposal-object-rest-spread": "^7.11.0",
|
|
64
|
-
"@babel/plugin-transform-runtime": "^7.11.0",
|
|
65
|
-
"@babel/preset-env": "^7.5.5",
|
|
66
|
-
"@babel/preset-typescript": "^7.10.4",
|
|
67
|
-
"@commitlint/cli": "^8.3.5",
|
|
68
|
-
"@commitlint/config-conventional": "^8.3.4",
|
|
69
|
-
"@typescript-eslint/eslint-plugin": "^4.22.0",
|
|
70
|
-
"@typescript-eslint/parser": "^4.22.0",
|
|
71
|
-
"clean-webpack-plugin": "^1.0.1",
|
|
72
|
-
"date-fns": "^2.29.3",
|
|
73
|
-
"eslint": "^6.8.0",
|
|
74
|
-
"eslint-config-standard": "^14.1.0",
|
|
75
|
-
"eslint-plugin-import": "^2.20.1",
|
|
76
|
-
"eslint-plugin-node": "^11.0.0",
|
|
77
|
-
"eslint-plugin-promise": "^4.2.1",
|
|
78
|
-
"eslint-plugin-standard": "^4.0.1",
|
|
79
|
-
"execa": "^4.1.0",
|
|
80
|
-
"html-webpack-plugin": "^3.2.0",
|
|
81
|
-
"husky": "^4.3.8",
|
|
82
|
-
"jest": "^27.5.1",
|
|
83
|
-
"lint-staged": "^10.0.8",
|
|
84
|
-
"prettier": "^1.19.1",
|
|
85
|
-
"prettier-eslint-cli": "^5.0.0",
|
|
86
|
-
"rollup": "^2.79.1",
|
|
87
|
-
"rollup-plugin-babel": "^4.3.3",
|
|
88
|
-
"rollup-plugin-cleaner": "^1.0.0",
|
|
89
|
-
"rollup-plugin-commonjs": "^10.1.0",
|
|
90
|
-
"rollup-plugin-
|
|
91
|
-
"rollup-plugin-
|
|
92
|
-
"
|
|
93
|
-
"
|
|
94
|
-
"
|
|
95
|
-
"
|
|
96
|
-
"webpack
|
|
97
|
-
"webpack-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
"
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
"
|
|
108
|
-
|
|
109
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "mazey",
|
|
3
|
+
"version": "3.3.6",
|
|
4
|
+
"description": "Mazey's library for front-end.",
|
|
5
|
+
"main": "lib/index.cjs.js",
|
|
6
|
+
"module": "lib/index.esm.js",
|
|
7
|
+
"typings": "lib/index.d.ts",
|
|
8
|
+
"mainEntryPointFilePath": "lib/index.d.ts",
|
|
9
|
+
"directories": {
|
|
10
|
+
"lib": "./lib"
|
|
11
|
+
},
|
|
12
|
+
"scripts": {
|
|
13
|
+
"dev": "webpack-dev-server --config ./scripts/webpack.config.dev.js --open",
|
|
14
|
+
"build": "rollup --config ./scripts/rollup.config.js",
|
|
15
|
+
"test": "jest",
|
|
16
|
+
"docs": "typedoc",
|
|
17
|
+
"lint-and-fix": "eslint ./src/index.ts --ext 'ts,tsx' --fix",
|
|
18
|
+
"preview": "npm run docs && npm run build && npm run test",
|
|
19
|
+
"release": "npm run preview && node ./scripts/release.js"
|
|
20
|
+
},
|
|
21
|
+
"repository": {
|
|
22
|
+
"type": "git",
|
|
23
|
+
"url": "git+https://github.com/mazeyqian/mazey.git"
|
|
24
|
+
},
|
|
25
|
+
"keywords": [
|
|
26
|
+
"javascript",
|
|
27
|
+
"function",
|
|
28
|
+
"math",
|
|
29
|
+
"load",
|
|
30
|
+
"css",
|
|
31
|
+
"debounce",
|
|
32
|
+
"throttle",
|
|
33
|
+
"trim",
|
|
34
|
+
"clone",
|
|
35
|
+
"json",
|
|
36
|
+
"random",
|
|
37
|
+
"dom",
|
|
38
|
+
"style",
|
|
39
|
+
"url",
|
|
40
|
+
"hash",
|
|
41
|
+
"storage",
|
|
42
|
+
"cookie",
|
|
43
|
+
"calculate",
|
|
44
|
+
"formula",
|
|
45
|
+
"browser",
|
|
46
|
+
"performance",
|
|
47
|
+
"pwa",
|
|
48
|
+
"console"
|
|
49
|
+
],
|
|
50
|
+
"author": {
|
|
51
|
+
"name": "Mazey Chu",
|
|
52
|
+
"email": "mazeyqian@gmail.com",
|
|
53
|
+
"url": "https://blog.mazey.net"
|
|
54
|
+
},
|
|
55
|
+
"license": "MIT",
|
|
56
|
+
"bugs": {
|
|
57
|
+
"url": "https://github.com/mazeyqian/mazey/issues"
|
|
58
|
+
},
|
|
59
|
+
"homepage": "https://github.com/mazeyqian/mazey#readme",
|
|
60
|
+
"devDependencies": {
|
|
61
|
+
"@babel/core": "^7.8.4",
|
|
62
|
+
"@babel/plugin-proposal-class-properties": "^7.10.4",
|
|
63
|
+
"@babel/plugin-proposal-object-rest-spread": "^7.11.0",
|
|
64
|
+
"@babel/plugin-transform-runtime": "^7.11.0",
|
|
65
|
+
"@babel/preset-env": "^7.5.5",
|
|
66
|
+
"@babel/preset-typescript": "^7.10.4",
|
|
67
|
+
"@commitlint/cli": "^8.3.5",
|
|
68
|
+
"@commitlint/config-conventional": "^8.3.4",
|
|
69
|
+
"@typescript-eslint/eslint-plugin": "^4.22.0",
|
|
70
|
+
"@typescript-eslint/parser": "^4.22.0",
|
|
71
|
+
"clean-webpack-plugin": "^1.0.1",
|
|
72
|
+
"date-fns": "^2.29.3",
|
|
73
|
+
"eslint": "^6.8.0",
|
|
74
|
+
"eslint-config-standard": "^14.1.0",
|
|
75
|
+
"eslint-plugin-import": "^2.20.1",
|
|
76
|
+
"eslint-plugin-node": "^11.0.0",
|
|
77
|
+
"eslint-plugin-promise": "^4.2.1",
|
|
78
|
+
"eslint-plugin-standard": "^4.0.1",
|
|
79
|
+
"execa": "^4.1.0",
|
|
80
|
+
"html-webpack-plugin": "^3.2.0",
|
|
81
|
+
"husky": "^4.3.8",
|
|
82
|
+
"jest": "^27.5.1",
|
|
83
|
+
"lint-staged": "^10.0.8",
|
|
84
|
+
"prettier": "^1.19.1",
|
|
85
|
+
"prettier-eslint-cli": "^5.0.0",
|
|
86
|
+
"rollup": "^2.79.1",
|
|
87
|
+
"rollup-plugin-babel": "^4.3.3",
|
|
88
|
+
"rollup-plugin-cleaner": "^1.0.0",
|
|
89
|
+
"rollup-plugin-commonjs": "^10.1.0",
|
|
90
|
+
"rollup-plugin-copy": "^3.4.0",
|
|
91
|
+
"rollup-plugin-terser": "^7.0.2",
|
|
92
|
+
"rollup-plugin-typescript2": "^0.27.2",
|
|
93
|
+
"ts-loader": "^8.0.2",
|
|
94
|
+
"typedoc": "^0.18.0",
|
|
95
|
+
"typescript": "^3.9.7",
|
|
96
|
+
"webpack": "^4.30.0",
|
|
97
|
+
"webpack-cli": "^3.3.2",
|
|
98
|
+
"webpack-dev-server": "^3.10.3"
|
|
99
|
+
},
|
|
100
|
+
"husky": {
|
|
101
|
+
"hooks": {
|
|
102
|
+
"commit-msg": "commitlint -E HUSKY_GIT_PARAMS",
|
|
103
|
+
"pre-commit": "lint-staged"
|
|
104
|
+
}
|
|
105
|
+
},
|
|
106
|
+
"dependencies": {
|
|
107
|
+
"@babel/runtime-corejs3": "^7.11.2",
|
|
108
|
+
"core-js": "^3.6.5"
|
|
109
|
+
}
|
|
110
|
+
}
|
package/scripts/build-helper.js
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
/* eslint-disable @typescript-eslint/no-var-requires */
|
|
2
|
-
/* eslint-disable no-undef */
|
|
3
|
-
const path = require('path');
|
|
4
|
-
const _resolve = (_path) => path.resolve(__dirname, _path);
|
|
5
|
-
const format = require('date-fns/format');
|
|
6
|
-
// Generate version: 20210308.072903
|
|
7
|
-
const genVersion = () => {
|
|
8
|
-
const d = new Date();
|
|
9
|
-
const version = format(d, 'yyyyMMdd.HHmmss');
|
|
10
|
-
return version;
|
|
11
|
-
};
|
|
12
|
-
const version = genVersion();
|
|
13
|
-
|
|
14
|
-
module.exports = {
|
|
15
|
-
_resolve,
|
|
16
|
-
version,
|
|
17
|
-
};
|
|
1
|
+
/* eslint-disable @typescript-eslint/no-var-requires */
|
|
2
|
+
/* eslint-disable no-undef */
|
|
3
|
+
const path = require('path');
|
|
4
|
+
const _resolve = (_path) => path.resolve(__dirname, _path);
|
|
5
|
+
const format = require('date-fns/format');
|
|
6
|
+
// Generate version: 20210308.072903
|
|
7
|
+
const genVersion = () => {
|
|
8
|
+
const d = new Date();
|
|
9
|
+
const version = format(d, 'yyyyMMdd.HHmmss');
|
|
10
|
+
return version;
|
|
11
|
+
};
|
|
12
|
+
const version = genVersion();
|
|
13
|
+
|
|
14
|
+
module.exports = {
|
|
15
|
+
_resolve,
|
|
16
|
+
version,
|
|
17
|
+
};
|
package/scripts/dev.js
CHANGED
|
@@ -1,19 +1,22 @@
|
|
|
1
|
-
/* eslint-disable no-undef */
|
|
2
|
-
/* eslint-disable @typescript-eslint/no-var-requires */
|
|
3
|
-
const execa = require('execa');
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
//
|
|
8
|
-
//
|
|
9
|
-
//
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
//
|
|
19
|
-
|
|
1
|
+
/* eslint-disable no-undef */
|
|
2
|
+
/* eslint-disable @typescript-eslint/no-var-requires */
|
|
3
|
+
// const execa = require('execa');
|
|
4
|
+
const { getGitCurrentBranch } = require('./github-helper');
|
|
5
|
+
|
|
6
|
+
(async () => {
|
|
7
|
+
// const { stdout: pushMsg = '' } = await execa('git', ['push'], { stdio: 'pipe' })
|
|
8
|
+
// .catch(error => {
|
|
9
|
+
// console.log('error:', error.message);
|
|
10
|
+
// });
|
|
11
|
+
// try {
|
|
12
|
+
// await execa('git', ['push'], { stdio: 'pipe' });
|
|
13
|
+
// } catch (error) {
|
|
14
|
+
// console.log('error:', error.message);
|
|
15
|
+
// const { stdout: currentBranch } = await execa('git', ['branch', '--show-current'], { stdio: 'pipe' });
|
|
16
|
+
// console.log('currentBranch:', currentBranch); // currentBranch: fix/rollup_dependences_mon_oct_31st_2022
|
|
17
|
+
// await execa('git', ['push', '--set-upstream', 'origin', currentBranch]);
|
|
18
|
+
// }
|
|
19
|
+
// console.log('pushMsg:', pushMsg);
|
|
20
|
+
const cb = await getGitCurrentBranch('fix returns value');
|
|
21
|
+
console.log('bbb', cb);
|
|
22
|
+
})();
|
package/scripts/github-helper.js
CHANGED
|
@@ -1,57 +1,110 @@
|
|
|
1
|
-
/* eslint-disable @typescript-eslint/no-var-requires */
|
|
2
|
-
/* eslint-disable no-undef */
|
|
3
|
-
// Github Helper
|
|
4
|
-
const execa = require('execa');
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* Release code.
|
|
8
|
-
*
|
|
9
|
-
* Example: Release code with version by `process.env.VERSION` or `package.json`.
|
|
10
|
-
*
|
|
11
|
-
* ```
|
|
12
|
-
* const pkgVersion = process.env.VERSION || require('../package.json').version;
|
|
13
|
-
* release(pkgVersion);
|
|
14
|
-
* ```
|
|
15
|
-
*/
|
|
16
|
-
async function release (ver) {
|
|
17
|
-
const releaseVersion = `v${ver}`;
|
|
18
|
-
const { stdout: releaseStdout } = await execa('echo', [`Start release ${releaseVersion}...`]);
|
|
19
|
-
console.log(releaseStdout);
|
|
20
|
-
//
|
|
21
|
-
|
|
22
|
-
//
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
1
|
+
/* eslint-disable @typescript-eslint/no-var-requires */
|
|
2
|
+
/* eslint-disable no-undef */
|
|
3
|
+
// Github Helper
|
|
4
|
+
const execa = require('execa');
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Release code.
|
|
8
|
+
*
|
|
9
|
+
* Example: Release code with version by `process.env.VERSION` or `package.json`.
|
|
10
|
+
*
|
|
11
|
+
* ```
|
|
12
|
+
* const pkgVersion = process.env.VERSION || require('../package.json').version;
|
|
13
|
+
* release(pkgVersion);
|
|
14
|
+
* ```
|
|
15
|
+
*/
|
|
16
|
+
async function release (ver) {
|
|
17
|
+
const releaseVersion = `v${ver}`;
|
|
18
|
+
const { stdout: releaseStdout } = await execa('echo', [`Start release ${releaseVersion}...`]);
|
|
19
|
+
console.log(releaseStdout);
|
|
20
|
+
// commit
|
|
21
|
+
await getCommit('stage');
|
|
22
|
+
// marge
|
|
23
|
+
await gitMergeMaster2Release();
|
|
24
|
+
// build
|
|
25
|
+
await execa('npm', ['run', 'preview']);
|
|
26
|
+
await execa('npm', ['publish']);
|
|
27
|
+
// git branch --show-current
|
|
28
|
+
// console.log('git push --set-upstream origin <branch>');
|
|
29
|
+
// Commit Stdout
|
|
30
|
+
const { stdout: diffStdout } = await execa('git', ['diff'], { stdio: 'pipe' });
|
|
31
|
+
if (diffStdout) {
|
|
32
|
+
console.log('Committing changes...');
|
|
33
|
+
await execa('git', ['add', '-A']);
|
|
34
|
+
await execa('git', ['commit', '-m', `release: ${releaseVersion}`]);
|
|
35
|
+
} else {
|
|
36
|
+
console.log('No changes to commit.');
|
|
37
|
+
}
|
|
38
|
+
// Push
|
|
39
|
+
console.log('Pushing to GitHub...');
|
|
40
|
+
await execa('git', ['tag', '-a', `${releaseVersion}`, '-m', `Release ${releaseVersion}`]);
|
|
41
|
+
await execa('git', ['push', 'origin', `refs/tags/${releaseVersion}`]);
|
|
42
|
+
await gitPush(); // execa('git', ['push']);
|
|
43
|
+
|
|
44
|
+
console.log('All done.');
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* Push code.
|
|
49
|
+
*/
|
|
50
|
+
async function gitPush () {
|
|
51
|
+
try {
|
|
52
|
+
await execa('git', ['push'], { stdio: 'pipe' });
|
|
53
|
+
} catch (error) {
|
|
54
|
+
console.log('error:', error.message);
|
|
55
|
+
const { stdout: currentBranch } = await execa('git', ['branch', '--show-current'], { stdio: 'pipe' });
|
|
56
|
+
console.log('currentBranch:', currentBranch); // currentBranch: fix/rollup_dependences_mon_oct_31st_2022
|
|
57
|
+
await execa('git', ['push', '--set-upstream', 'origin', currentBranch]);
|
|
58
|
+
}
|
|
59
|
+
return true;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* Merge master to current branch.
|
|
64
|
+
*/
|
|
65
|
+
async function gitMergeMaster2Release () {
|
|
66
|
+
const currentBranch = await getGitCurrentBranch();
|
|
67
|
+
await execa('git', ['checkout', 'master']);
|
|
68
|
+
await execa('git', ['pull']);
|
|
69
|
+
await execa('git', ['checkout', currentBranch]);
|
|
70
|
+
await execa('git', ['merge', 'master']);
|
|
71
|
+
return true;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
/**
|
|
75
|
+
* Get git current branch.
|
|
76
|
+
*/
|
|
77
|
+
async function getGitCurrentBranch () {
|
|
78
|
+
let currentBranch = '';
|
|
79
|
+
try {
|
|
80
|
+
({ stdout: currentBranch } = await execa('git', ['branch', '--show-current'], { stdio: 'pipe' }));
|
|
81
|
+
} catch (error) {
|
|
82
|
+
// console.log('error:', error.message);
|
|
83
|
+
({ stdout: currentBranch } = await execa('git', ['rev-parse', '--abbrev-ref', 'HEAD'], { stdio: 'pipe' }));
|
|
84
|
+
}
|
|
85
|
+
console.log('currentBranch:', currentBranch);
|
|
86
|
+
return currentBranch;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
/**
|
|
90
|
+
* Commit current code.
|
|
91
|
+
*/
|
|
92
|
+
async function getCommit (releaseVersion = 0) {
|
|
93
|
+
const { stdout: diffStdout } = await execa('git', ['diff'], { stdio: 'pipe' });
|
|
94
|
+
if (diffStdout) {
|
|
95
|
+
console.log('Committing changes...');
|
|
96
|
+
await execa('git', ['add', '-A']);
|
|
97
|
+
await execa('git', ['commit', '-m', `release: ${releaseVersion}`]);
|
|
98
|
+
} else {
|
|
99
|
+
console.log('No changes to commit.');
|
|
100
|
+
}
|
|
101
|
+
return true;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
module.exports = {
|
|
105
|
+
release,
|
|
106
|
+
gitPush,
|
|
107
|
+
gitMergeMaster2Release,
|
|
108
|
+
getGitCurrentBranch,
|
|
109
|
+
getCommit,
|
|
110
|
+
};
|
package/scripts/release.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
/* eslint-disable @typescript-eslint/no-var-requires */
|
|
2
|
-
/* eslint-disable no-undef */
|
|
3
|
-
// release
|
|
4
|
-
const { release } = require('./github-helper');
|
|
5
|
-
const pkgVersion = process.env.VERSION || require('../package.json').version;
|
|
6
|
-
|
|
7
|
-
release(pkgVersion);
|
|
1
|
+
/* eslint-disable @typescript-eslint/no-var-requires */
|
|
2
|
+
/* eslint-disable no-undef */
|
|
3
|
+
// release
|
|
4
|
+
const { release } = require('./github-helper');
|
|
5
|
+
const pkgVersion = process.env.VERSION || require('../package.json').version;
|
|
6
|
+
|
|
7
|
+
release(pkgVersion);
|
|
@@ -1,39 +1,39 @@
|
|
|
1
|
-
/* eslint-disable @typescript-eslint/no-var-requires */
|
|
2
|
-
/* eslint-disable no-undef */
|
|
3
|
-
const HtmlWebpackPlugin = require('html-webpack-plugin');
|
|
4
|
-
const CleanWebpackPlugin = require('clean-webpack-plugin');
|
|
5
|
-
const { _resolve } = require('./build-helper');
|
|
6
|
-
|
|
7
|
-
module.exports = {
|
|
8
|
-
entry: {
|
|
9
|
-
index: _resolve('../examples/index.ts'),
|
|
10
|
-
},
|
|
11
|
-
output: {
|
|
12
|
-
filename: '[name].js',
|
|
13
|
-
path: _resolve('../dist'),
|
|
14
|
-
},
|
|
15
|
-
devServer: {
|
|
16
|
-
contentBase: _resolve('../dist'),
|
|
17
|
-
},
|
|
18
|
-
module: {
|
|
19
|
-
rules: [
|
|
20
|
-
{
|
|
21
|
-
test: /\.tsx?$/,
|
|
22
|
-
use: 'ts-loader',
|
|
23
|
-
exclude: /node_modules/,
|
|
24
|
-
},
|
|
25
|
-
],
|
|
26
|
-
},
|
|
27
|
-
plugins: [
|
|
28
|
-
new HtmlWebpackPlugin({
|
|
29
|
-
filename: _resolve('../dist/index.html'),
|
|
30
|
-
template: _resolve('../examples/index.html'),
|
|
31
|
-
inject: true,
|
|
32
|
-
chunksSortMode: 'dependency'
|
|
33
|
-
}),
|
|
34
|
-
new CleanWebpackPlugin([_resolve('../dist')]),
|
|
35
|
-
],
|
|
36
|
-
resolve: {
|
|
37
|
-
extensions: ['.tsx', '.ts', '.js'],
|
|
38
|
-
},
|
|
39
|
-
};
|
|
1
|
+
/* eslint-disable @typescript-eslint/no-var-requires */
|
|
2
|
+
/* eslint-disable no-undef */
|
|
3
|
+
const HtmlWebpackPlugin = require('html-webpack-plugin');
|
|
4
|
+
const CleanWebpackPlugin = require('clean-webpack-plugin');
|
|
5
|
+
const { _resolve } = require('./build-helper');
|
|
6
|
+
|
|
7
|
+
module.exports = {
|
|
8
|
+
entry: {
|
|
9
|
+
index: _resolve('../examples/index.ts'),
|
|
10
|
+
},
|
|
11
|
+
output: {
|
|
12
|
+
filename: '[name].js',
|
|
13
|
+
path: _resolve('../dist'),
|
|
14
|
+
},
|
|
15
|
+
devServer: {
|
|
16
|
+
contentBase: _resolve('../dist'),
|
|
17
|
+
},
|
|
18
|
+
module: {
|
|
19
|
+
rules: [
|
|
20
|
+
{
|
|
21
|
+
test: /\.tsx?$/,
|
|
22
|
+
use: 'ts-loader',
|
|
23
|
+
exclude: /node_modules/,
|
|
24
|
+
},
|
|
25
|
+
],
|
|
26
|
+
},
|
|
27
|
+
plugins: [
|
|
28
|
+
new HtmlWebpackPlugin({
|
|
29
|
+
filename: _resolve('../dist/index.html'),
|
|
30
|
+
template: _resolve('../examples/index.html'),
|
|
31
|
+
inject: true,
|
|
32
|
+
chunksSortMode: 'dependency'
|
|
33
|
+
}),
|
|
34
|
+
new CleanWebpackPlugin([_resolve('../dist')]),
|
|
35
|
+
],
|
|
36
|
+
resolve: {
|
|
37
|
+
extensions: ['.tsx', '.ts', '.js'],
|
|
38
|
+
},
|
|
39
|
+
};
|