@awsless/awsless 0.0.99 → 0.0.101

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
@@ -1012,7 +1012,7 @@ var generateFingerprint = async (file) => {
1012
1012
  }
1013
1013
  };
1014
1014
  await generate(file);
1015
- const merge = Buffer.concat(Array.from(hashes.values()));
1015
+ const merge = Buffer.concat(Array.from(hashes.values()).sort());
1016
1016
  return createHash2("sha1").update(merge).digest("hex");
1017
1017
  };
1018
1018
  var readModuleFile = (file) => {
@@ -7243,6 +7243,19 @@ var Renderer = class {
7243
7243
  this.output.clearLine?.(1, () => resolve(void 0));
7244
7244
  });
7245
7245
  }
7246
+ // private stripEscapeCode(str: string) {
7247
+ // return str.replace(/[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]/g, '')
7248
+ // }
7249
+ // private chunkString(str: string, size: number): string[] {
7250
+ // const strLength: number = str.length
7251
+ // const numChunks: number = Math.ceil(strLength / size)
7252
+ // const chunks: string[] = new Array(numChunks)
7253
+ // for (let i = 0; i < numChunks; ++i) {
7254
+ // const s = i * size
7255
+ // chunks[i] = str.substring(s, s + size)
7256
+ // }
7257
+ // return chunks
7258
+ // }
7246
7259
  async flush() {
7247
7260
  clearTimeout(this.timeout);
7248
7261
  if (this.flushing) {
@@ -7265,8 +7278,8 @@ var Renderer = class {
7265
7278
  };
7266
7279
  this.unsubs.forEach((unsub) => unsub());
7267
7280
  this.unsubs = [];
7268
- const screen = walk(this.fragments).split("\n");
7269
7281
  const height = this.height();
7282
+ const screen = walk(this.fragments).split("\n");
7270
7283
  const oldSize = this.screen.length;
7271
7284
  const newSize = screen.length;
7272
7285
  const size = Math.max(oldSize, newSize);
@@ -8282,7 +8295,16 @@ import nodeResolve3 from "@rollup/plugin-node-resolve";
8282
8295
  import json3 from "@rollup/plugin-json";
8283
8296
  import { swc as swc4 } from "rollup-plugin-swc3";
8284
8297
  import { getTests } from "@vitest/runner/utils";
8285
- import { basename as basename3, extname } from "path";
8298
+ import { basename as basename3, extname, join as join11, relative as relative4 } from "path";
8299
+
8300
+ // src/cli/ui/layout/text-box.ts
8301
+ import wrapAnsi3 from "wrap-ansi";
8302
+ var textBox = (text, width, indent = 0) => {
8303
+ const space = " ".repeat(indent);
8304
+ return wrapAnsi3(text, width + indent).split(br()).map((line2) => `${space}${line2}`).join(br());
8305
+ };
8306
+
8307
+ // src/cli/ui/complex/tester.ts
8286
8308
  var CustomReporter = class {
8287
8309
  constructor(stack, out) {
8288
8310
  this.stack = stack;
@@ -8358,7 +8380,7 @@ var CustomReporter = class {
8358
8380
  " ",
8359
8381
  style.placeholder(symbol.pointerSmall),
8360
8382
  " ",
8361
- i === 0 ? task.name : style.placeholder(task.name)
8383
+ i === 0 ? this.formatFileName(task.name) : style.placeholder(task.name)
8362
8384
  ]),
8363
8385
  // style.placeholder(tests.length),
8364
8386
  // ' ',
@@ -8392,17 +8414,25 @@ var CustomReporter = class {
8392
8414
  " ",
8393
8415
  style.placeholder(symbol.pointerSmall),
8394
8416
  " ",
8395
- test2.file?.name,
8417
+ this.formatFileName(test2.file?.name),
8418
+ " ",
8419
+ style.placeholder(symbol.pointerSmall),
8396
8420
  " ",
8397
- style.placeholder(`${symbol.pointerSmall} ${test2.name}`),
8421
+ test2.name,
8398
8422
  br(),
8399
8423
  test2.result.errors.map((error) => {
8400
8424
  const [message, ...comment] = error.message.split("//");
8401
- const values = [
8402
- " ",
8425
+ const errorMessage = [
8403
8426
  style.error(`${style.error.bold(error.name)}: ${message}`),
8404
8427
  comment.length > 0 ? style.placeholder(`//${comment}`) : "",
8405
8428
  br()
8429
+ ].join("");
8430
+ const values = [
8431
+ textBox(errorMessage, this.out.width(), 2)
8432
+ // ' ',
8433
+ // style.error(`${style.error.bold(error.name)}: ${message}`),
8434
+ // comment.length > 0 ? style.placeholder(`//${comment}`) : '',
8435
+ // br(),
8406
8436
  ];
8407
8437
  if (error.showDiff && error.diff) {
8408
8438
  values.push(br(), error.diff, br());
@@ -8422,6 +8452,11 @@ var CustomReporter = class {
8422
8452
  this.logs.push(log.content);
8423
8453
  }
8424
8454
  formatFileName(path) {
8455
+ if (!path) {
8456
+ return "";
8457
+ }
8458
+ path = join11(process.cwd(), path);
8459
+ path = relative4(this.ctx.config.dir, path);
8425
8460
  const ext = extname(path);
8426
8461
  const bas = basename3(path, ext);
8427
8462
  return `${bas}${style.placeholder(ext)}`;
@@ -8450,8 +8485,6 @@ var singleTester = (stack, dir) => {
8450
8485
  watch: false,
8451
8486
  ui: false,
8452
8487
  silent: true,
8453
- // dir: '',
8454
- // dir: './test',
8455
8488
  dir,
8456
8489
  include: ["**/*.{js,jsx,ts,tsx}"],
8457
8490
  exclude: ["**/_*", "**/_*/**", ...configDefaults.exclude],
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@awsless/awsless",
3
- "version": "0.0.99",
3
+ "version": "0.0.101",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "sideEffects": false,
@@ -24,10 +24,10 @@
24
24
  }
25
25
  },
26
26
  "peerDependencies": {
27
- "@awsless/lambda": "^0.0.13",
28
27
  "@awsless/sns": "^0.0.7",
29
28
  "@awsless/redis": "^0.0.8",
30
29
  "@awsless/sqs": "^0.0.7",
30
+ "@awsless/lambda": "^0.0.13",
31
31
  "@awsless/ssm": "^0.0.7",
32
32
  "@awsless/validate": "^0.0.6"
33
33
  },