Skip to content

Commit

Permalink
fix: remove impl of synthesize
Browse files Browse the repository at this point in the history
  • Loading branch information
kirkness committed Nov 24, 2021
1 parent 6ba0baf commit 3ae66c3
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions src/constructs/WatchableNodejsFunction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,17 @@ class WatchableNodejsFunction extends NodejsFunction {
this.cdkWatchLogsApi.CDK_WATCH_API_GATEWAY_MANAGEMENT_URL,
);
}

this.node.addValidation({
validate: () => {
try {
this.outputManifest();
return [];
} catch (error) {
return [(error as Error).message];
}
},
});
}

/**
Expand All @@ -223,9 +234,7 @@ class WatchableNodejsFunction extends NodejsFunction {
* the info it needs to run the lambdas in watch mode. This will include the
* logical IDs and the stack name (and logical IDs of nested stacks).
*/
public synthesize(session: cdk.ISynthesisSession): void {
// super.synthesize(session);

public outputManifest(): void {
const asset = this.node
.findAll()
.find((construct) => construct instanceof Asset) as Asset;
Expand All @@ -236,7 +245,7 @@ class WatchableNodejsFunction extends NodejsFunction {
);
}

const assetPath = path.join(session.outdir, asset.assetPath);
const assetPath = path.join('', asset.assetPath);
const [rootStack, ...nestedStacks] = this.parentStacks;
const cdkWatchManifest = readManifest() || {
region: this.stack.region,
Expand Down

0 comments on commit 3ae66c3

Please sign in to comment.