@webflow/webflow-cli 2.1.1 → 2.2.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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,20 @@
1
1
  # @webflow/webflow-cli
2
2
 
3
+ ## 2.2.0
4
+
5
+ ### Minor Changes
6
+
7
+ - 6e9514a: Add an opt-in `camelCaseVariantNames` option to the `devlink-export` section of `webflow.json`. When set to `true`, `webflow export` converts each Variant name into a camelCase React prop value, appending a numeric suffix when two names collide (for example, `Foo-Bar` and `Foo Bar` become `fooBar` and `fooBar2`). It defaults to `false`, so exports are unchanged unless you turn it on.
8
+ - c9ca686: Add `Astro7Builder` (Astro 7 + `@astrojs/cloudflare` v14) to the framework detection hierarchy, registered ahead of `Astro6Builder` so Astro 7+ projects are detected and built correctly by `webflow cloud deploy`.
9
+
10
+ ### Patch Changes
11
+
12
+ - 750d3ed: Add a shared resource-ID resolver helper that resolves siteId, appId, environmentId, and workspaceId in a strict priority order (explicit flag > env var > webflow.json manifest > prompt/error).
13
+ - 081b3bb: Auto-detect non-interactive environments in `isNoInput()`: prompts are now suppressed automatically when `CI=true` or no TTY is attached, so agents and CI pipelines no longer need to pass `--no-input`. Explicit `--no-input` and interactive terminal behavior are unchanged.
14
+ - 261744c: Remove the hardcoded limit of 5 D1 databases, KV namespaces, and R2 buckets when validating a Webflow Cloud wrangler config. Cloud storage is governed by the `feature-cloud-storage` entitlement, which grants storage regardless of plan and imposes no per-binding count. R2 bucket-name validation is unchanged.
15
+ - 0492fab: Gate the `cloud_apps:read` OAuth scope behind the `@next` (beta) build channel. Stable (`@latest`) builds no longer request `cloud_apps:read` during `webflow auth login`, preventing OAuth failures until the scope is approved on the production OAuth app. `cloud_apps:write` is unchanged and still requested in all builds.
16
+ - 3c484be: Update `@module-federation/enhanced` to 2.5.1 for code component bundling.
17
+
3
18
  ## 2.1.1
4
19
 
5
20
  ### Patch Changes
