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

Restore a working linking setup #1523

Merged
merged 1 commit into from
Dec 11, 2023
Merged

Restore a working linking setup #1523

merged 1 commit into from
Dec 11, 2023

Conversation

chancancode
Copy link
Contributor

@chancancode chancancode commented Dec 8, 2023

Screen_Recording_2023-12-08_at_2.53.28_PM.mov

The purpose of this is to restore a working setup where we can link all glimmer-vm to ember.js without publishing.

Previously this was just a script that yarn link on both sides.

It seems like we tried to use yalc at some point.

Neither of those other solutions fully works with the constraints:

  • supports pnpm
  • supports pnpm workspace
  • supports publishConfig
  • resolve internal dependencies (like @glimmer/encoder) when linked

This script makes it work with all of the above.

Usage:

  1. pnpm install, develop, make changes, etc
  2. pnpm build
  3. pnpm link:all
  4. pnpm link:glimmer-vm from ember.js
  5. validate, iterate, re-run pnpm build/pnpm link:all as needed
  6. pnpm unlink from ember.js
  7. pnpm unlink:all here

See also emberjs/ember.js#20590

@chancancode
Copy link
Contributor Author

In hindsight, it may be nice to integrate or do some parts of this as a rollup plugin in the existing build pipeline, so that the linkable-dist folder can be kept up-to-date automatically, but that can be future work (it's also a little tricky to get right – right now the script uses pnpm pack to get all the right behavior automatically, if we want to do this in rollup, it would have to replicate the .npmignore, scripts, etc)

The purpose of this is to restore a working setup where we can link
all glimmer-vm to ember.js without publishing.

Previously this was just a script that `yarn link` on both sides.

It seems like we tried to use `yalc` at some point.

Neither of those other solutions fully works with the constraints:

* supports pnpm
* supports pnpm workspace
* supports `publishConfig`
* resolve internal dependencies (like `@glimmer/encoder`) when
  linked

This script makes it work with all of the above.

Usage:

1. pnpm install, develop, make changes, etc
2. pnpm build
3. pnpm link:all
4. pnpm link:glimmer-vm from ember.js
5. validate, iterate, re-run pnpm build/pnpm link:all as needed
6. pnpm unlink from ember.js
7. pnpm unlink:all here

See also emberjs/ember.js#20590

await unlink(tarball);

// https://github.com/pnpm/pnpm/issues/881
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks for leaving this link here!

@NullVoxPopuli NullVoxPopuli merged commit 810e6b9 into master Dec 11, 2023
5 checks passed
@NullVoxPopuli NullVoxPopuli deleted the yalc-shave branch December 11, 2023 16:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants