forked from dxos/dxos
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.pnpmfile.cjs
118 lines (100 loc) · 2.95 KB
/
.pnpmfile.cjs
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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
// https://pnpm.io/pnpmfile
function readPackage(packageJson, context) {
switch (packageJson.name) {
// Package has an unneccessarily strict peer dep of 17.0.1
case '@hot-loader/react-dom': {
packageJson.peerDependencies['react'] = '^18.0.0'
break;
}
// https://github.com/nrwl/nx/issues/11456#issuecomment-1211214171
case '@nrwl/nx-cloud': {
packageJson.dependencies['dotenv'] = '*'
break;
}
case '@nrwl/vite': {
// We don't use vitest.
delete packageJson.peerDependencies['vitest']
break;
}
case '@storybook/html': {
// Unused.
delete packageJson.peerDependencies['@babel/core'];
break;
}
case '@typescript-eslint/eslint-plugin':
case '@typescript-eslint/parser': {
packageJson.dependencies['eslint'] = '^8.0.0'
break;
}
case 'esbuild-plugin-raw': {
packageJson.peerDependencies['esbuild'] = '^0.16.0'
break;
}
case 'ink':
case 'ink-select-input':
case 'ink-syntax-highlight':
case 'ink-text-input':
case 'react-reconciler': {
packageJson.peerDependencies['react'] = '^18.0.0'
break;
}
// @dxos/presenter
case '@react-pdf/renderer': {
packageJson.peerDependencies['react'] = '^18.0.0'
break;
}
// @storybook/react transitive dep
case 'react-element-to-jsx-string': {
packageJson.peerDependencies['react'] = '^18.0.0'
packageJson.peerDependencies['react-dom'] = '^18.0.0'
break;
}
// @storybook/addon-essentials transitive deps
case 'react-inspector':
case '@mdx-js/react':
// https://github.com/FezVrasta/react-resize-aware/issues/59
case 'react-resize-aware': {
packageJson.peerDependencies['react'] = '^18.0.0'
break;
}
// @dxos/devtools
case 'react-vis':
case 'react-motion': {
packageJson.peerDependencies['react'] = '^18.0.0'
break;
}
// @dxos/devtools-extension
case '@crxjs/vite-plugin': {
packageJson.peerDependencies['vite'] = '^4.2.0'
break;
}
case 'storybook-addon-react-router-v6': {
packageJson.peerDependencies['@storybook/addons'] = '^7.0.0-beta'
packageJson.peerDependencies['@storybook/api'] = '^7.0.0-beta'
packageJson.peerDependencies['@storybook/components'] = '^7.0.0-beta'
packageJson.peerDependencies['@storybook/core-events'] = '^7.0.0-beta'
packageJson.peerDependencies['@storybook/theming'] = '^7.0.0-beta'
break;
}
// Ensure vuepress uses compatible vite version.
case '@vuepress/bundler-vite': {
packageJson.dependencies['vite'] = '^4.2.0'
break;
}
// Ensure vuepress uses compatible vite version.
case '@vitejs/plugin-vue': {
packageJson.peerDependencies['vite'] = '^4.2.0'
break;
}
}
return packageJson
}
function afterAllResolved(lockfile, context) {
return lockfile
}
module.exports = {
hooks: {
readPackage,
afterAllResolved,
}
}