sst 2.0.0-rc.9 → 2.0.0

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 (242) hide show
  1. package/bootstrap.d.ts +2 -4
  2. package/bootstrap.js +208 -61
  3. package/bus.d.ts +3 -3
  4. package/bus.js +1 -1
  5. package/cache.js +1 -1
  6. package/cdk/cloudformation-deployments-wrapper.d.ts +3 -0
  7. package/cdk/cloudformation-deployments-wrapper.js +117 -0
  8. package/cdk/cloudformation-deployments.d.ts +19 -4
  9. package/cdk/deploy-stack.d.ts +17 -2
  10. package/cdk/deploy-stack.js +6 -1
  11. package/cli/colors.d.ts +28 -0
  12. package/cli/colors.js +27 -0
  13. package/cli/commands/bind.d.ts +4 -0
  14. package/cli/commands/bind.js +10 -7
  15. package/cli/commands/bootstrap.d.ts +13 -0
  16. package/cli/commands/bootstrap.js +11 -0
  17. package/cli/commands/build.d.ts +6 -2
  18. package/cli/commands/build.js +13 -8
  19. package/cli/commands/console.d.ts +5 -1
  20. package/cli/commands/console.js +8 -6
  21. package/cli/commands/deploy.d.ts +4 -2
  22. package/cli/commands/deploy.js +69 -29
  23. package/cli/commands/dev.d.ts +5 -1
  24. package/cli/commands/dev.js +157 -79
  25. package/cli/commands/diff.d.ts +15 -0
  26. package/cli/commands/diff.js +61 -0
  27. package/cli/commands/env.d.ts +5 -1
  28. package/cli/commands/env.js +14 -15
  29. package/cli/commands/plugins/kysely.js +13 -5
  30. package/cli/commands/plugins/pothos.js +9 -4
  31. package/cli/commands/remove.d.ts +4 -0
  32. package/cli/commands/remove.js +26 -18
  33. package/cli/commands/secrets/get.d.ts +7 -3
  34. package/cli/commands/secrets/get.js +11 -24
  35. package/cli/commands/secrets/list.d.ts +6 -2
  36. package/cli/commands/secrets/list.js +15 -7
  37. package/cli/commands/secrets/remove.d.ts +8 -4
  38. package/cli/commands/secrets/remove.js +18 -16
  39. package/cli/commands/secrets/secrets.js +3 -3
  40. package/cli/commands/secrets/set.d.ts +8 -6
  41. package/cli/commands/secrets/set.js +16 -33
  42. package/cli/commands/telemetry.d.ts +15 -0
  43. package/cli/commands/telemetry.js +17 -0
  44. package/cli/commands/transform.d.ts +15 -0
  45. package/cli/commands/transform.js +55 -0
  46. package/cli/commands/update.d.ts +6 -2
  47. package/cli/commands/update.js +41 -33
  48. package/cli/commands/version.d.ts +13 -0
  49. package/cli/commands/version.js +7 -0
  50. package/cli/local/router.d.ts +6 -6
  51. package/cli/local/router.js +3 -3
  52. package/cli/local/server.d.ts +5 -3
  53. package/cli/local/server.js +21 -14
  54. package/cli/program.d.ts +5 -1
  55. package/cli/program.js +29 -5
  56. package/cli/spinner.js +2 -0
  57. package/cli/sst.js +35 -23
  58. package/cli/telemetry/environment.d.ts +1 -1
  59. package/cli/telemetry/environment.js +1 -1
  60. package/cli/terminal.d.ts +1 -0
  61. package/cli/terminal.js +8 -0
  62. package/cli/ui/deploy.d.ts +3 -2
  63. package/cli/ui/deploy.js +106 -106
  64. package/cli/ui/functions.d.ts +2 -0
  65. package/cli/ui/functions.js +132 -0
  66. package/cli/ui/header.d.ts +5 -0
  67. package/cli/ui/header.js +16 -0
  68. package/cli/ui/stack.d.ts +1 -0
  69. package/cli/ui/stack.js +6 -0
  70. package/config.d.ts +1 -1
  71. package/config.js +8 -8
  72. package/constructs/Api.d.ts +3 -71
  73. package/constructs/Api.js +3 -42
  74. package/constructs/ApiGatewayV1Api.d.ts +3 -3
  75. package/constructs/ApiGatewayV1Api.js +4 -3
  76. package/constructs/App.d.ts +2 -22
  77. package/constructs/App.js +12 -25
  78. package/constructs/AppSyncApi.d.ts +4 -5
  79. package/constructs/AppSyncApi.js +8 -5
  80. package/constructs/AstroSite.d.ts +2 -3
  81. package/constructs/AstroSite.js +43 -53
  82. package/constructs/Auth.js +27 -16
  83. package/constructs/BaseSite.d.ts +10 -10
  84. package/constructs/BaseSite.js +2 -2
  85. package/constructs/Cognito.js +28 -28
  86. package/constructs/EdgeFunction.d.ts +6 -4
  87. package/constructs/EdgeFunction.js +56 -59
  88. package/constructs/EventBus.js +1 -1
  89. package/constructs/Function.d.ts +4 -44
  90. package/constructs/Function.js +14 -50
  91. package/constructs/FunctionalStack.d.ts +2 -2
  92. package/constructs/Job.d.ts +23 -63
  93. package/constructs/Job.js +11 -32
  94. package/constructs/Metadata.d.ts +18 -20
  95. package/constructs/NextjsSite.d.ts +21 -5
  96. package/constructs/NextjsSite.js +67 -101
  97. package/constructs/Queue.js +10 -10
  98. package/constructs/RDS.d.ts +1 -1
  99. package/constructs/RDS.js +1 -1
  100. package/constructs/RemixSite.d.ts +0 -2
  101. package/constructs/RemixSite.js +20 -20
  102. package/constructs/Script.js +1 -1
  103. package/constructs/Secret.js +5 -3
  104. package/constructs/SolidStartSite.d.ts +2 -3
  105. package/constructs/SolidStartSite.js +42 -52
  106. package/constructs/SsrFunction.d.ts +22 -0
  107. package/constructs/SsrFunction.js +113 -0
  108. package/constructs/SsrSite.d.ts +104 -104
  109. package/constructs/SsrSite.js +196 -217
  110. package/constructs/Stack.d.ts +1 -20
  111. package/constructs/Stack.js +3 -65
  112. package/constructs/StaticSite.d.ts +33 -53
  113. package/constructs/StaticSite.js +92 -118
  114. package/constructs/Table.d.ts +1 -1
  115. package/constructs/Table.js +4 -4
  116. package/constructs/Topic.js +1 -1
  117. package/constructs/cdk/certificate-base.d.ts +18 -0
  118. package/constructs/cdk/certificate-base.js +26 -0
  119. package/constructs/cdk/dns-validated-certificate.d.ts +77 -0
  120. package/constructs/cdk/dns-validated-certificate.js +125 -0
  121. package/constructs/cdk/website-redirect.d.ts +53 -0
  122. package/constructs/cdk/website-redirect.js +77 -0
  123. package/constructs/deferred_task.d.ts +1 -1
  124. package/constructs/deprecated/NextjsSite.js +8 -6
  125. package/constructs/index.d.ts +0 -6
  126. package/constructs/index.js +0 -6
  127. package/constructs/util/apiGatewayV1AccessLog.d.ts +1 -1
  128. package/constructs/util/apiGatewayV2AccessLog.js +4 -4
  129. package/constructs/util/apiGatewayV2Domain.js +9 -2
  130. package/constructs/util/appSyncApiDomain.d.ts +1 -1
  131. package/constructs/util/appSyncApiDomain.js +9 -15
  132. package/constructs/util/duration.d.ts +1 -1
  133. package/constructs/util/functionBinding.js +1 -1
  134. package/constructs/util/permission.d.ts +3 -3
  135. package/constructs/util/permission.js +16 -18
  136. package/constructs/util/size.d.ts +1 -1
  137. package/constructs/util/warning.js +2 -2
  138. package/context/context.d.ts +2 -2
  139. package/context/context.js +4 -4
  140. package/context/handler.d.ts +1 -1
  141. package/credentials.d.ts +1 -1
  142. package/credentials.js +42 -6
  143. package/index.d.ts +1 -0
  144. package/index.js +1 -0
  145. package/iot.js +6 -2
  146. package/logger.js +3 -1
  147. package/node/api/index.d.ts +2 -3
  148. package/node/api/index.js +8 -2
  149. package/node/auth/adapter/adapter.d.ts +1 -1
  150. package/node/auth/adapter/facebook.js +1 -1
  151. package/node/auth/adapter/github.js +4 -4
  152. package/node/auth/adapter/google.d.ts +1 -1
  153. package/node/auth/adapter/google.js +2 -2
  154. package/node/auth/adapter/twitch.js +1 -1
  155. package/node/auth/session.d.ts +1 -1
  156. package/node/config/index.d.ts +2 -2
  157. package/node/config/index.js +3 -8
  158. package/node/job/index.d.ts +2 -2
  159. package/node/site/index.js +3 -5
  160. package/package.json +26 -21
  161. package/pothos.js +1 -0
  162. package/project.d.ts +47 -0
  163. package/{app.js → project.js} +60 -53
  164. package/runtime/handlers/dotnet.d.ts +1 -1
  165. package/runtime/handlers/dotnet.js +4 -4
  166. package/runtime/handlers/go.d.ts +1 -1
  167. package/runtime/handlers/go.js +3 -3
  168. package/runtime/handlers/java.d.ts +1 -1
  169. package/runtime/handlers/java.js +4 -4
  170. package/runtime/handlers/node.d.ts +1 -1
  171. package/runtime/handlers/node.js +60 -39
  172. package/runtime/handlers/python.d.ts +1 -1
  173. package/runtime/handlers/python.js +3 -3
  174. package/runtime/handlers.js +15 -12
  175. package/runtime/iot.js +3 -0
  176. package/runtime/runtime.d.ts +4 -0
  177. package/runtime/server.d.ts +3 -3
  178. package/runtime/server.js +11 -5
  179. package/runtime/workers.d.ts +4 -2
  180. package/runtime/workers.js +13 -3
  181. package/site-env.js +2 -1
  182. package/sst.mjs +6357 -20848
  183. package/stacks/app-metadata.d.ts +7 -0
  184. package/stacks/app-metadata.js +78 -0
  185. package/stacks/assembly.d.ts +1 -0
  186. package/stacks/assembly.js +4 -0
  187. package/stacks/build.d.ts +1 -1
  188. package/stacks/build.js +41 -48
  189. package/stacks/deploy.d.ts +1 -0
  190. package/stacks/deploy.js +128 -7
  191. package/stacks/diff.d.ts +8 -0
  192. package/stacks/diff.js +62 -0
  193. package/stacks/index.d.ts +3 -0
  194. package/stacks/index.js +3 -0
  195. package/stacks/metadata.d.ts +2 -0
  196. package/stacks/metadata.js +14 -12
  197. package/stacks/monitor.d.ts +8 -3
  198. package/stacks/monitor.js +38 -4
  199. package/stacks/remove.js +0 -4
  200. package/stacks/synth.d.ts +1 -0
  201. package/stacks/synth.js +27 -13
  202. package/support/base-site-archiver.mjs +1 -1
  203. package/support/bootstrap-metadata-function/index.mjs +68740 -0
  204. package/support/bridge/bridge.mjs +28 -28
  205. package/support/certificate-requestor/index.js +549 -0
  206. package/support/custom-resources/index.mjs +3824 -26567
  207. package/support/dotnet6-bootstrap/release/dotnet-bootstrap.deps.json +1 -1
  208. package/support/dotnet6-bootstrap/release/dotnet-bootstrap.runtimeconfig.json +1 -1
  209. package/support/edge-function/edge-lambda.mjs +2 -2
  210. package/support/job-invoker/index.mjs +26 -0
  211. package/support/nodejs-runtime/index.mjs +75 -72
  212. package/support/rds-migrator/index.mjs +22 -23
  213. package/support/remix-site-function/edge-server.js +1 -1
  214. package/support/script-function/index.mjs +30485 -0
  215. package/support/{edge-function-code-replacer → sls-nextjs-site-function-code-replacer}/lambda-code-updater.py +0 -0
  216. package/support/ssr-site-function-archiver.mjs +96 -0
  217. package/watcher.js +1 -1
  218. package/app.d.ts +0 -36
  219. package/constructs/DebugApp.d.ts +0 -49
  220. package/constructs/DebugApp.js +0 -63
  221. package/constructs/DebugStack.d.ts +0 -34
  222. package/constructs/DebugStack.js +0 -132
  223. package/constructs/GraphQLApi.d.ts +0 -98
  224. package/constructs/GraphQLApi.js +0 -80
  225. package/constructs/ReactStaticSite.d.ts +0 -20
  226. package/constructs/ReactStaticSite.js +0 -54
  227. package/constructs/Script/cfn-response.d.ts +0 -19
  228. package/constructs/Script/cfn-response.js +0 -77
  229. package/constructs/Script/index.d.ts +0 -1
  230. package/constructs/Script/index.js +0 -78
  231. package/constructs/Script/outbound.d.ts +0 -10
  232. package/constructs/Script/outbound.js +0 -42
  233. package/constructs/Script/util.d.ts +0 -2
  234. package/constructs/Script/util.js +0 -11
  235. package/constructs/ViteStaticSite.d.ts +0 -32
  236. package/constructs/ViteStaticSite.js +0 -66
  237. package/support/astro-site-html-stub/index.html +0 -99
  238. package/support/base-site-archiver.cjs +0 -116
  239. package/support/nextjs-site-html-stub/index.html +0 -99
  240. package/support/remix-site-html-stub/index.html +0 -99
  241. package/support/solid-start-site-html-stub/index.html +0 -99
  242. package/support/static-site-stub/index.html +0 -90
