mazey 3.2.0 → 3.3.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/LICENSE +21 -21
- package/README.md +532 -496
- package/README_CN.md +334 -334
- package/{src/example.html → examples/index.html} +21 -21
- package/examples/index.ts +32 -0
- package/index.js +47 -3
- package/lib/index.cjs.js +1 -1
- package/lib/index.d.ts +130 -56
- package/lib/index.d.ts.map +1 -1
- package/lib/index.esm.js +1 -1
- package/lib/mazey.min.js +1 -1
- package/package.json +109 -109
- package/scripts/release.js +28 -28
- package/src/index.ts +1595 -1426
- package/webpack.config.dev.js +39 -0
- package/src/example.ts +0 -49
package/package.json
CHANGED
|
@@ -1,109 +1,109 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "mazey",
|
|
3
|
-
"version": "3.
|
|
4
|
-
"description": "Mazey's library for front
|
|
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 --open",
|
|
14
|
-
"build": "npx rollup -c",
|
|
15
|
-
"test": "jest",
|
|
16
|
-
"[Give Up]docs": "npx typedoc --out docs/ src/",
|
|
17
|
-
"docs": "npx typedoc",
|
|
18
|
-
"lint-and-fix": "eslint ./src/index.ts --ext 'ts,tsx' --fix",
|
|
19
|
-
"preview": "npm run build && npm run test && npm run docs",
|
|
20
|
-
"release": "npm run preview && npm publish && node ./scripts/release.js"
|
|
21
|
-
},
|
|
22
|
-
"repository": {
|
|
23
|
-
"type": "git",
|
|
24
|
-
"url": "git+https://github.com/mazeyqian/mazey.git"
|
|
25
|
-
},
|
|
26
|
-
"keywords": [
|
|
27
|
-
"javascript",
|
|
28
|
-
"function",
|
|
29
|
-
"math",
|
|
30
|
-
"load",
|
|
31
|
-
"css",
|
|
32
|
-
"debounce",
|
|
33
|
-
"throttle",
|
|
34
|
-
"trim",
|
|
35
|
-
"clone",
|
|
36
|
-
"json",
|
|
37
|
-
"random",
|
|
38
|
-
"dom",
|
|
39
|
-
"style",
|
|
40
|
-
"url",
|
|
41
|
-
"hash",
|
|
42
|
-
"storage",
|
|
43
|
-
"cookie",
|
|
44
|
-
"calculate",
|
|
45
|
-
"formula",
|
|
46
|
-
"browser",
|
|
47
|
-
"performance",
|
|
48
|
-
"pwa",
|
|
49
|
-
"console"
|
|
50
|
-
],
|
|
51
|
-
"author": {
|
|
52
|
-
"name": "Mazey Chu",
|
|
53
|
-
"email": "mazeyqian@gmail.com",
|
|
54
|
-
"url": "https://blog.mazey.net"
|
|
55
|
-
},
|
|
56
|
-
"license": "MIT",
|
|
57
|
-
"bugs": {
|
|
58
|
-
"url": "https://github.com/mazeyqian/mazey/issues"
|
|
59
|
-
},
|
|
60
|
-
"homepage": "https://github.com/mazeyqian/mazey#readme",
|
|
61
|
-
"devDependencies": {
|
|
62
|
-
"@babel/core": "7.8.4",
|
|
63
|
-
"@babel/plugin-proposal-class-properties": "7.10.4",
|
|
64
|
-
"@babel/plugin-proposal-object-rest-spread": "7.11.0",
|
|
65
|
-
"@babel/plugin-transform-runtime": "7.11.0",
|
|
66
|
-
"@babel/preset-env": "7.5.5",
|
|
67
|
-
"@babel/preset-typescript": "7.10.4",
|
|
68
|
-
"@commitlint/cli": "^8.3.5",
|
|
69
|
-
"@commitlint/config-conventional": "^8.3.4",
|
|
70
|
-
"@typescript-eslint/eslint-plugin": "^4.22.0",
|
|
71
|
-
"@typescript-eslint/parser": "^4.22.0",
|
|
72
|
-
"clean-webpack-plugin": "1.0.1",
|
|
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": "^1.31.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-terser": "^7.0.2",
|
|
91
|
-
"rollup-plugin-typescript2": "^0.27.2",
|
|
92
|
-
"ts-loader": "8.0.2",
|
|
93
|
-
"typedoc": "0.18.0",
|
|
94
|
-
"typescript": "3.9.7",
|
|
95
|
-
"webpack": "4.30.0",
|
|
96
|
-
"webpack-cli": "3.3.2",
|
|
97
|
-
"webpack-dev-server": "3.10.3"
|
|
98
|
-
},
|
|
99
|
-
"husky": {
|
|
100
|
-
"hooks": {
|
|
101
|
-
"commit-msg": "commitlint -E HUSKY_GIT_PARAMS",
|
|
102
|
-
"pre-commit": "lint-staged"
|
|
103
|
-
}
|
|
104
|
-
},
|
|
105
|
-
"dependencies": {
|
|
106
|
-
"@babel/runtime-corejs3": "^7.11.2",
|
|
107
|
-
"core-js": "^3.6.5"
|
|
108
|
-
}
|
|
109
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "mazey",
|
|
3
|
+
"version": "3.3.0",
|
|
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 webpack.config.dev.js --open",
|
|
14
|
+
"build": "npx rollup -c",
|
|
15
|
+
"test": "jest",
|
|
16
|
+
"[Give Up]docs": "npx typedoc --out docs/ src/",
|
|
17
|
+
"docs": "npx typedoc",
|
|
18
|
+
"lint-and-fix": "eslint ./src/index.ts --ext 'ts,tsx' --fix",
|
|
19
|
+
"preview": "npm run build && npm run test && npm run docs",
|
|
20
|
+
"release": "npm run preview && npm publish && node ./scripts/release.js"
|
|
21
|
+
},
|
|
22
|
+
"repository": {
|
|
23
|
+
"type": "git",
|
|
24
|
+
"url": "git+https://github.com/mazeyqian/mazey.git"
|
|
25
|
+
},
|
|
26
|
+
"keywords": [
|
|
27
|
+
"javascript",
|
|
28
|
+
"function",
|
|
29
|
+
"math",
|
|
30
|
+
"load",
|
|
31
|
+
"css",
|
|
32
|
+
"debounce",
|
|
33
|
+
"throttle",
|
|
34
|
+
"trim",
|
|
35
|
+
"clone",
|
|
36
|
+
"json",
|
|
37
|
+
"random",
|
|
38
|
+
"dom",
|
|
39
|
+
"style",
|
|
40
|
+
"url",
|
|
41
|
+
"hash",
|
|
42
|
+
"storage",
|
|
43
|
+
"cookie",
|
|
44
|
+
"calculate",
|
|
45
|
+
"formula",
|
|
46
|
+
"browser",
|
|
47
|
+
"performance",
|
|
48
|
+
"pwa",
|
|
49
|
+
"console"
|
|
50
|
+
],
|
|
51
|
+
"author": {
|
|
52
|
+
"name": "Mazey Chu",
|
|
53
|
+
"email": "mazeyqian@gmail.com",
|
|
54
|
+
"url": "https://blog.mazey.net"
|
|
55
|
+
},
|
|
56
|
+
"license": "MIT",
|
|
57
|
+
"bugs": {
|
|
58
|
+
"url": "https://github.com/mazeyqian/mazey/issues"
|
|
59
|
+
},
|
|
60
|
+
"homepage": "https://github.com/mazeyqian/mazey#readme",
|
|
61
|
+
"devDependencies": {
|
|
62
|
+
"@babel/core": "7.8.4",
|
|
63
|
+
"@babel/plugin-proposal-class-properties": "7.10.4",
|
|
64
|
+
"@babel/plugin-proposal-object-rest-spread": "7.11.0",
|
|
65
|
+
"@babel/plugin-transform-runtime": "7.11.0",
|
|
66
|
+
"@babel/preset-env": "7.5.5",
|
|
67
|
+
"@babel/preset-typescript": "7.10.4",
|
|
68
|
+
"@commitlint/cli": "^8.3.5",
|
|
69
|
+
"@commitlint/config-conventional": "^8.3.4",
|
|
70
|
+
"@typescript-eslint/eslint-plugin": "^4.22.0",
|
|
71
|
+
"@typescript-eslint/parser": "^4.22.0",
|
|
72
|
+
"clean-webpack-plugin": "1.0.1",
|
|
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": "^1.31.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-terser": "^7.0.2",
|
|
91
|
+
"rollup-plugin-typescript2": "^0.27.2",
|
|
92
|
+
"ts-loader": "8.0.2",
|
|
93
|
+
"typedoc": "0.18.0",
|
|
94
|
+
"typescript": "3.9.7",
|
|
95
|
+
"webpack": "4.30.0",
|
|
96
|
+
"webpack-cli": "3.3.2",
|
|
97
|
+
"webpack-dev-server": "3.10.3"
|
|
98
|
+
},
|
|
99
|
+
"husky": {
|
|
100
|
+
"hooks": {
|
|
101
|
+
"commit-msg": "commitlint -E HUSKY_GIT_PARAMS",
|
|
102
|
+
"pre-commit": "lint-staged"
|
|
103
|
+
}
|
|
104
|
+
},
|
|
105
|
+
"dependencies": {
|
|
106
|
+
"@babel/runtime-corejs3": "^7.11.2",
|
|
107
|
+
"core-js": "^3.6.5"
|
|
108
|
+
}
|
|
109
|
+
}
|
package/scripts/release.js
CHANGED
|
@@ -1,28 +1,28 @@
|
|
|
1
|
-
/* eslint-disable @typescript-eslint/no-var-requires */
|
|
2
|
-
/* eslint-disable no-undef */
|
|
3
|
-
// release
|
|
4
|
-
const execa = require('execa');
|
|
5
|
-
const pkgVersion = process.env.VERSION || require('../package.json').version;
|
|
6
|
-
|
|
7
|
-
// Main
|
|
8
|
-
(async () => {
|
|
9
|
-
const releaseVersion = `v${pkgVersion}`;
|
|
10
|
-
const { stdout: releaseStdout } = await execa('echo', [`Start release ${releaseVersion}...`]);
|
|
11
|
-
console.log(releaseStdout);
|
|
12
|
-
// Commit Stdout
|
|
13
|
-
const { stdout: diffStdout } = await execa('git', ['diff'], { stdio: 'pipe' });
|
|
14
|
-
if (diffStdout) {
|
|
15
|
-
console.log('Committing changes...');
|
|
16
|
-
await execa('git', ['add', '-A']);
|
|
17
|
-
await execa('git', ['commit', '-m', `release: ${releaseVersion}`]);
|
|
18
|
-
} else {
|
|
19
|
-
console.log('No changes to commit.');
|
|
20
|
-
}
|
|
21
|
-
// Push
|
|
22
|
-
console.log('Pushing to GitHub...');
|
|
23
|
-
await execa('git', ['tag', '-a', `${releaseVersion}`, '-m', `Release ${releaseVersion}`]);
|
|
24
|
-
await execa('git', ['push', 'origin', `refs/tags/${releaseVersion}`]);
|
|
25
|
-
await execa('git', ['push']);
|
|
26
|
-
|
|
27
|
-
console.log('All done.');
|
|
28
|
-
})();
|
|
1
|
+
/* eslint-disable @typescript-eslint/no-var-requires */
|
|
2
|
+
/* eslint-disable no-undef */
|
|
3
|
+
// release
|
|
4
|
+
const execa = require('execa');
|
|
5
|
+
const pkgVersion = process.env.VERSION || require('../package.json').version;
|
|
6
|
+
|
|
7
|
+
// Main
|
|
8
|
+
(async () => {
|
|
9
|
+
const releaseVersion = `v${pkgVersion}`;
|
|
10
|
+
const { stdout: releaseStdout } = await execa('echo', [`Start release ${releaseVersion}...`]);
|
|
11
|
+
console.log(releaseStdout);
|
|
12
|
+
// Commit Stdout
|
|
13
|
+
const { stdout: diffStdout } = await execa('git', ['diff'], { stdio: 'pipe' });
|
|
14
|
+
if (diffStdout) {
|
|
15
|
+
console.log('Committing changes...');
|
|
16
|
+
await execa('git', ['add', '-A']);
|
|
17
|
+
await execa('git', ['commit', '-m', `release: ${releaseVersion}`]);
|
|
18
|
+
} else {
|
|
19
|
+
console.log('No changes to commit.');
|
|
20
|
+
}
|
|
21
|
+
// Push
|
|
22
|
+
console.log('Pushing to GitHub...');
|
|
23
|
+
await execa('git', ['tag', '-a', `${releaseVersion}`, '-m', `Release ${releaseVersion}`]);
|
|
24
|
+
await execa('git', ['push', 'origin', `refs/tags/${releaseVersion}`]);
|
|
25
|
+
await execa('git', ['push']);
|
|
26
|
+
|
|
27
|
+
console.log('All done.');
|
|
28
|
+
})();
|