-
Notifications
You must be signed in to change notification settings - Fork 663
/
.pnpmfile.cjs
46 lines (42 loc) · 1.12 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
const fs = require("fs");
const path = require("path");
const packages = fs.readdirSync(path.resolve(__dirname, "./packages"));
const components = packages
.filter(
(dirname) =>
![
"react-email",
"eslint-config-custom",
"tsconfig",
"create-email",
].includes(dirname),
)
.map((dirname) => `@react-email/${dirname}`);
function readPackage(pkg) {
if (components.includes(pkg.name)) {
if (
"react" in pkg.dependencies &&
pkg.dependencies["react"] === "^18.0 || ^19.0 || ^19.0.0-rc"
) {
pkg.dependencies.react = "19.0.0-rc-02c0e824-20241028";
}
if (
"react-dom" in pkg.dependencies &&
pkg.dependencies["react-dom"] === "^18.0 || ^19.0 || ^19.0.0-rc"
) {
pkg.dependencies["react-dom"] = "19.0.0-rc-02c0e824-20241028";
}
if ("react" in pkg.peerDependencies) {
pkg.peerDependencies.react = "19.0.0-rc-02c0e824-20241028";
}
if ("react-dom" in pkg.peerDependencies) {
pkg.peerDependencies["react-dom"] = "19.0.0-rc-02c0e824-20241028";
}
}
return pkg;
}
module.exports = {
hooks: {
readPackage,
},
};