File tree Expand file tree Collapse file tree 2 files changed +52
-2
lines changed Expand file tree Collapse file tree 2 files changed +52
-2
lines changed Original file line number Diff line number Diff line change 13
13
- pkgroll
14
14
- sonarjs
15
15
- vitepress
16
+ - xsai
16
17
ignoreWords : []
17
18
import : []
Original file line number Diff line number Diff line change 2
2
3
3
## [ Workspace] ( https://pnpm.io/workspaces )
4
4
5
+ ``` yaml
6
+ # pnpm-workspace.yaml
7
+ packages :
8
+ - packages/*
9
+ ` ` `
10
+
5
11
## [Catalogs](https://pnpm.io/catalogs)
6
12
7
- ## [ publishConfig] ( https://pnpm.io/package_json#publishconfig )
13
+ When you have multiple packages in your workspace that depend on the same library, you can use catalogs to better standardize versions.
14
+
15
+ ` ` ` yaml
16
+ # pnpm-workspace.yaml
17
+ packages :
18
+ - packages/*
19
+
20
+ catalog :
21
+ react : ^19.1.0
22
+
23
+ catalogs :
24
+ xsai :
25
+ xsai : ^0.2.0
26
+ ` ` `
27
+
28
+ ` ` ` jsonc
29
+ // packages/foo/package.json
30
+ {
31
+ " name " : " @example/foo" ,
32
+ " dependencies " : {
33
+ " react " : " catalog:" ,
34
+ " xsai " : " catalog:xsai"
35
+ }
36
+ }
37
+ ```
38
+
39
+ ### YAML Anchors
40
+
41
+ Do you remember that ` pnpm-workspace.yaml ` is YAML?
42
+
43
+ This means we can use YAML Anchors to manage the same version, like this:
44
+
45
+ ``` yaml
46
+ # pnpm-workspace.yaml
47
+ packages :
48
+ - packages/*
49
+
50
+ catalog :
51
+ ' @xsai/embed ' : &xsai ^0.2.0
52
+ ' @xsai/generate-text ' : *xsai
53
+ ' @xsai/shared ' : *xsai
54
+ ' @xsai/shared-chat ' : *xsai
55
+ ` ` `
56
+
57
+ ## [package.json#publishConfig](https://pnpm.io/package_json#publishconfig)
8
58
9
59
pnpm supports overriding something at publish time via publishConfig.
10
60
@@ -23,7 +73,6 @@ So we can do that:
23
73
}
24
74
},
25
75
" main " : " ./dist/index.js" ,
26
- "module" : " ./dist/index.js" ,
27
76
" types " : " ./dist/index.d.ts"
28
77
}
29
78
}
You can’t perform that action at this time.
0 commit comments