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

Use Yalc to fix version mismatch #1181

Merged
merged 4 commits into from
Oct 19, 2023
Merged

Use Yalc to fix version mismatch #1181

merged 4 commits into from
Oct 19, 2023

Conversation

srosset81
Copy link
Contributor

@srosset81 srosset81 commented Oct 17, 2023

For the problem we try to solve, see #1180

  • Add a yalc:publish NPM script on the /src/frontend directory which publish all SemApps packages to Yalc.
  • Call this new command when the build NPM script is called.
  • Adapt the build and watch NPM scripts on the @semapps/auth-provider package (according to this issue, nodemon is the only way to trigger a command after parcel build)

See this PR on ActivityPods for changes on the other side: activitypods/activitypods#108

What's next ?

  • For me the only thing missing would be to run yalc:publish every time the git branch is changed. Apparently this is possible with a git hook. @mguihal @Laurin-W What do you think of this idea ? Would one of you give it a try ? We would need a flexible error handling, in case yalc is not installed.
  • If the rest is OK, we can adapt the build and watch scripts on all SemApps packages.
  • We would also need to adapt the doc and the commands on other repos (Archipelago, etc).

Remaining issue

  • Should we keep using yarn link for middleware packages ? That seems easier since we don't have to bother about watching and publishing.

@srosset81 srosset81 changed the title Try Yalc Try Yalc to fix version mismatch Oct 17, 2023
@Laurin-W
Copy link
Contributor

Awesome!

Should we keep using yarn link for middleware packages ? That seems easier since we don't have to bother about watching and publishing.

Agree with that.

I tried to centralize the config so that the parcel dev dep is only in the workspace dev dependencies. This works fine. The only thing I didn't manage to get working for some reason is to use nx watch, to watch the whole workspace for file modifiactions. It just wouldn't trigger on file changes. Nodemon is fine though and I can set that up. Since the frontend root build script uses nx now, this will only rebuilt changed packages.

Also, I removed the yalc:publish since this will not be necessary, when yalc is called after each build or branch change, or did I oversee something?

Will add the git hook later tonight.

@srosset81
Copy link
Contributor Author

Great, thank you !

The only thing I didn't manage to get working for some reason is to use nx watch, to watch the whole workspace for file modifiactions.

Too bad. But from my experience, it's pretty rare I need to watch all frontend packages at the same time. Usually one or two is enough.

Also, I removed the yalc:publish since this will not be necessary, when yalc is called after each build or branch change, or did I oversee something?

The case I could see is on a fresh git clone: you don't need to do the build (packages are already built), but you need the yalc publish. However if this can be automated with the git hooks, it probably won't be needed.

@Laurin-W
Copy link
Contributor

The case I could see is on a fresh git clone: you don't need to do the build (packages are already built), but you need the yalc publish. However if this can be automated with the git hooks, it probably won't be needed.

My bad, that's the scenario that'd be useful to have the script for, I suppose :D

@srosset81
Copy link
Contributor Author

Thanks, the git hooks are working great !
I'm merging this now, I've also updated the docs on ActivityPods here: activitypods/activitypods@ff91a81 (this can be copy-pasted on any other repo)

@srosset81 srosset81 marked this pull request as ready for review October 19, 2023 14:56
@srosset81 srosset81 merged commit 989c321 into next Oct 19, 2023
@srosset81 srosset81 changed the title Try Yalc to fix version mismatch Use Yalc to fix version mismatch Oct 19, 2023
@srosset81 srosset81 deleted the use-yalc branch October 19, 2023 14:56
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