mazey 3.12.0 → 3.12.2
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/README.md +13 -16
- package/lib/index.cjs.js +6 -1
- package/lib/index.d.ts +5 -9
- package/lib/index.d.ts.map +1 -1
- package/lib/index.esm.js +6 -1
- package/lib/mazey.min.js +6 -1
- package/lib/typing.d.ts +2 -2
- package/package.json +45 -46
- package/scripts/rollup.config.mjs +0 -152
package/lib/typing.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @author Cheng
|
|
2
|
+
* @author: Cheng
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
5
|
interface BrowserInfo {
|
|
@@ -73,4 +73,4 @@ interface UnknownWindow {
|
|
|
73
73
|
[key: string]: any;
|
|
74
74
|
}
|
|
75
75
|
|
|
76
|
-
export
|
|
76
|
+
export { AnyFunction, BrowserInfo, DebounceFunc, DefineListeners, IsNumberOptions, LoadScriptReturns, RepeatUntilOptions, SimpleObject, SimpleType, TestUa, TestVs, ThrottleFunc, UnknownFn, UnknownFnParams, UnknownFnReturn, UnknownObject, UnknownWindow, UrlParams, ZResIsValidResOptions, ZResResponse };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "mazey",
|
|
3
|
-
"version": "3.12.
|
|
3
|
+
"version": "3.12.2",
|
|
4
4
|
"description": "A functional library for daily front-end work.",
|
|
5
5
|
"main": "lib/index.cjs.js",
|
|
6
6
|
"module": "lib/index.esm.js",
|
|
@@ -14,15 +14,15 @@
|
|
|
14
14
|
"jsdelivr": "lib/mazey.min.js",
|
|
15
15
|
"scripts": {
|
|
16
16
|
"dev": "webpack serve --config ./scripts/webpack.config.dev.js --open",
|
|
17
|
-
"build": "cross-env SCRIPTS_NPM_PACKAGE_DEBUG=close
|
|
18
|
-
"build:debug": "cross-env SCRIPTS_NPM_PACKAGE_DEBUG=open
|
|
17
|
+
"build": "cross-env SCRIPTS_NPM_PACKAGE_DEBUG=close rollup --config ./scripts/rollup.config.js",
|
|
18
|
+
"build:debug": "cross-env SCRIPTS_NPM_PACKAGE_DEBUG=open rollup --config ./scripts/rollup.config.js",
|
|
19
19
|
"test": "jest",
|
|
20
20
|
"test:debug": "npm run build:debug && npm run test",
|
|
21
21
|
"lint:fix": "eslint --ext 'js,ts,tsx' --fix ./src ./test ./scripts",
|
|
22
22
|
"docs": "typedoc --readme ./README.md --excludeProtected --excludePrivate --excludeInternal --hideGenerator",
|
|
23
23
|
"preview": "npm run build && npm run test",
|
|
24
24
|
"release": "npm run preview && cross-env SCRIPTS_NPM_PACKAGE_VERSION=$npm_package_version node ./scripts/release.js",
|
|
25
|
-
"release:win": "bash scripts/env.sh && npm i && npm run release"
|
|
25
|
+
"release:win": "bash scripts/env.sh && npm i --registry=https://registry.npmmirror.com && npm run release"
|
|
26
26
|
},
|
|
27
27
|
"repository": {
|
|
28
28
|
"type": "git",
|
|
@@ -65,53 +65,52 @@
|
|
|
65
65
|
},
|
|
66
66
|
"homepage": "https://github.com/mazeyqian/mazey#readme",
|
|
67
67
|
"devDependencies": {
|
|
68
|
-
"@babel/core": "^7.
|
|
69
|
-
"@babel/plugin-
|
|
70
|
-
"@babel/plugin-
|
|
71
|
-
"@babel/plugin-transform-runtime": "^7.
|
|
72
|
-
"@babel/preset-env": "^7.
|
|
73
|
-
"@babel/preset-typescript": "^7.
|
|
74
|
-
"@babel/runtime": "^7.
|
|
75
|
-
"@babel/runtime-corejs3": "^7.
|
|
76
|
-
"@commitlint/cli": "^
|
|
77
|
-
"@commitlint/config-conventional": "^
|
|
78
|
-
"@
|
|
79
|
-
"@
|
|
80
|
-
"@
|
|
81
|
-
"
|
|
82
|
-
"
|
|
83
|
-
"@typescript-eslint/parser": "^6.12.0",
|
|
84
|
-
"clean-webpack-plugin": "^4.0.0",
|
|
85
|
-
"core-js": "^3.33.2",
|
|
68
|
+
"@babel/core": "^7.8.4",
|
|
69
|
+
"@babel/plugin-proposal-class-properties": "^7.10.4",
|
|
70
|
+
"@babel/plugin-proposal-object-rest-spread": "^7.11.0",
|
|
71
|
+
"@babel/plugin-transform-runtime": "^7.11.0",
|
|
72
|
+
"@babel/preset-env": "^7.5.5",
|
|
73
|
+
"@babel/preset-typescript": "^7.10.4",
|
|
74
|
+
"@babel/runtime": "^7.20.7",
|
|
75
|
+
"@babel/runtime-corejs3": "^7.11.2",
|
|
76
|
+
"@commitlint/cli": "^8.3.5",
|
|
77
|
+
"@commitlint/config-conventional": "^8.3.4",
|
|
78
|
+
"@types/jquery": "^3.5.18",
|
|
79
|
+
"@typescript-eslint/eslint-plugin": "^4.22.0",
|
|
80
|
+
"@typescript-eslint/parser": "^4.22.0",
|
|
81
|
+
"clean-webpack-plugin": "^1.0.1",
|
|
82
|
+
"core-js": "^3.6.5",
|
|
86
83
|
"cross-env": "^7.0.3",
|
|
87
|
-
"date-fns": "^2.
|
|
88
|
-
"eslint": "^8.
|
|
89
|
-
"eslint-config-standard": "^
|
|
90
|
-
"eslint-plugin-import": "^2.
|
|
91
|
-
"eslint-plugin-node": "^11.
|
|
92
|
-
"eslint-plugin-promise": "^
|
|
93
|
-
"eslint-plugin-standard": "^4.1
|
|
94
|
-
"execa": "^
|
|
95
|
-
"html-webpack-plugin": "^
|
|
96
|
-
"husky": "^
|
|
97
|
-
"jest": "^
|
|
98
|
-
"
|
|
99
|
-
"lint-staged": "^14.0.1",
|
|
84
|
+
"date-fns": "^2.29.3",
|
|
85
|
+
"eslint": "^6.8.0",
|
|
86
|
+
"eslint-config-standard": "^14.1.0",
|
|
87
|
+
"eslint-plugin-import": "^2.20.1",
|
|
88
|
+
"eslint-plugin-node": "^11.0.0",
|
|
89
|
+
"eslint-plugin-promise": "^4.2.1",
|
|
90
|
+
"eslint-plugin-standard": "^4.0.1",
|
|
91
|
+
"execa": "^4.1.0",
|
|
92
|
+
"html-webpack-plugin": "^3.2.0",
|
|
93
|
+
"husky": "^4.3.8",
|
|
94
|
+
"jest": "^27.5.1",
|
|
95
|
+
"lint-staged": "^10.0.8",
|
|
100
96
|
"markdown-toc": "^1.2.0",
|
|
101
|
-
"prettier": "^
|
|
102
|
-
"prettier-eslint-cli": "^
|
|
103
|
-
"rollup": "^
|
|
97
|
+
"prettier": "^1.19.1",
|
|
98
|
+
"prettier-eslint-cli": "^5.0.0",
|
|
99
|
+
"rollup": "^2.79.1",
|
|
100
|
+
"rollup-plugin-babel": "^4.3.3",
|
|
104
101
|
"rollup-plugin-cleaner": "^1.0.0",
|
|
102
|
+
"rollup-plugin-commonjs": "^10.1.0",
|
|
105
103
|
"rollup-plugin-copy": "^3.4.0",
|
|
106
|
-
"rollup-plugin-dts": "^
|
|
107
|
-
"rollup-plugin-
|
|
108
|
-
"
|
|
104
|
+
"rollup-plugin-dts": "^4.2.3",
|
|
105
|
+
"rollup-plugin-terser": "^7.0.2",
|
|
106
|
+
"rollup-plugin-typescript2": "^0.30.0",
|
|
107
|
+
"ts-loader": "^8.0.2",
|
|
109
108
|
"tslib": "^2.6.2",
|
|
110
|
-
"typedoc": "^0.
|
|
111
|
-
"typescript": "5.
|
|
112
|
-
"webpack": "^
|
|
113
|
-
"webpack-cli": "^
|
|
114
|
-
"webpack-dev-server": "^
|
|
109
|
+
"typedoc": "^0.24.8",
|
|
110
|
+
"typescript": "5.1.6",
|
|
111
|
+
"webpack": "^4.46.0",
|
|
112
|
+
"webpack-cli": "^4.10.0",
|
|
113
|
+
"webpack-dev-server": "^3.11.3"
|
|
115
114
|
},
|
|
116
115
|
"husky": {
|
|
117
116
|
"hooks": {
|
|
@@ -1,152 +0,0 @@
|
|
|
1
|
-
/* eslint-disable @typescript-eslint/no-var-requires */
|
|
2
|
-
/* eslint-disable no-undef */
|
|
3
|
-
// import json from '@rollup/plugin-json'
|
|
4
|
-
import { babel } from '@rollup/plugin-babel';
|
|
5
|
-
import commonjs from '@rollup/plugin-commonjs';
|
|
6
|
-
import rollupTypescript from 'rollup-plugin-typescript2';
|
|
7
|
-
import { DEFAULT_EXTENSIONS } from '@babel/core';
|
|
8
|
-
import cleaner from 'rollup-plugin-cleaner';
|
|
9
|
-
import terser from '@rollup/plugin-terser';
|
|
10
|
-
import { dts } from 'rollup-plugin-dts';
|
|
11
|
-
// import { version as pkgJSONVersion } from '../package.json';
|
|
12
|
-
// import replace from '@rollup/plugin-replace';
|
|
13
|
-
// import copy from 'rollup-plugin-copy';
|
|
14
|
-
|
|
15
|
-
// const path = require('path');
|
|
16
|
-
// const _resolve = (_path) => path.resolve(__dirname, _path);
|
|
17
|
-
|
|
18
|
-
import path from 'path';
|
|
19
|
-
import { fileURLToPath } from 'url';
|
|
20
|
-
import { dirname } from 'path';
|
|
21
|
-
|
|
22
|
-
const __filename = fileURLToPath(import.meta.url);
|
|
23
|
-
const __dirname = dirname(__filename);
|
|
24
|
-
|
|
25
|
-
const _resolve = (_path) => path.resolve(__dirname, _path);
|
|
26
|
-
|
|
27
|
-
// const { _resolve } = require('./build-helper');
|
|
28
|
-
const pkgVersion = process.env.SCRIPTS_NPM_PACKAGE_VERSION || process.env.VERSION || 'unknown'; // || require('../package.json').version;
|
|
29
|
-
const debugMode = process.env.SCRIPTS_NPM_PACKAGE_DEBUG;
|
|
30
|
-
const banner =
|
|
31
|
-
'/*!\n' +
|
|
32
|
-
` * Mazey v${pkgVersion} https://github.com/mazeyqian/mazey\n` +
|
|
33
|
-
` * (c) 2018-${new Date().getFullYear()} Cheng\n` +
|
|
34
|
-
' * Released under the MIT License.\n' +
|
|
35
|
-
' */';
|
|
36
|
-
|
|
37
|
-
const plugins = [
|
|
38
|
-
// replace({
|
|
39
|
-
// __MAZEY_NPM_PACKAGE_VERSION__: pkgVersion,
|
|
40
|
-
// }),
|
|
41
|
-
// Remove the `lib` directory before rebuilding.
|
|
42
|
-
// https://github.com/aMarCruz/rollup-plugin-cleanup
|
|
43
|
-
// cleaner({
|
|
44
|
-
// targets: [
|
|
45
|
-
// _resolve('../lib/'),
|
|
46
|
-
// ],
|
|
47
|
-
// }),
|
|
48
|
-
rollupTypescript(),
|
|
49
|
-
commonjs({
|
|
50
|
-
include: /node_modules/,
|
|
51
|
-
}),
|
|
52
|
-
babel({
|
|
53
|
-
babelHelpers: 'runtime',
|
|
54
|
-
// 只转换源代码,不运行外部依赖
|
|
55
|
-
exclude: '**/node_modules/**',
|
|
56
|
-
// babel 默认不支持 ts 需要手动添加
|
|
57
|
-
extensions: [
|
|
58
|
-
...DEFAULT_EXTENSIONS,
|
|
59
|
-
'.ts',
|
|
60
|
-
],
|
|
61
|
-
// skipPreflightCheck: true,
|
|
62
|
-
}),
|
|
63
|
-
// dts(),
|
|
64
|
-
// uglify(),
|
|
65
|
-
// https://www.npmjs.com/package/rollup-plugin-copy
|
|
66
|
-
// copy({
|
|
67
|
-
// targets: [
|
|
68
|
-
// {
|
|
69
|
-
// src: _resolve('../src/t.html'),
|
|
70
|
-
// dest: _resolve('../docs'),
|
|
71
|
-
// },
|
|
72
|
-
// ],
|
|
73
|
-
// }),
|
|
74
|
-
];
|
|
75
|
-
|
|
76
|
-
const iifePlugins = [];
|
|
77
|
-
|
|
78
|
-
// console.log('debugMode:', debugMode);
|
|
79
|
-
if (debugMode !== 'open') {
|
|
80
|
-
iifePlugins.push(
|
|
81
|
-
// Add minification.
|
|
82
|
-
// https://github.com/TrySound/rollup-plugin-terser
|
|
83
|
-
terser({ // https://github.com/terser/terser
|
|
84
|
-
format: {
|
|
85
|
-
// https://github.com/terser/terser#format-options
|
|
86
|
-
comments: /^!\n\s\*\smazey/, // 'some', // `false` to omit comments in the output
|
|
87
|
-
},
|
|
88
|
-
}),
|
|
89
|
-
);
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
const dTsConf = {
|
|
93
|
-
input: _resolve('../src/typing.d.ts'),
|
|
94
|
-
// https://rollupjs.org/guide/en/#outputformat
|
|
95
|
-
output: [
|
|
96
|
-
{
|
|
97
|
-
file: _resolve('../lib/typing.d.ts'),
|
|
98
|
-
format: 'es',
|
|
99
|
-
},
|
|
100
|
-
],
|
|
101
|
-
plugins: [
|
|
102
|
-
// ...plugins,
|
|
103
|
-
// cleaner({
|
|
104
|
-
// targets: [
|
|
105
|
-
// _resolve('../lib/index.d.ts'),
|
|
106
|
-
// ],
|
|
107
|
-
// }),
|
|
108
|
-
dts(),
|
|
109
|
-
],
|
|
110
|
-
external: [],
|
|
111
|
-
};
|
|
112
|
-
|
|
113
|
-
// console.log('dTsConf:', dTsConf);
|
|
114
|
-
|
|
115
|
-
// https://rollupjs.org/guide/en/
|
|
116
|
-
export default [
|
|
117
|
-
{
|
|
118
|
-
input: _resolve('../src/index.ts'),
|
|
119
|
-
// https://rollupjs.org/guide/en/#outputformat
|
|
120
|
-
output: [
|
|
121
|
-
{
|
|
122
|
-
file: _resolve('../lib/index.cjs.js'),
|
|
123
|
-
format: 'cjs',
|
|
124
|
-
banner,
|
|
125
|
-
plugins: iifePlugins,
|
|
126
|
-
},
|
|
127
|
-
{
|
|
128
|
-
file: _resolve('../lib/index.esm.js'),
|
|
129
|
-
format: 'esm',
|
|
130
|
-
banner,
|
|
131
|
-
plugins: iifePlugins,
|
|
132
|
-
},
|
|
133
|
-
{
|
|
134
|
-
file: _resolve('../lib/mazey.min.js'),
|
|
135
|
-
format: 'iife',
|
|
136
|
-
name: 'mazey',
|
|
137
|
-
banner,
|
|
138
|
-
plugins: iifePlugins,
|
|
139
|
-
},
|
|
140
|
-
],
|
|
141
|
-
plugins: [
|
|
142
|
-
...plugins,
|
|
143
|
-
cleaner({
|
|
144
|
-
targets: [
|
|
145
|
-
_resolve('../lib/'),
|
|
146
|
-
],
|
|
147
|
-
}),
|
|
148
|
-
],
|
|
149
|
-
external: [],
|
|
150
|
-
},
|
|
151
|
-
dTsConf,
|
|
152
|
-
];
|