Skip to content

Remove most pnpm hoisting, fix phantom deps #24096

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

Merged
merged 3 commits into from
Apr 27, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 18 additions & 2 deletions .npmrc
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,21 @@ strict-peer-dependencies = true
# Force node version
engine-strict = true

# Default, minus eslint.
public-hoist-pattern=['*types*', '@prettier/plugin-*', '*prettier-plugin-*']
# No hoisting by default.
hoist-pattern=[]
public-hoist-pattern=[]

# Hoist eslint crap. Too many problems there to figure out right now.
# Probably we need to move more of the different eslint configs into tools/js-tools/eslintrc/.
hoist-pattern[]='@babel/eslint-parser'
hoist-pattern[]='@typescript-eslint/parser'
hoist-pattern[]='@typescript-eslint/eslint-plugin'
hoist-pattern[]='@wordpress/eslint-plugin'
hoist-pattern[]='eslint-config-prettier'
hoist-pattern[]='eslint-import-resolver-node'
hoist-pattern[]='eslint-plugin-es5'
hoist-pattern[]='eslint-plugin-playwright'
hoist-pattern[]='eslint-plugin-react'

# Hoist prettier crap too.
hoist-pattern[]='prettier-plugin-svelte'
33 changes: 33 additions & 0 deletions .pnpmfile.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,24 @@ function fixDeps( pkg ) {
pkg.dependencies[ '@wordpress/components' ] = '^19.2.0';
}
}
if ( pkg.name === '@automattic/components' ) {
// 1.0.0-alpha.3 published 2020-11-11. Not that we want alpha.4, they added an i18n-calypso dep (ugh).
if ( ! pkg.dependencies[ '@wordpress/base-styles' ] ) {
// Depends on this but doesn't specify it.
pkg.dependencies[ '@wordpress/base-styles' ] = '^4.0.4';
}
}

// Depends on events but doesn't declare it.
if ( pkg.name === '@automattic/popup-monitor' && ! pkg.dependencies.events ) {
pkg.dependencies.events = '^3.3.0';
}

// Depends on punycode but doesn't declare it.
// https://github.com/markdown-it/markdown-it/issues/230
if ( pkg.name === 'markdown-it' && ! pkg.dependencies.punycode ) {
pkg.dependencies.punycode = '^2.1.1';
}

// Even though Storybook works with webpack 5, they still have a bunch of deps on webpack4.
if ( pkg.name.startsWith( '@storybook/' ) ) {
Expand All @@ -37,6 +55,15 @@ function fixDeps( pkg ) {
}
}

// Outdated dep.
// https://github.com/SamVerschueren/stream-to-observable/pull/9
if (
pkg.name === '@samverschueren/stream-to-observable' &&
pkg.dependencies[ 'any-observable' ] === '^0.3.0'
) {
pkg.dependencies[ 'any-observable' ] = '^0.5.1';
}

// Project is supposedly not dead, but still isn't being updated.
// For our purposes at least it seems to work fine with jest-environment-jsdom 27.
// https://github.com/enzymejs/enzyme-matchers/issues/353
Expand Down Expand Up @@ -95,6 +122,12 @@ function fixPeerDeps( pkg ) {
delete pkg.peerDependencies?.[ 'eslint-plugin-node' ];
}

// Peer-depends on js-git but doesn't declare it.
// https://github.com/creationix/git-node-fs/pull/8
if ( pkg.name === 'git-node-fs' && ! pkg.peerDependencies?.[ 'js-git' ] ) {
pkg.peerDependencies[ 'js-git' ] = '*';
}

// Outdated. Looks like they're going to drop the eslint-config-wpcalypso package entirely with
// eslint-plugin-wpcalypso 5.1.0, but they haven't released that yet.
if ( pkg.name === 'eslint-config-wpcalypso' ) {
Expand Down
Loading