Skip to content

Fix shopify version in snapshots#6858

Open
gonzaloriestra wants to merge 1 commit intomainfrom
fix-cli-version
Open

Fix shopify version in snapshots#6858
gonzaloriestra wants to merge 1 commit intomainfrom
fix-cli-version

Conversation

@gonzaloriestra
Copy link
Contributor

@gonzaloriestra gonzaloriestra commented Feb 16, 2026

WHY are these changes introduced?

The shopify version command was returning a wrong value (the current from the main branch, like 3.90.0) for snapshot releases generated with /snapit

WHAT is this pull request doing?

Ensure the script to update the CLI version constant in cli-kit is run as part of the bundle task

How to test your changes?

  • npm i -g @shopify/cli@0.0.0-snapshot-20260217105009
  • shopify version

Measuring impact

How do we know this change was effective? Please choose one:

  • n/a - this doesn't need measurement, e.g. a linting rule or a bug-fix
  • Existing analytics will cater for this addition
  • PR includes analytics changes to measure impact

Checklist

  • I've considered possible cross-platform impacts (Mac, Linux, Windows)
  • I've considered possible documentation changes

Copy link
Contributor Author

gonzaloriestra commented Feb 16, 2026

This stack of pull requests is managed by Graphite. Learn more about stacking.

@gonzaloriestra gonzaloriestra mentioned this pull request Feb 16, 2026
5 tasks
@gonzaloriestra gonzaloriestra changed the title Fix CLI version detection to use package.json instead of constant Fix CLI version detection Feb 16, 2026
@github-actions
Copy link
Contributor

github-actions bot commented Feb 16, 2026

Coverage report

St.
Category Percentage Covered / Total
🟡 Statements 78.9% 14554/18447
🟡 Branches 73.22% 7222/9863
🟡 Functions 79.09% 3704/4683
🟡 Lines 79.25% 13761/17365

Test suite run success

3772 tests passing in 1453 suites.

Report generated by 🧪jest coverage report action from 34ac466

@gonzaloriestra gonzaloriestra changed the base branch from auto-upgrade to graphite-base/6858 February 16, 2026 16:53
@gonzaloriestra gonzaloriestra changed the base branch from graphite-base/6858 to main February 16, 2026 16:53
@gonzaloriestra gonzaloriestra force-pushed the fix-cli-version branch 4 times, most recently from c1df39a to daf24cb Compare February 17, 2026 07:34
@github-actions
Copy link
Contributor

Differences in type declarations

We detected differences in the type declarations generated by Typescript for this branch compared to the baseline ('main' branch). Please, review them to ensure they are backward-compatible. Here are some important things to keep in mind:

  • Some seemingly private modules might be re-exported through public modules.
  • If the branch is behind main you might see odd diffs, rebase main into this branch.

New type declarations

We found no new type declarations in this PR

Existing type declarations

packages/cli-kit/dist/public/node/fs.d.ts
@@ -1,6 +1,6 @@
 import { RandomNameFamily } from '../common/string.js';
 import { OverloadParameters } from '../../private/common/ts/overloaded-parameters.js';
-import { findUp as internalFindUp } from 'find-up';
+import { findUp as internalFindUp, findUpSync as internalFindUpSync } from 'find-up';
 import { ReadStream, WriteStream } from 'fs';
 import type { Pattern, Options as GlobOptions } from 'fast-glob';
 /**
@@ -335,6 +335,7 @@ export declare function defaultEOL(): EOL;
  * @returns The first path found that matches or  if none could be found.
  */
 export declare function findPathUp(matcher: OverloadParameters<typeof internalFindUp>[0], options: OverloadParameters<typeof internalFindUp>[1]): ReturnType<typeof internalFindUp>;
+export declare function findPathUpSync(matcher: OverloadParameters<typeof internalFindUp>[0], options: OverloadParameters<typeof internalFindUp>[1]): ReturnType<typeof internalFindUpSync>;
 export interface MatchGlobOptions {
     matchBase: boolean;
     noglobstar: boolean;
packages/cli-kit/dist/public/node/version.d.ts
@@ -1,3 +1,17 @@
+/**
+ * Returns the current CLI version, read from the nearest package.json.
+ * The result is cached after the first call.
+ *
+ * This is a lazy function (rather than a top-level constant) because 
+ * depends on npm packages that may not yet be initialized during ESM module evaluation
+ * when circular imports are involved. Deferring the call to runtime avoids that issue.
+ *
+ * In unbundled (dev) mode this finds cli-kit's own package.json.
+ * In bundled (global install) mode this finds the CLI's package.json, which shares the same version.
+ *
+ * @returns The CLI version string.
+ */
+export declare function cliVersion(): string;
 /**
  * Returns the version of the local dependency of the CLI if it's installed in the provided directory.
  *

@gonzaloriestra

This comment was marked as outdated.

@gonzaloriestra gonzaloriestra changed the title Fix CLI version detection Fix shopify version in snapshots Feb 17, 2026
@github-actions

This comment was marked as outdated.

@gonzaloriestra

This comment was marked as outdated.

@gonzaloriestra
Copy link
Contributor Author

/snapit

@github-actions
Copy link
Contributor

🫰✨ Thanks @gonzaloriestra! Your snapshot has been published to npm.

Test the snapshot by installing your package globally:

npm i -g --@shopify:registry=https://registry.npmjs.org @shopify/cli@0.0.0-snapshot-20260217105009

Caution

After installing, validate the version by running just shopify in your terminal.
If the versions don't match, you might have multiple global instances installed.
Use which shopify to find out which one you are running and uninstall it.

@gonzaloriestra gonzaloriestra marked this pull request as ready for review February 17, 2026 17:25
@gonzaloriestra gonzaloriestra requested a review from a team as a code owner February 17, 2026 17:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant