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

Add setup:vite command #1778

Merged
merged 90 commits into from
Mar 6, 2024
Merged

Add setup:vite command #1778

merged 90 commits into from
Mar 6, 2024

Conversation

frandiox
Copy link
Contributor

@frandiox frandiox commented Feb 20, 2024

Needs #1728

This adds a h2 setup vite command that transforms the current project to a Vite project.

  • Adds ?url to CSS imports.
  • Removes the <LiveReload /> component.
  • Adds vite.config.js.
  • Removes remix.config.js.
  • Transforms remix.env.d.ts to env.d.ts (this seems to be the new convention in Remix<>Vite templates).
  • Replaces the Remix build import in server.ts.
  • Changes scripts in package.json to run the Vite commands.
  • Adds new required dependencies to package.json and installs them.

To 🎩 :

  • Open templates/skeleton and run h2 setup vite, or generate a new project and run it there.
  • Then review the changes in Git and run the updated project.

I've updated how we import favicon in the skeleton to be more correct and also compatible with Vite (importing from public didn't make sense).

@frandiox frandiox requested a review from a team February 20, 2024 11:23
@frandiox frandiox changed the base branch from main to fd-h2-vite February 20, 2024 11:23

This comment has been minimized.

Base automatically changed from fd-h2-vite to main February 29, 2024 13:55
Copy link
Contributor

@blittle blittle left a comment

Choose a reason for hiding this comment

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

Looks really good. One thing I noticed is that after converting the skeleton template, the lint command in that template fails.

@frandiox
Copy link
Contributor Author

frandiox commented Mar 6, 2024

Looks really good. One thing I noticed is that after converting the skeleton template, the lint command in that template fails.

Fixed 👍
The problem is that .eslintrc.js is CJS so it doesn't work out of the box in projects with type: module. Renaming it to .eslintrc.cjs makes it work again.

Copy link
Contributor

shopify bot commented Mar 6, 2024

Oxygen deployed a preview of your fd-setup-vite branch. Details:

Storefront Status Preview link Deployment details Last update (UTC)
subscriptions ✅ Successful (Logs) Preview deployment Inspect deployment March 6, 202411:59 AM
third-party-queries-caching ✅ Successful (Logs) Preview deployment Inspect deployment March 6, 202411:59 AM
vite ✅ Successful (Logs) Preview deployment Inspect deployment March 6, 202411:59 AM
custom-cart-method ✅ Successful (Logs) Preview deployment Inspect deployment March 6, 202411:59 AM
optimistic-cart-ui ✅ Successful (Logs) Preview deployment Inspect deployment March 6, 202411:59 AM
skeleton ✅ Successful (Logs) Preview deployment Inspect deployment March 6, 202411:59 AM

Learn more about Hydrogen's GitHub integration.

@frandiox frandiox merged commit 46d8a11 into main Mar 6, 2024
13 checks passed
@frandiox frandiox deleted the fd-setup-vite branch March 6, 2024 12:08
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.

2 participants