Conversation
7056201 to
0287a52
Compare
a51cd38 to
085b95c
Compare
Coverage report
Test suite run success3787 tests passing in 1451 suites. Report generated by 🧪jest coverage report action from afbae8f |
085b95c to
a8bb7b0
Compare
a8bb7b0 to
312b035
Compare
469480a to
2dd72ba
Compare
a8fb677 to
5351562
Compare
5351562 to
14a0139
Compare
14a0139 to
56914ab
Compare
56914ab to
864eb50
Compare
864eb50 to
64b11ef
Compare
95735eb to
f526cb2
Compare
This comment was marked as outdated.
This comment was marked as outdated.
4bc4f60 to
35c2e6a
Compare
9b89711 to
ad08b61
Compare
1811e3c to
7614620
Compare
This comment was marked as outdated.
This comment was marked as outdated.
7614620 to
91a87a1
Compare
This comment was marked as outdated.
This comment was marked as outdated.
91a87a1 to
0f571af
Compare
This comment was marked as outdated.
This comment was marked as outdated.
|
We detected some changes at Caution DO NOT create changesets for features which you do not wish to be included in the public changelog of the next CLI release. |
0f571af to
395807a
Compare
This comment was marked as outdated.
This comment was marked as outdated.
395807a to
f1f1ed9
Compare
|
/snapit |
|
🫰✨ 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-20260224152342Caution After installing, validate the version by running |
Why: When developers created new git worktrees, they encountered: "shadowenv failure: directory '.shadowenv.d' contains untrusted shadowenv program" This happened because .shadowenv.d/yarn.lisp was committed to the repo, but shadowenv trust files are user-specific and not tracked by git. New worktrees got the lisp file but no trust, causing the error. How: Remove the committed shadowenv files and add .shadowenv.d/ to .gitignore. The yarn deprecation wrapper and pnpm alias scripts are no longer needed since the pnpm migration completed in 2022. Going forward, `dev up` will generate shadowenv files as needed and handle trust automatically. Files removed: - .shadowenv.d/yarn.lisp (shadowenv config) - .shadowenv.d/.gitignore (kept yarn.lisp tracked) - bin/shadowenv/yarn (yarn deprecation warning) - bin/shadowenv/p (pnpm alias)
f1f1ed9 to
afbae8f
Compare
Differences in type declarationsWe 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:
New type declarationsWe found no new type declarations in this PR Existing type declarationspackages/cli-kit/dist/private/node/conf-store.d.ts@@ -22,6 +22,7 @@ export interface ConfSchema {
sessionStore: string;
currentSessionId?: string;
cache?: Cache;
+ autoUpgradeEnabled?: boolean;
}
/**
* Get session.
@@ -123,6 +124,18 @@ interface RunWithRateLimitOptions {
* @returns true, or undefined if the task was not run.
*/
export declare function runWithRateLimit(options: RunWithRateLimitOptions, config?: LocalStorage<ConfSchema>): Promise<boolean>;
+/**
+ * Get auto-upgrade preference.
+ *
+ * @returns Whether auto-upgrade is enabled, or undefined if never set.
+ */
+export declare function getAutoUpgradeEnabled(config?: LocalStorage<ConfSchema>): boolean | undefined;
+/**
+ * Set auto-upgrade preference.
+ *
+ * @param enabled - Whether auto-upgrade should be enabled.
+ */
+export declare function setAutoUpgradeEnabled(enabled: boolean, config?: LocalStorage<ConfSchema>): void;
export declare function getConfigStoreForPartnerStatus(): LocalStorage<{
[partnerToken: string]: {
status: true;
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,14 @@ 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>;
+/**
+ * Find a file by walking parent directories.
+ *
+ * @param matcher - A pattern or an array of patterns to match a file name.
+ * @param options - Options for the search.
+ * @returns The first path found that matches or if none could be found.
+ */
+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/is-global.d.ts@@ -26,6 +26,14 @@ export declare function installGlobalCLIPrompt(): Promise<InstallGlobalCLIPrompt
* Infers the package manager used by the global CLI.
*
* @param argv - The arguments passed to the process.
+ * @param env - The environment variables of the process.
* @returns The package manager used by the global CLI.
*/
-export declare function inferPackageManagerForGlobalCLI(argv?: string[]): PackageManager;
\ No newline at end of file
+export declare function inferPackageManagerForGlobalCLI(argv?: string[], env?: NodeJS.ProcessEnv): PackageManager;
+/**
+ * Returns the project directory for the given path.
+ *
+ * @param directory - The path to the directory to get the project directory for.
+ * @returns The project directory for the given path.
+ */
+export declare function getProjectDir(directory: string): string | undefined;
\ No newline at end of file
packages/cli-kit/dist/public/node/node-package-manager.d.ts@@ -27,7 +27,7 @@ export type DependencyType = 'dev' | 'prod' | 'peer';
/**
* A union that represents the package managers available.
*/
-export declare const packageManager: readonly ["yarn", "npm", "pnpm", "bun", "unknown"];
+export declare const packageManager: readonly ["yarn", "npm", "pnpm", "bun", "homebrew", "unknown"];
export type PackageManager = (typeof packageManager)[number];
/**
* Returns an abort error that's thrown when the package manager can't be determined.
packages/cli-kit/dist/public/node/upgrade.d.ts@@ -4,11 +4,32 @@
*
* @returns A string with the command to run.
*/
-export declare function cliInstallCommand(): string;
+export declare function cliInstallCommand(): string | undefined;
+/**
+ * Runs the CLI upgrade using the appropriate package manager.
+ * Determines the install command and executes it.
+ *
+ * @throws AbortError if the package manager or command cannot be determined.
+ */
+export declare function runCLIUpgrade(): Promise<void>;
+/**
+ * Returns the version to auto-upgrade to, or undefined if auto-upgrade should be skipped.
+ * Auto-upgrade is disabled by default and must be enabled via .
+ * Also skips for CI, pre-release versions, or when no newer version is available.
+ *
+ * @returns The version string to upgrade to, or undefined if no upgrade should happen.
+ */
+export declare function versionToAutoUpgrade(): string | undefined;
/**
* Generates a message to remind the user to update the CLI.
*
* @param version - The version to update to.
* @returns The message to remind the user to update the CLI.
*/
-export declare function getOutputUpdateCLIReminder(version: string): string;
\ No newline at end of file
+export declare function getOutputUpdateCLIReminder(version: string): string;
+/**
+ * Prompts the user to enable or disable automatic upgrades, then persists their choice.
+ *
+ * @returns Whether the user chose to enable auto-upgrade.
+ */
+export declare function promptAutoUpgrade(): Promise<boolean>;
\ No newline at end of file
packages/cli-kit/dist/public/node/version.d.ts@@ -18,4 +18,13 @@ export declare function globalCLIVersion(): Promise<string | undefined>;
* @param version - The version to check.
* @returns True if the version is a pre-release version.
*/
-export declare function isPreReleaseVersion(version: string): boolean;
\ No newline at end of file
+export declare function isPreReleaseVersion(version: string): boolean;
+/**
+ * Checks if there is a major version change between two versions.
+ * Pre-release versions (0.0.0-*) are treated as not having a major version change.
+ *
+ * @param currentVersion - The current version.
+ * @param newerVersion - The newer version to compare against.
+ * @returns True if there is a major version change.
+ */
+export declare function isMajorVersionChange(currentVersion: string, newerVersion: string): boolean;
\ No newline at end of file
packages/cli-kit/dist/public/node/hooks/postrun.d.ts@@ -5,4 +5,10 @@ import { Hook } from '@oclif/core';
* @returns Whether post run hook has completed.
*/
export declare function postRunHookHasCompleted(): boolean;
-export declare const hook: Hook.Postrun;
\ No newline at end of file
+export declare const hook: Hook.Postrun;
+/**
+ * Auto-upgrades the CLI after a command completes, if a newer version is available.
+ *
+ * @returns Resolves when the upgrade attempt (or fallback warning) is complete.
+ */
+export declare function autoUpgradeIfNeeded(): Promise<void>;
\ No newline at end of file
packages/cli-kit/dist/public/node/hooks/prerun.d.ts@@ -11,6 +11,7 @@ export declare function parseCommandContent(cmdInfo: {
pluginAlias?: string;
}): CommandContent;
/**
- * Warns the user if there is a new version of the CLI available
+ * Triggers a background check for a newer CLI version (non-blocking).
+ * The result is cached and consumed by the postrun hook for auto-upgrade.
*/
-export declare function warnOnAvailableUpgrade(): Promise<void>;
\ No newline at end of file
+export declare function checkForNewVersionInBackground(): void;
\ No newline at end of file
|
| return `${packageManager} global add @shopify/cli@latest` | ||
| } else { | ||
| const verb = packageManager === 'pnpm' ? 'add' : 'install' | ||
| return `${packageManager} ${verb} -g @shopify/cli@latest` |
There was a problem hiding this comment.
it's possible that the new CLI requires a newer version of node than the currently installed in the system. Maybe we could try to be smart and detect that and warn the user instead of failing forever :thinking_face:
There was a problem hiding this comment.
It's a good idea to improve later. But if I'm not wrong, the user would see that specific error at the end of each command, so I guess it's not a big deal as if it failed silently.
There was a problem hiding this comment.
it's possible that the new CLI requires a newer version of node
Upgrading our required Node version would come in a major version, which is already handled, right?
There was a problem hiding this comment.
If we also switch to SemVer, yes
There was a problem hiding this comment.
Gotcha - I was thinking that was a dependency of this.
There was a problem hiding this comment.
Ideally yes, but we could ship this with the current system as well.

HackDays project: https://vault.shopify.io/hackdays/153/projects/22255
WHY are these changes introduced?
We want our devs to always use the latest CLI version and avoid fragmentation
WHAT is this pull request doing?
Adds a prompt in
shopify upgradeto ask about enabling auto-update:Then, it checks once per day if there is a new CLI version available and automatically upgrades unless:
The way to upgrade is to simply run the appropriated package manager command for the user (like
npm i -g @shopify/cli@latestfor NPM).How to test your changes?
Install the snapsot with different package managers and operating systems:
npm i -g --@shopify:registry=https://registry.npmjs.org @shopify/cli@0.0.0-snapshot-20260224152342shopify cache clear=> removes cached version checkshopify version=> does nothing because it skips auto-update in snapshotsSHOPIFY_CLI_FORCE_AUTO_UPGRADE=1 shopify version=> does nothing because auto-update is disabledshopify upgrade=> enable auto-upgradenpm i -g --@shopify:registry=https://registry.npmjs.org @shopify/cli@0.0.0-snapshot-20260224152342=> install the snapshot again because the previous command installed the latest versionshopify version=> does nothing because it skips auto-update in snapshotsSHOPIFY_CLI_FORCE_AUTO_UPGRADE=1 shopify version=> auto-updatesMeasuring impact
How do we know this change was effective? Please choose one:
Checklist