Skip to content

Fix theme package trying to use default environment #6054

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

graygilmore
Copy link
Contributor

@graygilmore graygilmore commented Jul 2, 2025

WHY are these changes introduced?

The package command does not support an environment flag and would fail if a default environment was present in a users shopify.theme.toml because we try to load it automatically.

This adds an early return if we're using the default environment but the command doesn't support it.

➜  aurora-theme git:(main) shopify theme package
╭─ error ───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│                                                                                                                                                                                           │
│  Nonexistent flag: --environment                                                                                                                                                          │
│  See more help with --help                                                                                                                                                                │
│                                                                                                                                                                                           │
╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯

➜  aurora-theme git:(main) npm i -g @shopify/cli@0.0.0-snapshot-20250702233241 --@shopify:registry=https://registry.npmjs.org
➜  aurora-theme git:(main) shopify theme package
╭─ success ─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│                                                                                                                                                                                           │
│  Your local theme was packaged in Dawn-15.1.0.zip                                                                                                                                         │
│                                                                                                                                                                                           │
╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯

The package command does not support an environment flag and would fail
if a default environment was present in a users `shopify.theme.toml`
because we try to load it automatically.

This adds an early return if we're using the default environment but the
command doesn't support it.
Copy link
Contributor

github-actions bot commented Jul 2, 2025

Coverage report

St.
Category Percentage Covered / Total
🟡 Statements
78.37% (+0.02% 🔼)
12576/16047
🟡 Branches
72.53% (+0.05% 🔼)
6127/8447
🟡 Functions
78.49% (+0.01% 🔼)
3281/4180
🟡 Lines
78.81% (+0.02% 🔼)
11900/15100
Show files with reduced coverage 🔻
St.
File Statements Branches Functions Lines
🟢
... / info.ts
81.44%
61.19% (-1.49% 🔻)
90.32% 83.15%

Test suite run success

2917 tests passing in 1263 suites.

Report generated by 🧪jest coverage report action from c3c5249

@graygilmore graygilmore marked this pull request as ready for review July 2, 2025 23:31
@graygilmore graygilmore requested review from a team as code owners July 2, 2025 23:31
@graygilmore
Copy link
Contributor Author

/snapit

Copy link
Contributor

github-actions bot commented Jul 2, 2025

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

Test the snapshot by installing your package globally:

pnpm i -g @shopify/cli@0.0.0-snapshot-20250702233241

Tip

If you get an ETARGET error, install it with NPM and the flag --@shopify:registry=https://registry.npmjs.org

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.

Copy link
Contributor

@EvilGenius13 EvilGenius13 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @graygilmore!

@graygilmore graygilmore enabled auto-merge July 3, 2025 16:46
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.

[Bug]: shopify theme package error since Shopify CLI 3.81.0
2 participants