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

How to work with lerna? #12

Closed
Zaynex opened this issue Feb 4, 2021 · 2 comments
Closed

How to work with lerna? #12

Zaynex opened this issue Feb 4, 2021 · 2 comments
Labels
question Further information is requested

Comments

@Zaynex
Copy link

Zaynex commented Feb 4, 2021

Question

Hi, I am suffering from local node Dependencies debugging.I have some question.

The context of the question is based on this article

If widget package have a dependence like @babylonjs/core,

widgets
  node_modules
    @types
      react
    react
    @babylonjs/core

if we just run npm pack,it doesnt include @babylonjs/core(in node_modules),just import it in dist/files

import { Engine, Scene, Color4, MeshBuilder, Vector3} from '@babylonjs/core';

at the same time, edit-axis-dialog doesn't have @babylonjs/core in node_modules.

If we run, edit-axis-dialog should show error message likeCan't resolve '@babylonjs/core' in .... .

There is two way can solve.

  1. add @babylonjs/core in devDependency to edit-axis-dialog,then install.
  2. copy widget's node_modules to edit-axis-dialog node_modules.

Does npm-pack-here consider this ?
In lerna,if using hosit, the @babylonjs/core maybe doesn't in widget's node_modules, but in its parent directory's node_modules.

Additional Context

  • Node/npm version: [Node v14.15.2/npm 6.14.9]
  • OS: [OSX 10.15]

wclr/yalc#95 (comment)

@greyepoxy
Copy link
Contributor

Hi @Zaynex,
Not sure I totally follow you, so checking my understanding you have a lerna project setup like the following.

your-lerna-workspace/
  package.json
  packages/
    widgets/
      package.json (dependencies includes react and @bablonjs/core)
    edit-axis-dialog/
      package.json (dependencies includes widgets)

Is this correct? Could you be more specific about the problem you are running into with this setup?

I am not aware of anyone using npm-pack-here with lerna so not sure it will work for your situation, will need more specifics to be able to determine that.

Looking at your post to yalc, if the question is about if npm-pack-here supports locally testing mult-level transitive dependencies, then the answer is yes. To make it work you need to use the useGlobalCache option although be aware that there are some unsolved issues with it #10

@greyepoxy greyepoxy added the question Further information is requested label Feb 16, 2021
@Zaynex
Copy link
Author

Zaynex commented Mar 2, 2021

@greyepoxy Thanks, useGlobalCache is helpful.

@Zaynex Zaynex closed this as completed Mar 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants