@awsless/awsless 0.0.530 → 0.0.532

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/bin.js CHANGED
@@ -1690,7 +1690,7 @@ var IconsSchema = z34.record(
1690
1690
  "Image transformation will be applied from a base image. Base images orginates from a local directory that will be uploaded to S3 or from a lambda function."
1691
1691
  ),
1692
1692
  cors: z34.object({
1693
- override: z34.boolean().default(false),
1693
+ override: z34.boolean().default(true),
1694
1694
  maxAge: DurationSchema.default("365 days"),
1695
1695
  exposeHeaders: z34.string().array().optional(),
1696
1696
  credentials: z34.boolean().default(false),
@@ -6003,7 +6003,7 @@ var imageFeature = defineFeature({
6003
6003
  const found = ctx.stackConfigs.filter((stack) => {
6004
6004
  return Object.keys(stack.images ?? {}).length > 0;
6005
6005
  });
6006
- if (!found) {
6006
+ if (found.length === 0) {
6007
6007
  return;
6008
6008
  }
6009
6009
  const group = new Group23(ctx.base, "image", "layer");
@@ -6426,16 +6426,17 @@ var iconFeature = defineFeature({
6426
6426
  const responseHeaders = new $23.aws.cloudfront.ResponseHeadersPolicy(group, "response", {
6427
6427
  name,
6428
6428
  corsConfig: {
6429
- originOverride: props.cors?.override ?? false,
6430
- accessControlMaxAgeSec: toSeconds9(props.cors?.maxAge ?? days7(365)),
6431
- accessControlAllowHeaders: { items: props.cors?.headers ?? ["*"] },
6432
- accessControlAllowMethods: { items: ["GET", "HEAD", "OPTIONS"] },
6433
- accessControlAllowOrigins: { items: props.cors?.origins ?? ["*"] },
6434
- accessControlExposeHeaders: { items: props.cors?.exposeHeaders ?? ["*"] },
6435
- accessControlAllowCredentials: props.cors?.credentials ?? false
6429
+ originOverride: true,
6430
+ accessControlMaxAgeSec: toSeconds9(days7(365)),
6431
+ accessControlAllowHeaders: { items: ["*"] },
6432
+ accessControlAllowMethods: { items: ["ALL"] },
6433
+ accessControlAllowOrigins: { items: ["*"] },
6434
+ accessControlExposeHeaders: { items: ["*"] },
6435
+ accessControlAllowCredentials: false
6436
6436
  }
6437
6437
  });
6438
6438
  const distribution = new $23.aws.cloudfront.Distribution(group, "distribution", {
6439
+ waitForDeployment: false,
6439
6440
  comment: name,
6440
6441
  enabled: true,
6441
6442
  aliases: domainName ? [domainName] : void 0,
@@ -6490,8 +6491,8 @@ var iconFeature = defineFeature({
6490
6491
  targetOriginId: "group",
6491
6492
  cachePolicyId: cache.id,
6492
6493
  viewerProtocolPolicy: "redirect-to-https",
6493
- allowedMethods: ["GET", "HEAD", "OPTIONS"],
6494
- cachedMethods: ["GET", "HEAD", "OPTIONS"],
6494
+ allowedMethods: ["GET", "HEAD"],
6495
+ cachedMethods: ["GET", "HEAD"],
6495
6496
  responseHeadersPolicyId: responseHeaders.id
6496
6497
  }
6497
6498
  });
@@ -7696,7 +7697,7 @@ var logTestErrors = (event) => {
7696
7697
  );
7697
7698
  });
7698
7699
  };
7699
- var runTest = async (stack, dir, filters) => {
7700
+ var runTest = async (stack, dir, filters, opts) => {
7700
7701
  await mkdir4(directories.test, { recursive: true });
7701
7702
  const fingerprint = await fingerprintFromDirectory(dir);
7702
7703
  const file = join16(directories.test, `${stack}.json`);
@@ -7712,7 +7713,9 @@ var runTest = async (stack, dir, filters) => {
7712
7713
  event: data
7713
7714
  })
7714
7715
  );
7715
- logTestLogs(data);
7716
+ if (opts.showLogs) {
7717
+ logTestLogs(data);
7718
+ }
7716
7719
  logTestErrors(data);
7717
7720
  return data.failed === 0;
7718
7721
  }
@@ -7742,7 +7745,9 @@ var runTest = async (stack, dir, filters) => {
7742
7745
  });
7743
7746
  return result2;
7744
7747
  });
7745
- logTestLogs(result);
7748
+ if (opts.showLogs) {
7749
+ logTestLogs(result);
7750
+ }
7746
7751
  logTestErrors(result);
7747
7752
  await writeFile3(
7748
7753
  file,
@@ -7753,7 +7758,7 @@ var runTest = async (stack, dir, filters) => {
7753
7758
  );
7754
7759
  return result.errors.length === 0;
7755
7760
  };
7756
- var runTests = async (tests, stackFilters = [], testFilters = []) => {
7761
+ var runTests = async (tests, stackFilters = [], testFilters = [], opts) => {
7757
7762
  for (const test2 of tests) {
7758
7763
  if (stackFilters && stackFilters.length > 0) {
7759
7764
  const found = stackFilters.find((f) => wildstring3.match(f, test2.stackName));
@@ -7762,7 +7767,7 @@ var runTests = async (tests, stackFilters = [], testFilters = []) => {
7762
7767
  }
7763
7768
  }
7764
7769
  for (const path of test2.paths) {
7765
- const result = await runTest(test2.name, path, testFilters);
7770
+ const result = await runTest(test2.name, path, testFilters, opts);
7766
7771
  if (!result) {
7767
7772
  return false;
7768
7773
  }
@@ -7805,7 +7810,9 @@ var deploy = (program2) => {
7805
7810
  }
7806
7811
  }
7807
7812
  if (!options.skipTests) {
7808
- const passed = await runTests(tests, filters);
7813
+ const passed = await runTests(tests, filters, [], {
7814
+ showLogs: false
7815
+ });
7809
7816
  if (!passed) {
7810
7817
  throw new Cancelled();
7811
7818
  }
@@ -8261,7 +8268,9 @@ var test = (program2) => {
8261
8268
  if (tests.length === 0) {
8262
8269
  return "No tests found.";
8263
8270
  }
8264
- await runTests(tests, stacks, options?.filters);
8271
+ await runTests(tests, stacks, options?.filters, {
8272
+ showLogs: true
8273
+ });
8265
8274
  return "All tests finished.";
8266
8275
  });
8267
8276
  });
@@ -1092,7 +1092,7 @@ var IconsSchema = z31.record(
1092
1092
  "Image transformation will be applied from a base image. Base images orginates from a local directory that will be uploaded to S3 or from a lambda function."
1093
1093
  ),
1094
1094
  cors: z31.object({
1095
- override: z31.boolean().default(false),
1095
+ override: z31.boolean().default(true),
1096
1096
  maxAge: DurationSchema.default("365 days"),
1097
1097
  exposeHeaders: z31.string().array().optional(),
1098
1098
  credentials: z31.boolean().default(false),
@@ -1 +1 @@
1
- 776c6181ef1e22d5fea13ee8cf92d6a9b6ce0279
1
+ 335545401eb807d040031352ed637833c4aba83e
Binary file
Binary file
Binary file