cdk-local 0.1.0 → 0.1.1
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/cli.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { i as createLocalInvokeCommand, n as createLocalRunTaskCommand, r as createLocalStartApiCommand, t as createLocalStartServiceCommand } from "./local-start-service-
|
|
2
|
+
import { i as createLocalInvokeCommand, n as createLocalRunTaskCommand, r as createLocalStartApiCommand, t as createLocalStartServiceCommand } from "./local-start-service-DOlK1NT0.js";
|
|
3
3
|
import { Command } from "commander";
|
|
4
4
|
|
|
5
5
|
//#region src/cli/index.ts
|
|
6
6
|
const program = new Command();
|
|
7
|
-
program.name("cdkl").description("Run AWS CDK stacks locally with Docker.").version("0.1.
|
|
7
|
+
program.name("cdkl").description("Run AWS CDK stacks locally with Docker.").version("0.1.1");
|
|
8
8
|
program.addCommand(createLocalInvokeCommand());
|
|
9
9
|
program.addCommand(createLocalStartApiCommand());
|
|
10
10
|
program.addCommand(createLocalRunTaskCommand());
|
package/dist/index.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { a as LocalStateSourceError, c as rejectExplicitCfnStackWithMultipleStacks, d as CfnLocalStateProvider, i as createLocalInvokeCommand, l as resolveCfnRegion, n as createLocalRunTaskCommand, o as createLocalStateProvider, r as createLocalStartApiCommand, s as isCfnFlagPresent, t as createLocalStartServiceCommand, u as resolveCfnStackName } from "./local-start-service-
|
|
1
|
+
import { a as LocalStateSourceError, c as rejectExplicitCfnStackWithMultipleStacks, d as CfnLocalStateProvider, i as createLocalInvokeCommand, l as resolveCfnRegion, n as createLocalRunTaskCommand, o as createLocalStateProvider, r as createLocalStartApiCommand, s as isCfnFlagPresent, t as createLocalStartServiceCommand, u as resolveCfnStackName } from "./local-start-service-DOlK1NT0.js";
|
|
2
2
|
|
|
3
3
|
export { CfnLocalStateProvider, LocalStateSourceError, createLocalInvokeCommand, createLocalRunTaskCommand, createLocalStartApiCommand, createLocalStartServiceCommand, createLocalStateProvider, isCfnFlagPresent, rejectExplicitCfnStackWithMultipleStacks, resolveCfnRegion, resolveCfnStackName };
|
|
@@ -6,7 +6,7 @@ import { dirname, isAbsolute, join, normalize, resolve } from "node:path";
|
|
|
6
6
|
import { Command, Option } from "commander";
|
|
7
7
|
import { AssumeRoleCommand, GetCallerIdentityCommand, STSClient } from "@aws-sdk/client-sts";
|
|
8
8
|
import { AssetManifestArtifact } from "@aws-cdk/cloud-assembly-api";
|
|
9
|
-
import { CdkAppMultiContext, Toolkit } from "@aws-cdk/toolkit-lib";
|
|
9
|
+
import { CdkAppMultiContext, NonInteractiveIoHost, Toolkit } from "@aws-cdk/toolkit-lib";
|
|
10
10
|
import { CloudFormationClient, DescribeStackResourcesCommand, DescribeStacksCommand, ListExportsCommand } from "@aws-sdk/client-cloudformation";
|
|
11
11
|
import { mkdir, mkdtemp, rm, writeFile } from "node:fs/promises";
|
|
12
12
|
import { Readable } from "node:stream";
|
|
@@ -271,6 +271,37 @@ function withErrorHandling(fn) {
|
|
|
271
271
|
};
|
|
272
272
|
}
|
|
273
273
|
|
|
274
|
+
//#endregion
|
|
275
|
+
//#region src/synthesis/cdkl-io-host.ts
|
|
276
|
+
/**
|
|
277
|
+
* Custom IoHost that prevents cdk-local from coloring CDK app subprocess
|
|
278
|
+
* stderr lines as errors.
|
|
279
|
+
*
|
|
280
|
+
* `@aws-cdk/toolkit-lib` classifies every line a synthesized CDK app
|
|
281
|
+
* emits on stderr as `CDK_ASSEMBLY_E1002` — an error-level message —
|
|
282
|
+
* which the default `NonInteractiveIoHost` colors red via chalk. CDK
|
|
283
|
+
* apps routinely emit non-error progress on stderr (e.g. the
|
|
284
|
+
* "Bundling asset ..." lines `aws-cdk-lib`'s asset bundlers print at
|
|
285
|
+
* synth time), so the default styling fires red on benign output and
|
|
286
|
+
* trains users to dismiss the color in the UI.
|
|
287
|
+
*
|
|
288
|
+
* cdk-local re-classifies `CDK_ASSEMBLY_E1002` as info-level so the
|
|
289
|
+
* line renders in the default terminal color. Real CDK app failures
|
|
290
|
+
* still surface — toolkit-lib raises an `AssemblyError` when the
|
|
291
|
+
* subprocess exits non-zero and the parent throws straight out of
|
|
292
|
+
* `Synthesizer.synthesize()`. The only change here is the color of the
|
|
293
|
+
* progress lines mid-synth.
|
|
294
|
+
*/
|
|
295
|
+
var CdklIoHost = class extends NonInteractiveIoHost {
|
|
296
|
+
async notify(msg) {
|
|
297
|
+
if (msg.code === "CDK_ASSEMBLY_E1002") return super.notify({
|
|
298
|
+
...msg,
|
|
299
|
+
level: "info"
|
|
300
|
+
});
|
|
301
|
+
return super.notify(msg);
|
|
302
|
+
}
|
|
303
|
+
};
|
|
304
|
+
|
|
274
305
|
//#endregion
|
|
275
306
|
//#region src/synthesis/assembly-reader.ts
|
|
276
307
|
var AssemblyReader = class {
|
|
@@ -279,7 +310,7 @@ var AssemblyReader = class {
|
|
|
279
310
|
* artifact in the resulting Cloud Assembly.
|
|
280
311
|
*/
|
|
281
312
|
async read(cdkAppCommand, options = {}) {
|
|
282
|
-
const toolkit = new Toolkit();
|
|
313
|
+
const toolkit = new Toolkit({ ioHost: new CdklIoHost() });
|
|
283
314
|
const hasContextOverrides = options.context !== void 0 && Object.keys(options.context).length > 0;
|
|
284
315
|
const source = await toolkit.fromCdkApp(cdkAppCommand, {
|
|
285
316
|
...options.outdir !== void 0 && { outdir: options.outdir },
|
|
@@ -298,7 +329,7 @@ var AssemblyReader = class {
|
|
|
298
329
|
* Read a pre-synthesized Cloud Assembly directory (no subprocess).
|
|
299
330
|
*/
|
|
300
331
|
async readFromDirectory(assemblyDir) {
|
|
301
|
-
const toolkit = new Toolkit();
|
|
332
|
+
const toolkit = new Toolkit({ ioHost: new CdklIoHost() });
|
|
302
333
|
const source = await toolkit.fromAssemblyDirectory(assemblyDir);
|
|
303
334
|
const cached = await toolkit.synth(source);
|
|
304
335
|
try {
|
|
@@ -17803,4 +17834,4 @@ function createLocalStartServiceCommand(opts = {}) {
|
|
|
17803
17834
|
|
|
17804
17835
|
//#endregion
|
|
17805
17836
|
export { LocalStateSourceError as a, rejectExplicitCfnStackWithMultipleStacks as c, CfnLocalStateProvider as d, createLocalInvokeCommand as i, resolveCfnRegion as l, createLocalRunTaskCommand as n, createLocalStateProvider as o, createLocalStartApiCommand as r, isCfnFlagPresent as s, createLocalStartServiceCommand as t, resolveCfnStackName as u };
|
|
17806
|
-
//# sourceMappingURL=local-start-service-
|
|
17837
|
+
//# sourceMappingURL=local-start-service-DOlK1NT0.js.map
|