Skip to content

Commit 5b45c14

Browse files
committed
refactor: consolidate pnpm configuration into pnpm-workspace.yaml and clean up .npmrc and package.json5
1 parent 7da380e commit 5b45c14

File tree

3 files changed

+184
-231
lines changed

3 files changed

+184
-231
lines changed

.npmrc

Lines changed: 1 addition & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1,47 +1,8 @@
11
;;; Your private registry
22
;;; registry = XXX
33

4-
;;; Node.js version that will be automatically used
5-
use-node-version = 22.6.0
6-
74
;;; During development of this package, only allow node & npm versions stated in package.json::engines
85
engine-strict = true
96

10-
;;; Prevent installing dependencies for ALL packages every time `pnpm install` is run
11-
recursive-install = false
12-
13-
;;; Do not bunch together peer dependencies in the root node_modules
14-
resolve-peers-from-workspace-root = false
15-
hoist = false
16-
17-
;;; Do not auto-install peer deps
18-
auto-install-peers = false
19-
20-
;; needed due to a bug in `recursive-install`
21-
;; ref 1: https://github.com/pnpm/pnpm/issues/6300
22-
;; ref 2: https://github.com/pnpm/pnpm/issues/5508
23-
dedupe-peer-dependents = false
24-
257
;;; Disable version update reminders, we don't want developers to have different versions
26-
update-notifier = false
27-
28-
;;; Let's be explicit about the shell that executes the "scripts" in package.json
29-
script-shell = bash
30-
31-
;;; Don't allow circular dependencies between projects in this repo
32-
disallow-workspace-cycles = true
33-
34-
;;; When available, default to using local package when running `pnpm install <package name>`
35-
link-workspace-packages = true
36-
37-
;;; If node_modules is outdated, fail the running command
38-
verify-deps-before-run = error
39-
40-
;;; Fail installation if a dependency has postinstall that is neither approved or ignored
41-
strict-dep-builds = true
42-
43-
;;; Don't ignore patch failures during install
44-
ignore-patch-failures = false
45-
46-
;;; Minimum age in minutes for any package that gets installed
47-
minimum-release-age = 1440
8+
update-notifier = false

package.json5

