@modern-js/plugin-polyfill 1.2.6 → 1.2.9

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/CHANGELOG.md CHANGED
@@ -1,5 +1,34 @@
1
1
  # @modern-js/plugin-polyfill
2
2
 
3
+ ## 1.2.9
4
+
5
+ ### Patch Changes
6
+
7
+ - d32f35134: chore: add modern/jest/eslint/ts config files to .npmignore
8
+ - Updated dependencies [d32f35134]
9
+ - Updated dependencies [6ae4a34ae]
10
+ - Updated dependencies [b80229c79]
11
+ - Updated dependencies [948cc4436]
12
+ - @modern-js/utils@1.7.3
13
+
14
+ ## 1.2.8
15
+
16
+ ### Patch Changes
17
+
18
+ - 69a728375: fix: remove exports.jsnext:source after publish
19
+ - Updated dependencies [cd7346b0d]
20
+ - Updated dependencies [69a728375]
21
+ - @modern-js/utils@1.7.2
22
+
23
+ ## 1.2.7
24
+
25
+ ### Patch Changes
26
+
27
+ - 6fa74d5f: add internal metrics and logger
28
+ - Updated dependencies [0ee4bb4e]
29
+ - Updated dependencies [6fa74d5f]
30
+ - @modern-js/utils@1.7.0
31
+
3
32
  ## 1.2.6
4
33
 
5
34
  ### Patch Changes
