8000 Merge pull request #3678 from dmichon-msft/pnpm-config-environment · mstomar698/rushstack@a1afb32 · GitHub
[go: up one dir, main page]

Skip to content

Commit a1afb32

Browse files
authored
Merge pull request microsoft#3678 from dmichon-msft/pnpm-config-environment
[rush] environmentVariables in pnpm-config schema
2 parents 9e51c05 + df157d9 commit a1afb32

File tree

4 files changed

+41
-0
lines changed

4 files changed

+41
-0
lines changed
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"changes": [
3+
{
4+
"packageName": "@microsoft/rush",
5+
"comment": "Add missing \"environmentVariables\" property to \"pnpm-config.json\" schema to restore feature parity with \"rush.json\" \"pnpmOptions\" field.",
6+
"type": "none"
7+
}
8+
],
9+
"packageName": "@microsoft/rush"
10+
}

libraries/rush-lib/src/logic/pnpm/test/PnpmOptionsConfiguration.test.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,13 @@ describe(PnpmOptionsConfiguration.name, () => {
3737
'bar@^2.1.0': '3.0.0',
3838
'qar@1>zoo': '2'
3939
});
40+
41+
expect(pnpmConfiguration.environmentVariables).toEqual({
42+
NODE_OPTIONS: {
43+
value: '--max-old-space-size=4096',
44+
override: false
45+
}
46+
});
4047
});
4148

4249
it('loads packageExtensions', () => {

libraries/rush-lib/src/logic/pnpm/test/jsonFiles/pnpm-config-overrides.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,12 @@
44
"quux": "npm:@myorg/quux@^1.0.0",
55
"bar@^2.1.0": "3.0.0",
66
"qar@1>zoo": "2"
7+
},
8+
9+
"environmentVariables": {
10+
"NODE_OPTIONS": {
11+
"value": "--max-old-space-size=4096",
12+
"override": false
13+
}
714
}
815
}

libraries/rush-lib/src/schemas/pnpm-config.schema.json

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,23 @@
2626
"enum": ["local", "global"]
2727
},
2828

29+
"environmentVariables": {
30+
"description": "Environment variables for PNPM invocation",
31+
"type": "object",
32+
"additionalProperties": {
33+
"type": "object",
34+
"properties": {
35+
"value": {
36+
"type": "string"
37+
},
38+
"override": {
39+
"type": "boolean"
40+
}
41+
},
42+
"additionalProperties": false
43+
}
44+
},
45+
2946
"preventManualShrinkwrapChanges": {
3047
"description": "If true, then \"rush install\" will report an error if manual modifications were made to the PNPM shrinkwrap file without running `rush update` afterwards. To temporarily disable this validation when invoking \"rush install\", use the \"--bypassPolicy\" command-line parameter. The default value is false.",
3148
"type": "boolean"

0 commit comments

Comments
 (0)
0