unplugin-https-reverse-proxy 1.0.0-beta.15 → 1.0.0-beta.16
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/dist/chunk-2VGRJ3QS.js +45 -0
- package/dist/chunk-QMYDD3HL.js +651 -0
- package/dist/esbuild.cjs +28 -1651
- package/dist/esbuild.js +2 -2
- package/dist/index.cjs +28 -1651
- package/dist/index.js +2 -2
- package/dist/nuxt.cjs +9 -1641
- package/dist/nuxt.js +3 -3
- package/dist/rollup.cjs +28 -1651
- package/dist/rollup.js +2 -2
- package/dist/rspack.cjs +28 -1651
- package/dist/rspack.js +2 -2
- package/dist/utils.cjs +1 -1
- package/dist/utils.js +1 -1
- package/dist/vite.cjs +28 -1651
- package/dist/vite.js +2 -2
- package/dist/webpack.cjs +28 -1651
- package/dist/webpack.js +2 -2
- package/package.json +2 -1
- package/scripts/postinstall.cjs +1 -0
- package/src/caddy/index.ts +4 -8
- package/dist/chunk-GV7Y22GZ.js +0 -2258
- package/dist/chunk-UGWFCSQS.js +0 -80
package/dist/webpack.js
CHANGED
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "unplugin-https-reverse-proxy",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "1.0.0-beta.
|
|
4
|
+
"version": "1.0.0-beta.16",
|
|
5
5
|
"description": "",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"homepage": "https://github.com/zcf0508/unplugin-https-reverse-proxy#readme",
|
|
@@ -84,6 +84,7 @@
|
|
|
84
84
|
"@rsbuild/core": "^0.4.3",
|
|
85
85
|
"@rspack/core": "^0.5.4",
|
|
86
86
|
"esbuild": "*",
|
|
87
|
+
"proper-lockfile": "^4.1.2",
|
|
87
88
|
"rollup": "^3",
|
|
88
89
|
"vite": ">=3",
|
|
89
90
|
"webpack": "^4 || ^5"
|
package/scripts/postinstall.cjs
CHANGED
|
@@ -55,6 +55,7 @@ var import_got_cjs = require("got-cjs");
|
|
|
55
55
|
var import_http_proxy_agent = require("http-proxy-agent");
|
|
56
56
|
var import_https_proxy_agent = require("https-proxy-agent");
|
|
57
57
|
var import_kill_port = __toESM(require("kill-port"), 1);
|
|
58
|
+
var lockfile = __toESM(require("proper-lockfile"), 1);
|
|
58
59
|
|
|
59
60
|
// src/host/index.ts
|
|
60
61
|
var import_node_process2 = __toESM(require("process"), 1);
|
package/src/caddy/index.ts
CHANGED
|
@@ -7,6 +7,7 @@ import { got } from 'got-cjs'
|
|
|
7
7
|
import { HttpProxyAgent } from 'http-proxy-agent'
|
|
8
8
|
import { HttpsProxyAgent } from 'https-proxy-agent'
|
|
9
9
|
import kill from 'kill-port'
|
|
10
|
+
import * as lockfile from 'proper-lockfile'
|
|
10
11
|
import { chmodRecursive, consola, once } from '../utils'
|
|
11
12
|
import { addHost, removeHost } from '../host'
|
|
12
13
|
import { TEMP_DIR, caddyFilePath, caddyLockFilePath, caddyPath, supportList } from './constants'
|
|
@@ -108,8 +109,6 @@ export class CaddyInstant {
|
|
|
108
109
|
private locked = false
|
|
109
110
|
private caddyfile: string | undefined
|
|
110
111
|
|
|
111
|
-
private lockfile: typeof import('proper-lockfile')
|
|
112
|
-
|
|
113
112
|
constructor() {
|
|
114
113
|
testCaddy().then(async () => {
|
|
115
114
|
await this.getCaddyfile()
|
|
@@ -117,16 +116,13 @@ export class CaddyInstant {
|
|
|
117
116
|
this.inited = true
|
|
118
117
|
})
|
|
119
118
|
|
|
120
|
-
// eslint-disable-next-line @typescript-eslint/no-require-imports
|
|
121
|
-
this.lockfile = require('proper-lockfile')
|
|
122
|
-
|
|
123
119
|
this.locked = this.checkLock()
|
|
124
120
|
}
|
|
125
121
|
|
|
126
122
|
checkLock() {
|
|
127
123
|
if (!existsSync(caddyLockFilePath))
|
|
128
124
|
writeFileSync(caddyLockFilePath, '')
|
|
129
|
-
return
|
|
125
|
+
return lockfile.checkSync(caddyLockFilePath)
|
|
130
126
|
}
|
|
131
127
|
|
|
132
128
|
async getCaddyfile() {
|
|
@@ -283,7 +279,7 @@ ${target.split(':')[0]}${https ? '' : ':80'} {
|
|
|
283
279
|
? spawn('sudo', ['-E', caddyPath, 'run', '--config', caddyFilePath, '--watch'])
|
|
284
280
|
: spawn(caddyPath, ['run', '--config', caddyFilePath, '--watch'])
|
|
285
281
|
|
|
286
|
-
|
|
282
|
+
lockfile.lockSync(caddyLockFilePath)
|
|
287
283
|
|
|
288
284
|
child.on('error', (err) => {
|
|
289
285
|
return reject(err)
|
|
@@ -328,7 +324,7 @@ ${target.split(':')[0]}${https ? '' : ':80'} {
|
|
|
328
324
|
async baseCleanup() {
|
|
329
325
|
if (!this.locked) {
|
|
330
326
|
try {
|
|
331
|
-
await
|
|
327
|
+
await lockfile.unlock(caddyLockFilePath)
|
|
332
328
|
await unlink(caddyFilePath)
|
|
333
329
|
await unlink(caddyLockFilePath)
|
|
334
330
|
}
|