Lines changed: 4 additions & 191 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,9 @@
8484
'shared:repo:fix:lint:package.json:dependencies': 'pnpm --filter=@repo/syncpack-base-isolated run fix:syncpack',
8585
// different naming from the other fixing commands so that it's not executed when you do pnpm --workspace-root run '/^shared:fix:.+/'
8686
'shared:staged:fix:common': "PACKAGE_DIR=$INIT_CWD pnpm --filter=@repo/lint-staged-base-isolated run staged:fix:lint --diff='--cached'",
87+
/**
88+
* SHORTCUTS FOR COMMANDS THAT DON'T APPLY TO SPECIFIC PACKAGE BUT TO ALL OF THEM
89+
*/
8790
// checks if dependencies which are not explicitly allowed to have different version are the same across all `packages.json`
8891
'repo:lint:package.json:dependencies': 'pnpm --filter=@repo/syncpack-base-isolated run syncpack:lint',
8992
// list all packages in the repo
@@ -129,197 +132,7 @@
129132
* This is achieved with a little bit of customization in .pnpmfile.cjs
130133
*/
131134
codeEditorIntegrationDependencies: {
132-
eslint: '9.30.1', /**
133-
* SHORTCUTS FOR COMMANDS THAT DON'T APPLY TO SPECIFIC PACKAGE BUT TO ALL OF THEM
134-
*/ /* [comment possibly relocated by pnpm] */
135+
eslint: '9.30.1',
135136
prettier: '3.4.2',
136137
},
137-
/**
138-
* Fixes and overrides of dependencies across packages in the repo
139-
*/
140-
pnpm: {
141-
/**
142-
* Override the older versions of those nested dependencies so we get some bug fixes
143-
*/
144-
overrides: {
145-
cosmiconfig: '^9',
146-
'@jest/globals@29>@jest/environment': '-',
147-
'@jest/globals@29>@jest/expect': '-',
148-
'@jest/globals@29>@jest/types': '-',
149-
},
150-
packageExtensions: {
151-
/**
152-
* We patch eslint-plugin-json-schema-validator to enable custom errors
153-
* which means we need the ajv packages as peer deps
154-
*/
155-
'eslint-plugin-json-schema-validator': {
156-
peerDependencies: {
157-
ajv: '*',
158-
'ajv-errors': '*',
159-
},
160-
},
161-
/**
162-
* Fix problems in third party package definitions
163-
*/
164-
'@reactflow/core': { /**
165-
* SHORTCUTS FOR RELEASING PACKAGES
166-
*/ /* [comment possibly relocated by pnpm] */
167-
peerDependencies: {
168-
'@types/react': '*',
169-
},
170-
},
171-
'react-toastify': {
172-
peerDependencies: {
173-
'react-dom': '*',
174-
},
175-
},
176-
// We want webpack-cli always available to webpack when installed as peer dependency
177-
webpack: { /**
178-
* MISC USEFUL SHORTCUTS
179-
*/ /* [comment possibly relocated by pnpm] */
180-
peerDependencies: {
181-
'webpack-cli': '*',
182-
},
183-
},
184-
// hygen have not defined any ts loaders as peers, so we need to fix that
185-
hygen: {
186-
peerDependencies: {
187-
tsx: '*',
188-
},
189-
},
190-
'@angular-devkit/build-angular': {
191-
peerDependencies: {
192-
'ng-packagr': '*',
193-
},
194-
},
195-
'@angular-builders/custom-webpack': {
196-
dependencies: {
197-
rxjs: '*',
198-
},
199-
},
200-
'@angular-architects/module-federation': {
201-
peerDependencies: {
202-
tslib: '*',
203-
webpack: '*',
204-
},
205-
dependencies: {
206-
json5: '*',
207-
},
208-
},
209-
'jest-runner': {
210-
peerDependencies: {
211-
tslib: '*',
212-
},
213-
},
214-
'jest-environment-jsdom': {
215-
peerDependencies: {
216-
tslib: '*',
217-
},
218-
},
219-
/**
220-
* SHORTCUTS FOR CODE-EDITOR INTEGRATIONS
221-
*/ /* [comment possibly relocated by pnpm] */ /* [comment possibly relocated by pnpm] */ /* [comment possibly relocated by pnpm] */
222-
'jest-preset-angular': {
223-
dependencies: {
224-
'zone.js': '*',
225-
},
226-
},
227-
'jest-circus': {
228-
peerDependencies: {
229-
tslib: '*',
230-
},
231-
},
232-
'jest-config': {
233-
dependencies: {
234-
'ts-node': '*',
235-
},
236-
},
237-
'@testing-library/jest-dom': {
238-
dependencies: {
239-
'@types/aria-query': '*',
240-
},
241-
peerDependencies: {
242-
'@types/react': '*',
243-
},
244-
},
245-
'@testing-library/react': {
246-
peerDependencies: {
247-
'@types/react-dom': '*',
248-
},
249-
},
250-
'@jest/globals@29': {
251-
peerDependencies: {
252-
'@jest/environment': '^29.7.0',
253-
'@jest/expect': '^29.7.0',
254-
'@jest/types': '^29.6.3',
255-
},
256-
},
257-
'react-i18next': {
258-
peerDependencies: {
259-
'@types/react': '*',
260-
},
261-
},
262-
tslib: {
263-
dependencies: {
264-
'ts-node': '*',
265-
},
266-
},
267-
'@auth0/auth0-angular': {
268-
dependencies: {
269-
rxjs: '*',
270-
},
271-
},
272-
'@angular-builders/common': {
273-
peerDependencies: {
274-
'mini-css-extract-plugin': '*',
275-
},
276-
},
277-
'@pnpm/filter-workspace-packages': {
278-
peerDependencies: {
279-
'@pnpm/types': '*',
280-
},
281-
},
282-
zx: {
283-
peerDependencies: {
284-
'@types/fs-extra': '*',
285-
},
286-
},
287-
'@eslint/eslintrc': {
288-
peerDependencies: {
289-
eslint: '*',
290-
},
291-
},
292-
},
293-
patchedDependencies: {
294-
/**
295-
* We patch hygen due to:
296-
* 1. a bug in color highlighting: https://github.com/jondot/hygen/issues/265
297-
* 2. using `tsx` instead of `ts-node` since `ts-node` is stale and does not support extending multiple tsconfigs
298-
*/
299-
'[email protected]': 'infra/devx-and-repo/generators/patches/[email protected]',
300-
/**
301-
* With this patch, we enable custom error messages via ajv-error
302-
*/
303-
'eslint-plugin-json-schema-validator': 'infra/code-checks/eslint-base-isolated/patches/eslint-plugin-json-schema-validator.patch',
304-
/**
305-
* With this patch, we make sure `lint-staged` recognizes its own `lint-staged` node_modules/.bin
306-
* files
307-
*/
308-
'lint-staged': 'infra/code-checks/lint-staged-base-isolated/patches/lint-staged.patch',
309-
/**
310-
* With this patch, we make sure `depcheck` recognizes the `package` option even when run as CLI
311-
*/
312-
depcheck: 'infra/code-checks/depcheck-base-isolated/patches/depcheck.patch',
313-
/**
314-
* Allow `filterPackages` to accept a new option called `createPkgGraph` to customize the graph
315-
*/
316-
'@pnpm/filter-workspace-packages': 'infra/devx-and-repo/repo-shell-scripts/patches/@pnpm__filter-workspace-packages.patch',
317-
},
318-
onlyBuiltDependencies: [
319-
'@swc/core',
320-
'core-js',
321-
'cypress',
322-
'esbuild',
323-
],
324-
},
325138
}

0 commit comments

Comments
 (0)