@stacksjs/ts-cloud 0.7.86 → 0.7.87

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 (58) hide show
  1. package/dist/bin/cli.js +440 -440
  2. package/dist/{chunk-1qjyqrc5.js → chunk-24kwnpe5.js} +2 -0
  3. package/dist/{chunk-d2aw5vyv.js → chunk-aqmdexc3.js} +1 -1
  4. package/dist/{chunk-4erbrg3e.js → chunk-cj3qrktr.js} +4 -4
  5. package/dist/{chunk-ztbn47we.js → chunk-tcr4xba6.js} +21 -4
  6. package/dist/{chunk-tq4v58zp.js → chunk-w61hh7n3.js} +2 -2
  7. package/dist/deploy/index.js +4 -4
  8. package/dist/drivers/index.js +2 -2
  9. package/dist/drivers/shared/rpx-gateway.d.ts +1 -0
  10. package/dist/index.js +4 -4
  11. package/dist/ui/access-denied.html +2 -2
  12. package/dist/ui/account/automation.html +3 -3
  13. package/dist/ui/account/security.html +2 -2
  14. package/dist/ui/applications/compose.html +4 -4
  15. package/dist/ui/applications/new.html +2 -2
  16. package/dist/ui/data/backups.html +4 -4
  17. package/dist/ui/data/services.html +3 -3
  18. package/dist/ui/data/volumes.html +4 -4
  19. package/dist/ui/index.html +4 -4
  20. package/dist/ui/operations/alerts.html +3 -3
  21. package/dist/ui/operations/configuration.html +4 -4
  22. package/dist/ui/operations/jobs.html +4 -4
  23. package/dist/ui/operations/maintenance.html +4 -4
  24. package/dist/ui/operations/observability.html +4 -4
  25. package/dist/ui/operations/previews.html +3 -3
  26. package/dist/ui/operations/queue.html +3 -3
  27. package/dist/ui/operations/regions.html +4 -4
  28. package/dist/ui/operations/releases.html +4 -4
  29. package/dist/ui/operations/workloads.html +4 -4
  30. package/dist/ui/security.html +2 -2
  31. package/dist/ui/server/actions.html +3 -3
  32. package/dist/ui/server/activity.html +2 -2
  33. package/dist/ui/server/capacity.html +4 -4
  34. package/dist/ui/server/database.html +4 -4
  35. package/dist/ui/server/deployments.html +4 -4
  36. package/dist/ui/server/diagnostics.html +2 -2
  37. package/dist/ui/server/firewall.html +4 -4
  38. package/dist/ui/server/fleet.html +4 -4
  39. package/dist/ui/server/logs.html +4 -4
  40. package/dist/ui/server/metrics.html +4 -4
  41. package/dist/ui/server/services.html +2 -2
  42. package/dist/ui/server/sites.html +4 -4
  43. package/dist/ui/server/ssh-keys.html +4 -4
  44. package/dist/ui/server/team.html +4 -4
  45. package/dist/ui/server/terminal.html +2 -2
  46. package/dist/ui/serverless/alarms.html +4 -4
  47. package/dist/ui/serverless/assets.html +2 -2
  48. package/dist/ui/serverless/cost.html +2 -2
  49. package/dist/ui/serverless/data.html +4 -4
  50. package/dist/ui/serverless/deployments.html +2 -2
  51. package/dist/ui/serverless/firewall.html +2 -2
  52. package/dist/ui/serverless/functions.html +3 -3
  53. package/dist/ui/serverless/logs.html +4 -4
  54. package/dist/ui/serverless/queues.html +4 -4
  55. package/dist/ui/serverless/secrets.html +4 -4
  56. package/dist/ui/serverless/traces.html +4 -4
  57. package/dist/ui/serverless.html +3 -3
  58. package/package.json +3 -3
