@fenglimg/fabric-shared 2.3.0-rc.2 → 2.3.0-rc.4
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/{chunk-ANUDBQBK.js → chunk-ASS2KBB7.js} +13 -1
- package/dist/{chunk-OAYQHN6J.js → chunk-KFFBQRL5.js} +1 -1
- package/dist/{chunk-ZYBWITH7.js → chunk-LDFQYCY7.js} +547 -99
- package/dist/i18n/index.js +2 -2
- package/dist/{index-BO7itJ8e.d.ts → index-C0cijMSw.d.ts} +6 -6
- package/dist/index.d.ts +30 -30
- package/dist/index.js +20 -13
- package/dist/templates/bootstrap-canonical.js +2 -2
- package/dist/theme.d.ts +2 -1
- package/dist/theme.js +7 -0
- package/dist/types/index.d.ts +1 -1
- package/package.json +1 -1
|
@@ -192,8 +192,20 @@ var globalConfigSchema = z.object({
|
|
|
192
192
|
import { existsSync, mkdirSync, readFileSync, writeFileSync } from "fs";
|
|
193
193
|
import { homedir } from "os";
|
|
194
194
|
import { join } from "path";
|
|
195
|
+
function isTestRuntime() {
|
|
196
|
+
return process.env.VITEST !== void 0 || process.env.VITEST_WORKER_ID !== void 0;
|
|
197
|
+
}
|
|
195
198
|
function resolveGlobalRoot() {
|
|
196
|
-
|
|
199
|
+
const fabricHome = process.env.FABRIC_HOME;
|
|
200
|
+
if (fabricHome !== void 0 && fabricHome !== "") {
|
|
201
|
+
return join(fabricHome, ".fabric");
|
|
202
|
+
}
|
|
203
|
+
if (isTestRuntime()) {
|
|
204
|
+
throw new Error(
|
|
205
|
+
"resolveGlobalRoot(): FABRIC_HOME must be set under the test runner \u2014 refusing to fall back to the real home dir (~/.fabric). Repoint process.env.FABRIC_HOME to an isolated temp dir in beforeEach (see plan-context.test.ts for the pattern)."
|
|
206
|
+
);
|
|
207
|
+
}
|
|
208
|
+
return join(homedir(), ".fabric");
|
|
197
209
|
}
|
|
198
210
|
function globalConfigPath(globalRoot = resolveGlobalRoot()) {
|
|
199
211
|
return join(globalRoot, "fabric-global.json");
|