@genesislcap/build-kit 15.75.0 → 15.77.0
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/utils/env.d.ts +5 -0
- package/dist/utils/env.d.ts.map +1 -1
- package/dist/utils/env.js +11 -3
- package/package.json +2 -2
package/dist/utils/env.d.ts
CHANGED
|
@@ -4,6 +4,11 @@ import type { BuildContext, ENV } from '../types';
|
|
|
4
4
|
*/
|
|
5
5
|
export declare const getPublicPath: (fallback?: string) => string;
|
|
6
6
|
export declare const setNodeEnv: (targetEnv: ENV) => void;
|
|
7
|
+
/**
|
|
8
|
+
* The `.env` files `loadEnvFiles` reads, in load order (later files win).
|
|
9
|
+
* @public
|
|
10
|
+
*/
|
|
11
|
+
export declare const getEnvFilePaths: (ctx: BuildContext) => string[];
|
|
7
12
|
export declare const loadEnvFiles: (ctx: BuildContext) => void;
|
|
8
13
|
export declare const setEnvVars: (ctx: BuildContext) => void;
|
|
9
14
|
export declare const resolveDefineConfig: (patterns: string[], httpConfig?: object, builder?: "webpack" | "vite") => Record<string, string>;
|
package/dist/utils/env.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"env.d.ts","sourceRoot":"","sources":["../../src/utils/env.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,YAAY,EAAE,GAAG,EAAE,MAAM,UAAU,CAAC;AAElD;;GAEG;AACH,eAAO,MAAM,aAAa,GAAI,WAAU,MAAY,KAAG,MAEtD,CAAC;AAEF,eAAO,MAAM,UAAU,GAAI,WAAW,GAAG,SAOxC,CAAC;AA0BF,eAAO,MAAM,YAAY,GAAI,KAAK,YAAY,
|
|
1
|
+
{"version":3,"file":"env.d.ts","sourceRoot":"","sources":["../../src/utils/env.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,YAAY,EAAE,GAAG,EAAE,MAAM,UAAU,CAAC;AAElD;;GAEG;AACH,eAAO,MAAM,aAAa,GAAI,WAAU,MAAY,KAAG,MAEtD,CAAC;AAEF,eAAO,MAAM,UAAU,GAAI,WAAW,GAAG,SAOxC,CAAC;AA0BF;;;GAGG;AACH,eAAO,MAAM,eAAe,GAAI,KAAK,YAAY,KAAG,MAAM,EAUzD,CAAC;AAEF,eAAO,MAAM,YAAY,GAAI,KAAK,YAAY,SAQ7C,CAAC;AAEF,eAAO,MAAM,UAAU,GAAI,KAAK,YAAY,SAe3C,CAAC;AAGF,eAAO,MAAM,mBAAmB,GAC9B,UAAU,MAAM,EAAE,EAClB,aAAa,MAAM,EACnB,UAAU,SAAS,GAAG,MAAM,KAC3B,MAAM,CAAC,MAAM,EAAE,MAAM,CAcnB,CAAC"}
|
package/dist/utils/env.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.resolveDefineConfig = exports.setEnvVars = exports.loadEnvFiles = exports.setNodeEnv = exports.getPublicPath = void 0;
|
|
3
|
+
exports.resolveDefineConfig = exports.setEnvVars = exports.loadEnvFiles = exports.getEnvFilePaths = exports.setNodeEnv = exports.getPublicPath = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const node_path_1 = require("node:path");
|
|
6
6
|
const consola_1 = tslib_1.__importDefault(require("consola"));
|
|
@@ -40,9 +40,13 @@ const resolveEnvValue = (ctx, key, value) => {
|
|
|
40
40
|
// 3. fall back to provided value
|
|
41
41
|
return value;
|
|
42
42
|
};
|
|
43
|
-
|
|
43
|
+
/**
|
|
44
|
+
* The `.env` files `loadEnvFiles` reads, in load order (later files win).
|
|
45
|
+
* @public
|
|
46
|
+
*/
|
|
47
|
+
const getEnvFilePaths = (ctx) => {
|
|
44
48
|
const useWorkspaceDir = ctx.dirs.cwd && ctx.dirs.workspace && ctx.dirs.cwd !== ctx.dirs.workspace;
|
|
45
|
-
|
|
49
|
+
return [
|
|
46
50
|
useWorkspaceDir && (0, node_path_1.resolve)(ctx.dirs.workspace, '.env'),
|
|
47
51
|
useWorkspaceDir && (0, node_path_1.resolve)(ctx.dirs.workspace, '.env.local'),
|
|
48
52
|
useWorkspaceDir && (0, node_path_1.resolve)(ctx.dirs.workspace, `.env.${process.env.DOT_ENV_FILE}`),
|
|
@@ -50,6 +54,10 @@ const loadEnvFiles = (ctx) => {
|
|
|
50
54
|
(0, node_path_1.resolve)(ctx.dirs.cwd, '.env.local'),
|
|
51
55
|
(0, node_path_1.resolve)(ctx.dirs.cwd, `.env.${process.env.DOT_ENV_FILE}`),
|
|
52
56
|
].filter(Boolean);
|
|
57
|
+
};
|
|
58
|
+
exports.getEnvFilePaths = getEnvFilePaths;
|
|
59
|
+
const loadEnvFiles = (ctx) => {
|
|
60
|
+
const path = (0, exports.getEnvFilePaths)(ctx);
|
|
53
61
|
dotenv_1.default.config({
|
|
54
62
|
debug: ctx.cli.options.logLevel === 'verbose',
|
|
55
63
|
// if the same variable occurs in multiple files, the last loaded file wins
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@genesislcap/build-kit",
|
|
3
3
|
"description": "Build utilities & types",
|
|
4
|
-
"version": "15.
|
|
4
|
+
"version": "15.77.0",
|
|
5
5
|
"license": "SEE LICENSE IN license.txt",
|
|
6
6
|
"main": "dist/index.js",
|
|
7
7
|
"types": "dist/index.d.ts",
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
"unparse-args": "^1.2.0"
|
|
39
39
|
},
|
|
40
40
|
"devDependencies": {
|
|
41
|
-
"@genesislcap/foundation-testing": "15.
|
|
41
|
+
"@genesislcap/foundation-testing": "15.77.0",
|
|
42
42
|
"@types/http-proxy": "^1.17.8",
|
|
43
43
|
"@types/node": "^22.10.2",
|
|
44
44
|
"tsx": "^4.7.0",
|