aws-cdk-lib
Version:
Version 2 of the AWS Cloud Development Kit library
2 lines (1 loc) • 1.39 kB
JavaScript
Object.defineProperty(exports,"__esModule",{value:!0}),exports.appOf=appOf,exports.assemblyBuilderOf=assemblyBuilderOf,exports.pipelineSynth=pipelineSynth,exports.embeddedAsmPath=embeddedAsmPath,exports.cloudAssemblyBuildSpecDir=cloudAssemblyBuildSpecDir,exports.obtainScope=obtainScope;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(core_1()).ValidationError(`Construct must be created under an App, but is not: ${constructs_1().Node.of(construct).path}`,construct);return root}function assemblyBuilderOf(stage){return stage._assemblyBuilder}function pipelineSynth(stage){return stage.synth({validateOnSynthesis:!0})}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)||"."}function cloudAssemblyBuildSpecDir(scope){return assemblyBuilderOf(appOf(scope)).outdir}function obtainScope(parent,id){const existing=constructs_1().Node.of(parent).tryFindChild(id);return existing||new(constructs_1()).Construct(parent,id)}
;