@awsless/cli 0.1.24 → 0.1.25
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 +20 -11
- package/package.json +14 -14
package/dist/bin.js
CHANGED
|
@@ -173413,8 +173413,8 @@ var startProjectsTest = async (props) => {
|
|
|
173413
173413
|
}
|
|
173414
173414
|
};
|
|
173415
173415
|
const progressReporter = {
|
|
173416
|
-
onTestModuleEnd() {
|
|
173417
|
-
props.onFileFinished?.();
|
|
173416
|
+
onTestModuleEnd(module) {
|
|
173417
|
+
props.onFileFinished?.(module.project.name);
|
|
173418
173418
|
}
|
|
173419
173419
|
};
|
|
173420
173420
|
const debug4 = process.env.AWSLESS_TEST_DEBUG === "1";
|
|
@@ -173626,20 +173626,20 @@ var formatModuleError = (error52) => {
|
|
|
173626
173626
|
return [error52.message, syscall && `(${syscall})`, ...extra, `
|
|
173627
173627
|
`, error52.stack ?? "(no stack captured)"].filter(Boolean).join(" ");
|
|
173628
173628
|
};
|
|
173629
|
-
var
|
|
173629
|
+
var countTestFiles = async (dir) => {
|
|
173630
173630
|
let entries2;
|
|
173631
173631
|
try {
|
|
173632
173632
|
entries2 = await readdir6(dir, { recursive: true, withFileTypes: true });
|
|
173633
173633
|
} catch {
|
|
173634
|
-
return
|
|
173634
|
+
return 0;
|
|
173635
173635
|
}
|
|
173636
|
-
return entries2.
|
|
173636
|
+
return entries2.filter((entry) => {
|
|
173637
173637
|
if (!entry.isFile() || !/\.(js|jsx|ts|tsx)$/.test(entry.name)) {
|
|
173638
173638
|
return false;
|
|
173639
173639
|
}
|
|
173640
173640
|
const relativePath2 = relative10(dir, join43(entry.parentPath, entry.name));
|
|
173641
173641
|
return relativePath2.split(sep2).every((segment) => !segment.startsWith("_"));
|
|
173642
|
-
});
|
|
173642
|
+
}).length;
|
|
173643
173643
|
};
|
|
173644
173644
|
var readCachedResult = async (file3, fingerprint) => {
|
|
173645
173645
|
if (process.env.NO_CACHE) {
|
|
@@ -173680,7 +173680,8 @@ var runTests = async (tests, stackFilters = [], testFilters = [], opts) => {
|
|
|
173680
173680
|
}))));
|
|
173681
173681
|
for (const test of selected) {
|
|
173682
173682
|
for (const [index, dir] of test.paths.entries()) {
|
|
173683
|
-
|
|
173683
|
+
const files = await countTestFiles(dir);
|
|
173684
|
+
if (files === 0) {
|
|
173684
173685
|
continue;
|
|
173685
173686
|
}
|
|
173686
173687
|
const file3 = join43(directories.test, `${test.name}.json`);
|
|
@@ -173702,6 +173703,7 @@ var runTests = async (tests, stackFilters = [], testFilters = [], opts) => {
|
|
|
173702
173703
|
stack: test.name,
|
|
173703
173704
|
dir,
|
|
173704
173705
|
file: file3,
|
|
173706
|
+
files,
|
|
173705
173707
|
fingerprint,
|
|
173706
173708
|
env: {
|
|
173707
173709
|
...opts.env,
|
|
@@ -173720,15 +173722,22 @@ var runTests = async (tests, stackFilters = [], testFilters = [], opts) => {
|
|
|
173720
173722
|
initialMessage: pending.length === 1 ? `Run tests for the ${color2.info(pending[0].stack)} stack` : `Run tests for ${pending.length} stacks`,
|
|
173721
173723
|
errorMessage: `Running tests failed`,
|
|
173722
173724
|
async task(ctx) {
|
|
173723
|
-
|
|
173725
|
+
const expectedFiles = new Map(pending.map((entry) => [entry.name, entry.files]));
|
|
173726
|
+
const finishedFiles = new Map;
|
|
173727
|
+
const finishedStacks = new Set;
|
|
173724
173728
|
const run = (entries2) => {
|
|
173725
173729
|
return startProjectsTest({
|
|
173726
173730
|
projects: entries2.map((entry) => ({ name: entry.name, dir: entry.dir, env: entry.env })),
|
|
173727
173731
|
filters: testFilters,
|
|
173728
173732
|
workers,
|
|
173729
|
-
onFileFinished() {
|
|
173730
|
-
|
|
173731
|
-
|
|
173733
|
+
onFileFinished(project) {
|
|
173734
|
+
const count = (finishedFiles.get(project) ?? 0) + 1;
|
|
173735
|
+
finishedFiles.set(project, count);
|
|
173736
|
+
if (count >= (expectedFiles.get(project) ?? Infinity)) {
|
|
173737
|
+
finishedStacks.add(project);
|
|
173738
|
+
}
|
|
173739
|
+
const progress = testFilters.length > 0 ? `${[...finishedFiles.values()].reduce((sum, value) => sum + value, 0)} files done` : `${finishedStacks.size}/${pending.length} stacks done`;
|
|
173740
|
+
ctx.updateMessage(`Run tests for ${pending.length} stacks ${color2.dim(`(${progress})`)}`);
|
|
173732
173741
|
}
|
|
173733
173742
|
});
|
|
173734
173743
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@awsless/cli",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.25",
|
|
4
4
|
"bugs": {
|
|
5
5
|
"url": "https://github.com/awsless/awsless/issues"
|
|
6
6
|
},
|
|
@@ -81,24 +81,24 @@
|
|
|
81
81
|
"wrap-ansi": "10.0.1",
|
|
82
82
|
"zod": "4.4.3",
|
|
83
83
|
"@awsless/big-float": "^0.1.8",
|
|
84
|
-
"@awsless/cloudwatch": "^0.0.2",
|
|
85
84
|
"@awsless/duration": "^0.0.4",
|
|
86
|
-
"@awsless/
|
|
85
|
+
"@awsless/cloudwatch": "^0.0.2",
|
|
87
86
|
"@awsless/clui": "^0.0.10",
|
|
87
|
+
"@awsless/dynamodb": "^0.3.26",
|
|
88
88
|
"@awsless/dynamodb-server": "^0.1.11",
|
|
89
|
-
"@awsless/json": "^0.0.12",
|
|
90
89
|
"@awsless/iot": "^0.0.6",
|
|
91
|
-
"@awsless/
|
|
90
|
+
"@awsless/json": "^0.0.12",
|
|
92
91
|
"@awsless/lambda": "^0.0.49",
|
|
92
|
+
"@awsless/open-search": "^0.0.29",
|
|
93
|
+
"@awsless/redis": "^0.1.14",
|
|
94
|
+
"@awsless/s3": "^0.0.23",
|
|
93
95
|
"@awsless/size": "^0.0.3",
|
|
94
96
|
"@awsless/sqs": "^0.0.25",
|
|
95
|
-
"@awsless/s3": "^0.0.23",
|
|
96
|
-
"awsless": "^0.1.6",
|
|
97
|
-
"@awsless/ts-file-cache": "^0.0.22",
|
|
98
97
|
"@awsless/sns": "^0.0.12",
|
|
98
|
+
"@awsless/validate": "^0.2.1",
|
|
99
|
+
"@awsless/ts-file-cache": "^0.0.22",
|
|
99
100
|
"@awsless/weak-cache": "^0.0.2",
|
|
100
|
-
"
|
|
101
|
-
"@awsless/validate": "^0.2.1"
|
|
101
|
+
"awsless": "^0.1.6"
|
|
102
102
|
},
|
|
103
103
|
"peerDependencies": {
|
|
104
104
|
"@aws-sdk/client-cloudfront-keyvaluestore": "3.1113.0",
|
|
@@ -118,14 +118,14 @@
|
|
|
118
118
|
"@awsless/big-float": "^0.1.8",
|
|
119
119
|
"@awsless/dynamodb": "^0.3.26",
|
|
120
120
|
"@awsless/json": "^0.0.12",
|
|
121
|
-
"@awsless/s3": "^0.0.23",
|
|
122
121
|
"@awsless/dynamodb-server": "^0.1.11",
|
|
123
|
-
"@awsless/ts-file-cache": "^0.0.22",
|
|
124
122
|
"@awsless/lambda": "^0.0.49",
|
|
125
123
|
"@awsless/duration": "^0.0.4",
|
|
126
|
-
"awsless": "^0.
|
|
124
|
+
"@awsless/s3": "^0.0.23",
|
|
127
125
|
"@awsless/validate": "^0.2.1",
|
|
128
|
-
"@awsless/weak-cache": "^0.0.2"
|
|
126
|
+
"@awsless/weak-cache": "^0.0.2",
|
|
127
|
+
"awsless": "^0.1.6",
|
|
128
|
+
"@awsless/ts-file-cache": "^0.0.22"
|
|
129
129
|
},
|
|
130
130
|
"scripts": {
|
|
131
131
|
"test": "pnpm typecheck && bun cli/build-handlers.ts && pnpm vitest",
|