fix: ensure @babel/parser can reference @babel/types#10315
fix: ensure @babel/parser can reference @babel/types#10315eventualbuddha wants to merge 1 commit intobabel:masterfrom eventualbuddha:parser-depends-on-types
@babel/parser can reference @babel/types#10315Conversation
|
@eventualbuddha Could you please rebase on master? |
|
There is also #9924, where @loganfsmyth wrote a big valid concern. |
|
I agree with @loganfsmyth that it's a little strange to include a package as a dependency simply because you need the types. However, I don't see a good way around it. As-is, |
|
I’m unsure why this is failing. Looks like a git issue? |
|
Yeah sorry, we have fixed in on master |
The type declarations for `@babel/parser` reference `@babel/types` but previously there was no explicit dependency on `@babel/parser`. This meant that TypeScript is unable to process `@babel/parser` unless `@babel/types` also happens to be installed. Furthermore, if installing using a stricter `node_modules` layout (like the one favored by `pnpm`), even if `@babel/types` is installed by another package `@babel/parser` will be unable to see it. With an explicit dependency this problem goes away.
|
More unrelated failures? |
|
Build successful! You can test your changes in the REPL here: https://babeljs.io/repl/build/11332/ |
1 similar comment
|
Build successful! You can test your changes in the REPL here: https://babeljs.io/repl/build/11332/ |
|
It seems like if we actually wanted to fix this, we'd have to make a new package that was just the type definitions or something. Can we just ask people using TS to install |
|
You could go back to using type definitions from DefinitelyTyped. Or you could also include a comment in the type declarations file at the point where TS shows an error message that instructs users to add Both of these feel kinda janky. I'm curious what the actual harm with this is, besides possibly adding a copy of |
|
Doesn't look like this is going to happen, so I'm closing. |
The type declarations for
@babel/parserreference@babel/typesbut previously there was no explicit dependency on@babel/parser. This meant that TypeScript is unable to process@babel/parserunless@babel/typesalso happens to be installed. Furthermore, if installing using a stricternode_moduleslayout (like the one favored bypnpm), even if@babel/typesis installed by another package@babel/parserwill be unable to see it. With an explicit dependency this problem goes away.See discussion on Slack.