@stacksjs/ts-cloud 0.7.62 → 0.7.63

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 (56) hide show
  1. package/dist/bin/cli.js +242 -242
  2. package/dist/{chunk-vx2yva1a.js → chunk-0zbqbrqg.js} +8 -4
  3. package/dist/{chunk-ff77qy0c.js → chunk-t092y37p.js} +1 -1
  4. package/dist/deploy/index.js +2 -2
  5. package/dist/drivers/index.js +1 -1
  6. package/dist/drivers/shared/releases.d.ts +11 -0
  7. package/dist/index.js +2 -2
  8. package/dist/ui/access-denied.html +2 -2
  9. package/dist/ui/account/automation.html +4 -4
  10. package/dist/ui/account/security.html +2 -2
  11. package/dist/ui/applications/compose.html +4 -4
  12. package/dist/ui/applications/new.html +2 -2
  13. package/dist/ui/data/backups.html +4 -4
  14. package/dist/ui/data/services.html +4 -4
  15. package/dist/ui/data/volumes.html +4 -4
  16. package/dist/ui/index.html +4 -4
  17. package/dist/ui/integrations.html +2 -2
  18. package/dist/ui/operations/alerts.html +4 -4
  19. package/dist/ui/operations/configuration.html +4 -4
  20. package/dist/ui/operations/jobs.html +4 -4
  21. package/dist/ui/operations/maintenance.html +3 -3
  22. package/dist/ui/operations/observability.html +4 -4
  23. package/dist/ui/operations/previews.html +4 -4
  24. package/dist/ui/operations/queue.html +4 -4
  25. package/dist/ui/operations/regions.html +4 -4
  26. package/dist/ui/operations/releases.html +4 -4
  27. package/dist/ui/operations/workloads.html +4 -4
  28. package/dist/ui/security.html +2 -2
  29. package/dist/ui/server/actions.html +3 -3
  30. package/dist/ui/server/activity.html +2 -2
  31. package/dist/ui/server/capacity.html +4 -4
  32. package/dist/ui/server/database.html +4 -4
  33. package/dist/ui/server/deployments.html +4 -4
  34. package/dist/ui/server/diagnostics.html +2 -2
  35. package/dist/ui/server/firewall.html +4 -4
  36. package/dist/ui/server/fleet.html +4 -4
  37. package/dist/ui/server/logs.html +4 -4
  38. package/dist/ui/server/metrics.html +2 -2
  39. package/dist/ui/server/security.html +2 -2
  40. package/dist/ui/server/services.html +2 -2
  41. package/dist/ui/server/sites.html +4 -4
  42. package/dist/ui/server/ssh-keys.html +4 -4
  43. package/dist/ui/server/team.html +4 -4
  44. package/dist/ui/server/terminal.html +2 -2
  45. package/dist/ui/serverless/alarms.html +4 -4
  46. package/dist/ui/serverless/assets.html +2 -2
  47. package/dist/ui/serverless/data.html +4 -4
  48. package/dist/ui/serverless/deployments.html +2 -2
  49. package/dist/ui/serverless/functions.html +4 -4
  50. package/dist/ui/serverless/logs.html +4 -4
  51. package/dist/ui/serverless/metrics.html +2 -2
  52. package/dist/ui/serverless/queues.html +4 -4
  53. package/dist/ui/serverless/secrets.html +4 -4
  54. package/dist/ui/serverless/traces.html +4 -4
  55. package/dist/ui/serverless.html +3 -3
  56. package/package.json +3 -3
@@ -3832,6 +3832,12 @@ function buildResetReleaseDir(paths) {
3832
3832
  "fi"
3833
3833
  ];
3834
3834
  }
