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

Migrate to pnpm #8848

Merged
merged 41 commits into from
Mar 6, 2024
Merged

Migrate to pnpm #8848

merged 41 commits into from
Mar 6, 2024

Conversation

markdalgleish
Copy link
Member

No description provided.

Copy link

changeset-bot bot commented Feb 22, 2024

🦋 Changeset detected

Latest commit: 2a8de2c

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 16 packages
Name Type
@remix-run/dev Patch
create-remix Patch
remix Patch
@remix-run/architect Patch
@remix-run/cloudflare Patch
@remix-run/cloudflare-pages Patch
@remix-run/cloudflare-workers Patch
@remix-run/css-bundle Patch
@remix-run/deno Patch
@remix-run/eslint-config Patch
@remix-run/express Patch
@remix-run/node Patch
@remix-run/react Patch
@remix-run/serve Patch
@remix-run/server-runtime Patch
@remix-run/testing Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@markdalgleish markdalgleish changed the title WIP: Migrate to pnpm Migrate to pnpm Mar 5, 2024
@markdalgleish markdalgleish marked this pull request as ready for review March 5, 2024 10:07
package.json Outdated Show resolved Hide resolved
Comment on lines -290 to -294
await fse.copy(
path.join(__dirname, "../../build/node_modules"),
path.join(projectDir, "node_modules"),
{ overwrite: true }
);
Copy link
Member Author

@markdalgleish markdalgleish Mar 6, 2024

Choose a reason for hiding this comment

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

This throws an error when combined with pnpm's use of symlinks. As an alternative approach, we now always copy the root build package directories to each package's dist directory and then use workspace:* dependencies so that the built versions of packages are available within workspace packages.

@@ -26,7 +26,7 @@
"access": "public",
"baseBranch": "dev",
"updateInternalDependencies": "patch",
"ignore": [],
"ignore": ["integration", "integration-*"],
Copy link
Member Author

Choose a reason for hiding this comment

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

This gets rid of all the changesets noise for packages that aren't published, which would otherwise be made even worse in this PR now that each integration helper template is a workspace package.

engine-strict=true
shell-emulator=true
enable-pre-post-scripts=true
Copy link
Member Author

Choose a reason for hiding this comment

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

We may want to remove this flag in the future, but I've enabled this flag for now to reduce the number of unnecessary changes.

engine-strict=true
shell-emulator=true
Copy link
Member Author

Choose a reason for hiding this comment

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

This allows us to remove cross-env.

"changeset": "changeset",
"changeset:version": "changeset version && node ./scripts/remove-prerelease-changelogs.mjs && node ./scripts/patchup-version.mjs",
"changeset:release": "yarn build --tsc --publish && changeset publish",
Copy link
Member Author

Choose a reason for hiding this comment

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

The --publish flag has been removed in this PR. Only --tsc is required.

exec("pnpm", ["rollup", "-c"])
.then(() => tsc && exec("pnpm", ["--recursive", "tsc", "-b"]))
.then(() =>
exec("node", ["scripts/copy-build-to-dist.mjs", ...(tsc ? ["--tsc"] : [])])
Copy link
Member Author

@markdalgleish markdalgleish Mar 6, 2024

Choose a reason for hiding this comment

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

We now always run this script. See https://github.com/remix-run/remix/pull/8848/files#r1513657148.

Note that this means it's not guaranteed a --tsc build is being run, so we now need to pass the flag down to this script too, otherwise this script fails trying to copy non-existent .d.ts files.

@@ -15,7 +15,7 @@ function getTaggedVersion() {
* @param {string} tag
*/
function publish(dir, tag) {
execSync(`npm publish --tag ${tag} ${dir}`, { stdio: "inherit" });
execSync(`pnpm publish ${dir} --tag ${tag}`, { stdio: "inherit" });
Copy link
Member Author

Choose a reason for hiding this comment

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

Since I haven't attempted a publish, I've rearranged args to match the pnpm docs just in case the order is important.

@markdalgleish markdalgleish merged commit bfb9c72 into dev Mar 6, 2024
9 checks passed
@markdalgleish markdalgleish deleted the markdalgleish/pnpm branch March 6, 2024 04:07
@github-actions github-actions bot added the awaiting release This issue has been fixed and will be released soon label Mar 6, 2024
@lifeiscontent
Copy link
Contributor

lifeiscontent commented Mar 6, 2024

@markdalgleish nice job on this one, will be a much nicer workflow now 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
awaiting release This issue has been fixed and will be released soon CLA Signed feat:dx Issues related to the developer experience
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants