-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Switch JS package manager to pnpm (#44167)
* Adjust `package.json`s to pnpm * Convert resolutions (pnpm doesn't support `**/` syntax) It also removes resolutions that are no longer relevant. * Convert `yarn.lock` to `pnpm-lock.yaml` with `pnpm import` * Always add `e/web/teleport` workspace to the lockfile * Adjust `jest` to new node_modules structure * Adjust `storybook` to new node_modules structure * Replace `toHaveStyleRule` with `toHaveStyle` `jest-styled-components` package is no longer global, so `toHaveStyleRule` matchers is not recognized by TS. We use them only in three places, so it's simpler to convert them to `toHaveStyle`. * Adjust README files * Adjust GHA workflows * Adjust build assets * Remove remaining `yarn` mentions I don't think anyone uses the debug configuration for electron (and we don't have `start-electron` script for a long time). * `corepack enable` -> `corepack enable pnpm` * Automatically enable pnpm when running `make build/teleport` * Run `pnpm import` again * Run `pnpm dedupe` * Add `yarn.lock` to .gitignore * Link to pnpm installation docs * Add a better comment for `transformIgnorePatterns` * Make pattern for `shared` stories more specific * Change `corepack enable pnpm` in readmes * Run `pnpm import && pnpm dedupe` again
- Loading branch information
Showing
34 changed files
with
18,680 additions
and
193 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -103,3 +103,6 @@ web/certs/ | |
|
||
# Files produced by tests | ||
*.avi | ||
|
||
# We have switched to pnpm, ignore Yarn lockfile | ||
yarn.lock |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
function afterAllResolved(lockfile, context) { | ||
// The pnpm lockfile contains entries for all workspaces. | ||
// This means that if the `e` repo is not cloned, we will get a different | ||
// lockfile. | ||
// The ugly workaround is to add an entry for e/web/teleport workspace manually. | ||
// We pass an empty object because `e/web/teleport` package.json doesn't have | ||
// any dependencies. | ||
if (!lockfile.importers['e/web/teleport']) { | ||
context.log(`Workspace 'e/web/teleport' is not present, patching lockfile.`); | ||
lockfile.importers['e/web/teleport'] = {}; | ||
} | ||
return lockfile; | ||
} | ||
|
||
module.exports = { | ||
hooks: { | ||
afterAllResolved, | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,12 +8,14 @@ const esModules = [ | |
'd3-color', | ||
'd3-scale', | ||
'd3-interpolate', | ||
'd3-time-format', | ||
'd3-array', | ||
'd3-format', | ||
'd3-time', | ||
'd3-shape', | ||
'd3-path', | ||
'internmap', | ||
'@nivo/bar', | ||
].join('|'); | ||
|
||
/** @type {import('@jest/types').Config.InitialOptions} */ | ||
|
@@ -27,7 +29,12 @@ module.exports = { | |
// '**/packages/design/src/**/*.jsx', | ||
'**/packages/shared/components/**/*.jsx', | ||
], | ||
transformIgnorePatterns: [`/node_modules/(?!${esModules})`], | ||
// Copied from https://jestjs.io/docs/configuration#transformignorepatterns-arraystring | ||
// Because in pnpm packages are symlinked to node_modules/.pnpm, | ||
// we need to transform packages in that directory. | ||
// We use a relative pattern to match the second 'node_modules/' in | ||
// 'node_modules/.pnpm/@[email protected]/node_modules/@scope/pkg-b/'. | ||
transformIgnorePatterns: [`node_modules/(?!.pnpm|${esModules})`], | ||
coverageReporters: ['text-summary', 'lcov'], | ||
testPathIgnorePatterns: ['e2e'], | ||
setupFilesAfterEnv: [ | ||
|
Oops, something went wrong.