Skip to content

chore(dev deps) - Upgrade all remaining dependencies #246

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

Conversation

spanishpear
Copy link
Contributor

@spanishpear spanishpear commented Apr 26, 2025

Yarn v1 is frozen, and not receiving bugfixes or features anymore!

This PR migrates manypkg internally to use yarn 4 instead :)

There should be no breaking changes to the usages.

Will have to fix some things in CI 🕸️

Copy link

changeset-bot bot commented Apr 26, 2025

🦋 Changeset detected

Latest commit: c580241

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

This PR includes changesets to release 6 packages
Name Type
@manypkg/gatsby-source-workspace Minor
@manypkg/get-packages Minor
@manypkg/find-root Minor
@manypkg/tools Minor
@manypkg/cli Minor
test-gatsby-thing Minor

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

@@ -41,7 +41,7 @@
"prettier-plugin-packagejson": "^2.5.10",
"typescript": "^5.3.2"
},
"packageManager": "yarn@1.22.22+sha512.a6b2f7906b721bba3d67d4aff083df04dad64c399707841b7acf00f6b133b7ac24255f2652fa22ae3534329dc6180534e98d17432037ff6fd140556e2bb3137e",
"packageManager": "yarn@4.9.1+sha512.f95ce356460e05be48d66401c1ae64ef84d163dd689964962c6888a9810865e39097a5e9de748876c2e0bf89b232d583c33982773e9903ae7a76257270986538",
Copy link
Contributor Author

Choose a reason for hiding this comment

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

SHA generated via corepack upnodejs/corepack#231 (comment)

@spanishpear spanishpear marked this pull request as draft April 26, 2025 11:08
Copy link

socket-security bot commented Apr 26, 2025

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Addedreact@​19.1.01001008397100

View full report

Copy link
Contributor Author

@spanishpear spanishpear Apr 26, 2025

Choose a reason for hiding this comment

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

We need a basic yarn lock, else the tests will fail when running yarn scripts - as they will all error with "this package isn't part of the yarn workspace of manypkg

@@ -22,27 +17,17 @@ exports[`Run command should execute "package start" and exit with 1: stderr 1`]

exports[`Run command should execute "package start" and exit with 1: stdout 1`] = `""`;

exports[`Run command should execute "package-one start" and exit with 0: stderr 1`] = `
"warning package.json: No license field
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This error doesn't exist anymore in yarn berry - https://github.com/search?q=repo%3Ayarnpkg%2Fberry++%22No+license+field%22&type=code

Was not fun to debug that 😆


const f = fixturez(__dirname);
const f = fixturez(import.meta.url);
const require = createRequire(import.meta.url);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added in order to get tests running with ESM

"allowImportingTsExtensions": true,
"skipLibCheck": true,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

skipLibCheck to avoid typechecking external .d.ts files - that have errors in them - mostly due to gatsby/react/JSX upstream issues :(

fix: typo with corepack (2)

feat: basic yarn cache, and correct args

fix: remove yarn cache, action requires different orderings

fix: attempt cache with differrent orderings

fix: attempt to remove chicken egg problem with cache

formatting
@spanishpear spanishpear force-pushed the spanishpear/yarn-upgrade-4.9 branch from b6fd466 to db89e4d Compare April 26, 2025 13:00
@@ -13,35 +13,39 @@
"postinstall": "preconstruct dev && NODE_OPTIONS=--experimental-strip-types packages/cli/bin.js check",
"knip": "knip",
"release": "preconstruct build && changeset publish",
"test": "jest",
"test": "NODE_OPTIONS='--disable-warning=ExperimentalWarning --experimental-vm-modules' jest",
Copy link
Contributor Author

Choose a reason for hiding this comment

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

tell jest to run with ESM as per https://jestjs.io/docs/ecmascript-modules

@spanishpear spanishpear marked this pull request as ready for review April 26, 2025 13:13
@spanishpear spanishpear changed the title chore(dev deps) - upgrade yarn from 1.22.1 -> 4.9.1 chore(dev deps) - Upgrade all remaining dependencies Apr 26, 2025
Comment on lines +9 to +16
"jest": {
"config": ["package.json"],
"entry": [
"**/__tests__/**/*.ts",
"**/?(*.)+(test).ts",
"**/__fixtures__/**/*.[jt]s"
]
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

q: what do we need this for?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

For some reason knip was failing to automaticaly detect our jest usage, and hence marking most of the test files as unused files.

@@ -35,7 +37,8 @@ describe("Run command", () => {
cwd: f.find("basic-with-scripts"),
env: {
...process.env,
NODE_OPTIONS: "--experimental-strip-types",
NODE_OPTIONS:
"--experimental-strip-types --disable-warning=ExperimentalWarning",
Copy link
Collaborator

Choose a reason for hiding this comment

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

does this make stripNodeWarnings obsolete?

@@ -1,8 +1,10 @@
import fixturez from "fixturez";
import stripAnsi from "strip-ansi";
import { exec } from "tinyexec";
import { createRequire } from "node:module";
Copy link
Collaborator

Choose a reason for hiding this comment

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

We could replace this with https://www.npmjs.com/package/import-meta-resolve , but honestly using either is just equally fine given this is a test file anyway

@@ -4,7 +4,7 @@
//
// Who can say? ¯\_(ツ)_/¯

import { Package } from "@manypkg/get-packages";
import type { Package } from "@manypkg/get-packages";
Copy link
Collaborator

Choose a reason for hiding this comment

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

We should use erasableSyntaxOnly + verbatimModuleSyntax to catch issues like this

Copy link
Collaborator

Choose a reason for hiding this comment

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

I see you have already enabled both 👍

@@ -3,9 +3,11 @@
/* Basic Options */
// "incremental": true, /* Enable incremental compilation */
"target": "esnext" /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019' or 'ESNEXT'. */,
"module": "Node16" /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', or 'ESNext'. */,
//"erasableSyntaxOnly": true, - we need TS 5.8 first
"module": "nodenext" /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', or 'ESNext'. */,
Copy link
Collaborator

Choose a reason for hiding this comment

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

Node16 (or Node18) is, kind of, a safer value

@@ -26,7 +28,8 @@

/* Strict Type-Checking Options */
"strict": true /* Enable all strict type-checking options. */,
// "noImplicitAny": true, /* Raise error on expressions and declarations with an implied 'any' type. */
"noImplicitOverride": true /* Ensure overriding members in derived classes are marked with an explicit override modifier. */,
"noImplicitAny": true /* Raise error on expressions and declarations with an implied 'any' type. */,
Copy link
Collaborator

Choose a reason for hiding this comment

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

this is already enabled through strict: true

Copy link
Contributor Author

Choose a reason for hiding this comment

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

oh, it is too!

@Andarist
Copy link
Collaborator

Given @bluwy's migration to Vitest... I think I'd close this one and split the work into slightly smaller pieces. I'm in favor of migrating the repo to pnpm so migrating (temporarily) to yarn 4 doesn't bring much value. With that migration in - we should then bump all the dependencies.

@spanishpear
Copy link
Contributor Author

spanishpear commented Apr 27, 2025

Makes sense @Andarist - will probably wait for the decision on gatsby package removal (#247) as well :D

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