@awsless/awsless 0.0.553 → 0.0.554
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 +35 -9
- package/dist/prebuild/icon/bundle.zip +0 -0
- package/dist/prebuild/image/bundle.zip +0 -0
- package/dist/prebuild/rpc/bundle.zip +0 -0
- package/dist/server.js +22 -9
- package/package.json +21 -20
package/dist/bin.js
CHANGED
|
@@ -8375,6 +8375,7 @@ var findDependencies = async (file, code) => {
|
|
|
8375
8375
|
|
|
8376
8376
|
// src/test/reporter.ts
|
|
8377
8377
|
import { getSuites, getTests } from "@vitest/runner/utils";
|
|
8378
|
+
import { parseStacktrace } from "@vitest/utils/source-map";
|
|
8378
8379
|
var CustomReporter = class {
|
|
8379
8380
|
interval;
|
|
8380
8381
|
tasks;
|
|
@@ -8407,13 +8408,22 @@ var CustomReporter = class {
|
|
|
8407
8408
|
if (!test2.result?.errors || test2.result.errors.length === 0) {
|
|
8408
8409
|
return [];
|
|
8409
8410
|
}
|
|
8410
|
-
|
|
8411
|
-
|
|
8412
|
-
|
|
8413
|
-
|
|
8414
|
-
|
|
8415
|
-
|
|
8416
|
-
|
|
8411
|
+
const item = test2.type === "suite" ? test2 : test2.file;
|
|
8412
|
+
console.log(test2.result.errors);
|
|
8413
|
+
return test2.result.errors.map((error) => {
|
|
8414
|
+
const traces = error.stackStr ? parseStacktrace(error.stackStr) : [];
|
|
8415
|
+
return {
|
|
8416
|
+
location: {
|
|
8417
|
+
line: traces[0]?.line,
|
|
8418
|
+
column: traces[0]?.column
|
|
8419
|
+
},
|
|
8420
|
+
file: item.name,
|
|
8421
|
+
test: test2.type === "test" ? test2.name : void 0,
|
|
8422
|
+
diff: error.showDiff && error.diff ? error.diff : void 0,
|
|
8423
|
+
type: error.name,
|
|
8424
|
+
message: error.message
|
|
8425
|
+
};
|
|
8426
|
+
});
|
|
8417
8427
|
}).flat();
|
|
8418
8428
|
this.events.finished?.({ errors, passed, failed, logs: this.logs });
|
|
8419
8429
|
}
|
|
@@ -8470,6 +8480,10 @@ var startTest = async (props) => {
|
|
|
8470
8480
|
exclude: ["**/_*", "**/_*/**", ...configDefaults.exclude],
|
|
8471
8481
|
globals: true,
|
|
8472
8482
|
reporters: props.reporter,
|
|
8483
|
+
// typecheck: {
|
|
8484
|
+
// checker: 'tsc',
|
|
8485
|
+
// enabled: true,
|
|
8486
|
+
// },
|
|
8473
8487
|
setupFiles: [
|
|
8474
8488
|
//
|
|
8475
8489
|
join18(__dirname4, "test-global-setup.js")
|
|
@@ -8534,6 +8548,17 @@ var logTestLogs = (event) => {
|
|
|
8534
8548
|
log15.message(event.logs.map((log26) => wrap(log26, { hard: true })).join("\n"));
|
|
8535
8549
|
}
|
|
8536
8550
|
};
|
|
8551
|
+
var formatFileName = (error) => {
|
|
8552
|
+
const name = [error.file];
|
|
8553
|
+
const loc = error.location;
|
|
8554
|
+
if (typeof loc.line === "number") {
|
|
8555
|
+
name.push(`:${loc.line}`);
|
|
8556
|
+
if (typeof loc.column === "number") {
|
|
8557
|
+
name.push(`:${loc.column}`);
|
|
8558
|
+
}
|
|
8559
|
+
}
|
|
8560
|
+
return name.join("");
|
|
8561
|
+
};
|
|
8537
8562
|
var logTestErrors = (event) => {
|
|
8538
8563
|
event.errors.forEach((error, i) => {
|
|
8539
8564
|
const [message, ...comment] = error.message.split("//");
|
|
@@ -8548,9 +8573,10 @@ var logTestErrors = (event) => {
|
|
|
8548
8573
|
color.error.inverse.bold(` FAIL `),
|
|
8549
8574
|
color.dim(`(${i + 1}/${event.errors.length})`),
|
|
8550
8575
|
color.dim(icon.arrow.right),
|
|
8551
|
-
error
|
|
8576
|
+
formatFileName(error),
|
|
8552
8577
|
color.dim(icon.arrow.right),
|
|
8553
|
-
|
|
8578
|
+
// `\n${color.label.inverse.bold(` TEST `)}`,
|
|
8579
|
+
color.dim(error.test),
|
|
8554
8580
|
[`
|
|
8555
8581
|
|
|
8556
8582
|
`, errorMessage, ...error.diff ? ["\n\n", error.diff] : []].join("")
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/dist/server.js
CHANGED
|
@@ -100,6 +100,7 @@ var mockCache = () => {
|
|
|
100
100
|
import { mockLambda } from "@awsless/lambda";
|
|
101
101
|
|
|
102
102
|
// src/lib/server/function.ts
|
|
103
|
+
import { stringify as stringify2 } from "@awsless/json";
|
|
103
104
|
import { invoke } from "@awsless/lambda";
|
|
104
105
|
import { WeakCache } from "@awsless/weak-cache";
|
|
105
106
|
var cache = new WeakCache();
|
|
@@ -109,11 +110,23 @@ var Function = /* @__PURE__ */ createProxy((stackName) => {
|
|
|
109
110
|
const name = getFunctionName(funcName, stackName);
|
|
110
111
|
const ctx = {
|
|
111
112
|
[name]: (payload, options = {}) => {
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
113
|
+
if (!options.cache) {
|
|
114
|
+
return invoke({
|
|
115
|
+
...options,
|
|
116
|
+
name,
|
|
117
|
+
payload
|
|
118
|
+
});
|
|
119
|
+
}
|
|
120
|
+
const cacheKey = stringify2([name, payload, options.qualifier]);
|
|
121
|
+
if (!cache.has(cacheKey)) {
|
|
122
|
+
const promise = invoke({
|
|
123
|
+
...options,
|
|
124
|
+
name,
|
|
125
|
+
payload
|
|
126
|
+
});
|
|
127
|
+
cache.set(cacheKey, promise);
|
|
128
|
+
}
|
|
129
|
+
return cache.get(cacheKey);
|
|
117
130
|
}
|
|
118
131
|
};
|
|
119
132
|
const call = ctx[name];
|
|
@@ -293,7 +306,7 @@ var mockTask = (cb) => {
|
|
|
293
306
|
import { mockSNS as mockSNS2 } from "@awsless/sns";
|
|
294
307
|
|
|
295
308
|
// src/lib/server/topic.ts
|
|
296
|
-
import { stringify as
|
|
309
|
+
import { stringify as stringify3 } from "@awsless/json";
|
|
297
310
|
import { publish as publish2 } from "@awsless/sns";
|
|
298
311
|
var getTopicName = bindGlobalResourceName("topic");
|
|
299
312
|
var Topic = /* @__PURE__ */ createProxy((name) => {
|
|
@@ -303,7 +316,7 @@ var Topic = /* @__PURE__ */ createProxy((name) => {
|
|
|
303
316
|
await publish2({
|
|
304
317
|
...options,
|
|
305
318
|
topic,
|
|
306
|
-
payload:
|
|
319
|
+
payload: stringify3(payload)
|
|
307
320
|
});
|
|
308
321
|
}
|
|
309
322
|
};
|
|
@@ -503,7 +516,7 @@ var Metric = /* @__PURE__ */ createProxy((stack) => {
|
|
|
503
516
|
// src/lib/server/pubsub.ts
|
|
504
517
|
import { hours, toSeconds } from "@awsless/duration";
|
|
505
518
|
import { publish as publish3, QoS } from "@awsless/iot";
|
|
506
|
-
import { stringify as
|
|
519
|
+
import { stringify as stringify4 } from "@awsless/json";
|
|
507
520
|
var getPubSubTopic = (name) => {
|
|
508
521
|
return `${APP}/pubsub/${name}`;
|
|
509
522
|
};
|
|
@@ -511,7 +524,7 @@ var PubSub = {
|
|
|
511
524
|
async publish(topic, event, payload, opts = {}) {
|
|
512
525
|
await publish3({
|
|
513
526
|
topic: getPubSubTopic(topic),
|
|
514
|
-
payload: Buffer.from(
|
|
527
|
+
payload: Buffer.from(stringify4([event, payload])),
|
|
515
528
|
...opts
|
|
516
529
|
});
|
|
517
530
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@awsless/awsless",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.554",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -34,22 +34,22 @@
|
|
|
34
34
|
},
|
|
35
35
|
"peerDependencies": {
|
|
36
36
|
"@awsless/big-float": "^0.1.3",
|
|
37
|
-
"@awsless/
|
|
37
|
+
"@awsless/cloudwatch": "^0.0.1",
|
|
38
38
|
"@awsless/duration": "^0.0.3",
|
|
39
|
-
"@awsless/dynamodb": "^0.2.6",
|
|
40
|
-
"@awsless/lambda": "^0.0.33",
|
|
41
|
-
"@awsless/open-search": "^0.0.21",
|
|
42
|
-
"@awsless/json": "^0.0.10",
|
|
43
39
|
"@awsless/clui": "^0.0.7",
|
|
44
|
-
"@awsless/
|
|
45
|
-
"@awsless/
|
|
46
|
-
"@awsless/
|
|
40
|
+
"@awsless/json": "^0.0.10",
|
|
41
|
+
"@awsless/iot": "^0.0.3",
|
|
42
|
+
"@awsless/mqtt": "^0.0.2",
|
|
47
43
|
"@awsless/sns": "^0.0.10",
|
|
48
|
-
"@awsless/
|
|
49
|
-
"@awsless/
|
|
50
|
-
"@awsless/weak-cache": "^0.0.1",
|
|
44
|
+
"@awsless/lambda": "^0.0.33",
|
|
45
|
+
"@awsless/s3": "^0.0.21",
|
|
51
46
|
"@awsless/redis": "^0.0.14",
|
|
52
|
-
"@awsless/
|
|
47
|
+
"@awsless/dynamodb": "^0.2.7",
|
|
48
|
+
"@awsless/ssm": "^0.0.7",
|
|
49
|
+
"@awsless/open-search": "^0.0.21",
|
|
50
|
+
"@awsless/sqs": "^0.0.8",
|
|
51
|
+
"@awsless/validate": "^0.0.19",
|
|
52
|
+
"@awsless/weak-cache": "^0.0.1"
|
|
53
53
|
},
|
|
54
54
|
"dependencies": {
|
|
55
55
|
"@arcanyx/cidr-slicer": "^0.3.0",
|
|
@@ -87,6 +87,7 @@
|
|
|
87
87
|
"@types/uuid": "^9.0.0",
|
|
88
88
|
"@types/wildstring": "^1.0.3",
|
|
89
89
|
"@vitest/runner": "^3.1.4",
|
|
90
|
+
"@vitest/utils": "3.2.4",
|
|
90
91
|
"aws-cron-expression-validator": "^1.0.5",
|
|
91
92
|
"aws-lambda": "^1.0.7",
|
|
92
93
|
"chalk": "^5.3.0",
|
|
@@ -132,17 +133,17 @@
|
|
|
132
133
|
"zip-a-folder": "^3.1.6",
|
|
133
134
|
"zod": "^3.24.2",
|
|
134
135
|
"zod-to-json-schema": "^3.24.3",
|
|
135
|
-
"@awsless/duration": "^0.0.3",
|
|
136
136
|
"@awsless/big-float": "^0.1.3",
|
|
137
|
+
"@awsless/cloudwatch": "^0.0.1",
|
|
138
|
+
"@awsless/duration": "^0.0.3",
|
|
139
|
+
"@awsless/clui": "^0.0.7",
|
|
137
140
|
"@awsless/formation": "^0.0.79",
|
|
138
|
-
"@awsless/scheduler": "^0.0.4",
|
|
139
|
-
"@awsless/graphql": "^0.0.9",
|
|
140
141
|
"@awsless/json": "^0.0.10",
|
|
141
|
-
"@awsless/
|
|
142
|
+
"@awsless/graphql": "^0.0.9",
|
|
143
|
+
"@awsless/scheduler": "^0.0.4",
|
|
142
144
|
"@awsless/ts-file-cache": "^0.0.12",
|
|
143
|
-
"@awsless/
|
|
144
|
-
"@awsless/validate": "^0.0.19"
|
|
145
|
-
"@awsless/clui": "^0.0.7"
|
|
145
|
+
"@awsless/size": "^0.0.2",
|
|
146
|
+
"@awsless/validate": "^0.0.19"
|
|
146
147
|
},
|
|
147
148
|
"devDependencies": {
|
|
148
149
|
"@node-rs/bcrypt": "^1.10.5",
|