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

move ts-node to devDependencies #735

Closed
vorant94 opened this issue Jul 14, 2023 · 8 comments
Closed

move ts-node to devDependencies #735

vorant94 opened this issue Jul 14, 2023 · 8 comments
Labels
enhancement New feature or request

Comments

@vorant94
Copy link

Describe the bug
For some reason ts-node is included in regular dependencies, which results in annoying warning while using oclif with yarn:

➤ YN0000: ┌ Resolution step
➤ YN0002: │ @oclif/core@npm:2.9.3 doesn't provide @types/node (p3ea0d), requested by ts-node
➤ YN0002: │ @oclif/core@npm:2.9.3 doesn't provide typescript (pc0071), requested by ts-node
➤ YN0000: │ Some peer dependencies are incorrectly met; run yarn explain peer-requirements <hash> for details, where <hash> is the six-letter p-prefixed code
➤ YN0000: └ Completed in 0s 280ms

To Reproduce
Steps to reproduce the behavior:

  1. run npx oclif generate mynewcli
  2. choose yarn as a package manager
  3. re-run yarn install (optionally)
  4. See error

Expected behavior
Since the actual code anyway is built to JS, there is no reason to mark ts-node as a regular dependency. It is only used in development and testing... maybe I'm missing something

Screenshots
Screenshot 2023-07-14 at 10 23 21

Environment (please complete the following information):

  • OS & version: macOS 13.4.1 (c) (22F770820d)
  • Shell/terminal & version zsh 5.9 (x86_64-apple-darwin22.0)
@cristiand391
Copy link
Member

Hi @vorant94

ts-node is also used to compile TS plugins at runtime when they are linked, see:
#650

plugin/command loading is done in @oclif/core so it needs ts-node as a dep.

@vorant94
Copy link
Author

Hi @vorant94

ts-node is also used to compile TS plugins at runtime when they are linked, see:

#650

plugin/command loading is done in @oclif/core so it needs ts-node as a dep.

Is it acceptable to maybe make it a deepDep then?

@cristiand391
Copy link
Member

Is it acceptable to maybe make it a deepDep then?

You mean making ts-node a peerDependency?

@vorant94
Copy link
Author

Is it acceptable to maybe make it a deepDep then?

You mean making ts-node a peerDependency?

yeah, sorry for typo

@SuperchupuDev
Copy link

any updates on this issue? it's a bit annoying to have ts-node always installed when it doesn't get used by any of my dependencies

@cristiand391
Copy link
Member

hey, sorry missed the last response.

AFAIK, npm installs peerDependencies by default unless you do npm i --omit peer:
npm v7 announcement

Maybe we could remove ts-node from @oclif/core as dep and require plugins to have it as a devDep (which already do for bin/dev to work), but that would be a breaking change and might require some refactor to lazy-load ts-node code in core.

@cristiand391 cristiand391 reopened this Sep 25, 2023
@mdonnalley mdonnalley added the enhancement New feature or request label Sep 25, 2023
@git2gus
Copy link

git2gus bot commented Sep 25, 2023

This issue has been linked to a new work item: W-14179298

@mdonnalley
Copy link
Contributor

Closed by #794

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants