unplugin-https-reverse-proxy 0.0.17 → 0.0.19

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.
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  unpluginFactory
3
- } from "./chunk-X56GIMIN.js";
3
+ } from "./chunk-URF2UORY.js";
4
4
 
5
5
  // src/vite.ts
6
6
  import { createVitePlugin } from "unplugin";
@@ -6,6 +6,7 @@ import {
6
6
 
7
7
  // src/index.ts
8
8
  import process3 from "process";
9
+ import { chmodSync as chmodSync2 } from "fs";
9
10
  import { createUnplugin } from "unplugin";
10
11
  import c from "picocolors";
11
12
 
@@ -311,7 +312,7 @@ var CaddyInstant = class {
311
312
  * @returns
312
313
  */
313
314
  async run(source, target, options) {
314
- source = source.replace("0.0.0.0", "127.0.0.1").replace("localhost", "127.0.0.1");
315
+ source = source.replace("0.0.0.0", "127.0.0.1");
315
316
  const {
316
317
  restore = true,
317
318
  base = "/",
@@ -390,11 +391,11 @@ function registerExit(clear) {
390
391
  });
391
392
  process3.once("SIGINT", async () => {
392
393
  await clear();
393
- process3.emit("SIGINT");
394
+ process3.exit(0);
394
395
  });
395
396
  process3.once("SIGTERM", async () => {
396
397
  await clear();
397
- process3.emit("SIGTERM");
398
+ process3.exit(0);
398
399
  });
399
400
  }
400
401
  var unpluginFactory = (options) => ({
@@ -436,6 +437,9 @@ var unpluginFactory = (options) => ({
436
437
  server.printUrls = () => {
437
438
  var _a;
438
439
  _printUrls();
440
+ const pwd = process3.cwd();
441
+ const vireCacheDir = `${pwd}/node_modules/.vite`;
442
+ chmodSync2(vireCacheDir, 511);
439
443
  let source = `localhost:${config.server.port}`;
440
444
  const url = (_a = server.resolvedUrls) == null ? void 0 : _a.local[0];
441
445
  if (url) {
@@ -475,7 +479,7 @@ var unpluginFactory = (options) => ({
475
479
  }
476
480
  try {
477
481
  const devServer = __spreadValues(__spreadValues({
478
- host: "127.0.0.1",
482
+ host: "localhost",
479
483
  port: 8080
480
484
  }, compiler.options.devServer), process3.VUE_CLI_SERVICE.projectOptions.devServer);
481
485
  const source = `${devServer.host}:${devServer.port}`;
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  unpluginFactory
3
- } from "./chunk-X56GIMIN.js";
3
+ } from "./chunk-URF2UORY.js";
4
4
 
5
5
  // src/webpack.ts
6
6
  import { createWebpackPlugin } from "unplugin";
package/dist/esbuild.cjs CHANGED
@@ -51,6 +51,7 @@ var import_unplugin2 = require("unplugin");
51
51
 
52
52
  // src/index.ts
53
53
  var import_node_process3 = __toESM(require("process"), 1);
54
+ var import_node_fs2 = require("fs");
54
55
  var import_unplugin = require("unplugin");
55
56
  var import_picocolors = __toESM(require("picocolors"), 1);
56
57
 
@@ -371,7 +372,7 @@ var CaddyInstant = class {
371
372
  * @returns
372
373
  */
373
374
  async run(source, target, options) {
374
- source = source.replace("0.0.0.0", "127.0.0.1").replace("localhost", "127.0.0.1");
375
+ source = source.replace("0.0.0.0", "127.0.0.1");
375
376
  const {
376
377
  restore = true,
377
378
  base = "/",
@@ -450,11 +451,11 @@ function registerExit(clear) {
450
451
  });
451
452
  import_node_process3.default.once("SIGINT", async () => {
452
453
  await clear();
453
- import_node_process3.default.emit("SIGINT");
454
+ import_node_process3.default.exit(0);
454
455
  });
455
456
  import_node_process3.default.once("SIGTERM", async () => {
456
457
  await clear();
457
- import_node_process3.default.emit("SIGTERM");
458
+ import_node_process3.default.exit(0);
458
459
  });
459
460
  }
460
461
  var unpluginFactory = (options) => ({
@@ -496,6 +497,9 @@ var unpluginFactory = (options) => ({
496
497
  server.printUrls = () => {
497
498
  var _a;
498
499
  _printUrls();
500
+ const pwd = import_node_process3.default.cwd();
501
+ const vireCacheDir = `${pwd}/node_modules/.vite`;
502
+ (0, import_node_fs2.chmodSync)(vireCacheDir, 511);
499
503
  let source = `localhost:${config.server.port}`;
500
504
  const url = (_a = server.resolvedUrls) == null ? void 0 : _a.local[0];
501
505
  if (url) {
@@ -535,7 +539,7 @@ var unpluginFactory = (options) => ({
535
539
  }
536
540
  try {
537
541
  const devServer = __spreadValues(__spreadValues({
538
- host: "127.0.0.1",
542
+ host: "localhost",
539
543
  port: 8080
540
544
  }, compiler.options.devServer), import_node_process3.default.VUE_CLI_SERVICE.projectOptions.devServer);
541
545
  const source = `${devServer.host}:${devServer.port}`;
package/dist/esbuild.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  unpluginFactory
3
- } from "./chunk-X56GIMIN.js";
3
+ } from "./chunk-URF2UORY.js";
4
4
  import "./chunk-CQC5SSJR.js";
5
5
 
6
6
  // src/esbuild.ts
package/dist/index.cjs CHANGED
@@ -50,6 +50,7 @@ __export(src_exports, {
50
50
  });
51
51
  module.exports = __toCommonJS(src_exports);
52
52
  var import_node_process3 = __toESM(require("process"), 1);
53
+ var import_node_fs2 = require("fs");
53
54
  var import_unplugin = require("unplugin");
54
55
  var import_picocolors = __toESM(require("picocolors"), 1);
55
56
 
@@ -370,7 +371,7 @@ var CaddyInstant = class {
370
371
  * @returns
371
372
  */
372
373
  async run(source, target, options) {
373
- source = source.replace("0.0.0.0", "127.0.0.1").replace("localhost", "127.0.0.1");
374
+ source = source.replace("0.0.0.0", "127.0.0.1");
374
375
  const {
375
376
  restore = true,
376
377
  base = "/",
@@ -449,11 +450,11 @@ function registerExit(clear) {
449
450
  });
450
451
  import_node_process3.default.once("SIGINT", async () => {
451
452
  await clear();
452
- import_node_process3.default.emit("SIGINT");
453
+ import_node_process3.default.exit(0);
453
454
  });
454
455
  import_node_process3.default.once("SIGTERM", async () => {
455
456
  await clear();
456
- import_node_process3.default.emit("SIGTERM");
457
+ import_node_process3.default.exit(0);
457
458
  });
458
459
  }
459
460
  var unpluginFactory = (options) => ({
@@ -495,6 +496,9 @@ var unpluginFactory = (options) => ({
495
496
  server.printUrls = () => {
496
497
  var _a;
497
498
  _printUrls();
499
+ const pwd = import_node_process3.default.cwd();
500
+ const vireCacheDir = `${pwd}/node_modules/.vite`;
501
+ (0, import_node_fs2.chmodSync)(vireCacheDir, 511);
498
502
  let source = `localhost:${config.server.port}`;
499
503
  const url = (_a = server.resolvedUrls) == null ? void 0 : _a.local[0];
500
504
  if (url) {
@@ -534,7 +538,7 @@ var unpluginFactory = (options) => ({
534
538
  }
535
539
  try {
536
540
  const devServer = __spreadValues(__spreadValues({
537
- host: "127.0.0.1",
541
+ host: "localhost",
538
542
  port: 8080
539
543
  }, compiler.options.devServer), import_node_process3.default.VUE_CLI_SERVICE.projectOptions.devServer);
540
544
  const source = `${devServer.host}:${devServer.port}`;
package/dist/index.js CHANGED
@@ -2,7 +2,7 @@ import {
2
2
  src_default,
3
3
  unplugin,
4
4
  unpluginFactory
5
- } from "./chunk-X56GIMIN.js";
5
+ } from "./chunk-URF2UORY.js";
6
6
  import "./chunk-CQC5SSJR.js";
7
7
  export {
8
8
  src_default as default,
package/dist/nuxt.cjs CHANGED
@@ -54,6 +54,7 @@ var import_unplugin2 = require("unplugin");
54
54
 
55
55
  // src/index.ts
56
56
  var import_node_process3 = __toESM(require("process"), 1);
57
+ var import_node_fs2 = require("fs");
57
58
  var import_unplugin = require("unplugin");
58
59
  var import_picocolors = __toESM(require("picocolors"), 1);
59
60
 
@@ -374,7 +375,7 @@ var CaddyInstant = class {
374
375
  * @returns
375
376
  */
376
377
  async run(source, target, options) {
377
- source = source.replace("0.0.0.0", "127.0.0.1").replace("localhost", "127.0.0.1");
378
+ source = source.replace("0.0.0.0", "127.0.0.1");
378
379
  const {
379
380
  restore = true,
380
381
  base = "/",
@@ -453,11 +454,11 @@ function registerExit(clear) {
453
454
  });
454
455
  import_node_process3.default.once("SIGINT", async () => {
455
456
  await clear();
456
- import_node_process3.default.emit("SIGINT");
457
+ import_node_process3.default.exit(0);
457
458
  });
458
459
  import_node_process3.default.once("SIGTERM", async () => {
459
460
  await clear();
460
- import_node_process3.default.emit("SIGTERM");
461
+ import_node_process3.default.exit(0);
461
462
  });
462
463
  }
463
464
  var unpluginFactory = (options) => ({
@@ -499,6 +500,9 @@ var unpluginFactory = (options) => ({
499
500
  server.printUrls = () => {
500
501
  var _a;
501
502
  _printUrls();
503
+ const pwd = import_node_process3.default.cwd();
504
+ const vireCacheDir = `${pwd}/node_modules/.vite`;
505
+ (0, import_node_fs2.chmodSync)(vireCacheDir, 511);
502
506
  let source = `localhost:${config.server.port}`;
503
507
  const url = (_a = server.resolvedUrls) == null ? void 0 : _a.local[0];
504
508
  if (url) {
@@ -538,7 +542,7 @@ var unpluginFactory = (options) => ({
538
542
  }
539
543
  try {
540
544
  const devServer = __spreadValues(__spreadValues({
541
- host: "127.0.0.1",
545
+ host: "localhost",
542
546
  port: 8080
543
547
  }, compiler.options.devServer), import_node_process3.default.VUE_CLI_SERVICE.projectOptions.devServer);
544
548
  const source = `${devServer.host}:${devServer.port}`;
package/dist/nuxt.js CHANGED
@@ -1,10 +1,10 @@
1
1
  import {
2
2
  vite_default
3
- } from "./chunk-QRPGIR3T.js";
3
+ } from "./chunk-EAJJ2ZZG.js";
4
4
  import {
5
5
  webpack_default
6
- } from "./chunk-7YCZMCZN.js";
7
- import "./chunk-X56GIMIN.js";
6
+ } from "./chunk-VOWRN6H5.js";
7
+ import "./chunk-URF2UORY.js";
8
8
  import "./chunk-CQC5SSJR.js";
9
9
 
10
10
  // src/nuxt.ts
package/dist/rollup.cjs CHANGED
@@ -51,6 +51,7 @@ var import_unplugin2 = require("unplugin");
51
51
 
52
52
  // src/index.ts
53
53
  var import_node_process3 = __toESM(require("process"), 1);
54
+ var import_node_fs2 = require("fs");
54
55
  var import_unplugin = require("unplugin");
55
56
  var import_picocolors = __toESM(require("picocolors"), 1);
56
57
 
@@ -371,7 +372,7 @@ var CaddyInstant = class {
371
372
  * @returns
372
373
  */
373
374
  async run(source, target, options) {
374
- source = source.replace("0.0.0.0", "127.0.0.1").replace("localhost", "127.0.0.1");
375
+ source = source.replace("0.0.0.0", "127.0.0.1");
375
376
  const {
376
377
  restore = true,
377
378
  base = "/",
@@ -450,11 +451,11 @@ function registerExit(clear) {
450
451
  });
451
452
  import_node_process3.default.once("SIGINT", async () => {
452
453
  await clear();
453
- import_node_process3.default.emit("SIGINT");
454
+ import_node_process3.default.exit(0);
454
455
  });
455
456
  import_node_process3.default.once("SIGTERM", async () => {
456
457
  await clear();
457
- import_node_process3.default.emit("SIGTERM");
458
+ import_node_process3.default.exit(0);
458
459
  });
459
460
  }
460
461
  var unpluginFactory = (options) => ({
@@ -496,6 +497,9 @@ var unpluginFactory = (options) => ({
496
497
  server.printUrls = () => {
497
498
  var _a;
498
499
  _printUrls();
500
+ const pwd = import_node_process3.default.cwd();
501
+ const vireCacheDir = `${pwd}/node_modules/.vite`;
502
+ (0, import_node_fs2.chmodSync)(vireCacheDir, 511);
499
503
  let source = `localhost:${config.server.port}`;
500
504
  const url = (_a = server.resolvedUrls) == null ? void 0 : _a.local[0];
501
505
  if (url) {
@@ -535,7 +539,7 @@ var unpluginFactory = (options) => ({
535
539
  }
536
540
  try {
537
541
  const devServer = __spreadValues(__spreadValues({
538
- host: "127.0.0.1",
542
+ host: "localhost",
539
543
  port: 8080
540
544
  }, compiler.options.devServer), import_node_process3.default.VUE_CLI_SERVICE.projectOptions.devServer);
541
545
  const source = `${devServer.host}:${devServer.port}`;
package/dist/rollup.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  unpluginFactory
3
- } from "./chunk-X56GIMIN.js";
3
+ } from "./chunk-URF2UORY.js";
4
4
  import "./chunk-CQC5SSJR.js";
5
5
 
6
6
  // src/rollup.ts
package/dist/vite.cjs CHANGED
@@ -51,6 +51,7 @@ var import_unplugin2 = require("unplugin");
51
51
 
52
52
  // src/index.ts
53
53
  var import_node_process3 = __toESM(require("process"), 1);
54
+ var import_node_fs2 = require("fs");
54
55
  var import_unplugin = require("unplugin");
55
56
  var import_picocolors = __toESM(require("picocolors"), 1);
56
57
 
@@ -371,7 +372,7 @@ var CaddyInstant = class {
371
372
  * @returns
372
373
  */
373
374
  async run(source, target, options) {
374
- source = source.replace("0.0.0.0", "127.0.0.1").replace("localhost", "127.0.0.1");
375
+ source = source.replace("0.0.0.0", "127.0.0.1");
375
376
  const {
376
377
  restore = true,
377
378
  base = "/",
@@ -450,11 +451,11 @@ function registerExit(clear) {
450
451
  });
451
452
  import_node_process3.default.once("SIGINT", async () => {
452
453
  await clear();
453
- import_node_process3.default.emit("SIGINT");
454
+ import_node_process3.default.exit(0);
454
455
  });
455
456
  import_node_process3.default.once("SIGTERM", async () => {
456
457
  await clear();
457
- import_node_process3.default.emit("SIGTERM");
458
+ import_node_process3.default.exit(0);
458
459
  });
459
460
  }
460
461
  var unpluginFactory = (options) => ({
@@ -496,6 +497,9 @@ var unpluginFactory = (options) => ({
496
497
  server.printUrls = () => {
497
498
  var _a;
498
499
  _printUrls();
500
+ const pwd = import_node_process3.default.cwd();
501
+ const vireCacheDir = `${pwd}/node_modules/.vite`;
502
+ (0, import_node_fs2.chmodSync)(vireCacheDir, 511);
499
503
  let source = `localhost:${config.server.port}`;
500
504
  const url = (_a = server.resolvedUrls) == null ? void 0 : _a.local[0];
501
505
  if (url) {
@@ -535,7 +539,7 @@ var unpluginFactory = (options) => ({
535
539
  }
536
540
  try {
537
541
  const devServer = __spreadValues(__spreadValues({
538
- host: "127.0.0.1",
542
+ host: "localhost",
539
543
  port: 8080
540
544
  }, compiler.options.devServer), import_node_process3.default.VUE_CLI_SERVICE.projectOptions.devServer);
541
545
  const source = `${devServer.host}:${devServer.port}`;
package/dist/vite.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  vite_default
3
- } from "./chunk-QRPGIR3T.js";
4
- import "./chunk-X56GIMIN.js";
3
+ } from "./chunk-EAJJ2ZZG.js";
4
+ import "./chunk-URF2UORY.js";
5
5
  import "./chunk-CQC5SSJR.js";
6
6
  export {
7
7
  vite_default as default
package/dist/webpack.cjs CHANGED
@@ -51,6 +51,7 @@ var import_unplugin2 = require("unplugin");
51
51
 
52
52
  // src/index.ts
53
53
  var import_node_process3 = __toESM(require("process"), 1);
54
+ var import_node_fs2 = require("fs");
54
55
  var import_unplugin = require("unplugin");
55
56
  var import_picocolors = __toESM(require("picocolors"), 1);
56
57
 
@@ -371,7 +372,7 @@ var CaddyInstant = class {
371
372
  * @returns
372
373
  */
373
374
  async run(source, target, options) {
374
- source = source.replace("0.0.0.0", "127.0.0.1").replace("localhost", "127.0.0.1");
375
+ source = source.replace("0.0.0.0", "127.0.0.1");
375
376
  const {
376
377
  restore = true,
377
378
  base = "/",
@@ -450,11 +451,11 @@ function registerExit(clear) {
450
451
  });
451
452
  import_node_process3.default.once("SIGINT", async () => {
452
453
  await clear();
453
- import_node_process3.default.emit("SIGINT");
454
+ import_node_process3.default.exit(0);
454
455
  });
455
456
  import_node_process3.default.once("SIGTERM", async () => {
456
457
  await clear();
457
- import_node_process3.default.emit("SIGTERM");
458
+ import_node_process3.default.exit(0);
458
459
  });
459
460
  }
460
461
  var unpluginFactory = (options) => ({
@@ -496,6 +497,9 @@ var unpluginFactory = (options) => ({
496
497
  server.printUrls = () => {
497
498
  var _a;
498
499
  _printUrls();
500
+ const pwd = import_node_process3.default.cwd();
501
+ const vireCacheDir = `${pwd}/node_modules/.vite`;
502
+ (0, import_node_fs2.chmodSync)(vireCacheDir, 511);
499
503
  let source = `localhost:${config.server.port}`;
500
504
  const url = (_a = server.resolvedUrls) == null ? void 0 : _a.local[0];
501
505
  if (url) {
@@ -535,7 +539,7 @@ var unpluginFactory = (options) => ({
535
539
  }
536
540
  try {
537
541
  const devServer = __spreadValues(__spreadValues({
538
- host: "127.0.0.1",
542
+ host: "localhost",
539
543
  port: 8080
540
544
  }, compiler.options.devServer), import_node_process3.default.VUE_CLI_SERVICE.projectOptions.devServer);
541
545
  const source = `${devServer.host}:${devServer.port}`;
package/dist/webpack.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  webpack_default
3
- } from "./chunk-7YCZMCZN.js";
4
- import "./chunk-X56GIMIN.js";
3
+ } from "./chunk-VOWRN6H5.js";
4
+ import "./chunk-URF2UORY.js";
5
5
  import "./chunk-CQC5SSJR.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.17",
4
+ "version": "0.0.19",
5
5
  "packageManager": "pnpm@8.6.12",
6
6
  "description": "",
7
7
  "license": "MIT",
@@ -164,7 +164,7 @@ export class CaddyInstant {
164
164
  * @returns
165
165
  */
166
166
  async run(source: string, target: string, options?: Partial<RunOptions>) {
167
- source = source.replace('0.0.0.0', '127.0.0.1').replace('localhost', '127.0.0.1')
167
+ source = source.replace('0.0.0.0', '127.0.0.1')
168
168
  const {
169
169
  restore = true,
170
170
  base = '/',
package/src/index.ts CHANGED
@@ -1,4 +1,5 @@
1
1
  import process from 'node:process'
2
+ import { chmodSync } from 'node:fs'
2
3
  import type { UnpluginFactory } from 'unplugin'
3
4
  import { createUnplugin } from 'unplugin'
4
5
  import type { ResolvedConfig, ViteDevServer } from 'vite'
@@ -37,12 +38,12 @@ function registerExit(clear: (() => Promise<any>) | (() => any)) {
37
38
 
38
39
  process.once('SIGINT', async () => {
39
40
  await clear()
40
- process.emit('SIGINT')
41
+ process.exit(0)
41
42
  })
42
43
 
43
44
  process.once('SIGTERM', async () => {
44
45
  await clear()
45
- process.emit('SIGTERM')
46
+ process.exit(0)
46
47
  })
47
48
  }
48
49
 
@@ -87,6 +88,12 @@ export const unpluginFactory: UnpluginFactory<Options> = options => ({
87
88
  const _printUrls = server.printUrls
88
89
  server.printUrls = () => {
89
90
  _printUrls()
91
+
92
+ // fix `Error: EPERM: operation not permitted`
93
+ const pwd = process.cwd()
94
+ const vireCacheDir = `${pwd}/node_modules/.vite`
95
+ chmodSync(vireCacheDir, 0o777)
96
+
90
97
  let source = `localhost:${config.server.port}`
91
98
  const url = server.resolvedUrls?.local[0]
92
99
  if (url) {
@@ -138,7 +145,7 @@ export const unpluginFactory: UnpluginFactory<Options> = options => ({
138
145
  // })
139
146
 
140
147
  const devServer = {
141
- host: '127.0.0.1',
148
+ host: 'localhost',
142
149
  port: 8080,
143
150
  ...compiler.options.devServer,
144
151
  // @ts-expect-error vuecli