@awsless/awsless 0.0.124 → 0.0.125
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 +50 -19
- 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 +1 -1
- package/package.json +4 -3
package/dist/bin.js
CHANGED
|
@@ -6291,7 +6291,7 @@ var StackSchema = z28.object({
|
|
|
6291
6291
|
tests: TestsSchema
|
|
6292
6292
|
});
|
|
6293
6293
|
|
|
6294
|
-
// src/
|
|
6294
|
+
// src/cli/error.ts
|
|
6295
6295
|
var ConfigError = class extends Error {
|
|
6296
6296
|
constructor(file, error, data) {
|
|
6297
6297
|
super(error.message);
|
|
@@ -6300,6 +6300,32 @@ var ConfigError = class extends Error {
|
|
|
6300
6300
|
this.data = data;
|
|
6301
6301
|
}
|
|
6302
6302
|
};
|
|
6303
|
+
var FileError = class extends Error {
|
|
6304
|
+
constructor(file, message) {
|
|
6305
|
+
super(message);
|
|
6306
|
+
this.file = file;
|
|
6307
|
+
}
|
|
6308
|
+
};
|
|
6309
|
+
var Cancelled = class extends Error {
|
|
6310
|
+
constructor() {
|
|
6311
|
+
super("Cancelled");
|
|
6312
|
+
}
|
|
6313
|
+
};
|
|
6314
|
+
|
|
6315
|
+
// src/config/load.ts
|
|
6316
|
+
import JSON5 from "json5";
|
|
6317
|
+
var readConfig = async (file) => {
|
|
6318
|
+
try {
|
|
6319
|
+
const json4 = await readFile5(file, "utf8");
|
|
6320
|
+
const data = JSON5.parse(json4);
|
|
6321
|
+
return data;
|
|
6322
|
+
} catch (error) {
|
|
6323
|
+
if (error instanceof Error) {
|
|
6324
|
+
throw new FileError(file, error.message);
|
|
6325
|
+
}
|
|
6326
|
+
throw error;
|
|
6327
|
+
}
|
|
6328
|
+
};
|
|
6303
6329
|
var loadConfig = async (options) => {
|
|
6304
6330
|
debug("Find the root directory");
|
|
6305
6331
|
const configFile = options.configFile || "app.json";
|
|
@@ -6309,8 +6335,7 @@ var loadConfig = async (options) => {
|
|
|
6309
6335
|
debug("CWD:", style.info(root2));
|
|
6310
6336
|
debug("Load app config file");
|
|
6311
6337
|
const appFileName = join7(root2, configFile);
|
|
6312
|
-
const
|
|
6313
|
-
const appConfig = JSON.parse(appJson);
|
|
6338
|
+
const appConfig = await readConfig(appFileName);
|
|
6314
6339
|
debug("Validate app config file");
|
|
6315
6340
|
let app;
|
|
6316
6341
|
try {
|
|
@@ -6327,15 +6352,14 @@ var loadConfig = async (options) => {
|
|
|
6327
6352
|
const account = await getAccountId(credentials, app.region);
|
|
6328
6353
|
debug("Account ID:", style.info(account));
|
|
6329
6354
|
debug("Load stacks config files");
|
|
6330
|
-
const stackFiles = await glob(["**/stack.json", "**/*.stack.json"], {
|
|
6355
|
+
const stackFiles = await glob(["**/stack.{json,jsonc,json5}", "**/*.stack.{json,jsonc,json5}"], {
|
|
6331
6356
|
ignore: ["**/node_modules/**", "**/dist/**"],
|
|
6332
6357
|
cwd: root2
|
|
6333
6358
|
});
|
|
6334
6359
|
const stacks = [];
|
|
6335
6360
|
for (const file of stackFiles) {
|
|
6336
6361
|
debug(`Load stack: ${style.info(file)}`);
|
|
6337
|
-
const
|
|
6338
|
-
const stackConfig = JSON.parse(stackJson);
|
|
6362
|
+
const stackConfig = await readConfig(file);
|
|
6339
6363
|
setLocalBasePath(join7(process.cwd(), dirname5(file)));
|
|
6340
6364
|
try {
|
|
6341
6365
|
const stack = await StackSchema.parseAsync(stackConfig);
|
|
@@ -6810,7 +6834,7 @@ var logs = () => {
|
|
|
6810
6834
|
};
|
|
6811
6835
|
};
|
|
6812
6836
|
|
|
6813
|
-
// src/cli/ui/
|
|
6837
|
+
// src/cli/ui/error/config.ts
|
|
6814
6838
|
var line = (value, level = 0, highlight = false) => {
|
|
6815
6839
|
return [
|
|
6816
6840
|
highlight ? style.error(symbol.pointerSmall) + style.placeholder(" | ") : style.placeholder.dim(" | "),
|
|
@@ -6844,7 +6868,7 @@ var format = (value) => {
|
|
|
6844
6868
|
}
|
|
6845
6869
|
return "";
|
|
6846
6870
|
};
|
|
6847
|
-
var
|
|
6871
|
+
var configError = (error) => {
|
|
6848
6872
|
return (term) => {
|
|
6849
6873
|
for (const issue of error.error.issues) {
|
|
6850
6874
|
term.out.gap();
|
|
@@ -6890,6 +6914,16 @@ var zodError = (error) => {
|
|
|
6890
6914
|
};
|
|
6891
6915
|
};
|
|
6892
6916
|
|
|
6917
|
+
// src/cli/ui/error/file.ts
|
|
6918
|
+
var fileError = (error) => {
|
|
6919
|
+
return (term) => {
|
|
6920
|
+
term.out.gap();
|
|
6921
|
+
term.out.write(dialog("error", [style.error(error.message)]));
|
|
6922
|
+
term.out.write(" " + style.placeholder(error.file));
|
|
6923
|
+
term.out.gap();
|
|
6924
|
+
};
|
|
6925
|
+
};
|
|
6926
|
+
|
|
6893
6927
|
// src/cli/ui/layout/layout.ts
|
|
6894
6928
|
var layout = async (cb) => {
|
|
6895
6929
|
const term = createTerminal();
|
|
@@ -6905,8 +6939,10 @@ var layout = async (cb) => {
|
|
|
6905
6939
|
await cb(config2, term.out.write.bind(term.out), term);
|
|
6906
6940
|
} catch (error) {
|
|
6907
6941
|
term.out.gap();
|
|
6908
|
-
if (error instanceof
|
|
6909
|
-
term.out.write(
|
|
6942
|
+
if (error instanceof FileError) {
|
|
6943
|
+
term.out.write(fileError(error));
|
|
6944
|
+
} else if (error instanceof ConfigError) {
|
|
6945
|
+
term.out.write(configError(error));
|
|
6910
6946
|
} else if (error instanceof Error) {
|
|
6911
6947
|
term.out.write(dialog("error", [error.message]));
|
|
6912
6948
|
} else if (typeof error === "string") {
|
|
@@ -7448,13 +7484,6 @@ var StackClient = class {
|
|
|
7448
7484
|
}
|
|
7449
7485
|
};
|
|
7450
7486
|
|
|
7451
|
-
// src/cli/error.ts
|
|
7452
|
-
var Cancelled = class extends Error {
|
|
7453
|
-
constructor() {
|
|
7454
|
-
super("Cancelled");
|
|
7455
|
-
}
|
|
7456
|
-
};
|
|
7457
|
-
|
|
7458
7487
|
// src/cli/ui/prompt/toggle.ts
|
|
7459
7488
|
var togglePrompt = (label, options = {}) => {
|
|
7460
7489
|
return (term) => new Promise((resolve) => {
|
|
@@ -8322,8 +8351,10 @@ var dev = (program2) => {
|
|
|
8322
8351
|
await write(typesGenerator(config2));
|
|
8323
8352
|
},
|
|
8324
8353
|
(error) => {
|
|
8325
|
-
if (error instanceof
|
|
8326
|
-
write(
|
|
8354
|
+
if (error instanceof FileError) {
|
|
8355
|
+
write(fileError(error));
|
|
8356
|
+
} else if (error instanceof ConfigError) {
|
|
8357
|
+
write(configError(error));
|
|
8327
8358
|
} else if (error instanceof Error) {
|
|
8328
8359
|
write(dialog("error", [error.message]));
|
|
8329
8360
|
} else if (typeof error === "string") {
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/dist/index.js
CHANGED
|
@@ -125,7 +125,7 @@ import {
|
|
|
125
125
|
import { constantCase as constantCase2 } from "change-case";
|
|
126
126
|
var getQueueName = getLocalResourceName;
|
|
127
127
|
var getQueueUrl = (name, stack = STACK) => {
|
|
128
|
-
return process.env[`QUEUE_${constantCase2(stack)}_${constantCase2(name)}_URL`];
|
|
128
|
+
return process.env[`QUEUE_${constantCase2(stack)}_${constantCase2(name)}_URL`] || name;
|
|
129
129
|
};
|
|
130
130
|
var Queue = /* @__PURE__ */ createProxy((stack) => {
|
|
131
131
|
return createProxy((queue2) => {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@awsless/awsless",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.125",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -29,9 +29,9 @@
|
|
|
29
29
|
},
|
|
30
30
|
"peerDependencies": {
|
|
31
31
|
"@awsless/lambda": "^0.0.15",
|
|
32
|
-
"@awsless/redis": "^0.0.8",
|
|
33
|
-
"@awsless/sqs": "^0.0.7",
|
|
34
32
|
"@awsless/sns": "^0.0.7",
|
|
33
|
+
"@awsless/redis": "^0.0.10",
|
|
34
|
+
"@awsless/sqs": "^0.0.7",
|
|
35
35
|
"@awsless/ssm": "^0.0.7",
|
|
36
36
|
"@awsless/validate": "^0.0.10",
|
|
37
37
|
"@awsless/weak-cache": "^0.0.1"
|
|
@@ -70,6 +70,7 @@
|
|
|
70
70
|
"filesize": "^10.0.7",
|
|
71
71
|
"glob": "^10.3.9",
|
|
72
72
|
"graphql": "^16.7.1",
|
|
73
|
+
"json5": "^2.2.3",
|
|
73
74
|
"jszip": "^3.10.1",
|
|
74
75
|
"mime-types": "^2.1.35",
|
|
75
76
|
"parse-imports": "^1.1.2",
|