@@ -22000,6 +22000,8 @@ function resolveManagementDashboardSites(config, environment, opts) {
22000
22000
  start: `bun ${DASHBOARD_ENTRY} dashboard:serve --box --host 127.0.0.1 --port ${port}`,
22001
22001
  port,
22002
22002
  env: {
22003
+ APP_ENV: "production",
22004
+ NODE_ENV: "production",
22003
22005
  TS_CLOUD_DASHBOARD_TELEMETRY: "1"
22004
22006
  },
22005
22007
  zeroDowntime: false,
@@ -8,7 +8,7 @@ import {
8
8
  phpRuntimeLayerAssets,
9
9
  runPhpBuildHooks,
10
10
  sha256
11
- } from "./chunk-1qjyqrc5.js";
11
+ } from "./chunk-24kwnpe5.js";
12
12
 
13
13
  // src/deploy/serverless-image.ts
14
14
  import { execFileSync } from "node:child_process";
@@ -9,7 +9,7 @@ import {
9
9
  step,
10
10
  success,
11
11
  warn
12
- } from "./chunk-d2aw5vyv.js";
12
+ } from "./chunk-aqmdexc3.js";
13
13
  import {
14
14
  AwsBackupClient,
15
15
  CloudWatchLogsClient,
@@ -45,7 +45,7 @@ import {
45
45
  resolveSiteKind,
46
46
  resolveUiSource,
47
47
  siteInstallBase
48
- } from "./chunk-ztbn47we.js";
48
+ } from "./chunk-tcr4xba6.js";
49
49
  import {
50
50
  artifactKey,
51
51
  buildCloudFormationTemplate,
@@ -67,7 +67,7 @@ import {
67
67
  resolveStatePath,
68
68
  setStateDir,
69
69
  statePath
70
- } from "./chunk-1qjyqrc5.js";
70
+ } from "./chunk-24kwnpe5.js";
71
71
  import {
72
72
  SSMClient
73
73
  } from "./chunk-7m60qnc8.js";
@@ -8324,7 +8324,7 @@ async function deployServerlessApp(config, environment2, opts = {}) {
8324
8324
  }
