-
Notifications
You must be signed in to change notification settings - Fork 18
Expand file tree
/
Copy path.npmrc
More file actions
55 lines (47 loc) · 2.7 KB
/
Copy path.npmrc
File metadata and controls
55 lines (47 loc) · 2.7 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
# WordPress core packages are provided at runtime by WordPress and extracted
# at build time via @wordpress/dependency-extraction-webpack-plugin. They're
# imported in virtually every plugin without being declared as direct deps.
# This is the standard WP ecosystem convention -- declaring them in every
# plugin would add ~270 redundant lines across the workspace.
public-hoist-pattern[]=@wordpress/*
# TypeScript type declarations needed at build time.
public-hoist-pattern[]=@types/*
# ESLint plugins must resolve to a single copy. pnpm's strict layout creates
# duplicate virtual store entries when peer dependency contexts diverge.
public-hoist-pattern[]=eslint
public-hoist-pattern[]=eslint-plugin-*
public-hoist-pattern[]=eslint-config-*
public-hoist-pattern[]=@typescript-eslint/*
# Some plugins' webpack.config.js reference babel-loader from the plugin
# context without declaring it -- newspack-ads via require.resolve('babel-loader'),
# newspack-blocks as a `loader: 'babel-loader'` rule -- relying on it being
# provided transitively by the WP scripts toolchain. Hoist it so those configs
# resolve under pnpm's strict layout.
public-hoist-pattern[]=babel-loader
# newspack-scripts' babelJestTransformer.js require()s babel-jest at runtime.
# Since it was removed from newspack-scripts' own package.json, it must be
# hoisted so the CJS require() can find it from the transformer's location.
public-hoist-pattern[]=babel-jest
# The same transformer's babel config loads @babel/preset-env and
# @babel/preset-typescript at runtime; hoist them so they resolve from the
# transformer's location under pnpm's strict layout.
public-hoist-pattern[]=@babel/preset-env
public-hoist-pattern[]=@babel/preset-typescript
# Testing Library matchers/utilities are provided by the shared newspack-scripts
# test toolchain and imported directly from plugin test files (e.g.
# `import '@testing-library/jest-dom'`) without being declared per-plugin. Hoist
# them so those imports resolve under pnpm's strict layout.
public-hoist-pattern[]=@testing-library/*
# Peer dep resolution.
legacy-peer-deps=true
auto-install-peers=true
strict-peer-dependencies=false
dedupe-peer-dependents=true
# Always satisfy an internal dep from packages/ rather than the npm registry.
# pnpm 10 defaults this to false, so a manifest carrying a concrete version
# (e.g. "newspack-scripts": "5.10.0-alpha.1") resolves from the registry instead
# of linking the workspace copy. The registry tarballs ship raw JSX in src/,
# which sits outside every plugin's babel-loader scope and fails the build with
# "Unexpected token <SVG". The release tooling no longer writes such pins, but
# this keeps a stray one from silently switching consumers to a registry copy.
link-workspace-packages=true