@awsless/awsless 0.0.168 → 0.0.170
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 +43 -25
- package/package.json +5 -5
package/dist/bin.js
CHANGED
|
@@ -265,7 +265,9 @@ var RetryAttemptsSchema = z7.number().int().min(0).max(2).describe(
|
|
|
265
265
|
var RuntimeSchema = z7.enum(["nodejs18.x", "nodejs20.x"]).describe("The identifier of the function's runtime.");
|
|
266
266
|
var ActionSchema = z7.string();
|
|
267
267
|
var ActionsSchema = z7.union([ActionSchema.transform((v) => [v]), ActionSchema.array()]);
|
|
268
|
-
var
|
|
268
|
+
var ArnSchema = z7.string().startsWith("arn:");
|
|
269
|
+
var WildcardSchema = z7.literal("*");
|
|
270
|
+
var ResourceSchema = z7.union([ArnSchema, WildcardSchema]).transform((v) => v);
|
|
269
271
|
var ResourcesSchema = z7.union([ResourceSchema.transform((v) => [v]), ResourceSchema.array()]);
|
|
270
272
|
var PermissionSchema = z7.object({
|
|
271
273
|
effect: z7.enum(["allow", "deny"]).default("allow"),
|
|
@@ -894,7 +896,7 @@ var SearchsSchema = z24.record(
|
|
|
894
896
|
storage: StorageSizeSchema.default("10 GB"),
|
|
895
897
|
vpc: z24.boolean().default(false)
|
|
896
898
|
})
|
|
897
|
-
).optional().describe("Define the
|
|
899
|
+
).optional().describe("Define the search instances in your stack. Backed by OpenSearch.");
|
|
898
900
|
|
|
899
901
|
// src/feature/site/schema.ts
|
|
900
902
|
import { z as z25 } from "zod";
|
|
@@ -1232,7 +1234,7 @@ var logApp = (app) => {
|
|
|
1232
1234
|
};
|
|
1233
1235
|
|
|
1234
1236
|
// src/cli/ui/error/error.ts
|
|
1235
|
-
import { log as
|
|
1237
|
+
import { log as log4 } from "@clack/prompts";
|
|
1236
1238
|
|
|
1237
1239
|
// src/cli/ui/error/config-error.ts
|
|
1238
1240
|
import * as p from "@clack/prompts";
|
|
@@ -1358,7 +1360,7 @@ var logStackError = (error) => {
|
|
|
1358
1360
|
].join(""),
|
|
1359
1361
|
{ symbol: color.error(icon.error) }
|
|
1360
1362
|
);
|
|
1361
|
-
} else if (
|
|
1363
|
+
} else if (issue instanceof Error) {
|
|
1362
1364
|
log2.message(wrap(color.error(issue.message), { hard: true }), {
|
|
1363
1365
|
symbol: color.error(icon.error)
|
|
1364
1366
|
});
|
|
@@ -1366,31 +1368,44 @@ var logStackError = (error) => {
|
|
|
1366
1368
|
}
|
|
1367
1369
|
};
|
|
1368
1370
|
|
|
1371
|
+
// src/cli/ui/error/file-error.ts
|
|
1372
|
+
import { log as log3 } from "@clack/prompts";
|
|
1373
|
+
var logFileError = (error) => {
|
|
1374
|
+
log3.message(
|
|
1375
|
+
wrap([color.error(error.message), color.dim(error.file)].join("\n"), {
|
|
1376
|
+
hard: true
|
|
1377
|
+
}),
|
|
1378
|
+
{ symbol: color.error(icon.error) }
|
|
1379
|
+
);
|
|
1380
|
+
};
|
|
1381
|
+
|
|
1369
1382
|
// src/cli/ui/error/error.ts
|
|
1370
1383
|
var logError = (error) => {
|
|
1371
1384
|
if (error instanceof ConfigError) {
|
|
1372
1385
|
logConfigError(error);
|
|
1373
1386
|
} else if (error instanceof Cancelled) {
|
|
1374
|
-
|
|
1387
|
+
log4.message(color.error("Cancelled."), {
|
|
1375
1388
|
symbol: color.error(icon.error)
|
|
1376
1389
|
});
|
|
1377
1390
|
} else if (error instanceof StackError2) {
|
|
1378
1391
|
logStackError(error);
|
|
1392
|
+
} else if (error instanceof FileError) {
|
|
1393
|
+
logFileError(error);
|
|
1379
1394
|
} else if (error instanceof Error) {
|
|
1380
1395
|
const message = `${error.name}: ${error.message}`;
|
|
1381
1396
|
const stack = error.stack ? color.dim(error.stack.replace(message, "")) : "";
|
|
1382
|
-
|
|
1397
|
+
log4.message(
|
|
1383
1398
|
wrap([color.error(message), stack], {
|
|
1384
1399
|
hard: true
|
|
1385
1400
|
}),
|
|
1386
1401
|
{ symbol: color.error(icon.error) }
|
|
1387
1402
|
);
|
|
1388
1403
|
} else if (typeof error === "string") {
|
|
1389
|
-
|
|
1404
|
+
log4.message(wrap(color.error(error)), {
|
|
1390
1405
|
symbol: color.error(icon.error)
|
|
1391
1406
|
});
|
|
1392
1407
|
} else {
|
|
1393
|
-
|
|
1408
|
+
log4.message(wrap(color.error("Unknown error!")), {
|
|
1394
1409
|
symbol: color.error(icon.error)
|
|
1395
1410
|
});
|
|
1396
1411
|
}
|
|
@@ -1427,7 +1442,7 @@ import {
|
|
|
1427
1442
|
ResourceNotFoundException,
|
|
1428
1443
|
ScalarAttributeType
|
|
1429
1444
|
} from "@aws-sdk/client-dynamodb";
|
|
1430
|
-
import { confirm, log as
|
|
1445
|
+
import { confirm, log as log5 } from "@clack/prompts";
|
|
1431
1446
|
var hasStateTable = async (client) => {
|
|
1432
1447
|
try {
|
|
1433
1448
|
const result = await client.send(
|
|
@@ -1467,7 +1482,7 @@ var bootstrapAwsless = async (opts) => {
|
|
|
1467
1482
|
const client = new DynamoDB(opts);
|
|
1468
1483
|
const table2 = await hasStateTable(client);
|
|
1469
1484
|
if (!table2) {
|
|
1470
|
-
|
|
1485
|
+
log5.warn(`Your Awsless hasn't been bootstrapped yet.`);
|
|
1471
1486
|
if (!process.env.SKIP_PROMPT) {
|
|
1472
1487
|
const confirmed = await confirm({
|
|
1473
1488
|
message: "Would you like to bootstrap now?"
|
|
@@ -1481,7 +1496,7 @@ var bootstrapAwsless = async (opts) => {
|
|
|
1481
1496
|
update("Done deploying the bootstrap stack");
|
|
1482
1497
|
});
|
|
1483
1498
|
} else {
|
|
1484
|
-
|
|
1499
|
+
log5.step("Awsless has already been bootstrapped.");
|
|
1485
1500
|
}
|
|
1486
1501
|
};
|
|
1487
1502
|
|
|
@@ -2632,7 +2647,10 @@ var graphqlFeature = defineFeature({
|
|
|
2632
2647
|
for (const [id, props] of Object.entries(ctx.stackConfig.graphql ?? {})) {
|
|
2633
2648
|
const defaultProps = ctx.appConfig.defaults.graphql?.[id];
|
|
2634
2649
|
if (!defaultProps) {
|
|
2635
|
-
throw new
|
|
2650
|
+
throw new FileError(
|
|
2651
|
+
ctx.stackConfig.file,
|
|
2652
|
+
`GraphQL definition is not defined on app level for "${id}"`
|
|
2653
|
+
);
|
|
2636
2654
|
}
|
|
2637
2655
|
const group = new Node6("graphql", id);
|
|
2638
2656
|
ctx.stack.add(group);
|
|
@@ -3959,7 +3977,7 @@ var del = (program2) => {
|
|
|
3959
3977
|
};
|
|
3960
3978
|
|
|
3961
3979
|
// src/cli/command/config/list.ts
|
|
3962
|
-
import { log as
|
|
3980
|
+
import { log as log6, spinner as spinner5 } from "@clack/prompts";
|
|
3963
3981
|
import chalk5 from "chalk";
|
|
3964
3982
|
var list2 = (program2) => {
|
|
3965
3983
|
program2.command("list").description(`List all config value's`).action(async () => {
|
|
@@ -3981,7 +3999,7 @@ var list2 = (program2) => {
|
|
|
3981
3999
|
})
|
|
3982
4000
|
);
|
|
3983
4001
|
} else {
|
|
3984
|
-
|
|
4002
|
+
log6.warning("No config parameters found.");
|
|
3985
4003
|
}
|
|
3986
4004
|
});
|
|
3987
4005
|
});
|
|
@@ -4180,14 +4198,14 @@ var CustomReporter = class {
|
|
|
4180
4198
|
this.cache = cache;
|
|
4181
4199
|
}
|
|
4182
4200
|
}
|
|
4183
|
-
onUserConsoleLog(
|
|
4184
|
-
if (
|
|
4185
|
-
const test2 = this.ctx?.state.idMap.get(
|
|
4201
|
+
onUserConsoleLog(log9) {
|
|
4202
|
+
if (log9.taskId) {
|
|
4203
|
+
const test2 = this.ctx?.state.idMap.get(log9.taskId);
|
|
4186
4204
|
if (test2) {
|
|
4187
4205
|
test2.name;
|
|
4188
4206
|
}
|
|
4189
4207
|
}
|
|
4190
|
-
this.logs.push(
|
|
4208
|
+
this.logs.push(log9.content.trimEnd());
|
|
4191
4209
|
}
|
|
4192
4210
|
runningTask(tasks) {
|
|
4193
4211
|
return tasks.find((t) => t.result?.state === "run");
|
|
@@ -4251,7 +4269,7 @@ var startTest = async (props) => {
|
|
|
4251
4269
|
};
|
|
4252
4270
|
|
|
4253
4271
|
// src/cli/ui/complex/run-tests.ts
|
|
4254
|
-
import { log as
|
|
4272
|
+
import { log as log7 } from "@clack/prompts";
|
|
4255
4273
|
import chalk6 from "chalk";
|
|
4256
4274
|
var formatResult = (props) => {
|
|
4257
4275
|
const line = [`Test ${chalk6.magenta(props.stack)}`];
|
|
@@ -4268,10 +4286,10 @@ var formatResult = (props) => {
|
|
|
4268
4286
|
};
|
|
4269
4287
|
var logTestLogs = (event) => {
|
|
4270
4288
|
if (event.logs.length > 0) {
|
|
4271
|
-
|
|
4289
|
+
log7.message(color.info.bold.inverse(" LOGS "), {
|
|
4272
4290
|
symbol: color.dim(icon.dot)
|
|
4273
4291
|
});
|
|
4274
|
-
|
|
4292
|
+
log7.message(event.logs.map((log9) => wrap(log9, { hard: true })).join("\n"));
|
|
4275
4293
|
}
|
|
4276
4294
|
};
|
|
4277
4295
|
var logTestErrors = (event) => {
|
|
@@ -4282,7 +4300,7 @@ var logTestErrors = (event) => {
|
|
|
4282
4300
|
message,
|
|
4283
4301
|
comment.length > 0 ? color.dim(`//${comment}`) : ""
|
|
4284
4302
|
].join(" ");
|
|
4285
|
-
|
|
4303
|
+
log7.message(
|
|
4286
4304
|
[
|
|
4287
4305
|
//
|
|
4288
4306
|
color.error.inverse.bold(` FAIL `),
|
|
@@ -4315,7 +4333,7 @@ var runTest = async (stack, dir, filters) => {
|
|
|
4315
4333
|
const raw = await readFile6(file, { encoding: "utf8" });
|
|
4316
4334
|
const data = JSON.parse(raw);
|
|
4317
4335
|
if (data.fingerprint === fingerprint) {
|
|
4318
|
-
|
|
4336
|
+
log7.step(
|
|
4319
4337
|
formatResult({
|
|
4320
4338
|
stack,
|
|
4321
4339
|
cached: true,
|
|
@@ -4511,7 +4529,7 @@ var diff = (program2) => {
|
|
|
4511
4529
|
};
|
|
4512
4530
|
|
|
4513
4531
|
// src/cli/ui/complex/build-types.ts
|
|
4514
|
-
import { log as
|
|
4532
|
+
import { log as log8 } from "@clack/prompts";
|
|
4515
4533
|
|
|
4516
4534
|
// src/type-gen/generate.ts
|
|
4517
4535
|
import { mkdir as mkdir3, writeFile as writeFile3 } from "fs/promises";
|
|
@@ -4545,7 +4563,7 @@ var generateTypes = async (props) => {
|
|
|
4545
4563
|
// src/cli/ui/complex/build-types.ts
|
|
4546
4564
|
var buildTypes = async (props) => {
|
|
4547
4565
|
await generateTypes(props);
|
|
4548
|
-
|
|
4566
|
+
log8.step("Done generating type definition files.");
|
|
4549
4567
|
};
|
|
4550
4568
|
|
|
4551
4569
|
// src/cli/command/types.ts
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@awsless/awsless",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.170",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -31,8 +31,8 @@
|
|
|
31
31
|
"@awsless/lambda": "^0.0.18",
|
|
32
32
|
"@awsless/redis": "^0.0.12",
|
|
33
33
|
"@awsless/sns": "^0.0.7",
|
|
34
|
-
"@awsless/sqs": "^0.0.7",
|
|
35
34
|
"@awsless/s3": "^0.0.10",
|
|
35
|
+
"@awsless/sqs": "^0.0.7",
|
|
36
36
|
"@awsless/ssm": "^0.0.7",
|
|
37
37
|
"@awsless/validate": "^0.0.13",
|
|
38
38
|
"@awsless/weak-cache": "^0.0.1"
|
|
@@ -97,11 +97,11 @@
|
|
|
97
97
|
"zod": "^3.21.4",
|
|
98
98
|
"zod-to-json-schema": "^3.22.3",
|
|
99
99
|
"@awsless/duration": "^0.0.1",
|
|
100
|
-
"@awsless/
|
|
100
|
+
"@awsless/formation": "^0.0.3",
|
|
101
101
|
"@awsless/size": "^0.0.1",
|
|
102
|
+
"@awsless/graphql": "^0.0.9",
|
|
102
103
|
"@awsless/validate": "^0.0.13",
|
|
103
|
-
"@awsless/code": "^0.0.10"
|
|
104
|
-
"@awsless/formation": "^0.0.3"
|
|
104
|
+
"@awsless/code": "^0.0.10"
|
|
105
105
|
},
|
|
106
106
|
"scripts": {
|
|
107
107
|
"test": "pnpm code test",
|