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

Change dev and build commands to use npm scripts to allow remix cli #8975

Merged
merged 2 commits into from Mar 5, 2024

Conversation

mattmazzola
Copy link
Contributor

Issue

The existing docs suggest using commands remix dev or remix build; the direct use of remix will fail (I believe unless this package is installed globally)

D:\repos\universe-timeline-remix [master]> remix vite:dev
remix: The term 'remix' is not recognized as a name of a cmdlet, function, script file, or executable program.
Check the spelling of the name, or if a path was included, verify that the path is correct and try again.

Solution

Invoke the same commands through NPM scripts, which makes all the binary packages from the current project available

package.json of new SPA project

...
  "scripts": {
    "build": "remix vite:build",
    "dev": "remix vite:dev",
    "lint": "eslint --ignore-path .gitignore --cache --cache-location ./node_modules/.cache/eslint .",
    "preview": "vite preview",
    "typecheck": "tsc"
  }
...
npm run dev
npm run build

Closes: N/A

  • Docs
  • Tests

Testing Strategy:

Run commands on new SPA project verify successful execution

Copy link

changeset-bot bot commented Mar 5, 2024

⚠️ No Changeset found

Latest commit: 794587a

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@kiliman
Copy link
Collaborator

kiliman commented Mar 5, 2024

I think it might be better to preface the commands with npx instead of relying on npm scripts. This way the user knows the exact command they need to run.

npx remix vite:build
npx remix vite:dev

docs/future/spa-mode.md Outdated Show resolved Hide resolved
docs/future/spa-mode.md Outdated Show resolved Hide resolved
Copy link
Contributor

@brophdawg11 brophdawg11 left a comment

Choose a reason for hiding this comment

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

I agree prefixing with npx is more explicit - thanks for the PR!

@brophdawg11 brophdawg11 merged commit 721d222 into remix-run:dev Mar 5, 2024
2 checks passed
brophdawg11 added a commit that referenced this pull request Mar 5, 2024
@mattmazzola mattmazzola deleted the dev branch March 5, 2024 18:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants