@awsless/awsless 0.0.110 → 0.0.112
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 +17 -12
- 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/dist/index.js +18 -4
- package/package.json +6 -5
package/dist/bin.js
CHANGED
|
@@ -1672,6 +1672,7 @@ type Func = (...args: any[]) => any
|
|
|
1672
1672
|
type Invoke<Name extends string, F extends Func> = {
|
|
1673
1673
|
readonly name: Name
|
|
1674
1674
|
readonly async: (payload: Parameters<F>[0], options?: Omit<InvokeOptions, 'name' | 'payload' | 'type'>) => InvokeResponse<F>
|
|
1675
|
+
readonly cached: (payload: Parameters<F>[0], options?: Omit<InvokeOptions, 'name' | 'payload' | 'type'>) => InvokeResponse<F>
|
|
1675
1676
|
(payload: Parameters<F>[0], options?: Omit<InvokeOptions, 'name' | 'payload'>): InvokeResponse<F>
|
|
1676
1677
|
}
|
|
1677
1678
|
|
|
@@ -8390,16 +8391,19 @@ var CustomReporter = class {
|
|
|
8390
8391
|
return [task];
|
|
8391
8392
|
}
|
|
8392
8393
|
};
|
|
8393
|
-
var singleTester = (stack, dir) => {
|
|
8394
|
+
var singleTester = (stack, dir, filters) => {
|
|
8394
8395
|
const formatFileName = (path) => {
|
|
8395
8396
|
if (!path) {
|
|
8396
8397
|
return "";
|
|
8397
8398
|
}
|
|
8398
|
-
|
|
8399
|
-
|
|
8400
|
-
const ext = extname2(
|
|
8401
|
-
|
|
8402
|
-
|
|
8399
|
+
const abs = join11(process.cwd(), path);
|
|
8400
|
+
const rel = relative4(dir, abs);
|
|
8401
|
+
const ext = extname2(rel);
|
|
8402
|
+
if (!ext) {
|
|
8403
|
+
return path;
|
|
8404
|
+
}
|
|
8405
|
+
const name = basename3(rel, ext);
|
|
8406
|
+
const base = dirname6(rel);
|
|
8403
8407
|
const start = base === "." ? "" : style.placeholder(base + "/");
|
|
8404
8408
|
return `${start}${name}${style.placeholder(ext)}`;
|
|
8405
8409
|
};
|
|
@@ -8549,7 +8553,7 @@ var singleTester = (stack, dir) => {
|
|
|
8549
8553
|
});
|
|
8550
8554
|
const result = await startVitest(
|
|
8551
8555
|
"test",
|
|
8552
|
-
|
|
8556
|
+
filters,
|
|
8553
8557
|
{
|
|
8554
8558
|
// name: config.name,
|
|
8555
8559
|
watch: false,
|
|
@@ -8586,11 +8590,11 @@ var singleTester = (stack, dir) => {
|
|
|
8586
8590
|
return result?.state.getCountOfFailedTests() === 0;
|
|
8587
8591
|
};
|
|
8588
8592
|
};
|
|
8589
|
-
var runTester = (tests) => {
|
|
8593
|
+
var runTester = (tests, filters = []) => {
|
|
8590
8594
|
return async (term) => {
|
|
8591
8595
|
for (const [name, paths] of tests.entries()) {
|
|
8592
8596
|
for (const path of paths) {
|
|
8593
|
-
const result = await term.out.write(singleTester(name, path));
|
|
8597
|
+
const result = await term.out.write(singleTester(name, path, filters));
|
|
8594
8598
|
if (!result) {
|
|
8595
8599
|
return false;
|
|
8596
8600
|
}
|
|
@@ -8807,14 +8811,15 @@ var config = (program2) => {
|
|
|
8807
8811
|
|
|
8808
8812
|
// src/cli/command/test.ts
|
|
8809
8813
|
var test = (program2) => {
|
|
8810
|
-
program2.command("test").argument("[stacks...]", "Optionally filter stacks to test").description("Test your app").action(async (
|
|
8814
|
+
program2.command("test").argument("[stacks...]", "Optionally filter stacks to test").option("-f --filters <string...>", "Optionally filter test files").description("Test your app").action(async (stacks, options) => {
|
|
8811
8815
|
await layout(async (config2, write) => {
|
|
8812
|
-
const { tests } = await toApp(config2,
|
|
8816
|
+
const { tests } = await toApp(config2, stacks);
|
|
8817
|
+
debug(stacks, options);
|
|
8813
8818
|
if (tests.size === 0) {
|
|
8814
8819
|
write(dialog("warning", ["No tests found"]));
|
|
8815
8820
|
return;
|
|
8816
8821
|
}
|
|
8817
|
-
await write(runTester(tests));
|
|
8822
|
+
await write(runTester(tests, options?.filters));
|
|
8818
8823
|
});
|
|
8819
8824
|
});
|
|
8820
8825
|
};
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/dist/index.js
CHANGED
|
@@ -19,18 +19,20 @@ import { invoke } from "@awsless/lambda";
|
|
|
19
19
|
|
|
20
20
|
// src/node/util.ts
|
|
21
21
|
var createProxy = /* @__NO_SIDE_EFFECTS__ */ (cb) => {
|
|
22
|
-
const
|
|
22
|
+
const cache2 = /* @__PURE__ */ new Map();
|
|
23
23
|
return new Proxy({}, {
|
|
24
24
|
get(_, name) {
|
|
25
|
-
if (!
|
|
26
|
-
|
|
25
|
+
if (!cache2.has(name)) {
|
|
26
|
+
cache2.set(name, cb(name));
|
|
27
27
|
}
|
|
28
|
-
return
|
|
28
|
+
return cache2.get(name);
|
|
29
29
|
}
|
|
30
30
|
});
|
|
31
31
|
};
|
|
32
32
|
|
|
33
33
|
// src/node/function.ts
|
|
34
|
+
import { WeakCache } from "@awsless/weak-cache";
|
|
35
|
+
var cache = new WeakCache();
|
|
34
36
|
var getFunctionName = (stack, name) => {
|
|
35
37
|
return getLocalResourceName(name, stack);
|
|
36
38
|
};
|
|
@@ -55,6 +57,18 @@ var Function = /* @__PURE__ */ createProxy((stackName) => {
|
|
|
55
57
|
payload
|
|
56
58
|
});
|
|
57
59
|
};
|
|
60
|
+
call.cached = async (payload, options = {}) => {
|
|
61
|
+
const cacheKey = JSON.stringify({ name, payload, options });
|
|
62
|
+
if (!cache.has(cacheKey)) {
|
|
63
|
+
const result = await invoke({
|
|
64
|
+
...options,
|
|
65
|
+
name,
|
|
66
|
+
payload
|
|
67
|
+
});
|
|
68
|
+
cache.set(cacheKey, result);
|
|
69
|
+
}
|
|
70
|
+
return cache.get(cacheKey);
|
|
71
|
+
};
|
|
58
72
|
return call;
|
|
59
73
|
});
|
|
60
74
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@awsless/awsless",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.112",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -24,12 +24,13 @@
|
|
|
24
24
|
}
|
|
25
25
|
},
|
|
26
26
|
"peerDependencies": {
|
|
27
|
-
"@awsless/lambda": "^0.0.13",
|
|
28
27
|
"@awsless/redis": "^0.0.8",
|
|
29
|
-
"@awsless/
|
|
28
|
+
"@awsless/lambda": "^0.0.14",
|
|
30
29
|
"@awsless/sqs": "^0.0.7",
|
|
31
|
-
"@awsless/
|
|
32
|
-
"@awsless/
|
|
30
|
+
"@awsless/validate": "^0.0.10",
|
|
31
|
+
"@awsless/sns": "^0.0.7",
|
|
32
|
+
"@awsless/weak-cache": "^0.0.1",
|
|
33
|
+
"@awsless/ssm": "^0.0.7"
|
|
33
34
|
},
|
|
34
35
|
"dependencies": {
|
|
35
36
|
"@aws-appsync/utils": "^1.5.0",
|