vite-plugin-rpx 0.11.35 → 0.11.37

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.
Files changed (2) hide show
  1. package/dist/index.js +106 -2
  2. package/package.json +2 -2
package/dist/index.js CHANGED
@@ -24181,6 +24181,12 @@ var init_sni = __esm(() => {
24181
24181
  // ../rpx/src/on-demand.ts
24182
24182
  import * as fsp2 from "node:fs/promises";
24183
24183
  import * as path5 from "node:path";
24184
+ function resolveCertificateReloadStrategy(env = process.env) {
24185
+ const explicit = env.RPX_TLS_RELOAD_STRATEGY?.trim().toLowerCase();
24186
+ if (explicit === "restart" || explicit === "rebind")
24187
+ return explicit;
24188
+ return env.INVOCATION_ID ? "restart" : "rebind";
24189
+ }
24184
24190
  function matchesAllowedSuffix(host, suffixes) {
24185
24191
  if (!suffixes || suffixes.length === 0)
24186
24192
  return false;
@@ -26155,8 +26161,101 @@ init_sni();
26155
26161
  init_on_demand();
26156
26162
  init_static_files();
26157
26163
  init_utils();
26164
+ // ../rpx/package.json
26165
+ var package_default = {
26166
+ name: "@stacksjs/rpx",
26167
+ type: "module",
26168
+ version: "0.11.37",
26169
+ description: "A modern and smart reverse proxy.",
26170
+ author: "Chris Breuer <chris@stacksjs.org>",
26171
+ license: "MIT",
26172
+ homepage: "https://github.com/stacksjs/rpx",
26173
+ repository: {
26174
+ type: "git",
26175
+ url: "git+https://github.com/stacksjs/rpx.git"
26176
+ },
26177
+ bugs: {
26178
+ url: "https://github.com/stacksjs/rpx/issues"
26179
+ },
26180
+ keywords: [
26181
+ "reverse proxy",
26182
+ "ssl",
26183
+ "development",
26184
+ "environment",
26185
+ "proxy",
26186
+ "bun",
26187
+ "stacks",
26188
+ "typescript",
26189
+ "javascript"
26190
+ ],
26191
+ exports: {
26192
+ ".": {
26193
+ types: "./dist/index.d.ts",
26194
+ bun: "./dist/index.js",
26195
+ import: "./dist/index.js"
26196
+ }
26197
+ },
26198
+ module: "./dist/index.js",
26199
+ types: "./dist/index.d.ts",
26200
+ bin: {
26201
+ rpx: "./dist/bin/cli.js",
26202
+ "reverse-proxy": "./dist/bin/cli.js"
26203
+ },
26204
+ files: [
26205
+ "README.md",
26206
+ "dist"
26207
+ ],
26208
+ scripts: {
26209
+ build: "bun build.ts && bun build ./bin/cli.ts --compile --minify --outfile bin/rpx",
26210
+ compile: "bun build ./bin/cli.ts --compile --minify --outfile bin/rpx",
26211
+ "compile:all": "bun run compile:linux-x64 && bun run compile:linux-arm64 && bun run compile:windows-x64 && bun run compile:darwin-x64 && bun run compile:darwin-arm64",
26212
+ "compile:linux-x64": "bun build ./bin/cli.ts --compile --minify --target=bun-linux-x64 --outfile bin/rpx-linux-x64",
26213
+ "compile:linux-arm64": "bun build ./bin/cli.ts --compile --minify --target=bun-linux-arm64 --outfile bin/rpx-linux-arm64",
26214
+ "compile:windows-x64": "bun build ./bin/cli.ts --compile --minify --target=bun-windows-x64 --outfile bin/rpx-windows-x64.exe",
26215
+ "compile:darwin-x64": "bun build ./bin/cli.ts --compile --minify --target=bun-darwin-x64 --outfile bin/rpx-darwin-x64",
26216
+ "compile:darwin-arm64": "bun build ./bin/cli.ts --compile --minify --target=bun-darwin-arm64 --outfile bin/rpx-darwin-arm64",
26217
+ bench: "bun run bench/run.ts",
26218
+ "bench:html": "bun run bench/run.ts --html",
26219
+ "bench:latency": "bun run bench/run.ts --latency",
26220
+ "bench:throughput": "bun run bench/run.ts --throughput",
26221
+ lint: "bunx --bun pickier .",
26222
+ "lint:fix": "bunx --bun pickier . --fix",
26223
+ fresh: "bunx rimraf node_modules/ bun.lock && bun i",
26224
+ changelog: "changelogen --output CHANGELOG.md",
26225
+ prepublishOnly: "bun build.ts",
26226
+ "release:binaries": "bun run compile:all && bun run zip",
26227
+ test: "bun test",
26228
+ typecheck: "bunx tsc --noEmit",
26229
+ zip: "bun run zip:all",
26230
+ "zip:all": "bun run zip:linux-x64 && bun run zip:linux-arm64 && bun run zip:windows-x64 && bun run zip:darwin-x64 && bun run zip:darwin-arm64",
26231
+ "zip:linux-x64": "zip -j bin/rpx-linux-x64.zip bin/rpx-linux-x64",
26232
+ "zip:linux-arm64": "zip -j bin/rpx-linux-arm64.zip bin/rpx-linux-arm64",
26233
+ "zip:windows-x64": "zip -j bin/rpx-windows-x64.zip bin/rpx-windows-x64.exe",
26234
+ "zip:darwin-x64": "zip -j bin/rpx-darwin-x64.zip bin/rpx-darwin-x64",
26235
+ "zip:darwin-arm64": "zip -j bin/rpx-darwin-arm64.zip bin/rpx-darwin-arm64"
26236
+ },
26237
+ dependencies: {
26238
+ "@stacksjs/clapp": "^0.2.10",
26239
+ "@stacksjs/tlsx": "^0.13.13"
26240
+ },
26241
+ devDependencies: {
26242
+ bunfig: "^0.15.6",
26243
+ mitata: "^1.0.34",
26244
+ typescript: "^7.0.2"
26245
+ },
26246
+ "simple-git-hooks": {
26247
+ "pre-commit": "bunx lint-staged"
26248
+ },
26249
+ "lint-staged": {
26250
+ "*.{js,ts}": "bunx --bun pickier . --fix"
26251
+ }
26252
+ };
26253
+
26254
+ // ../rpx/src/version.ts
26255
+ var version3 = package_default.version;
26256
+
26257
+ // ../rpx/src/start.ts
26158
26258
  var processManager2 = new ProcessManager;
26159
- var version3 = "0.12.0";
26160
26259
  var globalPortManager = new DefaultPortManager("0.0.0.0");
26161
26260
  var activeServers = new Set;
26162
26261
  var activeUpstreamPools = new Set;
@@ -26845,7 +26944,12 @@ async function startProxies(options) {
26845
26944
  initial: productionTlsConfig,
26846
26945
  verbose,
26847
26946
  onCertAdded: (entries) => {
26848
- rebuildSharedTls(entries);
26947
+ if (resolveCertificateReloadStrategy() === "restart") {
26948
+ debugLog("on-demand", "certificate installed; restarting supervised gateway to reload TLS", verbose);
26949
+ setTimeout(() => process31.kill(process31.pid, "SIGTERM"), 10).unref();
26950
+ } else {
26951
+ rebuildSharedTls(entries);
26952
+ }
26849
26953
  }
26850
26954
  }) : null;
26851
26955
  let rebuildLatest = null;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "vite-plugin-rpx",
3
3
  "type": "module",
4
- "version": "0.11.35",
4
+ "version": "0.11.37",
5
5
  "description": "A modern and smart reverse proxy. Vite plugin.",
6
6
  "author": "Chris Breuer <chris@stacksjs.org>",
7
7
  "license": "MIT",
@@ -47,7 +47,7 @@
47
47
  "typecheck": "bunx tsc --noEmit"
48
48
  },
49
49
  "dependencies": {
50
- "@stacksjs/rpx": "0.11.35",
50
+ "@stacksjs/rpx": "0.11.37",
51
51
  "@stacksjs/tlsx": "^0.13.13"
52
52
  },
53
53
  "simple-git-hooks": {