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

upgrade Yarn to v4 #9945

Draft
wants to merge 20 commits into
base: master
Choose a base branch
from
Draft

upgrade Yarn to v4 #9945

wants to merge 20 commits into from

Conversation

turadg
Copy link
Member

@turadg turadg commented Aug 22, 2024

closes: #451

#loadgen-branch: ta/yarn4-compat

Description

Attempting #8461 again after various other packageManager improvements. Starting with a fresh branch to be able to compare with the earlier attempt.

This time I'm deferring adoption of the workspace protocol to avoid having to test publishing (for all but boot package which is private)

Security Considerations

None. Though Yarn 4 opens the option to keep the registry cache in the repo, reducing supply chain risk.

Scaling Considerations

n/a

Documentation Considerations

Any docs that advise a global install of Yarn will need updating. We should only be advising corepack enable so that the packageManager field can specify the correct version.

Testing Considerations

CI

Upgrade Considerations

n/a

Copy link

cloudflare-workers-and-pages bot commented Aug 22, 2024

Deploying agoric-sdk with  Cloudflare Pages  Cloudflare Pages

Latest commit: fd40918
Status: ✅  Deploy successful!
Preview URL: https://87ef4d83.agoric-sdk.pages.dev
Branch Preview URL: https://451-yarn-4.agoric-sdk.pages.dev

View logs

@turadg turadg force-pushed the 451-yarn-4 branch 2 times, most recently from ed72865 to 3e004b5 Compare August 22, 2024 20:05
@turadg turadg marked this pull request as ready for review August 22, 2024 20:40
Copy link
Member

@dckc dckc left a comment

Choose a reason for hiding this comment

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

exciting!

reviewed by commit

.gitignore Outdated
@@ -42,8 +42,14 @@ typings/
# Output of 'npm pack'
*.tgz

# Yarn Integrity file
.yarn-integrity
# Yarn (https://yarnpkg.com/getting-started/qa#which-files-should-be-gitignored)
Copy link
Member

Choose a reason for hiding this comment

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

👏 thanks for the clue

"lint": "run-s --continue-on-error lint:*",
"lint:eslint": "eslint .",
"lint:types": "tsc"
"lint": "yarn run -T run-s --continue-on-error 'lint:*'",
Copy link
Member

Choose a reason for hiding this comment

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

TIL:

-T,--top-level Check the root workspace for scripts and/or binaries instead of the current one

packages/agoric-cli/src/lib/yarn.js Outdated Show resolved Hide resolved
Copy link
Member

@kriskowal kriskowal left a comment

Choose a reason for hiding this comment

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

Looks like maintenance to me.

const cliEntrypoint = await importMetaResolve(
'agoric/src/entrypoint.js',
import.meta.url,
).then(u => new URL(u).pathname);
Copy link
Member

Choose a reason for hiding this comment

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

Generally favor url.fileURLToPath for portability.

Copy link
Member

Choose a reason for hiding this comment

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

I lean toward createRequire

import { createRequire } from 'node:module';
const require = createRequire(import.meta.url);

@@ -47,6 +47,7 @@ The parent and child communicate using "commands".

![state diagram](doc/xsnap-states.svg)

<!-- FIXME this stopped working some time ago (was never in CI)
Copy link
Member

Choose a reason for hiding this comment

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

@@ -26,6 +26,7 @@ Then for the couple deeper packages
yarn lerna exec --concurrency 1 --no-bail '../../../scripts/migrate-test-names.mjs'

`;
console.log(usage);
Copy link
Member

Choose a reason for hiding this comment

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

Seems odd to log usage on the happy path.

Copy link
Member Author

Choose a reason for hiding this comment

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

agreed. it was expedient to fix a lint error that usage isn't ever used.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
force:integration Force integration tests to run on PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

eventually move to Yarn 2+ (currently 4)
3 participants