@awsless/awsless 0.0.108 → 0.0.110
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 +88 -49
- package/dist/features/cognito-client-secret/bundle.zip +0 -0
- package/dist/features/delete-bucket/bundle.zip +0 -0
- package/dist/features/delete-hosted-zone/bundle.zip +0 -0
- package/dist/features/global-exports/bundle.zip +0 -0
- package/dist/features/invalidate-cache/bundle.zip +0 -0
- package/dist/features/upload-bucket-asset/bundle.zip +0 -0
- package/package.json +5 -4
package/dist/bin.js
CHANGED
|
@@ -10,14 +10,14 @@ import { Command } from "commander";
|
|
|
10
10
|
import chalk from "chalk";
|
|
11
11
|
var symbol = {
|
|
12
12
|
info: "\u2139",
|
|
13
|
-
success: "\
|
|
13
|
+
success: "\u2713",
|
|
14
14
|
warning: "\u26A0",
|
|
15
15
|
question: "?",
|
|
16
|
-
error: "\
|
|
16
|
+
error: "\xD7",
|
|
17
17
|
dot: "\xB7",
|
|
18
|
+
line: "\u2500",
|
|
18
19
|
ellipsis: "\u2026",
|
|
19
20
|
pointerSmall: "\u203A",
|
|
20
|
-
// line: '─',
|
|
21
21
|
pointer: "\u276F"
|
|
22
22
|
};
|
|
23
23
|
var style = {
|
|
@@ -912,6 +912,7 @@ var rollupBundle = ({
|
|
|
912
912
|
debugError(error.message);
|
|
913
913
|
},
|
|
914
914
|
treeshake: {
|
|
915
|
+
preset: "smallest",
|
|
915
916
|
moduleSideEffects: (id) => input === id
|
|
916
917
|
},
|
|
917
918
|
plugins: [
|
|
@@ -994,7 +995,7 @@ import { join as join2 } from "path";
|
|
|
994
995
|
import { createHash as createHash2 } from "crypto";
|
|
995
996
|
import { readFile, readdir, stat as stat2 } from "fs/promises";
|
|
996
997
|
import { basename, dirname as dirname2, extname, join } from "path";
|
|
997
|
-
import
|
|
998
|
+
import parseStaticImports from "parse-static-imports";
|
|
998
999
|
var extensions = ["js", "mjs", "jsx", "ts", "mts", "tsx"];
|
|
999
1000
|
var generateFileHashes = async (file, hashes) => {
|
|
1000
1001
|
if (hashes.has(file)) {
|
|
@@ -1054,8 +1055,8 @@ var readFiles = async (files) => {
|
|
|
1054
1055
|
throw new Error(`No such file: ${files.join(", ")}`);
|
|
1055
1056
|
};
|
|
1056
1057
|
var findDependencies = async (file, code) => {
|
|
1057
|
-
const imports =
|
|
1058
|
-
return imports.map((entry) => entry.
|
|
1058
|
+
const imports = await parseStaticImports(code);
|
|
1059
|
+
return imports.map((entry) => entry.moduleName).filter(Boolean).map((value) => value?.startsWith(".") ? join(dirname2(file), value) : value);
|
|
1059
1060
|
};
|
|
1060
1061
|
|
|
1061
1062
|
// src/formation/resource/lambda/code.ts
|
|
@@ -8307,14 +8308,14 @@ import { startVitest } from "vitest/node";
|
|
|
8307
8308
|
import commonjs3 from "@rollup/plugin-commonjs";
|
|
8308
8309
|
import nodeResolve3 from "@rollup/plugin-node-resolve";
|
|
8309
8310
|
import { swc as swc4 } from "rollup-plugin-swc3";
|
|
8310
|
-
import { getTests } from "@vitest/runner/utils";
|
|
8311
|
-
import { basename as basename3, extname as extname2, join as join11, relative as relative4 } from "path";
|
|
8311
|
+
import { getSuites, getTests } from "@vitest/runner/utils";
|
|
8312
|
+
import { basename as basename3, dirname as dirname6, extname as extname2, join as join11, relative as relative4 } from "path";
|
|
8312
8313
|
|
|
8313
8314
|
// src/cli/ui/layout/text-box.ts
|
|
8314
8315
|
import wrapAnsi3 from "wrap-ansi";
|
|
8315
8316
|
var textWrap = (text, width, { indent = 0, skipFirstLine = false, ...rest } = {}) => {
|
|
8316
8317
|
const space = " ".repeat(indent);
|
|
8317
|
-
return wrapAnsi3(text, width - indent, { hard: true, ...rest }).split(br()).map((line2, i) => i === 0 && skipFirstLine ? line2 : `${space}${line2}`).join(br());
|
|
8318
|
+
return wrapAnsi3(text, width - indent, { hard: true, trim: false, ...rest }).split(br()).map((line2, i) => i === 0 && skipFirstLine ? line2 : `${space}${line2}`).join(br());
|
|
8318
8319
|
};
|
|
8319
8320
|
|
|
8320
8321
|
// src/cli/ui/complex/tester.ts
|
|
@@ -8343,16 +8344,18 @@ var CustomReporter = class {
|
|
|
8343
8344
|
onFinished() {
|
|
8344
8345
|
clearInterval(this.interval);
|
|
8345
8346
|
this.interval = void 0;
|
|
8347
|
+
const suites = getSuites(this.tasks);
|
|
8346
8348
|
const tests = getTests(this.tasks);
|
|
8347
|
-
const
|
|
8348
|
-
const
|
|
8349
|
-
const
|
|
8349
|
+
const tasks = [...suites, ...tests];
|
|
8350
|
+
const passed = tasks.filter((t) => t.result?.state === "pass").length;
|
|
8351
|
+
const failed = tasks.filter((t) => t.result?.state === "fail").length;
|
|
8352
|
+
const errors = [...suites, ...tests].map((test2) => {
|
|
8350
8353
|
if (!test2.result?.errors || test2.result.errors.length === 0) {
|
|
8351
8354
|
return [];
|
|
8352
8355
|
}
|
|
8353
8356
|
return test2.result.errors.map((error) => ({
|
|
8354
|
-
file: test2.file?.name,
|
|
8355
|
-
test: test2.name,
|
|
8357
|
+
file: test2.type === "suite" ? test2.name : test2.file?.name,
|
|
8358
|
+
test: test2.type === "test" ? test2.name : void 0,
|
|
8356
8359
|
diff: error.showDiff && error.diff ? error.diff : void 0,
|
|
8357
8360
|
type: error.name,
|
|
8358
8361
|
message: error.message
|
|
@@ -8395,45 +8398,81 @@ var singleTester = (stack, dir) => {
|
|
|
8395
8398
|
path = join11(process.cwd(), path);
|
|
8396
8399
|
path = relative4(dir, path);
|
|
8397
8400
|
const ext = extname2(path);
|
|
8398
|
-
const
|
|
8399
|
-
|
|
8401
|
+
const name = basename3(path, ext);
|
|
8402
|
+
const base = dirname6(path);
|
|
8403
|
+
const start = base === "." ? "" : style.placeholder(base + "/");
|
|
8404
|
+
return `${start}${name}${style.placeholder(ext)}`;
|
|
8400
8405
|
};
|
|
8401
8406
|
const formatLogs = (logs2, width) => {
|
|
8402
|
-
|
|
8403
|
-
|
|
8404
|
-
|
|
8405
|
-
|
|
8406
|
-
|
|
8407
|
-
|
|
8408
|
-
|
|
8409
|
-
|
|
8410
|
-
|
|
8407
|
+
const length2 = logs2.length;
|
|
8408
|
+
if (length2 === 0) {
|
|
8409
|
+
return [];
|
|
8410
|
+
}
|
|
8411
|
+
const header2 = ` Logs ${length2} `;
|
|
8412
|
+
const lineSize = (width - 2) / 2 - header2.length / 2;
|
|
8413
|
+
return [
|
|
8414
|
+
" ",
|
|
8415
|
+
style.info(symbol.line.repeat(lineSize)),
|
|
8416
|
+
style.info.inverse.bold(header2),
|
|
8417
|
+
style.info(symbol.line.repeat(lineSize + (header2.length % 2 ? 0 : 1))),
|
|
8418
|
+
br(),
|
|
8419
|
+
br(),
|
|
8420
|
+
...logs2.map((log) => {
|
|
8421
|
+
return [
|
|
8422
|
+
textWrap([style.info(`${symbol.dot} `), log].join(""), width, {
|
|
8423
|
+
skipFirstLine: true,
|
|
8424
|
+
indent: 2
|
|
8425
|
+
}),
|
|
8426
|
+
br(),
|
|
8427
|
+
br()
|
|
8428
|
+
];
|
|
8429
|
+
}).flat()
|
|
8430
|
+
];
|
|
8411
8431
|
};
|
|
8412
8432
|
const formatErrors = (errors, width) => {
|
|
8413
|
-
|
|
8414
|
-
|
|
8415
|
-
|
|
8416
|
-
|
|
8417
|
-
|
|
8418
|
-
|
|
8419
|
-
|
|
8420
|
-
|
|
8421
|
-
|
|
8422
|
-
|
|
8423
|
-
|
|
8424
|
-
|
|
8425
|
-
|
|
8426
|
-
|
|
8427
|
-
|
|
8428
|
-
|
|
8429
|
-
|
|
8430
|
-
|
|
8431
|
-
|
|
8432
|
-
|
|
8433
|
-
|
|
8434
|
-
|
|
8435
|
-
|
|
8436
|
-
|
|
8433
|
+
const length2 = errors.length;
|
|
8434
|
+
if (length2 === 0) {
|
|
8435
|
+
return [];
|
|
8436
|
+
}
|
|
8437
|
+
const header2 = ` Failed Tests ${length2} `;
|
|
8438
|
+
const lineSize = (width - 2) / 2 - header2.length / 2;
|
|
8439
|
+
return [
|
|
8440
|
+
" ",
|
|
8441
|
+
style.error(symbol.line.repeat(lineSize)),
|
|
8442
|
+
style.error.inverse.bold(header2),
|
|
8443
|
+
style.error(symbol.line.repeat(lineSize + (header2.length % 2 ? 0 : 1))),
|
|
8444
|
+
br(),
|
|
8445
|
+
...errors.map((error, i) => {
|
|
8446
|
+
const [message, ...comment] = error.message.split("//");
|
|
8447
|
+
const errorMessage = [
|
|
8448
|
+
style.error.bold(error.type + ":"),
|
|
8449
|
+
" ",
|
|
8450
|
+
message,
|
|
8451
|
+
comment.length > 0 ? style.placeholder(`//${comment}`) : "",
|
|
8452
|
+
br()
|
|
8453
|
+
].join("");
|
|
8454
|
+
const pagination = `[${i + 1}/${length2}]${symbol.line}`;
|
|
8455
|
+
const name = error.test ? [" ", style.placeholder(symbol.pointerSmall), " ", error.test] : [];
|
|
8456
|
+
return [
|
|
8457
|
+
br(),
|
|
8458
|
+
style.error(`${symbol.error} `),
|
|
8459
|
+
style.error.inverse.bold(` FAIL `),
|
|
8460
|
+
" ",
|
|
8461
|
+
style.placeholder(symbol.pointerSmall),
|
|
8462
|
+
" ",
|
|
8463
|
+
formatFileName(error.file),
|
|
8464
|
+
...name,
|
|
8465
|
+
br(),
|
|
8466
|
+
br(),
|
|
8467
|
+
textWrap(errorMessage, width, { indent: 2 }),
|
|
8468
|
+
...error.diff ? [br(), error.diff, br()] : [],
|
|
8469
|
+
br(),
|
|
8470
|
+
" ",
|
|
8471
|
+
style.error.dim(symbol.line.repeat(width - 2 - pagination.length) + pagination),
|
|
8472
|
+
br()
|
|
8473
|
+
];
|
|
8474
|
+
}).flat()
|
|
8475
|
+
];
|
|
8437
8476
|
};
|
|
8438
8477
|
const formatOutput = ({
|
|
8439
8478
|
passed,
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@awsless/awsless",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.110",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -25,11 +25,11 @@
|
|
|
25
25
|
},
|
|
26
26
|
"peerDependencies": {
|
|
27
27
|
"@awsless/lambda": "^0.0.13",
|
|
28
|
-
"@awsless/sns": "^0.0.7",
|
|
29
28
|
"@awsless/redis": "^0.0.8",
|
|
29
|
+
"@awsless/sns": "^0.0.7",
|
|
30
30
|
"@awsless/sqs": "^0.0.7",
|
|
31
|
-
"@awsless/
|
|
32
|
-
"@awsless/
|
|
31
|
+
"@awsless/ssm": "^0.0.7",
|
|
32
|
+
"@awsless/validate": "^0.0.7"
|
|
33
33
|
},
|
|
34
34
|
"dependencies": {
|
|
35
35
|
"@aws-appsync/utils": "^1.5.0",
|
|
@@ -67,6 +67,7 @@
|
|
|
67
67
|
"jszip": "^3.10.1",
|
|
68
68
|
"mime-types": "^2.1.35",
|
|
69
69
|
"parse-imports": "^1.1.2",
|
|
70
|
+
"parse-static-imports": "^1.1.0",
|
|
70
71
|
"pretty-hrtime": "^1.0.3",
|
|
71
72
|
"rollup": "^4.0.2",
|
|
72
73
|
"rollup-plugin-replace": "^2.2.0",
|