@modern-js/plugin-proxy 1.2.0 → 1.2.1

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,17 @@
1
1
  # @modern-js/plugin-proxy
2
2
 
3
+ ## 1.2.1
4
+
5
+ ### Patch Changes
6
+
7
+ - e2d3a575: fix extending core config interface
8
+ - e2d3a575: fix extending core config interface
9
+ - Updated dependencies [823809c6]
10
+ - Updated dependencies [4584cc04]
11
+ - Updated dependencies [7c19fd94]
12
+ - @modern-js/utils@1.2.1
13
+ - @modern-js/core@1.3.1
14
+
3
15
  ## 1.2.0
4
16
 
5
17
  ### Minor Changes
@@ -18,7 +18,7 @@ export default createPlugin(() => ({
18
18
  } = useAppContext();
19
19
  /* eslint-enable react-hooks/rules-of-hooks */
20
20
 
21
- if (!dev.proxy) {
21
+ if (!(dev !== null && dev !== void 0 && dev.proxy)) {
22
22
  return;
23
23
  }
24
24
 
@@ -32,7 +32,7 @@ var _default = (0, _core.createPlugin)(() => ({
32
32
  } = (0, _core.useAppContext)();
33
33
  /* eslint-enable react-hooks/rules-of-hooks */
34
34
 
35
- if (!dev.proxy) {
35
+ if (!(dev !== null && dev !== void 0 && dev.proxy)) {
36
36
  return;
37
37
  }
38
38
 
@@ -4,8 +4,6 @@ export default _default;
4
4
  export declare type ProxyOptions = string | Record<string, string>;
5
5
  declare module '@modern-js/core' {
6
6
  interface DevConfig {
7
- dev: {
8
- proxy?: ProxyOptions;
9
- };
7
+ proxy?: ProxyOptions;
10
8
  }
11
9
  }
package/package.json CHANGED
@@ -11,7 +11,7 @@
11
11
  "modern",
12
12
  "modern.js"
13
13
  ],
14
- "version": "1.2.0",
14
+ "version": "1.2.1",
15
15
  "jsnext:source": "./src/index.ts",
16
16
  "types": "./dist/types/index.d.ts",
17
17
  "main": "./dist/js/node/index.js",
@@ -33,20 +33,20 @@
33
33
  },
34
34
  "dependencies": {
35
35
  "@babel/runtime": "^7",
36
- "@modern-js/utils": "^1.2.0",
36
+ "@modern-js/utils": "^1.2.1",
37
37
  "whistle": "^2.7.18"
38
38
  },
39
39
  "devDependencies": {
40
40
  "@types/jest": "^26",
41
41
  "@types/node": "^14",
42
42
  "typescript": "^4",
43
- "@modern-js/core": "^1.3.0",
43
+ "@modern-js/core": "^1.3.1",
44
44
  "@scripts/build": "0.0.0",
45
45
  "jest": "^27",
46
46
  "@scripts/jest-config": "0.0.0"
47
47
  },
48
48
  "peerDependencies": {
49
- "@modern-js/core": "^1.3.0"
49
+ "@modern-js/core": "^1.3.1"
50
50
  },
51
51
  "sideEffects": false,
52
52
  "modernConfig": {
package/src/index.ts CHANGED
@@ -19,11 +19,11 @@ export default createPlugin(
19
19
  const { internalDirectory } = useAppContext();
20
20
  /* eslint-enable react-hooks/rules-of-hooks */
21
21
 
22
- if (!(dev as any).proxy) {
22
+ if (!dev?.proxy) {
23
23
  return;
24
24
  }
25
25
 
26
- const rule = createProxyRule(internalDirectory, (dev as any).proxy);
26
+ const rule = createProxyRule(internalDirectory, dev.proxy);
27
27
  proxyServer = new WhistleProxy({ port: 8899, rule });
28
28
  await proxyServer.start();
29
29
  },
@@ -39,8 +39,6 @@ export type ProxyOptions = string | Record<string, string>;
39
39
 
40
40
  declare module '@modern-js/core' {
41
41
  export interface DevConfig {
42
- dev: {
43
- proxy?: ProxyOptions;
44
- };
42
+ proxy?: ProxyOptions;
45
43
  }
46
44
  }