@modern-js/plugin-proxy 1.2.4 → 1.2.7

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,37 @@
1
1
  # @modern-js/plugin-proxy
2
2
 
3
+ ## 1.2.7
4
+
5
+ ### Patch Changes
6
+
7
+ - 69a728375: fix: remove exports.jsnext:source after publish
8
+ - Updated dependencies [cd7346b0d]
9
+ - Updated dependencies [69a728375]
10
+ - @modern-js/utils@1.7.2
11
+
12
+ ## 1.2.6
13
+
14
+ ### Patch Changes
15
+
16
+ - 6cffe99d: chore:
17
+ remove react eslint rules for `modern-js` rule set.
18
+ add .eslintrc for each package to speed up linting
19
+ - 04ae5262: chore: bump @modern-js/utils to v1.4.1 in dependencies
20
+ - 60f7d8bf: feat: add tests dir to npmignore
21
+ - Updated dependencies [b8599d09]
22
+ - Updated dependencies [60f7d8bf]
23
+ - Updated dependencies [3bf4f8b0]
24
+ - @modern-js/utils@1.5.0
25
+
26
+ ## 1.2.5
27
+
28
+ ### Patch Changes
29
+
30
+ - bebb39b6: chore: improve devDependencies and peerDependencies
31
+ - 132f7b53: feat: move config declarations to @modern-js/core
32
+ - Updated dependencies [132f7b53]
33
+ - @modern-js/utils@1.3.7
34
+
3
35
  ## 1.2.4
4
36
 
5
37
  ### 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.4",
14
+ "version": "1.2.7",
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,26 +29,18 @@
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.6",
36
+ "@modern-js/utils": "^1.7.2",
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.6.0",
43
+ "@modern-js/core": "1.10.1",
62
44
  "@scripts/build": "0.0.0",
63
45
  "jest": "^27",
64
46
  "@scripts/jest-config": "0.0.0"
@@ -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
- }