Skip to content

Removes the checked-in @berry/pnpify & @berry/builder#328

Merged
arcanis merged 1 commit into
masterfrom
mael/less-checkedin-artifacts
Aug 2, 2019
Merged

Removes the checked-in @berry/pnpify & @berry/builder#328
arcanis merged 1 commit into
masterfrom
mael/less-checkedin-artifacts

Conversation

@arcanis
Copy link
Copy Markdown
Member

@arcanis arcanis commented Aug 2, 2019

This PR removes the checked-in versions of @berry/pnpify and @berry/builder that are stored within the repository. We previously needed them in order to build Yarn (we needed), but I found a way to do this using ts-node to add TypeScript support at runtime. The key was:

  • ts-node supports an option called transpileOnly. This avoids the typechecking errors that would happen when running pnpify from its TS sources because TypeScript wouldn't be able to find the modules.

  • Disabling the typechecking this way isn't a problem because we use pnpify to build itself (by calling tsc), meaning that the typecheck will be effectively run - just slightly later in the process.

  • I've implemented a publishConfig.bin property which allows us to use different binaries locally than the ones used when the package gets downloaded from the registry. This makes it possible to auto-register ts-node locally, but just run the regular binary in all other cases. This avoid having to complicate our scripts to bootstrap ts-node or similar.

@Vlasenko Did you consider using ts-node when you implemented PnPify? I'm curious if I'm forgetting some edge cases that would make this strategy crumble 😄

@arcanis
Copy link
Copy Markdown
Member Author

arcanis commented Aug 2, 2019

In term of performances, running ./scripts/update-local.sh yielded almost no performance change between this branch and master (45s in both cases), which I find slightly surprising 🤔

@arcanis
Copy link
Copy Markdown
Member Author

arcanis commented Aug 2, 2019

Merging to fix the pnp hook build

@arcanis arcanis merged commit b8e83f6 into master Aug 2, 2019
@larixer
Copy link
Copy Markdown
Member

larixer commented Aug 3, 2019

@arcanis Nope, I didn't consider ts-node when implemented PnPify.

Cool, thats much easier, I love it!

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