8325
8325
  if (imageMode) {
8326
8326
  step("Building + pushing container image");
8327
- const { buildAndPushServerlessImage } = await import("./chunk-tq4v58zp.js");
8327
+ const { buildAndPushServerlessImage } = await import("./chunk-w61hh7n3.js");
8328
8328
  const built = await buildAndPushServerlessImage({
8329
8329
  app,
8330
8330
  projectRoot,
@@ -8,7 +8,7 @@ import {
8
8
  resolveProjectStackName,
9
9
  resolveStatePath,
10
10
  statePath
11
- } from "./chunk-1qjyqrc5.js";
11
+ } from "./chunk-24kwnpe5.js";
12
12
  import {
13
13
  EC2Client,
14
14
  SSMClient
@@ -1255,6 +1255,7 @@ function usesRpxProxy(compute) {
1255
1255
  var RPX_DIR = "/etc/rpx";
1256
1256
  var RPX_INSTALL_DIR = "/opt/rpx-gateway";
1257
1257
  var RPX_LAUNCHER_PATH = "/etc/rpx/gateway.ts";
1258
+ var RPX_BINARY_PATH = "/etc/rpx/gateway";
1258
1259
  var RPX_SERVICE_NAME = "rpx-gateway.service";
1259
1260
  var RPX_SITES_DIR = "/etc/rpx/sites.d";
1260
1261
  function renderRpxAssembler(sitesDir = RPX_SITES_DIR, defaultCertsDir = DEFAULT_RPX_CERTS_DIR) {
@@ -1460,6 +1461,9 @@ function buildRpxProvisionScript(options) {
1460
1461
  `ln -sfn ${RPX_INSTALL_DIR}/node_modules ${RPX_DIR}/node_modules`,
1461
1462
  ...writeFileHeredoc(`${RPX_SITES_DIR}/${slug}.json`, fragment, "TS_CLOUD_RPX_FRAGMENT_EOF", "0600"),
1462
1463
  ...writeFileHeredoc(RPX_LAUNCHER_PATH, assembler, "TS_CLOUD_RPX_EOF"),
1464
+ `${bunBin} build --production --compile --outfile ${RPX_BINARY_PATH}.next ${RPX_LAUNCHER_PATH}`,
1465
+ `chmod 0755 ${RPX_BINARY_PATH}.next`,
1466
+ `mv -f ${RPX_BINARY_PATH}.next ${RPX_BINARY_PATH}`,
1463
1467
  ...writeFileHeredoc(`/etc/systemd/system/${RPX_SERVICE_NAME}`, [
1464
1468
  "[Unit]",
1465
1469
  "Description=rpx reverse-proxy gateway (managed by ts-cloud)",
@@ -1468,9 +1472,11 @@ function buildRpxProvisionScript(options) {
1468
1472
  "",
1469
1473
  "[Service]",
1470
1474
  "Type=simple",
1471
- `ExecStart=${bunBin} ${RPX_LAUNCHER_PATH}`,
1475
+ `ExecStart=${RPX_BINARY_PATH}`,
1472
1476
  `WorkingDirectory=${RPX_INSTALL_DIR}`,
1473
1477
  `Environment=BUN_INSTALL=/root/.bun`,
1478
+ `Environment=APP_ENV=production`,
1479
+ `Environment=NODE_ENV=production`,
1474
1480
  ...poolEnv,
1475
1481
  "MemoryAccounting=true",
1476
1482
  `MemoryHigh=${memoryHigh}`,
@@ -5216,7 +5222,12 @@ var STACKS_CLI = "storage/framework/core/buddy/src/cli.ts";
5216
5222
  var stacksDriver = {
5217
5223
  id: "stacks",
5218
5224
  wrapExec: (command) => command,
5219
- execEnv: { PATH: "/usr/local/bin:/usr/bin:/bin", BUN_INSTALL: "/root/.bun" },
5225
+ execEnv: {
5226
+ PATH: "/usr/local/bin:/usr/bin:/bin",
5227
+ BUN_INSTALL: "/root/.bun",
5228
+ APP_ENV: "production",
5229
+ NODE_ENV: "production"
5230
+ },
5220
5231
  schedulerMode: "daemon",
5221
5232
  schedulerCommand: () => `${BUN_BIN} ${STACKS_CLI} schedule:run`,
5222
5233
  queueWorkerCommand: (worker, { current }) => {
@@ -5702,7 +5713,13 @@ async function deploySiteRelease(driver, options, logger = noopLogger2) {
5702
5713
  const dbEnv = outputs.servicesPrivateIp ? buildFleetServicesEnv(outputs.servicesPrivateIp, resolveAppDatabase(config)) : buildManagedDbEnv(resolveAppDatabase(config));
5703
5714
  const compute = config.infrastructure?.compute;
5704
5715
  const proxyEnv = usesRpxProxy(compute) ? { HOST: "127.0.0.1" } : {};
5705
- const envWithServices = { ...dbEnv, ...proxyEnv, ...site.env || {} };
5716
+ const productionEnv = environment === "production" ? { APP_ENV: "production", NODE_ENV: "production" } : {};
5717
+ const envWithServices = {
5718
+ ...dbEnv,
5719
+ ...proxyEnv,
5720
+ ...site.env || {},
5721
+ ...productionEnv
5722
+ };
5706
5723
  if (isPhpSite(site)) {
5707
5724
  const phpVersion = site.phpVersion ?? compute?.php?.default ?? compute?.php?.versions?.[0];
5708
5725
  const appBase2 = siteInstallBase(slug, siteName);
@@ -1,8 +1,8 @@
1
1
  import {
2
2
  buildAndPushServerlessImage
3
- } from "./chunk-d2aw5vyv.js";
3
+ } from "./chunk-aqmdexc3.js";
4
4
  import"./chunk-50jpda9q.js";
5
- import"./chunk-1qjyqrc5.js";
5
+ import"./chunk-24kwnpe5.js";
6
6
  import"./chunk-zqtpg06c.js";
7
7
  import"./chunk-v0bahtg2.js";
8
8
  export {
@@ -30,7 +30,7 @@ import {
30
30
  synchronizeDashboardUsers,
31
31
  trackDashboardOperation,
32
32
  verifyStaticApiOrigin
33
- } from "../chunk-4erbrg3e.js";
33
+ } from "../chunk-cj3qrktr.js";
34
34
  import {
35
35
  deleteStaticSite,
36
36
  deployStaticSite,
@@ -44,7 +44,7 @@ import {
44
44
  } from "../chunk-ef2dwfrg.js";
45
45
  import {
46
46
  buildAndPushServerlessImage
47
- } from "../chunk-d2aw5vyv.js";
47
+ } from "../chunk-aqmdexc3.js";
48
48
  import"../chunk-ybcz6sxc.js";
49
49
  import"../chunk-01d86gt1.js";
50
50
  import"../chunk-50jpda9q.js";
@@ -70,8 +70,8 @@ import {
70
70
  siteInstallBase,
71
71
  validateDeploymentConfig,
72
72
  verifyAddressRecord
73
- } from "../chunk-ztbn47we.js";
74
- import"../chunk-1qjyqrc5.js";
73
+ } from "../chunk-tcr4xba6.js";
74
+ import"../chunk-24kwnpe5.js";
75
75
  import"../chunk-7m60qnc8.js";
76
76
  import"../chunk-4cjrg98a.js";
77
77
  import"../chunk-hpv68b4a.js";
@@ -68,8 +68,8 @@ import {
68
68
  waitForSsh,
69
69
  wrapCloudInitUserData,
70
70
  writeResizeCheckpoint
71
- } from "../chunk-ztbn47we.js";
72
- import"../chunk-1qjyqrc5.js";
71
+ } from "../chunk-tcr4xba6.js";
72
+ import"../chunk-24kwnpe5.js";
73
73
  import"../chunk-7m60qnc8.js";
74
74
  import"../chunk-4cjrg98a.js";
75
75
  import"../chunk-wj3s95p9.js";
@@ -230,6 +230,7 @@ export declare function usesRpxProxy(compute?: {
230
230
  export declare const RPX_DIR = "/etc/rpx";
231
231
  export declare const RPX_INSTALL_DIR = "/opt/rpx-gateway";
232
232
  export declare const RPX_LAUNCHER_PATH = "/etc/rpx/gateway.ts";
233
+ export declare const RPX_BINARY_PATH = "/etc/rpx/gateway";
233
234
  export declare const RPX_SERVICE_NAME = "rpx-gateway.service";
234
235
  /**
235
236
  * Per-app gateway registry. Each project's deploy writes ONLY its own fragment
package/dist/index.js CHANGED
@@ -283,7 +283,7 @@ import {
283
283
  volumeCapabilities,
284
284
  webhookEndpoint,
285
285
  zeroCapacity
286
- } from "./chunk-4erbrg3e.js";
286
+ } from "./chunk-cj3qrktr.js";
287
287
  import {
288
288
  deleteStaticSite,
289
289
  deployStaticSite,
@@ -297,7 +297,7 @@ import {
297
297
  } from "./chunk-ef2dwfrg.js";
298
298
  import {
299
299
  buildAndPushServerlessImage
300
- } from "./chunk-d2aw5vyv.js";
300
+ } from "./chunk-aqmdexc3.js";
301
301
  import {
302
302
  ApplicationAutoScalingClient,
303
303
  BedrockClient,
@@ -403,7 +403,7 @@ import {
403
403
  waitForCloudInit,
404
404
  waitForSsh,
405
405
  wrapCloudInitUserData
406
- } from "./chunk-ztbn47we.js";
406
+ } from "./chunk-tcr4xba6.js";
407
407
  import {
408
408
  ABTestManager,
409
409
  AI,
@@ -817,7 +817,7 @@ import {
817
817
  withSecurity,
818
818
  withTimeout,
819
819
  xrayManager
820
- } from "./chunk-1qjyqrc5.js";
820
+ } from "./chunk-24kwnpe5.js";
821
821
  import {
822
822
  EC2Client,
823
823
  SSMClient