You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// Given that this is a loose file included from elsewhere, I couldn't rely on the tmp package here and had to go with built-in node functions. I saw no significant downsides in this case, versus the upside in developer experience of not needing to do a build step when changing these utils.
console.log(`Loading dependencies into store via temp dir ${tmpDir}`);
14
16
try{
15
17
constpackageJsonContents=
16
18
`{
@@ -24,30 +26,31 @@ export function preparePackageJson(dependencies: {[key: string]: string} = {}, d
24
26
}
25
27
}`;
26
28
29
+
// I considered doing a `pnpm store add` here instead of a plain install. While that worked, I decided against it in the end because it's a secondary way of processing the dependencies and I didn't see a significant downside to just installing and throwing the local project away right after.
27
30
initProjectDir(tmpDir,packageJsonContents,false);
28
31
29
32
returnpackageJsonContents;
30
33
}finally{
31
34
fs.rmSync(tmpDir,{recursive: true,force: true});
32
-
console.log(`Loaded dependencies into store via temp dir ${tmpDir}`);
0 commit comments