@go-to-k/cdkd 0.0.4 → 0.1.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.
Binary file
package/dist/index.js CHANGED
@@ -649,7 +649,7 @@ Caused by: ${error.cause.message}`;
649
649
  init_aws_clients();
650
650
 
651
651
  // src/synthesis/synthesizer.ts
652
- import { mkdirSync } from "node:fs";
652
+ import { existsSync as existsSync3, mkdirSync, statSync } from "node:fs";
653
653
  import { resolve as resolve3 } from "node:path";
654
654
  import { GetCallerIdentityCommand, STSClient as STSClient2 } from "@aws-sdk/client-sts";
655
655
 
@@ -1846,6 +1846,14 @@ var Synthesizer = class {
1846
1846
  * 5. Return assembly with stacks
1847
1847
  */
1848
1848
  async synthesize(options) {
1849
+ const appPath = resolve3(options.app);
1850
+ if (existsSync3(appPath) && statSync(appPath).isDirectory()) {
1851
+ this.logger.debug(`Using pre-synthesized cloud assembly at ${appPath}`);
1852
+ const manifest = this.assemblyReader.readManifest(appPath);
1853
+ const stacks = this.assemblyReader.getAllStacks(appPath, manifest);
1854
+ this.logger.debug(`Loaded ${stacks.length} stack(s) from pre-synthesized assembly`);
1855
+ return { manifest, assemblyDir: appPath, stacks };
1856
+ }
1849
1857
  const outputDir = resolve3(options.output || "cdk.out");
1850
1858
  mkdirSync(outputDir, { recursive: true });
1851
1859
  const userCdkJson = loadUserCdkJson();
@@ -1933,7 +1941,7 @@ function setsEqual(a, b) {
1933
1941
  import { readFileSync as readFileSync4 } from "node:fs";
1934
1942
 
1935
1943
  // src/assets/file-asset-publisher.ts
1936
- import { createReadStream, statSync } from "node:fs";
1944
+ import { createReadStream, statSync as statSync2 } from "node:fs";
1937
1945
  import { join as join4, basename } from "node:path";
1938
1946
  import { S3Client as S3Client2, HeadObjectCommand, PutObjectCommand } from "@aws-sdk/client-s3";
1939
1947
  var FileAssetPublisher = class {
@@ -2003,7 +2011,7 @@ var FileAssetPublisher = class {
2003
2011
  * Upload a single file to S3
2004
2012
  */
2005
2013
  async uploadFile(client, filePath, bucket, key) {
2006
- const stat = statSync(filePath);
2014
+ const stat = statSync2(filePath);
2007
2015
  const stream = createReadStream(filePath);
2008
2016
  await client.send(
2009
2017
  new PutObjectCommand({
@@ -2025,7 +2033,7 @@ var FileAssetPublisher = class {
2025
2033
  archive.on("data", (chunk) => chunks.push(chunk));
2026
2034
  archive.on("end", () => resolve4(Buffer.concat(chunks)));
2027
2035
  archive.on("error", reject);
2028
- const stat = statSync(dirPath);
2036
+ const stat = statSync2(dirPath);
2029
2037
  if (stat.isDirectory()) {
2030
2038
  archive.directory(dirPath, false);
2031
2039
  } else {