Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Add typechat to example package deps #90

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

Merged
merged 1 commit into from
Aug 8, 2023

Conversation

jakebailey
Copy link
Member

@jakebailey jakebailey commented Aug 3, 2023

This is an alternative to #89, and also fixes #81.

This worked for me but not for @DanielRosenwasser; I did see a bunch of time spent idealTree-ing but that happens when you change the tree, it seems.

There are other reasons to take #89 instead, mainly, perf.

@DanielRosenwasser
Copy link
Member

DanielRosenwasser commented Aug 3, 2023

It works, but my issue was that if you run with a specific install-strategy in an .npmrc, that doesn't seem to do anything different than usual. It appears that everything still gets hoisted.

@jakebailey
Copy link
Member Author

The layouts you get between this PR and the pnpm one are the same; you get hoisted to the top no matter what, so I'm not sure what you're observing that's different/bad exactly.

@DanielRosenwasser
Copy link
Member

DanielRosenwasser commented Aug 3, 2023

My assumption was that pnpm creates a specific node_modules directory per package which ends up being "stricter". The two main things which that helps with is:

  1. pnpm will not directly expose a package that an example relies on (like dotenv) to typechat itself
  2. examples that don't explicitly depend on typechat will not be able to access it

Does pnpm not do that?

@jakebailey
Copy link
Member Author

It may or may not do either because you're using the monorepo root as an actual package with dependencies. It's impossible for an example to not see axios, for example; it's there in the parent directory, and you can't fix that without using the more typical layout which moves everything into packages/* or something.

But, it is at least more unlikely that you'll accidentally use a package that hasn't been declared thanks to pnpm not linking anything but declared ones.

In this repo's case, I believe you will get an error if typechat is not listed even though it's a parent because pnpm doesn't (yet) automatically create self-links like npm/yarn do.

@DanielRosenwasser DanielRosenwasser merged commit 89134ed into microsoft:main Aug 8, 2023
@jakebailey jakebailey deleted the npm-fix branch August 8, 2023 21:03
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.

all samples package.json do not have typechat as a dependency
2 participants