-
Notifications
You must be signed in to change notification settings - Fork 251
Expand file tree
/
Copy pathyarn.config.cjs
More file actions
45 lines (44 loc) · 1.66 KB
/
Copy pathyarn.config.cjs
File metadata and controls
45 lines (44 loc) · 1.66 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
// see https://yarnpkg.com/features/constraints
const { defineConfig } = require('@yarnpkg/types');
module.exports = defineConfig({
async constraints({ Yarn }) {
for (const workspace of Yarn.workspaces()) {
for (const version of workspace.pkg.dependencies.values()) {
if (
version.ident.startsWith('@aglocal/') ||
version.ident.startsWith('@agoric/') ||
version.ident == 'agoric'
) {
// If the dependency is not a workspace and is not the special case '@agoric/wallet-ui',
// then it's an error because all Agoric dependencies must be resolved via the workspace protocol.
if (!version.workspace && version.ident != '@agoric/wallet-ui')
workspace.error(
'Agoric dependencies must resolve by the workspace: protocol',
);
}
}
if (workspace.cwd.startsWith('packages/')) {
workspace.set('engines.node', '^22.11');
if (workspace.ident?.startsWith('@aglocal/')) {
workspace.set('private', true);
} else if (
workspace.ident?.startsWith('@agoric/') ||
workspace.ident == 'agoric'
) {
workspace.unset('private');
} else {
workspace.error(
'Workspaces in the packages directory must be under the @agoric or @aglocal scope',
);
}
} else if (workspace.cwd.startsWith('services/')) {
if (!workspace.ident?.startsWith('@aglocal/')) {
workspace.error(
'Workspaces in the services directory must be in the @aglocal scope',
);
}
workspace.set('private', true);
}
}
},
});