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