Skip to content
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

[Theme] Change how assets are resolved #5252

Merged
merged 4 commits into from
Jan 22, 2025
Merged

[Theme] Change how assets are resolved #5252

merged 4 commits into from
Jan 22, 2025

Conversation

frandiox
Copy link
Contributor

WHY are these changes introduced?

Originally reported here.

Under some unknown circumstances, NX might complain about circular dependencies:

image

WHAT is this pull request doing?

Replace require.resolve with findPathUp to ensure Nx doesn't think @shopify/cli is a dependency.

How to test your changes?

shopify theme profile --url / should still work.

Post-release steps

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

@frandiox frandiox requested review from a team as code owners January 22, 2025 12:37
@frandiox
Copy link
Contributor Author

/snapit

Copy link
Contributor

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

Test the snapshot by intalling your package globally:

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

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

github-actions bot commented Jan 22, 2025

Coverage report

St.
Category Percentage Covered / Total
🟡 Statements
75.32% (-0.01% 🔻)
8889/11801
🟡 Branches
70.56% (-0.02% 🔻)
4322/6125
🟡 Functions 75.1% 2337/3112
🟡 Lines 75.86% 8401/11074
Show files with reduced coverage 🔻
St.
File Statements Branches Functions Lines
🟢
... / app-event-watcher.ts
93.83% (-1.23% 🔻)
86.49% (-2.7% 🔻)
90.48% 98.61%
🟢
... / ConcurrentOutput.tsx
98.36% (-1.64% 🔻)
88% (-4% 🔻)
100%
98.33% (-1.67% 🔻)

Test suite run success

2001 tests passing in 904 suites.

Report generated by 🧪jest coverage report action from 6121c3d

Copy link
Contributor

@isaacroldan isaacroldan left a comment

Choose a reason for hiding this comment

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

Would be best to test this with a snapshot release, to verify that it works after bundling

This reverts commit 2688080.
Copy link
Contributor

We detected some changes at packages/*/src and there are no updates in the .changeset.
If the changes are user-facing, run "pnpm changeset add" to track your changes and include them in the next release CHANGELOG.

@frandiox
Copy link
Contributor Author

@gonzaloriestra @isaacroldan Reverted the changeset, and tested with this snapshot. The url generated is the following and it works, so it's finding the path correctly:

file:///Users/frandiox/Library/pnpm/global/5/.pnpm/@shopify+cli@0.0.0-snapshot-20250122123941/node_modules/@shopify/cli/dist/assets/speedscope/index.html#localProfilePath=/private/var/folders/lv/n7dkzg7n08b00gfn7kxpkry80000gn/T/3e1128b7717431e43d8db018726266bd/speedscope-1737551779332-65825.js
image

Copy link
Contributor

@gonzaloriestra gonzaloriestra left a comment

Choose a reason for hiding this comment

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

Thanks!

@frandiox frandiox added this pull request to the merge queue Jan 22, 2025
Merged via the queue into main with commit 7b3ba77 Jan 22, 2025
27 checks passed
@frandiox frandiox deleted the fd-fix-nx-dep branch January 22, 2025 16:10
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.

3 participants