mirror of
https://github.com/meteor/meteor.git
synced 2026-05-02 03:01:46 -04:00
fix self-test tests
This commit is contained in:
@@ -263,17 +263,20 @@ export function parseRunTargets(targets) {
|
||||
|
||||
export function getMeteorConfig(appDir) {
|
||||
if (global.meteorConfig) return global.meteorConfig;
|
||||
const packageJsonPath = files.pathJoin(appDir, 'package.json');
|
||||
if (!files.exists(packageJsonPath)) {
|
||||
return false;
|
||||
let packageJson;
|
||||
if (appDir) {
|
||||
const packageJsonPath = files.pathJoin(appDir, 'package.json');
|
||||
if (!files.exists(packageJsonPath)) {
|
||||
return false;
|
||||
}
|
||||
const packageJsonFile = files.readFile(packageJsonPath, 'utf8');
|
||||
packageJson = JSON.parse(packageJsonFile);
|
||||
}
|
||||
const packageJsonFile = files.readFile(packageJsonPath, 'utf8');
|
||||
const packageJson = JSON.parse(packageJsonFile);
|
||||
const meteorConfig = {
|
||||
const modernForced = JSON.parse(process.env.METEOR_MODERN || "false");
|
||||
global.meteorConfig = {
|
||||
...(packageJson?.meteor || {}),
|
||||
modern: projectContextModule.normalizeModern(projectContextModule.modernForced || packageJson?.meteor?.modern),
|
||||
modern: projectContextModule.normalizeModern(modernForced || packageJson?.meteor?.modern || false),
|
||||
};
|
||||
global.meteorConfig = meteorConfig;
|
||||
return global.meteorConfig;
|
||||
}
|
||||
|
||||
|
||||
@@ -865,9 +865,9 @@ makeGlobalAsyncLocalStorage().run({}, async function () {
|
||||
var appDir = files.findAppDir();
|
||||
if (appDir) {
|
||||
appDir = files.pathResolve(appDir);
|
||||
// Initialize meteorConfig globally for command context
|
||||
global.meteorConfig = getMeteorConfig(appDir);
|
||||
}
|
||||
// Initialize meteorConfig globally for command context
|
||||
global.meteorConfig = getMeteorConfig(appDir);
|
||||
|
||||
await require('../tool-env/isopackets.js').ensureIsopacketsLoadable();
|
||||
|
||||
|
||||
@@ -1788,8 +1788,6 @@ export const normalizeModern = (r = false) => Object.fromEntries(
|
||||
]),
|
||||
);
|
||||
|
||||
export const modernForced = JSON.parse(process.env.METEOR_MODERN || "false");
|
||||
|
||||
export class MeteorConfig {
|
||||
constructor({
|
||||
appDirectory,
|
||||
@@ -1834,11 +1832,12 @@ export class MeteorConfig {
|
||||
},
|
||||
}),
|
||||
} : this._config;
|
||||
const modernForced = JSON.parse(process.env.METEOR_MODERN || "false");
|
||||
// Reinitialize meteorConfig globally for project context
|
||||
// Updates config when package.json changes trigger rebuilds
|
||||
global.meteorConfig = {
|
||||
...(this._config || {}),
|
||||
modern: normalizeModern(modernForced || this._config?.modern),
|
||||
modern: normalizeModern(modernForced || this._config?.modern || false),
|
||||
};
|
||||
return this._config;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user