@@ -6,7 +6,7 @@ import PolyfillCache, { generateCacheKey } from "./libs/cache";
6
6
  export default (() => ({
7
7
  name: '@modern-js/plugin-polyfill',
8
8
  setup: () => ({
9
- preServerInit(_) {
9
+ beforeProdServer(_) {
10
10
  const cache = new PolyfillCache();
11
11
  const route = defaultPolyfill;
12
12
  const features = defaultFeatures;
@@ -1,3 +1,5 @@
1
+ function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
2
+
1
3
  import crypto from 'crypto';
2
4
  import LRUCache from 'lru-cache';
3
5
  const KB = 1024;
@@ -23,7 +25,8 @@ export const generateCacheKey = options => {
23
25
  };
24
26
  export default class Cache {
25
27
  constructor() {
26
- this.caches = void 0;
28
+ _defineProperty(this, "caches", void 0);
29
+
27
30
  this.caches = new LRUCache({
28
31
  max: 200 * MB,
29
32
  length: v => v.length
@@ -24,7 +24,7 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
24
24
  var _default = () => ({
25
25
  name: '@modern-js/plugin-polyfill',
26
26
  setup: () => ({
27
- preServerInit(_) {
27
+ beforeProdServer(_) {
28
28
  const cache = new _cache.default();
29
29
  const route = _const.defaultPolyfill;
30
30
  const features = _const.defaultFeatures;
@@ -11,6 +11,8 @@ var _lruCache = _interopRequireDefault(require("lru-cache"));
11
11
 
12
12
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
13
13
 
14
+ function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
15
+
14
16
  const KB = 1024;
15
17
  const MB = 1024 * KB;
16
18
  const keyCache = new _lruCache.default(10000);
@@ -39,7 +41,8 @@ exports.generateCacheKey = generateCacheKey;
39
41
 
40
42
  class Cache {
41
43
  constructor() {
42
- this.caches = void 0;
44
+ _defineProperty(this, "caches", void 0);
45
+
43
46
  this.caches = new _lruCache.default({
44
47
  max: 200 * MB,
45
48
  length: v => v.length
package/package.json CHANGED
@@ -11,7 +11,7 @@
11
11
  "modern",
12
12
  "modern.js"
13
13
  ],
14
- "version": "1.2.6",
14
+ "version": "1.2.9",
15
15
  "jsnext:source": "./src/index.ts",
16
16
  "types": "./dist/types/index.d.ts",
17
17
  "main": "./dist/js/node/index.js",
@@ -37,22 +37,22 @@
37
37
  },
38
38
  "dependencies": {
39
39
  "@babel/runtime": "^7",
40
- "@modern-js/utils": "^1.6.0",
40
+ "@modern-js/utils": "^1.7.3",
41
41
  "@modern-js/polyfill-lib": "^1.0.0",
42
42
  "lru-cache": "^6.0.0",
43
43
  "ua-parser-js": "^0.7.28"
44
44
  },
45
45
  "devDependencies": {
46
- "@modern-js/server-core": "1.3.2",
47
- "@modern-js/types": "1.5.1",
48
- "@types/jest": "^26",
46
+ "@modern-js/server-core": "1.3.5",
47
+ "@modern-js/types": "1.5.3",
48
+ "@types/jest": "^27",
49
49
  "@types/lru-cache": "^5.1.1",
50
50
  "@types/node": "^14",
51
51
  "@types/react": "^17",
52
52
  "@types/react-dom": "^17",
53
53
  "@types/ua-parser-js": "^0.7.36",
54
54
  "typescript": "^4",
55
- "@modern-js/core": "1.9.0",
55
+ "@modern-js/core": "1.10.2",
56
56
  "@scripts/build": "0.0.0",
57
57
  "jest": "^27",
58
58
  "@scripts/jest-config": "0.0.0"
@@ -67,11 +67,33 @@
67
67
  "registry": "https://registry.npmjs.org/",
68
68
  "access": "public"
69
69
  },
70
+ "wireit": {
71
+ "build": {
72
+ "command": "modern build",
73
+ "files": [
74
+ "src/**/*",
75
+ "tsconfig.json",
76
+ "package.json"
77
+ ],
78
+ "output": [
79
+ "dist/**/*"
80
+ ]
81
+ },
82
+ "test": {
83
+ "command": "jest --passWithNoTests",
84
+ "files": [
85
+ "src/**/*",
86
+ "tsconfig.json",
87
+ "package.json"
88
+ ],
89
+ "output": []
90
+ }
91
+ },
70
92
  "scripts": {
71
93
  "new": "modern new",
72
- "build": "modern build",
94
+ "build": "wireit",
73
95
  "dev": "modern build --watch",
74
- "test": "jest --passWithNoTests"
96
+ "test": "wireit"
75
97
  },
76
98
  "readme": "\n<p align=\"center\">\n <a href=\"https://modernjs.dev\" target=\"blank\"><img src=\"https://lf3-static.bytednsdoc.com/obj/eden-cn/ylaelkeh7nuhfnuhf/modernjs-cover.png\" width=\"300\" alt=\"Modern.js Logo\" /></a>\n</p>\n<p align=\"center\">\n现代 Web 工程体系\n <br/>\n <a href=\"https://modernjs.dev\" target=\"blank\">\n modernjs.dev\n </a>\n</p>\n<p align=\"center\">\n The meta-framework suite designed from scratch for frontend-focused modern web development\n</p>\n\n# Introduction\n\n> The doc site ([modernjs.dev](https://modernjs.dev)) and articles are only available in Chinese for now, we are planning to add English versions soon.\n\n- [Modern.js: Hello, World!](https://zhuanlan.zhihu.com/p/426707646)\n\n## Getting Started\n\n- [Quick Start](https://modernjs.dev/docs/start)\n- [Guides](https://modernjs.dev/docs/guides)\n- [API References](https://modernjs.dev/docs/apis)\n\n## Contributing\n\n- [Contributing Guide](https://github.com/modern-js-dev/modern.js/blob/main/CONTRIBUTING.md)\n"
77
99
  }
package/.eslintrc.js DELETED
@@ -1,7 +0,0 @@
1
- module.exports = {
2
- extends: ['@modern-js'],
3
- parserOptions: {
4
- project: require.resolve('./tsconfig.json'),
5
- },
6
- ignorePatterns: ['types.d.ts'],
7
- };
package/jest.config.js DELETED
@@ -1,7 +0,0 @@
1
- const sharedConfig = require('@scripts/jest-config');
2
-
3
- /** @type {import('@jest/types').Config.InitialOptions} */
4
- module.exports = {
5
- ...sharedConfig,
6
- rootDir: __dirname,
7
- };
package/modern.config.js DELETED
@@ -1,2 +0,0 @@
1
- /** @type {import('@modern-js/module-tools').UserConfig} */
2
- module.exports = {};
package/tsconfig.json DELETED
@@ -1,10 +0,0 @@
1
- {
2
- "extends": "@modern-js/tsconfig/base",
3
- "compilerOptions": {
4
- "declaration": false,
5
- "jsx": "preserve",
6
- "baseUrl": "./",
7
- "isolatedModules": true
8
- },
9
- "include": ["src"]
10
- }