aws-cdk-lib
Version:
Version 2 of the AWS Cloud Development Kit library
2 lines (1 loc) • 1.5 kB
JavaScript
Object.defineProperty(exports,"__esModule",{value:!0}),exports.obtainScope=exports.cloudAssemblyBuildSpecDir=exports.embeddedAsmPath=exports.pipelineSynth=exports.assemblyBuilderOf=exports.appOf=void 0;var path=()=>{var tmp=require("path");return path=()=>tmp,tmp},constructs_1=()=>{var tmp=require("constructs");return constructs_1=()=>tmp,tmp},core_1=()=>{var tmp=require("../../../core");return core_1=()=>tmp,tmp};function appOf(construct){const root=constructs_1().Node.of(construct).root;if(!core_1().App.isApp(root))throw new Error(`Construct must be created under an App, but is not: ${constructs_1().Node.of(construct).path}`);return root}exports.appOf=appOf;function assemblyBuilderOf(stage){return stage._assemblyBuilder}exports.assemblyBuilderOf=assemblyBuilderOf;function pipelineSynth(stage){return stage.synth({validateOnSynthesis:!0})}exports.pipelineSynth=pipelineSynth;function embeddedAsmPath(scope){const appAsmRoot=assemblyBuilderOf(appOf(scope)).outdir,stage=core_1().Stage.of(scope)??appOf(scope),stageAsmRoot=assemblyBuilderOf(stage).outdir;return path().relative(appAsmRoot,stageAsmRoot)||"."}exports.embeddedAsmPath=embeddedAsmPath;function cloudAssemblyBuildSpecDir(scope){return assemblyBuilderOf(appOf(scope)).outdir}exports.cloudAssemblyBuildSpecDir=cloudAssemblyBuildSpecDir;function obtainScope(parent,id){const existing=constructs_1().Node.of(parent).tryFindChild(id);return existing||new(constructs_1()).Construct(parent,id)}exports.obtainScope=obtainScope;
;