mazey 4.0.6 → 4.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.
Files changed (50) hide show
  1. package/LICENSE +21 -21
  2. package/README.md +990 -990
  3. package/coverage/clover.xml +1238 -0
  4. package/coverage/coverage-final.json +2 -0
  5. package/coverage/lcov-report/base.css +224 -0
  6. package/coverage/lcov-report/block-navigation.js +87 -0
  7. package/coverage/lcov-report/favicon.png +0 -0
  8. package/coverage/lcov-report/index.esm.js.html +12646 -0
  9. package/coverage/lcov-report/index.html +116 -0
  10. package/coverage/lcov-report/prettify.css +1 -0
  11. package/coverage/lcov-report/prettify.js +2 -0
  12. package/coverage/lcov-report/sort-arrow-sprite.png +0 -0
  13. package/coverage/lcov-report/sorter.js +196 -0
  14. package/coverage/lcov.info +2548 -0
  15. package/lib/browser.d.ts +90 -0
  16. package/lib/browser.d.ts.map +1 -0
  17. package/lib/calc.d.ts +106 -0
  18. package/lib/calc.d.ts.map +1 -0
  19. package/lib/debug.d.ts +40 -0
  20. package/lib/debug.d.ts.map +1 -0
  21. package/lib/dom.d.ts +164 -0
  22. package/lib/dom.d.ts.map +1 -0
  23. package/lib/event.d.ts +76 -0
  24. package/lib/event.d.ts.map +1 -0
  25. package/lib/global.d.ts +87 -0
  26. package/lib/index.cjs.js +2 -2
  27. package/lib/index.d.ts +10 -2040
  28. package/lib/index.d.ts.map +1 -1
  29. package/lib/index.esm.js +2 -2
  30. package/lib/load.d.ts +169 -0
  31. package/lib/load.d.ts.map +1 -0
  32. package/lib/mazey.min.js +2 -2
  33. package/lib/perf.d.ts +199 -0
  34. package/lib/perf.d.ts.map +1 -0
  35. package/lib/store.d.ts +216 -0
  36. package/lib/store.d.ts.map +1 -0
  37. package/lib/typing.d.ts +88 -74
  38. package/lib/url.d.ts +246 -0
  39. package/lib/url.d.ts.map +1 -0
  40. package/lib/util.d.ts +841 -0
  41. package/lib/util.d.ts.map +1 -0
  42. package/package.json +124 -122
  43. package/scripts/README.md +0 -38
  44. package/scripts/build-helper.js +0 -76
  45. package/scripts/dev.js +0 -23
  46. package/scripts/env-win.sh +0 -2
  47. package/scripts/git-helper.js +0 -155
  48. package/scripts/mac-build.sh +0 -8
  49. package/scripts/release.js +0 -9
  50. package/scripts/rollup.config.mjs +0 -152
@@ -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
- ];