@modern-js/plugin-proxy 1.2.3 → 1.2.6

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/.eslintrc.js ADDED
@@ -0,0 +1,8 @@
1
+ module.exports = {
2
+ root: true,
3
+ extends: ['@modern-js'],
4
+ parserOptions: {
5
+ tsconfigRootDir: __dirname,
6
+ project: ['./tsconfig.json'],
7
+ },
8
+ };
package/CHANGELOG.md CHANGED
@@ -1,5 +1,36 @@
1
1
  # @modern-js/plugin-proxy
2
2
 
3
+ ## 1.2.6
4
+
5
+ ### Patch Changes
6
+
7
+ - 6cffe99d: chore:
8
+ remove react eslint rules for `modern-js` rule set.
9
+ add .eslintrc for each package to speed up linting
10
+ - 04ae5262: chore: bump @modern-js/utils to v1.4.1 in dependencies
11
+ - 60f7d8bf: feat: add tests dir to npmignore
12
+ - Updated dependencies [b8599d09]
13
+ - Updated dependencies [60f7d8bf]
14
+ - Updated dependencies [3bf4f8b0]
15
+ - @modern-js/utils@1.5.0
16
+
17
+ ## 1.2.5
18
+
19
+ ### Patch Changes
20
+
21
+ - bebb39b6: chore: improve devDependencies and peerDependencies
22
+ - 132f7b53: feat: move config declarations to @modern-js/core
23
+ - Updated dependencies [132f7b53]
24
+ - @modern-js/utils@1.3.7
25
+
26
+ ## 1.2.4
27
+
28
+ ### Patch Changes
29
+
30
+ - 681a1ff9: feat: remove unnecessary peerDependencies
31
+ - Updated dependencies [c2046f37]
32
+ - @modern-js/utils@1.3.6
33
+
3
34
  ## 1.2.3
4
35
 
5
36
  ### Patch Changes
@@ -1,7 +1,6 @@
1
1
  import { PLUGIN_SCHEMAS } from '@modern-js/utils';
2
2
  import { createProxyRule } from "./utils/createProxyRule";
3
3
  import WhistleProxy from "./utils/whistleProxy";
4
- import "./types";
5
4
  export default (() => {
6
5
  let proxyServer;
7
6
  return {
@@ -11,8 +11,6 @@ var _createProxyRule = require("./utils/createProxyRule");
11
11
 
12
12
  var _whistleProxy = _interopRequireDefault(require("./utils/whistleProxy"));
13
13
 
14
- require("./types");
15
-
16
14
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
17
15
 
18
16
  var _default = () => {
@@ -1,5 +1,4 @@
1
1
  import type { CliPlugin } from '@modern-js/core';
2
- import './types';
3
2
 
4
3
  declare const _default: () => CliPlugin;
5
4
 
@@ -1,2 +1,2 @@
1
- import type { ProxyOptions } from '../types';
2
- export declare const createProxyRule: (appDirectory: string, proxyOptions: ProxyOptions) => string;
1
+ import type { DevProxyOptions } from '@modern-js/core';
2
+ export declare const createProxyRule: (appDirectory: string, proxyOptions: DevProxyOptions) => string;
package/jest.config.js CHANGED
@@ -2,7 +2,6 @@ const sharedConfig = require('@scripts/jest-config');
2
2
 
3
3
  /** @type {import('@jest/types').Config.InitialOptions} */
4
4
  module.exports = {
5
- // eslint-disable-next-line node/no-unsupported-features/es-syntax
6
5
  ...sharedConfig,
7
6
  rootDir: __dirname,
8
7
  };
package/package.json CHANGED
@@ -11,22 +11,12 @@
11
11
  "modern",
12
12
  "modern.js"
13
13
  ],
14
- "version": "1.2.3",
14
+ "version": "1.2.6",
15
15
  "jsnext:source": "./src/index.ts",
16
16
  "types": "./dist/types/index.d.ts",
17
17
  "main": "./dist/js/node/index.js",
18
18
  "module": "./dist/js/treeshaking/index.js",
19
19
  "jsnext:modern": "./dist/js/modern/index.js",
20
- "typesVersions": {
21
- "*": {
22
- ".": [
23
- "./dist/types/index.d.ts"
24
- ],
25
- "types": [
26
- "./dist/types/types.d.ts"
27
- ]
28
- }
29
- },
30
20
  "exports": {
31
21
  ".": {
32
22
  "node": {
@@ -39,33 +29,22 @@
39
29
  "./cli": {
40
30
  "jsnext:source": "./src/index.ts",
41
31
  "default": "./dist/js/node/index.js"
42
- },
43
- "./types": {
44
- "node": {
45
- "import": "./dist/js/modern/types.js",
46
- "require": "./dist/js/node/types.js",
47
- "types": "./dist/types/types.d.ts"
48
- },
49
- "default": "./dist/js/treeshaking/types.js"
50
32
  }
51
33
  },
52
34
  "dependencies": {
53
35
  "@babel/runtime": "^7",
54
- "@modern-js/utils": "^1.3.5",
36
+ "@modern-js/utils": "^1.5.0",
55
37
  "whistle": "^2.7.18"
56
38
  },
57
39
  "devDependencies": {
58
40
  "@types/jest": "^26",
59
41
  "@types/node": "^14",
60
42
  "typescript": "^4",
61
- "@modern-js/core": "^1.5.0",
43
+ "@modern-js/core": "1.8.0",
62
44
  "@scripts/build": "0.0.0",
63
45
  "jest": "^27",
64
46
  "@scripts/jest-config": "0.0.0"
65
47
  },
66
- "peerDependencies": {
67
- "@modern-js/core": "^1.5.0"
68
- },
69
48
  "sideEffects": false,
70
49
  "publishConfig": {
71
50
  "registry": "https://registry.npmjs.org/",
@@ -1 +0,0 @@
1
- import '@modern-js/core';
@@ -1,3 +0,0 @@
1
- "use strict";
2
-
3
- require("@modern-js/core");
@@ -1,7 +0,0 @@
1
- import '@modern-js/core';
2
- export declare type ProxyOptions = string | Record<string, string>;
3
- declare module '@modern-js/core' {
4
- interface DevConfig {
5
- proxy?: ProxyOptions;
6
- }
7
- }
@@ -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
- }