hereya-cli 0.20.0 → 0.22.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/README.md +52 -30
- package/dist/commands/add/index.js +18 -5
- package/dist/commands/deploy/index.js +31 -10
- package/dist/commands/down/index.js +15 -6
- package/dist/commands/remove/index.js +14 -5
- package/dist/commands/undeploy/index.js +20 -7
- package/dist/commands/up/index.js +20 -7
- package/dist/commands/workspace/install/index.js +8 -3
- package/dist/commands/workspace/uninstall/index.js +8 -3
- package/dist/executor/interface.d.ts +2 -0
- package/dist/executor/local.js +2 -0
- package/dist/iac/cdk.js +7 -3
- package/dist/iac/common.d.ts +2 -0
- package/dist/iac/terraform.d.ts +2 -1
- package/dist/iac/terraform.js +19 -8
- package/dist/infrastructure/aws.js +2 -0
- package/dist/infrastructure/common.d.ts +2 -0
- package/dist/infrastructure/index.d.ts +2 -0
- package/dist/infrastructure/index.js +4 -0
- package/dist/infrastructure/local.js +2 -0
- package/dist/lib/log.d.ts +17 -3
- package/dist/lib/log.js +62 -12
- package/dist/lib/shell.d.ts +2 -8
- package/dist/lib/shell.js +5 -28
- package/oclif.manifest.json +10 -10
- package/package.json +1 -1
package/dist/lib/shell.d.ts
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import { SpawnOptions } from 'node:child_process';
|
|
2
|
-
|
|
3
|
-
export declare function isDebug(): boolean;
|
|
2
|
+
import { type Logger } from './log.js';
|
|
4
3
|
export interface RunShellOptions {
|
|
5
4
|
directory?: string;
|
|
6
5
|
env?: NodeJS.ProcessEnv;
|
|
7
|
-
logger?:
|
|
6
|
+
logger?: Logger;
|
|
8
7
|
stdio?: SpawnOptions['stdio'];
|
|
9
8
|
}
|
|
10
9
|
export declare function runShell(cmd: string, args: string[], options?: RunShellOptions): Promise<{
|
|
@@ -15,8 +14,3 @@ export declare function runShell(cmd: string, args: string[], options?: RunShell
|
|
|
15
14
|
stdout: string;
|
|
16
15
|
}>;
|
|
17
16
|
export declare function delay(ms: number): Promise<unknown> | undefined;
|
|
18
|
-
export declare const defaultLogger: {
|
|
19
|
-
debug(message: string): void;
|
|
20
|
-
error(message: string): void;
|
|
21
|
-
info(message: string): void;
|
|
22
|
-
};
|
package/dist/lib/shell.js
CHANGED
|
@@ -1,24 +1,18 @@
|
|
|
1
1
|
import { spawn } from 'node:child_process';
|
|
2
|
-
|
|
3
|
-
export function setDebug(value) {
|
|
4
|
-
debug = value;
|
|
5
|
-
}
|
|
6
|
-
export function isDebug() {
|
|
7
|
-
return debug;
|
|
8
|
-
}
|
|
2
|
+
import { getDefaultLogger } from './log.js';
|
|
9
3
|
// Asynchronous runShell that logs output using the provided logger.
|
|
10
4
|
export async function runShell(cmd, args, options = {}) {
|
|
11
5
|
return new Promise((resolve, reject) => {
|
|
12
6
|
// Use the provided logger or default to console.log
|
|
13
|
-
const logger = options.logger ??
|
|
7
|
+
const logger = options.logger ?? getDefaultLogger();
|
|
14
8
|
const spawnOptions = {
|
|
15
9
|
cwd: options.directory ?? process.cwd(),
|
|
16
10
|
env: { ...process.env, ...options.env },
|
|
17
11
|
shell: true,
|
|
18
12
|
// If not explicitly set, use 'inherit' when debugging, or 'pipe' otherwise
|
|
19
|
-
stdio: options.stdio ??
|
|
13
|
+
stdio: options.stdio ?? 'pipe',
|
|
20
14
|
};
|
|
21
|
-
logger.debug(`Executing: ${cmd} ${args.join(' ')}`);
|
|
15
|
+
logger.debug(`Executing: ${cmd} ${args.join(' ')}\n`);
|
|
22
16
|
const child = spawn(cmd, args, spawnOptions);
|
|
23
17
|
// Buffers to accumulate output from the process.
|
|
24
18
|
let stdout = '';
|
|
@@ -49,7 +43,7 @@ export async function runShell(cmd, args, options = {}) {
|
|
|
49
43
|
});
|
|
50
44
|
child.on('close', () => {
|
|
51
45
|
if (exitCode !== 0) {
|
|
52
|
-
const errorMsg = `Command "${cmd} ${args.join(' ')}" failed with exit code "${exitCode}"`;
|
|
46
|
+
const errorMsg = `Command "${cmd} ${args.join(' ')}" failed with exit code "${exitCode}"\n`;
|
|
53
47
|
logger.error(errorMsg);
|
|
54
48
|
return reject(new Error(errorMsg));
|
|
55
49
|
}
|
|
@@ -71,20 +65,3 @@ export function delay(ms) {
|
|
|
71
65
|
setTimeout(resolve, ms);
|
|
72
66
|
});
|
|
73
67
|
}
|
|
74
|
-
export const defaultLogger = {
|
|
75
|
-
debug(message) {
|
|
76
|
-
if (isDebug()) {
|
|
77
|
-
console.debug(message);
|
|
78
|
-
}
|
|
79
|
-
},
|
|
80
|
-
error(message) {
|
|
81
|
-
if (isDebug()) {
|
|
82
|
-
console.error(message);
|
|
83
|
-
}
|
|
84
|
-
},
|
|
85
|
-
info(message) {
|
|
86
|
-
if (isDebug()) {
|
|
87
|
-
console.info(message);
|
|
88
|
-
}
|
|
89
|
-
},
|
|
90
|
-
};
|
package/oclif.manifest.json
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"aliases": [],
|
|
5
5
|
"args": {
|
|
6
6
|
"package": {
|
|
7
|
-
"description": "The package to add
|
|
7
|
+
"description": "\n The package to add, specified as a GitHub repository in the format owner/repository.\n To change the registry URL, set the HEREYA_REGISTRY_URL environment variable, so that it points to $HEREYA_REGISTRY_URL/owner/repository.\n For local packages, use the format local://path/to/package where path/to/package is the path to the package on your local machine.\n ",
|
|
8
8
|
"name": "package",
|
|
9
9
|
"required": true
|
|
10
10
|
}
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
],
|
|
16
16
|
"flags": {
|
|
17
17
|
"chdir": {
|
|
18
|
-
"description": "
|
|
18
|
+
"description": "\n Directory where the command will be executed.\n If not specified, it defaults to the current working directory.\n Alternatively, you can define the project root by setting the HEREYA_PROJECT_ROOT_DIR environment variable.\n ",
|
|
19
19
|
"name": "chdir",
|
|
20
20
|
"required": false,
|
|
21
21
|
"hasDynamicHelp": false,
|
|
@@ -102,7 +102,7 @@
|
|
|
102
102
|
],
|
|
103
103
|
"flags": {
|
|
104
104
|
"chdir": {
|
|
105
|
-
"description": "
|
|
105
|
+
"description": "\n Directory where the command will be executed.\n If not specified, it defaults to the current working directory.\n Alternatively, you can define the project root by setting the HEREYA_PROJECT_ROOT_DIR environment variable.\n ",
|
|
106
106
|
"name": "chdir",
|
|
107
107
|
"required": false,
|
|
108
108
|
"hasDynamicHelp": false,
|
|
@@ -150,7 +150,7 @@
|
|
|
150
150
|
],
|
|
151
151
|
"flags": {
|
|
152
152
|
"chdir": {
|
|
153
|
-
"description": "
|
|
153
|
+
"description": "\n Directory where the command will be executed.\n If not specified, it defaults to the current working directory.\n Alternatively, you can define the project root by setting the HEREYA_PROJECT_ROOT_DIR environment variable.\n ",
|
|
154
154
|
"name": "chdir",
|
|
155
155
|
"required": false,
|
|
156
156
|
"hasDynamicHelp": false,
|
|
@@ -172,7 +172,7 @@
|
|
|
172
172
|
},
|
|
173
173
|
"workspace": {
|
|
174
174
|
"char": "w",
|
|
175
|
-
"description": "name of the workspace to
|
|
175
|
+
"description": "name of the workspace to destroy the packages for",
|
|
176
176
|
"name": "workspace",
|
|
177
177
|
"required": false,
|
|
178
178
|
"hasDynamicHelp": false,
|
|
@@ -308,7 +308,7 @@
|
|
|
308
308
|
"aliases": [],
|
|
309
309
|
"args": {
|
|
310
310
|
"package": {
|
|
311
|
-
"description": "
|
|
311
|
+
"description": "Remove a previously added package.",
|
|
312
312
|
"name": "package",
|
|
313
313
|
"required": true
|
|
314
314
|
}
|
|
@@ -319,7 +319,7 @@
|
|
|
319
319
|
],
|
|
320
320
|
"flags": {
|
|
321
321
|
"chdir": {
|
|
322
|
-
"description": "
|
|
322
|
+
"description": "\n Directory where the command will be executed.\n If not specified, it defaults to the current working directory.\n Alternatively, you can define the project root by setting the HEREYA_PROJECT_ROOT_DIR environment variable.\n ",
|
|
323
323
|
"name": "chdir",
|
|
324
324
|
"required": false,
|
|
325
325
|
"hasDynamicHelp": false,
|
|
@@ -446,7 +446,7 @@
|
|
|
446
446
|
],
|
|
447
447
|
"flags": {
|
|
448
448
|
"chdir": {
|
|
449
|
-
"description": "
|
|
449
|
+
"description": "\n Directory where the command will be executed.\n If not specified, it defaults to the current working directory.\n Alternatively, you can define the project root by setting the HEREYA_PROJECT_ROOT_DIR environment variable.\n ",
|
|
450
450
|
"name": "chdir",
|
|
451
451
|
"required": false,
|
|
452
452
|
"hasDynamicHelp": false,
|
|
@@ -494,7 +494,7 @@
|
|
|
494
494
|
],
|
|
495
495
|
"flags": {
|
|
496
496
|
"chdir": {
|
|
497
|
-
"description": "
|
|
497
|
+
"description": "\n Directory where the command will be executed.\n If not specified, it defaults to the current working directory.\n Alternatively, you can define the project root by setting the HEREYA_PROJECT_ROOT_DIR environment variable.\n ",
|
|
498
498
|
"name": "chdir",
|
|
499
499
|
"required": false,
|
|
500
500
|
"hasDynamicHelp": false,
|
|
@@ -954,5 +954,5 @@
|
|
|
954
954
|
]
|
|
955
955
|
}
|
|
956
956
|
},
|
|
957
|
-
"version": "0.
|
|
957
|
+
"version": "0.22.0"
|
|
958
958
|
}
|