@@ -317,61 +317,61 @@ var require_util = __commonJS({
317
317
  function isBlobLike(object) {
318
318
  return Blob && object instanceof Blob || object && typeof object === "object" && (typeof object.stream === "function" || typeof object.arrayBuffer === "function") && /^(Blob|File)$/.test(object[Symbol.toStringTag]);
319
319
  }
320
- function buildURL(url, queryParams) {
321
- if (url.includes("?") || url.includes("#")) {
320
+ function buildURL(url2, queryParams) {
321
+ if (url2.includes("?") || url2.includes("#")) {
322
322
  throw new Error('Query params cannot be passed when url already contains "?" or "#".');
323
323
  }
324
324
  const stringified = stringify(queryParams);
325
325
  if (stringified) {
326
- url += "?" + stringified;
326
+ url2 += "?" + stringified;
327
327
  }
328
- return url;
328
+ return url2;
329
329
  }
330
- function parseURL(url) {
331
- if (typeof url === "string") {
332
- url = new URL(url);
330
+ function parseURL(url2) {
331
+ if (typeof url2 === "string") {
332
+ url2 = new URL(url2);
333
333
  }
334
- if (!url || typeof url !== "object") {
334
+ if (!url2 || typeof url2 !== "object") {
335
335
  throw new InvalidArgumentError("invalid url");
336
336
  }
337
- if (url.port != null && url.port !== "" && !Number.isFinite(parseInt(url.port))) {
337
+ if (url2.port != null && url2.port !== "" && !Number.isFinite(parseInt(url2.port))) {
338
338
  throw new InvalidArgumentError("invalid port");
339
339
  }
340
- if (url.path != null && typeof url.path !== "string") {
340
+ if (url2.path != null && typeof url2.path !== "string") {
341
341
  throw new InvalidArgumentError("invalid path");
342
342
  }
343
- if (url.pathname != null && typeof url.pathname !== "string") {
343
+ if (url2.pathname != null && typeof url2.pathname !== "string") {
344
344
  throw new InvalidArgumentError("invalid pathname");
345
345
  }
346
- if (url.hostname != null && typeof url.hostname !== "string") {
346
+ if (url2.hostname != null && typeof url2.hostname !== "string") {
347
347
  throw new InvalidArgumentError("invalid hostname");
348
348
  }
349
- if (url.origin != null && typeof url.origin !== "string") {
349
+ if (url2.origin != null && typeof url2.origin !== "string") {
350
350
  throw new InvalidArgumentError("invalid origin");
351
351
  }
352
- if (!/^https?:/.test(url.origin || url.protocol)) {
352
+ if (!/^https?:/.test(url2.origin || url2.protocol)) {
353
353
  throw new InvalidArgumentError("invalid protocol");
354
354
  }
355
- if (!(url instanceof URL)) {
356
- const port = url.port != null ? url.port : url.protocol === "https:" ? 443 : 80;
357
- let origin = url.origin != null ? url.origin : `${url.protocol}//${url.hostname}:${port}`;
358
- let path2 = url.path != null ? url.path : `${url.pathname || ""}${url.search || ""}`;
355
+ if (!(url2 instanceof URL)) {
356
+ const port = url2.port != null ? url2.port : url2.protocol === "https:" ? 443 : 80;
357
+ let origin = url2.origin != null ? url2.origin : `${url2.protocol}//${url2.hostname}:${port}`;
358
+ let path2 = url2.path != null ? url2.path : `${url2.pathname || ""}${url2.search || ""}`;
359
359
  if (origin.endsWith("/")) {
360
360
  origin = origin.substring(0, origin.length - 1);
361
361
  }
362
362
  if (path2 && !path2.startsWith("/")) {
363
363
  path2 = `/${path2}`;
364
364
  }
365
- url = new URL(origin + path2);
365
+ url2 = new URL(origin + path2);
366
366
  }
367
- return url;
367
+ return url2;
368
368
  }
369
- function parseOrigin(url) {
370
- url = parseURL(url);
371
- if (url.pathname !== "/" || url.search || url.hash) {
369
+ function parseOrigin(url2) {
370
+ url2 = parseURL(url2);
371
+ if (url2.pathname !== "/" || url2.search || url2.hash) {
372
372
  throw new InvalidArgumentError("invalid url");
373
373
  }
374
- return url;
374
+ return url2;
375
375
  }
376
376
  function getHostname(host) {
377
377
  if (host[0] === "[") {
@@ -4532,8 +4532,8 @@ var require_util2 = __commonJS({
4532
4532
  return request.urlList[request.urlList.length - 1];
4533
4533
  }
4534
4534
  function requestBadPort(request) {
4535
- const url = requestCurrentURL(request);
4536
- if (/^https?:/.test(url.protocol) && badPorts.includes(url.port)) {
4535
+ const url2 = requestCurrentURL(request);
4536
+ if (/^https?:/.test(url2.protocol) && badPorts.includes(url2.port)) {
4537
4537
  return "blocked";
4538
4538
  }
4539
4539
  return "allowed";
@@ -4709,26 +4709,26 @@ var require_util2 = __commonJS({
4709
4709
  default:
4710
4710
  return isNonPotentiallyTrustWorthy ? "no-referrer" : referrerOrigin;
4711
4711
  }
4712
- function stripURLForReferrer(url, originOnly = false) {
4713
- const urlObject = new URL(url.href);
4712
+ function stripURLForReferrer(url2, originOnly = false) {
4713
+ const urlObject = new URL(url2.href);
4714
4714
  urlObject.username = "";
4715
4715
  urlObject.password = "";
4716
4716
  urlObject.hash = "";
4717
4717
  return originOnly ? urlObject.origin : urlObject.href;
4718
4718
  }
4719
4719
  }
4720
- function isURLPotentiallyTrustworthy(url) {
4721
- if (!(url instanceof URL)) {
4720
+ function isURLPotentiallyTrustworthy(url2) {
4721
+ if (!(url2 instanceof URL)) {
4722
4722
  return false;
4723
4723
  }
4724
- if (url.href === "about:blank" || url.href === "about:srcdoc") {
4724
+ if (url2.href === "about:blank" || url2.href === "about:srcdoc") {
4725
4725
  return true;
4726
4726
  }
4727
- if (url.protocol === "data:")
4727
+ if (url2.protocol === "data:")
4728
4728
  return true;
4729
- if (url.protocol === "file:")
4729
+ if (url2.protocol === "file:")
4730
4730
  return true;
4731
- return isOriginPotentiallyTrustworthy(url.origin);
4731
+ return isOriginPotentiallyTrustworthy(url2.origin);
4732
4732
  function isOriginPotentiallyTrustworthy(origin) {
4733
4733
  if (origin == null || origin === "null")
4734
4734
  return false;
@@ -5353,31 +5353,31 @@ var require_dataURL = __commonJS({
5353
5353
  }
5354
5354
  return { mimeType: mimeTypeRecord, body };
5355
5355
  }
5356
- function URLSerializer(url, excludeFragment = false) {
5357
- let output = url.protocol;
5358
- if (url.host.length > 0) {
5356
+ function URLSerializer(url2, excludeFragment = false) {
5357
+ let output = url2.protocol;
5358
+ if (url2.host.length > 0) {
5359
5359
  output += "//";
5360
- if (url.username.length > 0 || url.password.length > 0) {
5361
- output += url.username;
5362
- if (url.password.length > 0) {
5363
- output += ":" + url.password;
5360
+ if (url2.username.length > 0 || url2.password.length > 0) {
5361
+ output += url2.username;
5362
+ if (url2.password.length > 0) {
5363
+ output += ":" + url2.password;
5364
5364
  }
5365
5365
  output += "@";
5366
5366
  }
5367
- output += decodeURIComponent(url.hostname);
5368
- if (url.port.length > 0) {
5369
- output += ":" + url.port;
5367
+ output += decodeURIComponent(url2.hostname);
5368
+ if (url2.port.length > 0) {
5369
+ output += ":" + url2.port;
5370
5370
  }
5371
5371
  }
5372
- if (url.host.length === 0 && url.pathname.length > 1 && url.href.slice(url.protocol.length + 1)[0] === ".") {
5372
+ if (url2.host.length === 0 && url2.pathname.length > 1 && url2.href.slice(url2.protocol.length + 1)[0] === ".") {
5373
5373
  output += "/.";
5374
5374
  }
5375
- output += url.pathname;
5376
- if (url.search.length > 0) {
5377
- output += url.search;
5375
+ output += url2.pathname;
5376
+ if (url2.search.length > 0) {
5377
+ output += url2.search;
5378
5378
  }
5379
- if (excludeFragment === false && url.hash.length > 0) {
5380
- output += url.hash;
5379
+ if (excludeFragment === false && url2.hash.length > 0) {
5380
+ output += url2.hash;
5381
5381
  }
5382
5382
  return output;
5383
5383
  }
@@ -7489,7 +7489,7 @@ var require_client = __commonJS({
7489
7489
  channels.connected = { hasSubscribers: false };
7490
7490
  }
7491
7491
  var Client = class extends DispatcherBase {
7492
- constructor(url, {
7492
+ constructor(url2, {
7493
7493
  interceptors,
7494
7494
  maxHeaderSize,
7495
7495
  headersTimeout,
@@ -7579,7 +7579,7 @@ var require_client = __commonJS({
7579
7579
  });
7580
7580
  }
7581
7581
  this[kInterceptors] = interceptors && interceptors.Client && Array.isArray(interceptors.Client) ? interceptors.Client : [createRedirectInterceptor({ maxRedirections })];
7582
- this[kUrl] = util.parseOrigin(url);
7582
+ this[kUrl] = util.parseOrigin(url2);
7583
7583
  this[kConnector] = connect2;
7584
7584
  this[kSocket] = null;
7585
7585
  this[kPipelining] = pipelining != null ? pipelining : 1;
@@ -10594,10 +10594,10 @@ var require_mock_utils = __commonJS({
10594
10594
  };
10595
10595
  }
10596
10596
  function checkNetConnect(netConnect, origin) {
10597
- const url = new URL(origin);
10597
+ const url2 = new URL(origin);
10598
10598
  if (netConnect === true) {
10599
10599
  return true;
10600
- } else if (Array.isArray(netConnect) && netConnect.some((matcher) => matchValue(matcher, url.host))) {
10600
+ } else if (Array.isArray(netConnect) && netConnect.some((matcher) => matchValue(matcher, url2.host))) {
10601
10601
  return true;
10602
10602
  }
10603
10603
  return false;
@@ -11711,20 +11711,20 @@ var require_response = __commonJS({
11711
11711
  initializeResponse(responseObject, init, { body: body[0], type: "application/json" });
11712
11712
  return responseObject;
11713
11713
  }
11714
- static redirect(url, status = 302) {
11714
+ static redirect(url2, status = 302) {
11715
11715
  const relevantRealm = { settingsObject: {} };
11716
11716
  if (arguments.length < 1) {
11717
11717
  throw new TypeError(
11718
11718
  `Failed to execute 'redirect' on 'Response': 1 argument required, but only ${arguments.length} present.`
11719
11719
  );
11720
11720
  }
11721
- url = webidl.converters.USVString(url);
11721
+ url2 = webidl.converters.USVString(url2);
11722
11722
  status = webidl.converters["unsigned short"](status);
11723
11723
  let parsedURL;
11724
11724
  try {
11725
- parsedURL = new URL(url, getGlobalOrigin());
11725
+ parsedURL = new URL(url2, getGlobalOrigin());
11726
11726
  } catch (err) {
11727
- throw Object.assign(new TypeError("Failed to parse URL from " + url), {
11727
+ throw Object.assign(new TypeError("Failed to parse URL from " + url2), {
11728
11728
  cause: err
11729
11729
  });
11730
11730
  }
@@ -11772,11 +11772,11 @@ var require_response = __commonJS({
11772
11772
  throw new TypeError("Illegal invocation");
11773
11773
  }
11774
11774
  const urlList = this[kState].urlList;
11775
- const url = urlList[urlList.length - 1] ?? null;
11776
- if (url === null) {
11775
+ const url2 = urlList[urlList.length - 1] ?? null;
11776
+ if (url2 === null) {
11777
11777
  return "";
11778
11778
  }
11779
- return URLSerializer(url, true);
11779
+ return URLSerializer(url2, true);
11780
11780
  }
11781
11781
  get redirected() {
11782
11782
  if (!(this instanceof Response)) {
@@ -13548,11 +13548,11 @@ var require_fetch = __commonJS({
13548
13548
  }
13549
13549
  return response;
13550
13550
  async function dispatch({ body }) {
13551
- const url = requestCurrentURL(request);
13551
+ const url2 = requestCurrentURL(request);
13552
13552
  return new Promise((resolve, reject) => fetchParams.controller.dispatcher.dispatch(
13553
13553
  {
13554
- path: url.pathname + url.search,
13555
- origin: url.origin,
13554
+ path: url2.pathname + url2.search,
13555
+ origin: url2.origin,
13556
13556
  method: request.method,
13557
13557
  body: fetchParams.controller.dispatcher.isMockActive ? request.body && request.body.source : body,
13558
13558
  headers: [...request.headersList].flat(),
@@ -14516,12 +14516,12 @@ var require_undici = __commonJS({
14516
14516
  module.exports.buildConnector = buildConnector;
14517
14517
  module.exports.errors = errors;
14518
14518
  function makeDispatcher(fn) {
14519
- return (url, opts, handler) => {
14519
+ return (url2, opts, handler) => {
14520
14520
  if (typeof opts === "function") {
14521
14521
  handler = opts;
14522
14522
  opts = null;
14523
14523
  }
14524
- if (!url || typeof url !== "string" && typeof url !== "object" && !(url instanceof URL)) {
14524
+ if (!url2 || typeof url2 !== "string" && typeof url2 !== "object" && !(url2 instanceof URL)) {
14525
14525
  throw new InvalidArgumentError("invalid url");
14526
14526
  }
14527
14527
  if (opts != null && typeof opts !== "object") {
@@ -14535,12 +14535,12 @@ var require_undici = __commonJS({
14535
14535
  if (!opts.path.startsWith("/")) {
14536
14536
  path2 = `/${path2}`;
14537
14537
  }
14538
- url = new URL(util.parseOrigin(url).origin + path2);
14538
+ url2 = new URL(util.parseOrigin(url2).origin + path2);
14539
14539
  } else {
14540
14540
  if (!opts) {
14541
- opts = typeof url === "object" ? url : {};
14541
+ opts = typeof url2 === "object" ? url2 : {};
14542
14542
  }
14543
- url = util.parseURL(url);
14543
+ url2 = util.parseURL(url2);
14544
14544
  }
14545
14545
  const { agent, dispatcher = getGlobalDispatcher() } = opts;
14546
14546
  if (agent) {
@@ -14548,8 +14548,8 @@ var require_undici = __commonJS({
14548
14548
  }
14549
14549
  return fn.call(dispatcher, {
14550
14550
  ...opts,
14551
- origin: url.origin,
14552
- path: url.search ? `${url.pathname}${url.search}` : url.pathname,
14551
+ origin: url2.origin,
14552
+ path: url2.search ? `${url2.pathname}${url2.search}` : url2.pathname,
14553
14553
  method: opts.method || (opts.body ? "PUT" : "GET")
14554
14554
  }, handler);
14555
14555
  };
@@ -14596,6 +14596,7 @@ var import_undici = __toESM(require_undici(), 1);
14596
14596
  import { workerData } from "node:worker_threads";
14597
14597
  import path from "path";
14598
14598
  import fs from "fs";
14599
+ import url from "url";
14599
14600
  var input = workerData;
14600
14601
  var parsed = path.parse(input.handler);
14601
14602
  var file = [".js", ".jsx", ".mjs", ".cjs"].map((ext) => path.join(input.out, parsed.dir, parsed.name + ext)).find((file2) => {
@@ -14603,7 +14604,8 @@ var file = [".js", ".jsx", ".mjs", ".cjs"].map((ext) => path.join(input.out, par
14603
14604
  });
14604
14605
  var mod;
14605
14606
  try {
14606
- mod = await import(file);
14607
+ const { href } = url.pathToFileURL(file);
14608
+ mod = await import(href);
14607
14609
  } catch (ex) {
14608
14610
  await (0, import_undici.fetch)(`${input.url}/runtime/init/error`, {
14609
14611
  method: "POST",
@@ -14616,6 +14618,7 @@ try {
14616
14618
  trace: ex.stack?.split("\n")
14617
14619
  })
14618
14620
  });
14621
+ process.exit(1);
14619
14622
  }
14620
14623
  var timeout;
14621
14624
  while (true) {