@awsless/awsless 0.0.122 → 0.0.123

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
@@ -6296,8 +6296,9 @@ var StackSchema = z28.object({
6296
6296
 
6297
6297
  // src/config/load.ts
6298
6298
  var ConfigError = class extends Error {
6299
- constructor(error, data) {
6299
+ constructor(file, error, data) {
6300
6300
  super(error.message);
6301
+ this.file = file;
6301
6302
  this.error = error;
6302
6303
  this.data = data;
6303
6304
  }
@@ -6319,7 +6320,7 @@ var loadConfig = async (options) => {
6319
6320
  app = await AppSchema.parseAsync(appConfig);
6320
6321
  } catch (error) {
6321
6322
  if (error instanceof z29.ZodError) {
6322
- throw new ConfigError(error, appConfig);
6323
+ throw new ConfigError(appFileName, error, appConfig);
6323
6324
  }
6324
6325
  throw error;
6325
6326
  }
@@ -6344,7 +6345,7 @@ var loadConfig = async (options) => {
6344
6345
  stacks.push(stack);
6345
6346
  } catch (error) {
6346
6347
  if (error instanceof z29.ZodError) {
6347
- throw new ConfigError(error, stackConfig);
6348
+ throw new ConfigError(file, error, stackConfig);
6348
6349
  }
6349
6350
  throw error;
6350
6351
  }
@@ -6846,14 +6847,15 @@ var format = (value) => {
6846
6847
  }
6847
6848
  return "";
6848
6849
  };
6849
- var zodError = (error, data) => {
6850
+ var zodError = (error) => {
6850
6851
  return (term) => {
6851
- for (const issue of error.issues) {
6852
+ for (const issue of error.error.issues) {
6852
6853
  term.out.gap();
6853
6854
  term.out.write(dialog("error", [style.error(issue.message)]));
6855
+ term.out.write(" " + style.placeholder(error.file));
6854
6856
  term.out.gap();
6855
6857
  term.out.write(line("{"));
6856
- let context = data;
6858
+ let context = error.data;
6857
6859
  const inStack = issue.path[0] === "stacks" && typeof issue.path[1] === "number";
6858
6860
  const length2 = issue.path.length;
6859
6861
  const end = [];
@@ -6873,7 +6875,7 @@ var zodError = (error, data) => {
6873
6875
  end.unshift(line("]", index));
6874
6876
  } else if (typeof context === "object") {
6875
6877
  if (inStack && index === 3) {
6876
- const name = data.stacks[issue.path[1]].name;
6878
+ const name = error.data.stacks[issue.path[1]].name;
6877
6879
  term.out.write(line("name: " + style.info(`"${name}"`) + ",", index));
6878
6880
  }
6879
6881
  term.out.write(line(key + "{", index));
@@ -6907,7 +6909,7 @@ var layout = async (cb) => {
6907
6909
  } catch (error) {
6908
6910
  term.out.gap();
6909
6911
  if (error instanceof ConfigError) {
6910
- term.out.write(zodError(error.error, error.data));
6912
+ term.out.write(zodError(error));
6911
6913
  } else if (error instanceof Error) {
6912
6914
  term.out.write(dialog("error", [error.message]));
6913
6915
  } else if (typeof error === "string") {
@@ -8321,7 +8323,7 @@ var dev = (program2) => {
8321
8323
  },
8322
8324
  (error) => {
8323
8325
  if (error instanceof ConfigError) {
8324
- write(zodError(error.error, error.data));
8326
+ write(zodError(error));
8325
8327
  } else if (error instanceof Error) {
8326
8328
  write(dialog("error", [error.message]));
8327
8329
  } else if (typeof error === "string") {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@awsless/awsless",
3
- "version": "0.0.122",
3
+ "version": "0.0.123",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "sideEffects": false,