yeoman-environment 5.1.1 → 5.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/module-lookup.js +7 -1
- package/dist/store.js +9 -3
- package/package.json +1 -1
package/dist/module-lookup.js
CHANGED
|
@@ -211,7 +211,13 @@ function getGlobalNpmPaths(filterPaths = true) {
|
|
|
211
211
|
paths.push(resolve(yarnBase, 'node_modules'), resolve(yarnBase, '../link/'));
|
|
212
212
|
}
|
|
213
213
|
if (process.env.PNPM_HOME) {
|
|
214
|
-
|
|
214
|
+
const pnpmHome = process.env.PNPM_HOME;
|
|
215
|
+
paths.push(...globbySync('global/*/node_modules', {
|
|
216
|
+
cwd: pnpmHome,
|
|
217
|
+
onlyDirectories: true,
|
|
218
|
+
suppressErrors: true,
|
|
219
|
+
absolute: true,
|
|
220
|
+
}).map(modulesPath => resolve(modulesPath)));
|
|
215
221
|
}
|
|
216
222
|
// Get npm global prefix and infer the module paths from there
|
|
217
223
|
const globalInstall = execaOutput('npm', ['root', '-g']);
|
package/dist/store.js
CHANGED
|
@@ -63,8 +63,11 @@ export default class Store {
|
|
|
63
63
|
try {
|
|
64
64
|
return require(meta.resolved);
|
|
65
65
|
}
|
|
66
|
-
catch {
|
|
67
|
-
|
|
66
|
+
catch (error) {
|
|
67
|
+
if (error.code === 'ERR_REQUIRE_ESM' || error.code === 'ERR_REQUIRE_ASYNC_MODULE') {
|
|
68
|
+
return import(__rewriteRelativeImportExtension(pathToFileURL(meta.resolved).href));
|
|
69
|
+
}
|
|
70
|
+
throw error;
|
|
68
71
|
}
|
|
69
72
|
};
|
|
70
73
|
}
|
|
@@ -77,8 +80,11 @@ export default class Store {
|
|
|
77
80
|
const maybeModule = importModule();
|
|
78
81
|
if (maybeModule.then) {
|
|
79
82
|
importPromise = maybeModule;
|
|
80
|
-
return maybeModule
|
|
83
|
+
return maybeModule
|
|
84
|
+
.then((mod) => {
|
|
81
85
|
Generator = mod;
|
|
86
|
+
})
|
|
87
|
+
.finally(() => {
|
|
82
88
|
importPromise = undefined;
|
|
83
89
|
});
|
|
84
90
|
}
|