@awsless/awsless 0.0.555 → 0.0.557

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
@@ -1665,7 +1665,7 @@ var SitesSchema = z34.record(
1665
1665
  cacheKey: z34.union([LocalEntrySchema.transform((v) => [v]), LocalEntrySchema.array()]).describe(
1666
1666
  `Specifies the files and directories to generate the cache key for your custom build command.`
1667
1667
  ),
1668
- configs: z34.string().array().describe("Define the config values for your build command.")
1668
+ configs: z34.string().array().optional().describe("Define the config values for your build command.")
1669
1669
  }).optional().describe(`Specifies the build process for sites that need a build step.`),
1670
1670
  static: z34.union([LocalDirectorySchema, z34.boolean()]).optional().describe(
1671
1671
  "Specifies the path to the static files directory. Additionally you can also pass `true` when you don't have local static files, but still want to make an S3 bucket."
@@ -1721,10 +1721,10 @@ var SitesSchema = z34.record(
1721
1721
  origins: z34.string().array().default(["*"]),
1722
1722
  methods: z34.enum(["GET", "DELETE", "HEAD", "OPTIONS", "PATCH", "POST", "PUT", "ALL"]).array().default(["ALL"])
1723
1723
  }).optional().describe("Specify the cors headers."),
1724
- auth: z34.object({
1725
- username: z34.string().describe("Basic auth username"),
1726
- password: z34.string().describe("Basic auth password")
1727
- }).optional().describe("Enable basic authentication for the site"),
1724
+ basicAuth: z34.object({
1725
+ username: z34.string().describe("Basic auth username."),
1726
+ password: z34.string().describe("Basic auth password.")
1727
+ }).optional().describe("Enable basic authentication for the site."),
1728
1728
  security: z34.object({
1729
1729
  // contentSecurityPolicy: z.object({
1730
1730
  // override: z.boolean().default(false),
@@ -2106,7 +2106,12 @@ var TasksSchema = z40.record(ResourceIdSchema, TaskSchema).optional().describe("
2106
2106
 
2107
2107
  // src/feature/test/schema.ts
2108
2108
  import { z as z41 } from "zod";
2109
- var TestsSchema = z41.union([LocalDirectorySchema.transform((v) => [v]), LocalDirectorySchema.array()]).describe("Define the location of your tests for your stack.").optional();
2109
+ var TestsSchema = z41.union([
2110
+ //
2111
+ LocalDirectorySchema.transform((v) => [v]),
2112
+ LocalDirectorySchema.array(),
2113
+ z41.literal(false)
2114
+ ]).describe("Define the location of your tests for your stack.").optional();
2110
2115
 
2111
2116
  // src/config/stack.ts
2112
2117
  var DependsSchema = ResourceIdSchema.array().optional().describe("Define the stacks that this stack is depended on.");
@@ -5300,7 +5305,7 @@ var siteFeature = defineFeature({
5300
5305
  runtime: `cloudfront-js-2.0`,
5301
5306
  comment: `Viewer Request - ${name}`,
5302
5307
  publish: true,
5303
- code: getViewerRequestFunctionCode(domainName, bucket, functionUrl, props.auth),
5308
+ code: getViewerRequestFunctionCode(domainName, bucket, functionUrl, props.basicAuth),
5304
5309
  keyValueStoreAssociations: kvs ? [kvs.arn] : void 0
5305
5310
  });
5306
5311
  const distribution = new $15.aws.cloudfront.Distribution(group, "distribution", {
@@ -5935,11 +5940,15 @@ var taskFeature = defineFeature({
5935
5940
  var testFeature = defineFeature({
5936
5941
  name: "test",
5937
5942
  onStack(ctx) {
5938
- if (ctx.stackConfig.tests) {
5943
+ if (Array.isArray(ctx.stackConfig.tests)) {
5939
5944
  ctx.registerTest(ctx.stackConfig.name, ctx.stackConfig.tests);
5940
- } else {
5945
+ } else if (typeof ctx.stackConfig.tests === "undefined") {
5941
5946
  ctx.addWarning({
5942
- message: `Stack ${color.info(ctx.stack.name)} has no tests defined. Consider adding test cases to ensure stability.`
5947
+ message: [
5948
+ `Stack ${color.info(ctx.stack.name)} has no tests defined.`,
5949
+ `Consider adding test cases to ensure stability.`,
5950
+ `If your stack doesn't need tests you can set the tests field to \`false\``
5951
+ ].join(" ")
5943
5952
  });
5944
5953
  }
5945
5954
  }
@@ -8413,8 +8422,8 @@ var CustomReporter = class {
8413
8422
  const traces = error.stackStr ? parseStacktrace(error.stackStr) : [];
8414
8423
  return {
8415
8424
  location: {
8416
- line: traces[0]?.line,
8417
- column: traces[0]?.column
8425
+ line: traces[0]?.line ?? item.location?.line,
8426
+ column: traces[0]?.column ?? item.location?.column
8418
8427
  },
8419
8428
  file: item.name,
8420
8429
  test: test2.type === "test" ? test2.name : void 0,
@@ -1057,7 +1057,7 @@ var SitesSchema = z31.record(
1057
1057
  cacheKey: z31.union([LocalEntrySchema.transform((v) => [v]), LocalEntrySchema.array()]).describe(
1058
1058
  `Specifies the files and directories to generate the cache key for your custom build command.`
1059
1059
  ),
1060
- configs: z31.string().array().describe("Define the config values for your build command.")
1060
+ configs: z31.string().array().optional().describe("Define the config values for your build command.")
1061
1061
  }).optional().describe(`Specifies the build process for sites that need a build step.`),
1062
1062
  static: z31.union([LocalDirectorySchema, z31.boolean()]).optional().describe(
1063
1063
  "Specifies the path to the static files directory. Additionally you can also pass `true` when you don't have local static files, but still want to make an S3 bucket."
@@ -1113,10 +1113,10 @@ var SitesSchema = z31.record(
1113
1113
  origins: z31.string().array().default(["*"]),
1114
1114
  methods: z31.enum(["GET", "DELETE", "HEAD", "OPTIONS", "PATCH", "POST", "PUT", "ALL"]).array().default(["ALL"])
1115
1115
  }).optional().describe("Specify the cors headers."),
1116
- auth: z31.object({
1117
- username: z31.string().describe("Basic auth username"),
1118
- password: z31.string().describe("Basic auth password")
1119
- }).optional().describe("Enable basic authentication for the site"),
1116
+ basicAuth: z31.object({
1117
+ username: z31.string().describe("Basic auth username."),
1118
+ password: z31.string().describe("Basic auth password.")
1119
+ }).optional().describe("Enable basic authentication for the site."),
1120
1120
  security: z31.object({
1121
1121
  // contentSecurityPolicy: z.object({
1122
1122
  // override: z.boolean().default(false),
@@ -1498,7 +1498,12 @@ var TasksSchema = z37.record(ResourceIdSchema, TaskSchema).optional().describe("
1498
1498
 
1499
1499
  // src/feature/test/schema.ts
1500
1500
  import { z as z38 } from "zod";
1501
- var TestsSchema = z38.union([LocalDirectorySchema.transform((v) => [v]), LocalDirectorySchema.array()]).describe("Define the location of your tests for your stack.").optional();
1501
+ var TestsSchema = z38.union([
1502
+ //
1503
+ LocalDirectorySchema.transform((v) => [v]),
1504
+ LocalDirectorySchema.array(),
1505
+ z38.literal(false)
1506
+ ]).describe("Define the location of your tests for your stack.").optional();
1502
1507
 
1503
1508
  // src/config/stack.ts
1504
1509
  var DependsSchema = ResourceIdSchema.array().optional().describe("Define the stacks that this stack is depended on.");
Binary file
Binary file
@@ -1 +1 @@
1
- 355b49989570d95758c09af3e91d59c93fcf2284
1
+ e4e6754c9211e7052132876e9d5853a8fca5bafe
Binary file