3835
+ function buildStrandedReleaseTrap(paths) {
3836
+ const live = `TS_CLOUD_TRAP_LIVE="$(readlink -f ${paths.current} 2>/dev/null || true)"`;
3837
+ const target = `TS_CLOUD_TRAP_TARGET="$(readlink -f ${paths.release} 2>/dev/null || echo ${paths.release})"`;
3838
+ const body = `if [ $? -ne 0 ]; then ${live}; ${target}; [ "$TS_CLOUD_TRAP_LIVE" = "$TS_CLOUD_TRAP_TARGET" ] || rm -rf ${paths.release}; fi`;
3839
+ return `trap '${body}' EXIT`;
3840
+ }
3835
3841
  function buildIsReleaseLive(paths) {
3836
3842
  return [
3837
3843
  `TS_CLOUD_LIVE_PATH="$(readlink -f ${paths.current} 2>/dev/null || true)"`,
@@ -3964,8 +3970,7 @@ function buildSiteDeployScript(options) {
3964
3970
  const stageRelease = [
3965
3971
  "set -euo pipefail",
3966
3972
  ...buildDeployLock(paths),
3967
- ...buildIsReleaseLive(paths),
3968
- `trap 'if [ $? -ne 0 ] && [ "$TS_CLOUD_IS_LIVE" != "yes" ]; then rm -rf ${paths.release}; fi' EXIT`,
3973
+ buildStrandedReleaseTrap(paths),
3969
3974
  ...artifactFetch,
3970
3975
  ...buildEnsureReleaseLayout(paths, sharedPaths),
3971
3976
  ...buildResetReleaseDir(paths),
@@ -4054,8 +4059,7 @@ function buildStaticSiteDeployScript(options) {
4054
4059
  return [
4055
4060
  "set -euo pipefail",
4056
4061
  ...buildDeployLock(paths),
4057
- ...buildIsReleaseLive(paths),
4058
- `trap 'if [ $? -ne 0 ] && [ "$TS_CLOUD_IS_LIVE" != "yes" ]; then rm -rf ${paths.release}; fi' EXIT`,
4062
+ buildStrandedReleaseTrap(paths),
4059
4063
  ...artifactFetch,
4060
4064
  ...buildEnsureReleaseLayout(paths, []),
4061
4065
  ...buildResetReleaseDir(paths),
@@ -45,7 +45,7 @@ import {
45
45
  resolveSiteKind,
46
46
  resolveUiSource,
47
47
  siteInstallBase
48
- } from "./chunk-vx2yva1a.js";
48
+ } from "./chunk-0zbqbrqg.js";
49
49
  import {
50
50
  artifactKey,
51
51
  buildCloudFormationTemplate,
@@ -32,7 +32,7 @@ import {
32
32
  synchronizeDashboardUsers,
33
33
  trackDashboardOperation,
34
34
  verifyStaticApiOrigin
35
- } from "../chunk-ff77qy0c.js";
35
+ } from "../chunk-t092y37p.js";
36
36
  import {
37
37
  deleteStaticSite,
38
38
  deployStaticSite,
@@ -65,7 +65,7 @@ import {
65
65
  shipsARelease,
66
66
  siteInstallBase,
67
67
  validateDeploymentConfig
68
- } from "../chunk-vx2yva1a.js";
68
+ } from "../chunk-0zbqbrqg.js";
69
69
  import"../chunk-tq46tnxv.js";
70
70
  import"../chunk-703nkybg.js";
71
71
  import"../chunk-4cjrg98a.js";
@@ -52,7 +52,7 @@ import {
52
52
  waitForCloudInit,
53
53
  waitForSsh,
54
54
  wrapCloudInitUserData
55
- } from "../chunk-vx2yva1a.js";
55
+ } from "../chunk-0zbqbrqg.js";
56
56
  import"../chunk-tq46tnxv.js";
57
57
  import"../chunk-703nkybg.js";
58
58
  import"../chunk-4cjrg98a.js";
@@ -70,6 +70,17 @@ export declare function buildDeployLock(paths: ReleasePaths, waitSeconds?: numbe
70
70
  * two renames, which is atomic enough that no request lands mid-swap.
71
71
  */
72
72
  export declare function buildResetReleaseDir(paths: ReleasePaths): string[];
73
+ /**
74
+ * Remove a half-built release if the deploy fails before it went live.
75
+ *
76
+ * The check has to run *when the trap fires*, not when it is armed. A deploy
77
+ * arms this at the top and activates the release much later, so a value
78
+ * computed up front says "not live" for the rest of the script — and a failure
79
+ * in any step after activation would then delete the release the site had just
80
+ * started serving. Both paths are resolved at that moment for the reason in
81
+ * {@link buildIsReleaseLive}.
82
+ */
83
+ export declare function buildStrandedReleaseTrap(paths: ReleasePaths): string;
73
84
  /**
74
85
  * Set `TS_CLOUD_IS_LIVE` to "yes" when `current` resolves to this release.
75
86
  *
package/dist/index.js CHANGED
@@ -285,7 +285,7 @@ import {
285
285
  volumeCapabilities,
286
286
  webhookEndpoint,
287
287
  zeroCapacity
288
- } from "./chunk-ff77qy0c.js";
288
+ } from "./chunk-t092y37p.js";
289
289
  import {
290
290
  deleteStaticSite,
291
291
  deployStaticSite,
@@ -398,7 +398,7 @@ import {
398
398
  waitForCloudInit,
399
399
  waitForSsh,
400
400
  wrapCloudInitUserData
401
- } from "./chunk-vx2yva1a.js";
401
+ } from "./chunk-0zbqbrqg.js";
402
402
  import {
403
403
  ABTestManager,
404
404
  AI,