@sylphx/cli 0.14.12 → 0.14.14

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/CHANGELOG.md CHANGED
@@ -1,5 +1,18 @@
1
1
  # @sylphx/cli
2
2
 
3
+ ## 0.14.14
4
+
5
+ ### Patch Changes
6
+
7
+ - [#1807](https://github.com/SylphxAI/platform/pull/1807) [`e9e6190`](https://github.com/SylphxAI/platform/commit/e9e6190fec0ebfb9ff71999b57e0b9254bdd51ae) Thanks [@shtse8](https://github.com/shtse8)! - Publish project manifests before triggering `sylphx deploy`, so management
8
+ deploys use the local `sylphx.toml` as the desired-state source of truth.
9
+
10
+ ## 0.14.13
11
+
12
+ ### Patch Changes
13
+
14
+ - [#1798](https://github.com/SylphxAI/platform/pull/1798) [`9b52313`](https://github.com/SylphxAI/platform/commit/9b52313107975e133eb6cdf6028b349f228d075c) Thanks [@shtse8](https://github.com/shtse8)! - Treat `running` deployments as ready in `sylphx deployments wait`.
15
+
3
16
  ## 0.14.12
4
17
 
5
18
  ### Patch Changes
package/dist/main.js CHANGED
@@ -15,7 +15,7 @@ var init_package = __esm({
15
15
  "package.json"() {
16
16
  package_default = {
17
17
  name: "@sylphx/cli",
18
- version: "0.14.12",
18
+ version: "0.14.14",
19
19
  description: "Sylphx Platform CLI \u2014 deploy and manage your applications from the terminal. 63 commands across deployment, logs, env vars, domains, databases, storage, monitoring, self-service (user), admin (users/quotas/audit/invitations/jwt-keys/project-migrate), and more.",
20
20
  type: "module",
21
21
  homepage: "https://sylphx.com",
@@ -25650,6 +25650,15 @@ function apiErrorToCli(command) {
25650
25650
  });
25651
25651
  };
25652
25652
  }
25653
+ function pushManifestToProjectEffect(input) {
25654
+ return Effect23.tryPromise({
25655
+ try: () => authedFetch(`/projects/${input.projectId}/manifest`, {
25656
+ method: "PUT",
25657
+ body: JSON.stringify(input.manifest)
25658
+ }),
25659
+ catch: apiErrorToCli(input.command)
25660
+ });
25661
+ }
25653
25662
  function configPullEffect(input) {
25654
25663
  return Effect23.gen(function* () {
25655
25664
  yield* requireAuthEffect;
@@ -25712,12 +25721,10 @@ function configPushEffect(input) {
25712
25721
  const local = yield* loadManifestEffect(input.file).pipe(
25713
25722
  Effect23.mapError(toCliError("config push"))
25714
25723
  );
25715
- const response = yield* Effect23.tryPromise({
25716
- try: () => authedFetch(`/projects/${linked.projectId}/manifest`, {
25717
- method: "PUT",
25718
- body: JSON.stringify(local.manifest)
25719
- }),
25720
- catch: apiErrorToCli("config push")
25724
+ const response = yield* pushManifestToProjectEffect({
25725
+ command: "config push",
25726
+ manifest: local.manifest,
25727
+ projectId: linked.projectId
25721
25728
  });
25722
25729
  yield* Console13.log("");
25723
25730
  yield* Console13.log(
@@ -26806,7 +26813,8 @@ init_effect_io();
26806
26813
  import { Effect as Effect28, Schedule as Schedule2 } from "effect";
26807
26814
  var DEPLOYMENT_WAIT_POLL_INTERVAL_MS = 2e3;
26808
26815
  var DEPLOYMENT_WAIT_DEFAULT_TIMEOUT_MS = 10 * 60 * 1e3;
26809
- var DEPLOYMENT_TERMINAL_STATUSES = /* @__PURE__ */ new Set(["success", "failed", "cancelled", "canceled"]);
26816
+ var DEPLOYMENT_READY_STATUSES = /* @__PURE__ */ new Set(["success", "running"]);
26817
+ var DEPLOYMENT_TERMINAL_FAILURE_STATUSES = /* @__PURE__ */ new Set(["failed", "cancelled", "canceled"]);
26810
26818
  function parseDeploymentWaitTimeoutMs(raw, defaultMs = DEPLOYMENT_WAIT_DEFAULT_TIMEOUT_MS) {
26811
26819
  const match = raw.match(/^\s*(\d+)\s*(ms|s|m|h)?\s*$/i);
26812
26820
  if (!match) return defaultMs;
@@ -26829,7 +26837,8 @@ function waitForDeploymentSuccessEffect(api2, opts) {
26829
26837
  const tick = Effect28.gen(function* () {
26830
26838
  const detail = yield* opts.orgId ? api2.getDeployment(opts.id, { orgId: opts.orgId }) : api2.getDeployment(opts.id);
26831
26839
  const status3 = (detail.status ?? "").toLowerCase();
26832
- if (!DEPLOYMENT_TERMINAL_STATUSES.has(status3)) {
26840
+ if (DEPLOYMENT_READY_STATUSES.has(status3)) return detail;
26841
+ if (!DEPLOYMENT_TERMINAL_FAILURE_STATUSES.has(status3)) {
26833
26842
  return yield* Effect28.fail(
26834
26843
  new CliCommandError({
26835
26844
  command,
@@ -26838,7 +26847,6 @@ function waitForDeploymentSuccessEffect(api2, opts) {
26838
26847
  })
26839
26848
  );
26840
26849
  }
26841
- if (status3 === "success") return detail;
26842
26850
  return yield* Effect28.fail(
26843
26851
  new CliCommandError({
26844
26852
  command,
@@ -27326,6 +27334,19 @@ function deployEffect(env, opts = {}) {
27326
27334
  const target = env ?? targetProject.defaultEnv;
27327
27335
  const reconcileTimeoutMs = resolveDeployReconcileTimeoutMs(opts.waitTimeout);
27328
27336
  const manifest = yield* preflightManifestEffect(opts.skipManifest ?? false);
27337
+ if (manifest) {
27338
+ const response = yield* withSpinner(
27339
+ "Publishing manifest...",
27340
+ pushManifestToProjectEffect({
27341
+ command: "deploy",
27342
+ manifest,
27343
+ projectId: targetProject.projectId
27344
+ })
27345
+ );
27346
+ yield* Console17.log(
27347
+ chalk_default.dim(` \u2713 Manifest v${response.version} published (${response.updatedAt})`)
27348
+ );
27349
+ }
27329
27350
  const frameworkSignals = yield* Effect29.tryPromise({
27330
27351
  try: () => detectFrameworkSignals(manifest),
27331
27352
  catch: () => null
@@ -27494,8 +27515,8 @@ function readExt(d) {
27494
27515
  }
27495
27516
  function statusColour3(status3) {
27496
27517
  const s = (status3 || "").toLowerCase();
27497
- if (s === "success") return chalk_default.green(status3);
27498
- if (s === "running" || s === "building" || s === "queued") return chalk_default.yellow(status3);
27518
+ if (s === "success" || s === "running") return chalk_default.green(status3);
27519
+ if (s === "building" || s === "queued") return chalk_default.yellow(status3);
27499
27520
  if (s === "failed" || s === "cancelled" || s === "canceled") return chalk_default.red(status3);
27500
27521
  return chalk_default.white(status3);
27501
27522
  }
@@ -27690,7 +27711,7 @@ function deploymentsWaitEffect(opts) {
27690
27711
  yield* makeFormatter(output).print(
27691
27712
  result,
27692
27713
  (view) => Console18.log(
27693
- chalk_default.green(`\u2713 Deployment ${chalk_default.bold(view.id)} completed: ${view.status ?? "success"}`)
27714
+ chalk_default.green(`\u2713 Deployment ${chalk_default.bold(view.id)} ready: ${view.status ?? "success"}`)
27694
27715
  )
27695
27716
  );
27696
27717
  });
@@ -27807,7 +27828,7 @@ var waitCmd = Command18.make(
27807
27828
  timeoutMs: parseDeploymentWaitTimeoutMs(timeout),
27808
27829
  output
27809
27830
  })
27810
- ).pipe(Command18.withDescription("Wait for a deployment to reach a terminal state"));
27831
+ ).pipe(Command18.withDescription("Wait for a deployment to reach a ready state"));
27811
27832
  var deploymentsCommand = Command18.make(
27812
27833
  "deployments",
27813
27834
  {