Skip to content

dev-ui should run npm run dev not npm start#111

Merged
dr-frmr merged 1 commit intohyperware-ai:dr/gus-dev-ui-fixfrom
gusapps:fix-the-dev-ui-command
Mar 20, 2024
Merged

dev-ui should run npm run dev not npm start#111
dr-frmr merged 1 commit intohyperware-ai:dr/gus-dev-ui-fixfrom
gusapps:fix-the-dev-ui-command

Conversation

@gusapps
Copy link
Copy Markdown
Contributor

@gusapps gusapps commented Mar 20, 2024

Problem

  • The npm start command is conventionally used to start an application in its production environment
  • The npm run dev command is a convention for starting an application in its development environment
  • dev-ui runs npm start when it should be running npm run dev

Solution

This PR is not a complete solution since it doesn't handle the production case AFAICT. A complete solution shouldn't naively replace npm start with npm run dev, but conditionally run one over the other depending on wether execute is called in production or development. I'm hoping someone with a higher-level view of kit can help implement that conditional.

Docs Update

The Arguments section on this page would need updating: https://book.kinode.org/kit/dev-ui.html

Notes

The reason this hasn't been a problem so far is because the Kinode template apps all use Vite, and Vite doesn't discriminate between start and dev even though you will find both scripts in its package.json:

"scripts": {
  "dev": "vite --port 3000",
  "start": "vite --port 3000"
}

But not all build tools are this laissez-faire. The React framework we are using for our app, NextJS, which uses Webpack under the hood, requires you to use a distinct dev command, and so does Webpack's rust-powered successor, Turbopack. If nothing else, dev vs start is a pretty established convention in web dev.

Copy link
Copy Markdown
Contributor

@dr-frmr dr-frmr left a comment

Choose a reason for hiding this comment

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

!!

@dr-frmr dr-frmr merged commit 3e116d0 into hyperware-ai:dr/gus-dev-ui-fix Mar 20, 2024
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