@@ -8,27 +8,15 @@ import { getGlobalVariable, setGlobalVariable } from '../utils/env';
8
8
export default async function ( ) {
9
9
const tempRoot : string = getGlobalVariable ( 'tmp-root' ) ;
10
10
const npmModulesPrefix = join ( tempRoot , 'npm-global' ) ;
11
- const yarnModulesPrefix = join ( tempRoot , 'yarn-global' ) ;
12
11
const npmRegistry : string = getGlobalVariable ( 'package-registry' ) ;
13
12
const npmrc = join ( tempRoot , '.npmrc' ) ;
14
- const yarnrc = join ( tempRoot , '.yarnrc' ) ;
15
- const npmCacheFolder = join ( tempRoot , 'npm-cache-folder' ) ;
16
- const yarnCacheFolder = join ( tempRoot , 'yarn-cache-folder' ) ;
17
13
18
- // Change the npm+yarn userconfig to the sandboxed npmrc to override the default ~
14
+ // Configure npm to use the sandboxed npm globals and rc file
15
+ // From this point onward all npm transactions use the "global" npm cache
16
+ // isolated within this e2e test invocation.
19
17
process . env . NPM_CONFIG_USERCONFIG = npmrc ;
20
-
21
- // The npm+yarn registry URL
22
- process . env . NPM_CONFIG_REGISTRY = npmRegistry ;
23
-
24
- // Configure npm+yarn to use a sandboxed bin directory
25
- // From this point onward all yarn/npm bin files/symlinks are put into the prefix directories
26
18
process . env . NPM_CONFIG_PREFIX = npmModulesPrefix ;
27
- process . env . YARN_CONFIG_PREFIX = yarnModulesPrefix ;
28
-
29
- // Package cache diretories
30
- process . env . NPM_CONFIG_CACHE = npmCacheFolder ;
31
- process . env . YARN_CACHE_FOLDER = yarnCacheFolder ;
19
+ process . env . NPM_CONFIG_REGISTRY = npmRegistry ;
32
20
33
21
// Snapshot builds may contain versions that are not yet released (e.g., RC phase main branch).
34
22
// In this case peer dependency ranges may not resolve causing npm 7+ to fail during tests.
@@ -37,22 +25,11 @@ export default async function () {
37
25
process . env [ 'NPM_CONFIG_legacy_peer_deps' ] = 'true' ;
38
26
}
39
27
40
- // Configure the registry and prefix used within the test sandbox via rc files
41
- await writeFile (
42
- npmrc ,
43
- `registry=${ npmRegistry } \nprefix=${ npmModulesPrefix } \ncache=${ npmCacheFolder } ` ,
44
- ) ;
45
- await writeFile (
46
- yarnrc ,
47
- `registry ${ npmRegistry } \nprefix ${ yarnModulesPrefix } \ncache-folder ${ yarnCacheFolder } ` ,
48
- ) ;
28
+ // Configure the registry and prefix used within the test sandbox
29
+ await writeFile ( npmrc , `registry=${ npmRegistry } \nprefix=${ npmModulesPrefix } ` ) ;
49
30
await mkdir ( npmModulesPrefix ) ;
50
- await mkdir ( yarnModulesPrefix ) ;
51
- await mkdir ( yarnCacheFolder ) ;
52
31
53
32
setGlobalVariable ( 'npm-global' , npmModulesPrefix ) ;
54
- setGlobalVariable ( 'yarn-global' , yarnModulesPrefix ) ;
55
33
56
- console . log ( ` Using "${ npmModulesPrefix } " as e2e test global npm bin dir.` ) ;
57
- console . log ( ` Using "${ yarnModulesPrefix } " as e2e test global yarn bin dir.` ) ;
34
+ console . log ( ` Using "${ npmModulesPrefix } " as e2e test global npm cache.` ) ;
58
35
}
0 commit comments