From 0bc2153609b88e03cb4383241c20349ea93ee260 Mon Sep 17 00:00:00 2001 From: Alfonso Noriega Date: Wed, 15 Apr 2026 14:02:20 +0200 Subject: [PATCH 1/2] Make Homebrew packaging script version-agnostic - Rename packaging/3/ to packaging/stable/ so the template directory is not tied to the CLI major version - Update getTemplateVersion() to match any stable semver (was hardcoded to ^3.x) - Stop updating shopify-cli@3.rb when the major version is 4+; that formula stays frozen at the last 3.x release - Fix hardcoded 'Shopify CLI 3 formula' in the Homebrew PR commit message - Merge changeset bump-type reflection into a single PR template checkbox --- .github/PULL_REQUEST_TEMPLATE.md | 8 ++-- .github/workflows/release.yml | 2 +- .github/workflows/tests-main.yml | 2 +- CONTRIBUTING.md | 44 +++++++++++++++++++ bin/create-homebrew-pr.js | 13 ++++-- .../{3 => stable}/src/shopify-cli.rb.liquid | 0 .../{3 => stable}/src/shopify-cli@3.rb.liquid | 0 7 files changed, 59 insertions(+), 10 deletions(-) create mode 100644 CONTRIBUTING.md rename packaging/{3 => stable}/src/shopify-cli.rb.liquid (100%) rename packaging/{3 => stable}/src/shopify-cli@3.rb.liquid (100%) diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index 188bdcca981..4c421863ee0 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -3,7 +3,7 @@ - Prefix it with [Feature] (if applicable) - Start with a verb, for example: Add, Delete, Improve, Fix… - Give as much context as necessary and as little as possible - - Use a draft PR while it’s a work in progress + - Use a draft PR while it's a work in progress --> ### WHY are these changes introduced? @@ -11,7 +11,7 @@ Fixes #0000 ### WHAT is this pull request doing? @@ -40,5 +40,5 @@ Fixes #0000 - [ ] I've considered possible cross-platform impacts (Mac, Linux, Windows) - [ ] I've considered possible [documentation](https://shopify.dev) changes -- [ ] I've considered analytics changes to measure impact -- [ ] The change is user-facing, so I've added a changelog entry with `pnpm changeset add` +- [ ] I've considered analytics changes to measure impact +- [ ] The change is user-facing — I've identified the correct bump type (`patch` for bug fixes · `minor` for new features · `major` for [breaking changes](../CONTRIBUTING.md#what-counts-as-a-breaking-change)) and added a changeset with `pnpm changeset add` diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 0fb07840e31..9511bf29273 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -10,7 +10,7 @@ on: push: branches: - main - - stable/3.* + - stable/* # Trigger for manual/cron release functionality schedule: diff --git a/.github/workflows/tests-main.yml b/.github/workflows/tests-main.yml index 48b8f4c49b7..8323d59e8d7 100644 --- a/.github/workflows/tests-main.yml +++ b/.github/workflows/tests-main.yml @@ -4,7 +4,7 @@ on: push: branches: - main - - stable/3.* + - stable/* paths-ignore: - '**.md' - 'docs/**' diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 00000000000..6422291582a --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,44 @@ +# Contributing to Shopify CLI + +## Changesets and versioning + +This project uses [Changesets](https://github.com/changesets/changesets) to manage versions and changelogs. Every user-facing change requires a changeset file. + +``` +pnpm changeset add +``` + +### Choosing the right bump type + +The CLI follows [semantic versioning](https://semver.org). Pick the bump type that matches the nature of your change: + +| Bump | When to use | +| :---- | :---- | +| `patch` | Bug fix that doesn't change any public interface | +| `minor` | New feature or behaviour that is backwards-compatible | +| `major` | Breaking change to a stable interface (see table below) | + +### What counts as a breaking change + +The following interfaces are **stable** — any incompatible change to them requires a `major` bump: + +| Interface | Breaking change examples | +| :---- | :---- | +| **Command surface** | Removing a command or subcommand; renaming a flag; changing a flag's semantics | +| **Exit codes** | Changing the exit code for a given outcome | +| **Machine-readable output (`--json`)** | Removing or renaming a JSON key; changing a value's type | +| **Config file schema** (`shopify.app.toml`, etc.) | Removing a required key; changing a key's type | +| **Extension manifest schema** | Removing a field; changing validation rules that reject previously-valid manifests | +| **`@shopify/cli-kit` public API** | Removing or renaming a publicly exported function or type | +| **Documented environment variables** | Removing or renaming a documented env var | + +Human-readable output (messages, spinner text, prompts) is **not** a stable interface. Changing wording or formatting is not a breaking change. + +### Deprecation policy + +Before removing or incompatibly changing a stable interface: + +1. Mark it deprecated in the code and surface a runtime warning when it is used. +2. Ship the deprecation notice in a **minor** release — this starts the clock. +3. Wait at least one minor release cycle before removing it. +4. Ship the removal in a **major** release with a migration guide in the release notes. diff --git a/bin/create-homebrew-pr.js b/bin/create-homebrew-pr.js index 6f672cee5f0..9021b8af9c0 100755 --- a/bin/create-homebrew-pr.js +++ b/bin/create-homebrew-pr.js @@ -40,11 +40,16 @@ program if (options.openPr) { console.log(`Opening a PR in shopify/homebrew-shopify to update the formula ${version}`) + const majorVersion = parseInt(version.split('.')[0], 10) const files = {} switch (templateVersion) { - case "3": + case "stable": files["shopify-cli.rb"] = (await readFile(path.join(outputDirectory, "shopify-cli.rb"))).toString() - files["shopify-cli@3.rb"] = (await readFile(path.join(outputDirectory, "shopify-cli@3.rb"))).toString() + // Only keep the @3 versioned formula up to date while we are on major version 3. + // Once we move to v4+, shopify-cli@3.rb stays frozen at the last 3.x release. + if (majorVersion === 3) { + files["shopify-cli@3.rb"] = (await readFile(path.join(outputDirectory, "shopify-cli@3.rb"))).toString() + } break case "pre": files["shopify-cli-pre.rb"] = (await readFile(path.join(outputDirectory, "shopify-cli-pre.rb"))).toString() @@ -70,7 +75,7 @@ program changes: [ { files, - commit: `Update Shopify CLI 3 formula to install the version ${version}`, + commit: `Update Shopify CLI formula to install version ${version}`, }, ], createWhenEmpty: false, @@ -106,7 +111,7 @@ async function versionToRelease() { function getTemplateVersion(version) { if (version.includes("pre")) return "pre" if (version.includes("nightly")) return "nightly" - if (version.match(/^3\.\d+\.\d+$/)) return "3" + if (version.match(/^\d+\.\d+\.\d+$/)) return "stable" throw `Unrecognized version string ${version}` } diff --git a/packaging/3/src/shopify-cli.rb.liquid b/packaging/stable/src/shopify-cli.rb.liquid similarity index 100% rename from packaging/3/src/shopify-cli.rb.liquid rename to packaging/stable/src/shopify-cli.rb.liquid diff --git a/packaging/3/src/shopify-cli@3.rb.liquid b/packaging/stable/src/shopify-cli@3.rb.liquid similarity index 100% rename from packaging/3/src/shopify-cli@3.rb.liquid rename to packaging/stable/src/shopify-cli@3.rb.liquid From c24f37ce784edb0a8731279f3f0ae399ad87ddea Mon Sep 17 00:00:00 2001 From: Alfonso Noriega Date: Thu, 16 Apr 2026 14:43:09 +0200 Subject: [PATCH 2/2] =?UTF-8?q?Fix=20broken=20template=20paths=20after=20p?= =?UTF-8?q?ackaging/3=20=E2=86=92=20packaging/stable=20rename?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packaging/nightly/src/shopify-cli-nightly.rb.liquid | 2 +- packaging/stable/src/shopify-cli@3.rb.liquid | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packaging/nightly/src/shopify-cli-nightly.rb.liquid b/packaging/nightly/src/shopify-cli-nightly.rb.liquid index 46097ca9c15..14eafecd143 100644 --- a/packaging/nightly/src/shopify-cli-nightly.rb.liquid +++ b/packaging/nightly/src/shopify-cli-nightly.rb.liquid @@ -1,4 +1,4 @@ -{% render '3/src/shopify-cli.rb.liquid', +{% render 'stable/src/shopify-cli.rb.liquid', formulaVersion: 'nightly', cliTarball: cliTarball, cliSha: cliSha, diff --git a/packaging/stable/src/shopify-cli@3.rb.liquid b/packaging/stable/src/shopify-cli@3.rb.liquid index f57637f45ce..52515a93cfc 100644 --- a/packaging/stable/src/shopify-cli@3.rb.liquid +++ b/packaging/stable/src/shopify-cli@3.rb.liquid @@ -1,4 +1,4 @@ -{% render '3/src/shopify-cli.rb.liquid', +{% render 'stable/src/shopify-cli.rb.liquid', formulaVersion: '3', cliTarball: cliTarball, cliSha: cliSha,