package/README.md CHANGED
@@ -18,6 +18,7 @@ npm install -g @webflow/webflow-cli
18
18
  - [DevLink Import (Code Components)](#devlink-import-code-components)
19
19
  - [DevLink Export](#devlink-export)
20
20
  - [Designer Extensions](#designer-extensions)
21
+ - [Apps (Webflow Cloud)](#apps-webflow-cloud)
21
22
  - [Global Options](#global-options)
22
23
 
23
24
  ---
@@ -234,6 +235,57 @@ webflow extension bundle # Build and package for upload (outputs bundle.z
234
235
 
235
236
  ---
236
237
 
238
+ ## Apps (Webflow Cloud)
239
+
240
+ Manage Webflow Cloud app environment variables non-interactively. `--app-id` and
241
+ `--environment-id` default from `webflow.json` (`cloud.app_id` / `cloud.environment_id`)
242
+ when omitted.
243
+
244
+ ```shell
245
+ webflow apps env-vars list --app-id <appId> --environment-id <envId> # List variables
246
+ webflow apps env-vars set <key> <value> --app-id <appId> --environment-id <envId> # Create or update (plaintext; for secrets use stdin/prompt below)
247
+ webflow apps env-vars set <key> --secret # Prompt (hidden) for a secret value
248
+ printf %s "$VALUE" | webflow apps env-vars set <key> --secret # Read a secret from stdin
249
+ webflow apps env-vars delete <key> --app-id <appId> --environment-id <envId> # Delete a variable
250
+ webflow apps env-vars import .env --app-id <appId> --environment-id <envId> # Bulk import from a .env file
251
+ webflow apps env-vars import .env.secrets --secret # Import every key as a secret
252
+ ```
253
+
254
+ Secret values are encrypted server-side and are never displayed: reads return
255
+ them masked, and `set` / `import` never echo values to stdout, logs, or
256
+ telemetry.
257
+
258
+ For `set`, the value is optional: omit it to read from piped **stdin** or to be
259
+ prompted with hidden input. Prefer this for secrets — passing a value as a
260
+ command-line argument leaves it in your shell history and the process list
261
+ (`set` warns when you do so with `--secret`).
262
+
263
+ ### `env-vars list` options
264
+
265
+ | Flag | Description |
266
+ | ----------------------- | ------------------------------------------------------------------------------------------------- |
267
+ | `--app-id <id>` | Cloud app ID (default: `cloud.app_id` in `webflow.json`) |
268
+ | `--environment-id <id>` | Environment ID (default: `cloud.environment_id` in `webflow.json`) |
269
+ | `--fields <fields>` | Comma-separated columns (key, isSecret, value, id, environmentId). `value` is excluded by default |
270
+ | `--json` | Output as JSON |
271
+
272
+ ### `env-vars set` / `delete` / `import` options
273
+
274
+ | Flag | Description |
275
+ | ----------------------- | ------------------------------------------------------------------ |
276
+ | `--app-id <id>` | Cloud app ID (default: `cloud.app_id` in `webflow.json`) |
277
+ | `--environment-id <id>` | Environment ID (default: `cloud.environment_id` in `webflow.json`) |
278
+ | `--secret` | (`set`, `import`) Mark the variable(s) as an encrypted secret |
279
+ | `--dry-run` | Preview without making any API calls |
280
+ | `--json` | Output as JSON |
281
+
282
+ A plain `set` on an existing secret preserves its secrecy (it never silently
283
+ downgrades a secret to plaintext). `import` reports a per-key
284
+ created/updated/skipped/errors breakdown and exits non-zero if any key fails
285
+ (e.g. a reserved or invalid name). The bulk import is capped at 100 variables.
286
+
287
+ ---
288
+
237
289
  ## Global Options
238
290
 
239
291
  Available on all commands:
@@ -7,6 +7,7 @@ import { getFrameworkDefinition, toMinimalScaffoldId } from "./registry";
7
7
  import type { ScaffoldContent } from "./types";
8
8
  import { ScaffoldError } from "./types";
9
9
  import logger from "../../utils/logger";
10
+ import { isBetaBuild } from "../../utils/release-tag";
10
11
 
11
12
  const GITHUB_TARBALL_BASE = "https://github.com";
12
13
 
@@ -87,7 +88,10 @@ async function fetchScaffoldFromGitHub(
87
88
  );
88
89
  }
89
90
 
90
- const ref = def.source.ref ?? "main";
91
+ const ref =
92
+ (isBetaBuild() ? def.source.betaRef : undefined) ??
93
+ def.source.ref ??
94
+ "main";
91
95
  const tarballUrl = `${GITHUB_TARBALL_BASE}/${def.source.repo}/archive/${ref}.tar.gz`;
92
96
 
93
97
  const extractDir = await fs.promises.mkdtemp(
@@ -24,6 +24,14 @@ import { ScaffoldError } from "./types";
24
24
  * ships the breaking change.
25
25
  *
26
26
  * Old `vN` branches stay frozen — we don't backport fixes.
27
+ *
28
+ * Exception: the `astro-minimal`/`astro` entries additionally set `betaRef`
29
+ * to a framework-version branch name (`astro7`) rather than the next `vN`.
30
+ * `betaRef` is only used on beta (`@next`) builds — see `isBetaBuild()` and
31
+ * `fetcher.ts` — so `cloud init` keeps scaffolding Astro 6 (`ref: "v2"`) on
32
+ * stable until Astro 7 support lands on the cosmic-builder side (CLD-2148)
33
+ * and the CLI's own E2E coverage (CLD-2216) is green, at which point `betaRef`
34
+ * is promoted to `ref`.
27
35
  */
28
36
  export const FRAMEWORK_REGISTRY: Record<string, FrameworkDefinition> = {
29
37
  "astro-minimal": {
@@ -33,6 +41,7 @@ export const FRAMEWORK_REGISTRY: Record<string, FrameworkDefinition> = {
33
41
  type: "github",
34
42
  repo: "Webflow-Examples/hello-world-astro",
35
43
  ref: "v2",
44
+ betaRef: "astro7",
36
45
  },
37
46
  },
38
47
  "nextjs-minimal": {
@@ -51,6 +60,7 @@ export const FRAMEWORK_REGISTRY: Record<string, FrameworkDefinition> = {
51
60
  type: "github",
52
61
  repo: "Webflow-Examples/hello-world-astro-devlink",
53
62
  ref: "v2",
63
+ betaRef: "astro7",
54
64
  },
55
65
  },
56
66
  nextjs: {
@@ -8,6 +8,12 @@ export interface GitHubScaffoldSource {
8
8
  repo: string;
9
9
  /** Branch or tag. Default: "main" */
10
10
  ref?: string;
11
+ /**
12
+ * Branch or tag used instead of `ref` on beta (`@next`) builds — see
13
+ * `isBetaBuild()`. Lets a scaffold's contract move ahead on the pre-release
14
+ * channel before it's promoted to `ref` for stable.
15
+ */
16
+ betaRef?: string;
11
17
  }
12
18
 
13
19
  /**