unplugin-https-reverse-proxy 0.0.8 → 0.0.10

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/README.md CHANGED
@@ -7,7 +7,11 @@ A plugin for https reverse proxy, support `vite` and `webpack`.
7
7
  ## Install
8
8
 
9
9
  ```bash
10
- npm i unplugin-https-reverse-proxy
10
+ # not auto install caddy when postinstall
11
+ npm i unplugin-https-reverse-proxy --save-dev
12
+
13
+ # auto install
14
+ UHRP_AUTO_INSTALL_CADDY=true npm i unplugin-https-reverse-proxy --save-dev
11
15
  ```
12
16
 
13
17
  ```ts
@@ -197,7 +197,7 @@ function testCaddy() {
197
197
  chmodSync(caddyPath, 493);
198
198
  const child = process2.platform === "win32" ? spawn(caddyPath, []) : spawn("sudo", [caddyPath]);
199
199
  child.on("close", () => {
200
- return resolve(true);
200
+ return resolve(false);
201
201
  });
202
202
  child.on("error", (err) => {
203
203
  return reject(err);
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  unpluginFactory
3
- } from "./chunk-H5P77DDT.js";
3
+ } from "./chunk-AJ47BPUG.js";
4
4
 
5
5
  // src/vite.ts
6
6
  import { createVitePlugin } from "unplugin";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  unpluginFactory
3
- } from "./chunk-H5P77DDT.js";
3
+ } from "./chunk-AJ47BPUG.js";
4
4
 
5
5
  // src/webpack.ts
6
6
  import { createWebpackPlugin } from "unplugin";
package/dist/esbuild.cjs CHANGED
@@ -236,7 +236,7 @@ function testCaddy() {
236
236
  (0, import_node_fs.chmodSync)(caddyPath, 493);
237
237
  const child = import_node_process2.default.platform === "win32" ? (0, import_node_child_process.spawn)(caddyPath, []) : (0, import_node_child_process.spawn)("sudo", [caddyPath]);
238
238
  child.on("close", () => {
239
- return resolve(true);
239
+ return resolve(false);
240
240
  });
241
241
  child.on("error", (err) => {
242
242
  return reject(err);
package/dist/esbuild.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  unpluginFactory
3
- } from "./chunk-H5P77DDT.js";
3
+ } from "./chunk-AJ47BPUG.js";
4
4
  import "./chunk-3HKPYCSE.js";
5
5
 
6
6
  // src/esbuild.ts
package/dist/index.cjs CHANGED
@@ -235,7 +235,7 @@ function testCaddy() {
235
235
  (0, import_node_fs.chmodSync)(caddyPath, 493);
236
236
  const child = import_node_process2.default.platform === "win32" ? (0, import_node_child_process.spawn)(caddyPath, []) : (0, import_node_child_process.spawn)("sudo", [caddyPath]);
237
237
  child.on("close", () => {
238
- return resolve(true);
238
+ return resolve(false);
239
239
  });
240
240
  child.on("error", (err) => {
241
241
  return reject(err);
package/dist/index.js CHANGED
@@ -2,7 +2,7 @@ import {
2
2
  src_default,
3
3
  unplugin,
4
4
  unpluginFactory
5
- } from "./chunk-H5P77DDT.js";
5
+ } from "./chunk-AJ47BPUG.js";
6
6
  import "./chunk-3HKPYCSE.js";
7
7
  export {
8
8
  src_default as default,
package/dist/nuxt.cjs CHANGED
@@ -239,7 +239,7 @@ function testCaddy() {
239
239
  (0, import_node_fs.chmodSync)(caddyPath, 493);
240
240
  const child = import_node_process2.default.platform === "win32" ? (0, import_node_child_process.spawn)(caddyPath, []) : (0, import_node_child_process.spawn)("sudo", [caddyPath]);
241
241
  child.on("close", () => {
242
- return resolve(true);
242
+ return resolve(false);
243
243
  });
244
244
  child.on("error", (err) => {
245
245
  return reject(err);
package/dist/nuxt.js CHANGED
@@ -1,10 +1,10 @@
1
1
  import {
2
2
  vite_default
3
- } from "./chunk-HSJJYR6E.js";
3
+ } from "./chunk-FD66DR3R.js";
4
4
  import {
5
5
  webpack_default
6
- } from "./chunk-JN5C2QIT.js";
7
- import "./chunk-H5P77DDT.js";
6
+ } from "./chunk-J2XKEZPC.js";
7
+ import "./chunk-AJ47BPUG.js";
8
8
  import "./chunk-3HKPYCSE.js";
9
9
 
10
10
  // src/nuxt.ts
package/dist/rollup.cjs CHANGED
@@ -236,7 +236,7 @@ function testCaddy() {
236
236
  (0, import_node_fs.chmodSync)(caddyPath, 493);
237
237
  const child = import_node_process2.default.platform === "win32" ? (0, import_node_child_process.spawn)(caddyPath, []) : (0, import_node_child_process.spawn)("sudo", [caddyPath]);
238
238
  child.on("close", () => {
239
- return resolve(true);
239
+ return resolve(false);
240
240
  });
241
241
  child.on("error", (err) => {
242
242
  return reject(err);
package/dist/rollup.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  unpluginFactory
3
- } from "./chunk-H5P77DDT.js";
3
+ } from "./chunk-AJ47BPUG.js";
4
4
  import "./chunk-3HKPYCSE.js";
5
5
 
6
6
  // src/rollup.ts
package/dist/vite.cjs CHANGED
@@ -236,7 +236,7 @@ function testCaddy() {
236
236
  (0, import_node_fs.chmodSync)(caddyPath, 493);
237
237
  const child = import_node_process2.default.platform === "win32" ? (0, import_node_child_process.spawn)(caddyPath, []) : (0, import_node_child_process.spawn)("sudo", [caddyPath]);
238
238
  child.on("close", () => {
239
- return resolve(true);
239
+ return resolve(false);
240
240
  });
241
241
  child.on("error", (err) => {
242
242
  return reject(err);
package/dist/vite.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  vite_default
3
- } from "./chunk-HSJJYR6E.js";
4
- import "./chunk-H5P77DDT.js";
3
+ } from "./chunk-FD66DR3R.js";
4
+ import "./chunk-AJ47BPUG.js";
5
5
  import "./chunk-3HKPYCSE.js";
6
6
  export {
7
7
  vite_default as default
package/dist/webpack.cjs CHANGED
@@ -236,7 +236,7 @@ function testCaddy() {
236
236
  (0, import_node_fs.chmodSync)(caddyPath, 493);
237
237
  const child = import_node_process2.default.platform === "win32" ? (0, import_node_child_process.spawn)(caddyPath, []) : (0, import_node_child_process.spawn)("sudo", [caddyPath]);
238
238
  child.on("close", () => {
239
- return resolve(true);
239
+ return resolve(false);
240
240
  });
241
241
  child.on("error", (err) => {
242
242
  return reject(err);
package/dist/webpack.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  webpack_default
3
- } from "./chunk-JN5C2QIT.js";
4
- import "./chunk-H5P77DDT.js";
3
+ } from "./chunk-J2XKEZPC.js";
4
+ import "./chunk-AJ47BPUG.js";
5
5
  import "./chunk-3HKPYCSE.js";
6
6
  export {
7
7
  webpack_default as default
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "unplugin-https-reverse-proxy",
3
3
  "type": "module",
4
- "version": "0.0.8",
4
+ "version": "0.0.10",
5
5
  "packageManager": "pnpm@8.6.12",
6
6
  "description": "",
7
7
  "license": "MIT",
@@ -1,12 +1,15 @@
1
1
  import { existsSync, unlinkSync } from 'node:fs'
2
+ import process from 'node:process'
2
3
  import { consola } from '../src/utils'
3
4
  import { download } from '../src/caddy'
4
5
  import { caddyPath } from '../src/caddy/constants'
5
6
 
6
7
  async function run() {
7
8
  try {
8
- existsSync(caddyPath) && unlinkSync(caddyPath)
9
- await download()
9
+ if (process.env.UHRP_AUTO_INSTALL_CADDY) {
10
+ existsSync(caddyPath) && unlinkSync(caddyPath)
11
+ await download()
12
+ }
10
13
  }
11
14
  catch (e: any) {
12
15
  consola.error(e.code)
@@ -67,7 +67,7 @@ function testCaddy() {
67
67
  chmodSync(caddyPath, 0o755)
68
68
  const child = process.platform === 'win32' ? spawn(caddyPath, []) : spawn('sudo', [caddyPath])
69
69
  child.on('close', () => {
70
- return resolve(true)
70
+ return resolve(false)
71
71
  })
72
72
  child.on('error', (err) => {
73
73
  return reject(err)