@mono-labs/cli 0.0.126 → 0.0.128
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/index.js +72 -0
- package/lib/commands/build-process/runHasteCommand.js +8 -10
- package/package.json +1 -1
- package/types.d.ts +2 -0
package/index.js
CHANGED
|
@@ -5,3 +5,75 @@ import { generateNewEnvList } from './lib/generateNewEnvList.js';
|
|
|
5
5
|
export default {
|
|
6
6
|
generateNewEnvList,
|
|
7
7
|
};
|
|
8
|
+
|
|
9
|
+
export function filterUnwantedEnvVars(env) {
|
|
10
|
+
const unwantedPrefixes = [
|
|
11
|
+
'EFC_',
|
|
12
|
+
'FPS_',
|
|
13
|
+
'GIT_',
|
|
14
|
+
'NVM_',
|
|
15
|
+
'VSCODE_',
|
|
16
|
+
'windir',
|
|
17
|
+
'Chocolatey',
|
|
18
|
+
'ALLUSERSPROFILE',
|
|
19
|
+
'APPDATA',
|
|
20
|
+
'CommonProgramFiles',
|
|
21
|
+
'CommonProgramW6432',
|
|
22
|
+
'ComSpec',
|
|
23
|
+
'Driver',
|
|
24
|
+
'HOME',
|
|
25
|
+
'npm',
|
|
26
|
+
'HOME',
|
|
27
|
+
'LOCALAPPDATA',
|
|
28
|
+
'LOGONSERVER',
|
|
29
|
+
'NUMBER_OF_PROCESSORS',
|
|
30
|
+
'OS',
|
|
31
|
+
'Path',
|
|
32
|
+
'COREPACK',
|
|
33
|
+
'PATHEXT',
|
|
34
|
+
'PROCESSOR',
|
|
35
|
+
'Program',
|
|
36
|
+
'PSModule',
|
|
37
|
+
'PUBLIC',
|
|
38
|
+
'SystemDrive',
|
|
39
|
+
'SystemRoot',
|
|
40
|
+
'TEMP',
|
|
41
|
+
'TMP',
|
|
42
|
+
'USERDOMAIN',
|
|
43
|
+
'USERDOMAIN_ROAMINGPROFILE',
|
|
44
|
+
'USERNAME',
|
|
45
|
+
'USERPROFILE',
|
|
46
|
+
'CUDA',
|
|
47
|
+
'SESSIONNAME',
|
|
48
|
+
'ZES',
|
|
49
|
+
'3DVPATH',
|
|
50
|
+
'APP_NAME',
|
|
51
|
+
'asl.log',
|
|
52
|
+
'BERRY_BIN_FOLDER',
|
|
53
|
+
'CHROME_CRASHPAD_PIPE_NAME',
|
|
54
|
+
'COLORTERM',
|
|
55
|
+
'COMPUTERNAME',
|
|
56
|
+
'CUDNN',
|
|
57
|
+
'EAS_BUILD_PROFILE',
|
|
58
|
+
'EAS_PROJECT_ID',
|
|
59
|
+
'EXPO_UNSTABLE_ATLAS',
|
|
60
|
+
'INIT_CWD',
|
|
61
|
+
'JAVA_HOME',
|
|
62
|
+
'LANG',
|
|
63
|
+
'OneDrive',
|
|
64
|
+
'ORIGINAL_XDG_CURRENT_DESKTOP',
|
|
65
|
+
'PATH',
|
|
66
|
+
'PROJECT_CWD',
|
|
67
|
+
'PROMPT',
|
|
68
|
+
'PWD',
|
|
69
|
+
'TERM_PROGRAM',
|
|
70
|
+
'TERM_PROGRAM_VERSION',
|
|
71
|
+
'__PSLockDownPolicy',
|
|
72
|
+
];
|
|
73
|
+
return Object.keys(env).reduce((obj, key) => {
|
|
74
|
+
if (!unwantedPrefixes.some((prefix) => key.startsWith(prefix))) {
|
|
75
|
+
obj[key] = env[key];
|
|
76
|
+
}
|
|
77
|
+
return obj;
|
|
78
|
+
}, {});
|
|
79
|
+
}
|
|
@@ -14,7 +14,7 @@ import path from 'node:path';
|
|
|
14
14
|
*/
|
|
15
15
|
export async function runHasteCommand(configObject, options = {}) {
|
|
16
16
|
const { config } = getHasteConfig();
|
|
17
|
-
|
|
17
|
+
console.log('runHasteCommand options:', options);
|
|
18
18
|
const devConfig = configObject.environments?.dev ?? {};
|
|
19
19
|
|
|
20
20
|
// Usage:
|
|
@@ -53,18 +53,16 @@ export async function runHasteCommand(configObject, options = {}) {
|
|
|
53
53
|
const preactions = configObject.preactions ?? [];
|
|
54
54
|
const actions = configObject.actions ?? [];
|
|
55
55
|
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
56
|
+
console.log(
|
|
59
57
|
`→ Executing haste command: ${configObject.name || 'Unnamed Command'}`
|
|
60
58
|
);
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
59
|
+
console.log(`→ Using AWS profile: ${awsProfile}`);
|
|
60
|
+
console.log(`→ Using environment: ${options.stage ? 'stage' : 'dev'}`);
|
|
61
|
+
console.log('→ Environment variables:', envObj);
|
|
64
62
|
|
|
65
63
|
// Run preactions sequentially
|
|
66
64
|
for (const cmd of preactions) {
|
|
67
|
-
|
|
65
|
+
console.log(`→ pre-action: ${cmd}`);
|
|
68
66
|
await runForeground(cmd, envObj, options);
|
|
69
67
|
}
|
|
70
68
|
|
|
@@ -74,11 +72,11 @@ export async function runHasteCommand(configObject, options = {}) {
|
|
|
74
72
|
const fg = actions[actions.length - 1];
|
|
75
73
|
|
|
76
74
|
for (const cmd of bg) {
|
|
77
|
-
|
|
75
|
+
console.log(`→ background action: ${cmd}`);
|
|
78
76
|
runBackground(cmd, envObj, options);
|
|
79
77
|
}
|
|
80
78
|
|
|
81
|
-
|
|
79
|
+
console.log(`→ foreground action (attached): ${fg}`);
|
|
82
80
|
try {
|
|
83
81
|
await runBackground(fg, envObj, options, true);
|
|
84
82
|
} finally {
|
package/package.json
CHANGED
package/types.d.ts
CHANGED
|
@@ -45,6 +45,8 @@ declare module '@mono-labs/cli' {
|
|
|
45
45
|
config: HasteConfig;
|
|
46
46
|
}
|
|
47
47
|
|
|
48
|
+
export declare function filterUnwantedEnvVars(env: string): NodeJS.ProcessEnv;
|
|
49
|
+
|
|
48
50
|
// Function type declarations
|
|
49
51
|
export declare function generateNewEnvList(
|
|
50
52
|
processEnv: NodeJS.ProcessEnv
|