@modern-js/plugin-proxy 1.2.5 → 1.2.8

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,39 @@
1
1
  # @modern-js/plugin-proxy
2
2
 
3
+ ## 1.2.8
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.7
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.6
24
+
25
+ ### Patch Changes
26
+
27
+ - 6cffe99d: chore:
28
+ remove react eslint rules for `modern-js` rule set.
29
+ add .eslintrc for each package to speed up linting
30
+ - 04ae5262: chore: bump @modern-js/utils to v1.4.1 in dependencies
31
+ - 60f7d8bf: feat: add tests dir to npmignore
32
+ - Updated dependencies [b8599d09]
33
+ - Updated dependencies [60f7d8bf]
34
+ - Updated dependencies [3bf4f8b0]
35
+ - @modern-js/utils@1.5.0
36
+
3
37
  ## 1.2.5
4
38
 
5
39
  ### Patch Changes
@@ -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 path from 'path';
2
4
  import { logger } from '@modern-js/utils';
3
5
  import execSync from "./execSync";
@@ -10,10 +12,14 @@ const {
10
12
 
11
13
  export default class WhistleProxy {
12
14
  constructor(config) {
13
- this.rule = void 0;
14
- this.port = void 0;
15
- this.bin = void 0;
16
- this.certDir = void 0;
15
+ _defineProperty(this, "rule", void 0);
16
+
17
+ _defineProperty(this, "port", void 0);
18
+
19
+ _defineProperty(this, "bin", void 0);
20
+
21
+ _defineProperty(this, "certDir", void 0);
22
+
17
23
  this.rule = config.rule;
18
24
  this.port = config.port; // unused
19
25
  // this.mode = config.mode; // pureProxy|debug|multiEnv
@@ -15,6 +15,8 @@ var _macCAManager = require("./macCAManager");
15
15
 
16
16
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
17
17
 
18
+ 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; }
19
+
18
20
  const {
19
21
  disableGlobalProxy,
20
22
  enableGlobalProxy
@@ -22,10 +24,14 @@ const {
22
24
 
23
25
  class WhistleProxy {
24
26
  constructor(config) {
25
- this.rule = void 0;
26
- this.port = void 0;
27
- this.bin = void 0;
28
- this.certDir = void 0;
27
+ _defineProperty(this, "rule", void 0);
28
+
29
+ _defineProperty(this, "port", void 0);
30
+
31
+ _defineProperty(this, "bin", void 0);
32
+
33
+ _defineProperty(this, "certDir", void 0);
34
+
29
35
  this.rule = config.rule;
30
36
  this.port = config.port; // unused
31
37
  // this.mode = config.mode; // pureProxy|debug|multiEnv
package/package.json CHANGED
@@ -11,7 +11,7 @@
11
11
  "modern",
12
12
  "modern.js"
13
13
  ],
14
- "version": "1.2.5",
14
+ "version": "1.2.8",
15
15
  "jsnext:source": "./src/index.ts",
16
16
  "types": "./dist/types/index.d.ts",
17
17
  "main": "./dist/js/node/index.js",
@@ -33,14 +33,14 @@
33
33
  },
34
34
  "dependencies": {
35
35
  "@babel/runtime": "^7",
36
- "@modern-js/utils": "^1.3.7",
36
+ "@modern-js/utils": "^1.7.3",
37
37
  "whistle": "^2.7.18"
38
38
  },
39
39
  "devDependencies": {
40
- "@types/jest": "^26",
40
+ "@types/jest": "^27",
41
41
  "@types/node": "^14",
42
42
  "typescript": "^4",
43
- "@modern-js/core": "1.6.1",
43
+ "@modern-js/core": "1.10.2",
44
44
  "@scripts/build": "0.0.0",
45
45
  "jest": "^27",
46
46
  "@scripts/jest-config": "0.0.0"
@@ -50,11 +50,33 @@
50
50
  "registry": "https://registry.npmjs.org/",
51
51
  "access": "public"
52
52
  },
53
+ "wireit": {
54
+ "build": {
55
+ "command": "modern build",
56
+ "files": [
57
+ "src/**/*",
58
+ "tsconfig.json",
59
+ "package.json"
60
+ ],
61
+ "output": [
62
+ "dist/**/*"
63
+ ]
64
+ },
65
+ "test": {
66
+ "command": "jest --passWithNoTests",
67
+ "files": [
68
+ "src/**/*",
69
+ "tsconfig.json",
70
+ "package.json"
71
+ ],
72
+ "output": []
73
+ }
74
+ },
53
75
  "scripts": {
54
76
  "new": "modern new",
55
77
  "dev": "modern build --watch",
56
- "build": "modern build",
57
- "test": "jest --passWithNoTests"
78
+ "build": "wireit",
79
+ "test": "wireit"
58
80
  },
59
81
  "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"
60
82
  }
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,6 +0,0 @@
1
- /** @type {import('@modern-js/module-tools').UserConfig} */
2
- module.exports = {
3
- output: {
4
- packageMode: 'node-js',
5
- },
6
- };
@@ -1,6 +0,0 @@
1
- module.exports = {
2
- extends: ['@modern-js'],
3
- parserOptions: {
4
- project: require.resolve('./tsconfig.json'),
5
- },
6
- };
@@ -1,19 +0,0 @@
1
- // Jest Snapshot v1, https://goo.gl/fbAQLP
2
-
3
- exports[`plugin proxy test config 1`] = `Array []`;
4
-
5
- exports[`plugin proxy test schema 1`] = `
6
- Array [
7
- Array [
8
- Object {
9
- "schema": Object {
10
- "typeof": Array [
11
- "string",
12
- "object",
13
- ],
14
- },
15
- "target": "dev.proxy",
16
- },
17
- ],
18
- ]
19
- `;
package/tests/cli.test.ts DELETED
@@ -1,39 +0,0 @@
1
- import path from 'path';
2
- import { manager } from '@modern-js/core';
3
- import plugin from '../src';
4
-
5
- const root = path.normalize(path.resolve(__dirname, '../../../../'));
6
- expect.addSnapshotSerializer({
7
- test: val =>
8
- typeof val === 'string' &&
9
- (val.includes('modern.js') ||
10
- val.includes('node_modules') ||
11
- val.includes(root)),
12
- print: val =>
13
- // eslint-disable-next-line no-nested-ternary
14
- typeof val === 'string'
15
- ? // eslint-disable-next-line no-nested-ternary
16
- val.includes('node_modules')
17
- ? `"${val.replace(/.+node_modules/, '')}"`
18
- : val.includes('modern.js')
19
- ? `"${val.replace(/.+modern\.js/, '')}"`
20
- : `"${val.replace(root, '')}"`
21
- : (val as string),
22
- });
23
-
24
- describe('plugin proxy test', () => {
25
- it('schema', async () => {
26
- const main = manager.clone().usePlugin(plugin);
27
- const runner = await main.init();
28
- const result = await runner.validateSchema();
29
-
30
- expect(result).toMatchSnapshot();
31
- });
32
-
33
- it('config', async () => {
34
- const main = manager.clone().usePlugin(plugin);
35
- const runner = await main.init();
36
- const result = await runner.config();
37
- expect(result).toMatchSnapshot();
38
- });
39
- });
@@ -1,14 +0,0 @@
1
- {
2
- "extends": "@modern-js/tsconfig/base",
3
- "compilerOptions": {
4
- "declaration": true,
5
- "jsx": "preserve",
6
- "baseUrl": ".",
7
- "noEmit": true,
8
- "skipLibCheck": true,
9
- "esModuleInterop": true,
10
- "isolatedModules": true,
11
- "paths": {},
12
- "types": ["node", "jest"]
13
- }
14
- }
package/tsconfig.json DELETED
@@ -1,11 +0,0 @@
1
- {
2
- "extends": "@modern-js/tsconfig/base",
3
- "compilerOptions": {
4
- "declaration": false,
5
- "jsx": "preserve",
6
- "baseUrl": "./",
7
- "isolatedModules": true,
8
- "paths": {}
9
- },
10
- "include": ["src"]
11
- }