@take-out/scripts 0.4.2 → 0.4.3-1775691786096
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@take-out/scripts",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.3-1775691786096",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./src/cmd.ts",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -29,8 +29,8 @@
|
|
|
29
29
|
},
|
|
30
30
|
"dependencies": {
|
|
31
31
|
"@clack/prompts": "^0.8.2",
|
|
32
|
-
"@take-out/helpers": "0.4.
|
|
33
|
-
"@take-out/run": "0.4.
|
|
32
|
+
"@take-out/helpers": "0.4.3-1775691786096",
|
|
33
|
+
"@take-out/run": "0.4.3-1775691786096",
|
|
34
34
|
"picocolors": "^1.1.1"
|
|
35
35
|
}
|
|
36
36
|
}
|
package/src/helpers/env-load.ts
CHANGED
|
@@ -9,9 +9,25 @@ export async function loadEnv(
|
|
|
9
9
|
// loads env into process.env
|
|
10
10
|
await vxrnLoadEnv(environment)
|
|
11
11
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
12
|
+
const previousMode = process.env.TAKEOUT_ENV_MODE
|
|
13
|
+
if (environment === 'development' || environment === 'production') {
|
|
14
|
+
process.env.TAKEOUT_ENV_MODE = environment
|
|
15
|
+
} else {
|
|
16
|
+
delete process.env.TAKEOUT_ENV_MODE
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
let Environment: Record<string, string>
|
|
20
|
+
try {
|
|
21
|
+
// import src/env.ts to get the env config applied (side effect: populates process.env)
|
|
22
|
+
const envModule = await import(join(process.cwd(), 'src/env.ts'))
|
|
23
|
+
Environment = envModule.server || {}
|
|
24
|
+
} finally {
|
|
25
|
+
if (previousMode === undefined) {
|
|
26
|
+
delete process.env.TAKEOUT_ENV_MODE
|
|
27
|
+
} else {
|
|
28
|
+
process.env.TAKEOUT_ENV_MODE = previousMode
|
|
29
|
+
}
|
|
30
|
+
}
|
|
15
31
|
|
|
16
32
|
// validate
|
|
17
33
|
for (const key in Environment) {
|
|
@@ -22,6 +22,10 @@ export async function getTestEnv() {
|
|
|
22
22
|
...serverEnvFallback,
|
|
23
23
|
...devEnv,
|
|
24
24
|
CI: 'true',
|
|
25
|
+
// Child test processes may import src/env.ts directly. Keep them pinned to
|
|
26
|
+
// development mode even when the parent release flow started from
|
|
27
|
+
// production-flavored env.
|
|
28
|
+
TAKEOUT_ENV_MODE: 'development',
|
|
25
29
|
...(!process.env.DEBUG_BACKEND && {
|
|
26
30
|
ZERO_LOG_LEVEL: 'warn',
|
|
27
31
|
}),
|