@mono-labs/cli 0.0.129 → 0.0.131
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.
|
@@ -21,35 +21,25 @@ export function hasData(key) {
|
|
|
21
21
|
}
|
|
22
22
|
|
|
23
23
|
export function replaceTokens(str, env = {}) {
|
|
24
|
-
console.log('replaceTokens input:', str);
|
|
25
24
|
if (typeof str !== 'string') return str;
|
|
26
|
-
console.log('dataLayer:', dataLayer);
|
|
27
25
|
|
|
28
26
|
const rVal = str.replace(/\$\{([^}]+)\}/g, (m, k) => {
|
|
29
|
-
console.log('token:', k);
|
|
30
|
-
console.log('match:', m);
|
|
31
|
-
console.log('hasData:', hasData(k));
|
|
32
|
-
|
|
33
27
|
// ✅ 1. Priority: existing dataLayer replacement
|
|
34
28
|
if (hasData(k)) {
|
|
35
29
|
const val = getData(k);
|
|
36
|
-
console.log('getData:', val);
|
|
37
30
|
return String(val);
|
|
38
31
|
}
|
|
39
32
|
|
|
40
33
|
// ✅ 2. Next: environment variable replacement
|
|
41
34
|
if (env && Object.prototype.hasOwnProperty.call(env, k)) {
|
|
42
35
|
const val = env[k];
|
|
43
|
-
console.log('env match:', k, '=>', val);
|
|
44
36
|
return String(val ?? '');
|
|
45
37
|
}
|
|
46
38
|
|
|
47
39
|
// ✅ 3. Fallback: replace with empty string
|
|
48
|
-
console.log('no match, returning empty string');
|
|
49
40
|
return '';
|
|
50
41
|
});
|
|
51
42
|
|
|
52
|
-
console.log('rVal:', rVal);
|
|
53
43
|
return rVal;
|
|
54
44
|
}
|
|
55
45
|
|
|
@@ -14,7 +14,6 @@ import path from 'node:path';
|
|
|
14
14
|
*/
|
|
15
15
|
export async function runHasteCommand(configObject, options = {}) {
|
|
16
16
|
const { config } = getHasteConfig();
|
|
17
|
-
console.log('runHasteCommand options:', options);
|
|
18
17
|
const devConfig = configObject.environments?.dev ?? {};
|
|
19
18
|
|
|
20
19
|
// Usage:
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { spawn } from 'child_process';
|
|
2
2
|
import { replaceTokens, setData } from '../dataLayer.js';
|
|
3
|
-
|
|
3
|
+
import { filterUnwantedEnvVars } from '../../../../lib/filterUnwantedEnvVars.js';
|
|
4
4
|
// Regex to capture tokens like: {out:field value}
|
|
5
5
|
const TOKEN_RX = /\{out:(?<field>[^\s}]+)\s+(?<value>[^\s}]+)\}/g;
|
|
6
6
|
|