@awsless/awsless 0.0.536 → 0.0.537
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 +27 -16
- package/dist/build-json-schema.js +2 -1
- 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/stack.json +1 -1
- package/package.json +11 -11
package/dist/bin.js
CHANGED
|
@@ -1508,7 +1508,8 @@ var SitesSchema = z32.record(
|
|
|
1508
1508
|
),
|
|
1509
1509
|
cacheKey: z32.union([LocalEntrySchema.transform((v) => [v]), LocalEntrySchema.array()]).describe(
|
|
1510
1510
|
`Specifies the files and directories to generate the cache key for your custom build command.`
|
|
1511
|
-
)
|
|
1511
|
+
),
|
|
1512
|
+
configs: z32.string().array().describe("Define the config values for your build command.")
|
|
1512
1513
|
}).optional().describe(`Specifies the build process for sites that need a build step.`),
|
|
1513
1514
|
static: z32.union([LocalDirectorySchema, z32.boolean()]).optional().describe(
|
|
1514
1515
|
"Specifies the path to the static files directory. Additionally you can also pass `true` when you don't have local static files, but still want to make an S3 bucket."
|
|
@@ -2622,6 +2623,11 @@ var configFeature = defineFeature({
|
|
|
2622
2623
|
for (const name of stack.configs ?? []) {
|
|
2623
2624
|
resources2.addConst(name, "string");
|
|
2624
2625
|
}
|
|
2626
|
+
for (const site of Object.values(stack.sites ?? {})) {
|
|
2627
|
+
for (const name of site.build?.configs ?? []) {
|
|
2628
|
+
resources2.addConst(name, "string");
|
|
2629
|
+
}
|
|
2630
|
+
}
|
|
2625
2631
|
}
|
|
2626
2632
|
gen.addInterface("ConfigResources", resources2.toString());
|
|
2627
2633
|
await ctx.write("config.d.ts", gen, true);
|
|
@@ -4884,12 +4890,12 @@ if (event.request.headers.host) {
|
|
|
4884
4890
|
setLambdaOrigin('${url}');`;
|
|
4885
4891
|
|
|
4886
4892
|
// src/feature/site/index.ts
|
|
4887
|
-
import { camelCase as camelCase6 } from "change-case";
|
|
4893
|
+
import { camelCase as camelCase6, constantCase as constantCase10 } from "change-case";
|
|
4888
4894
|
|
|
4889
4895
|
// src/util/exec.ts
|
|
4890
4896
|
import { exec } from "promisify-child-process";
|
|
4891
|
-
var execCommand = async ({ cwd, command }) => {
|
|
4892
|
-
await exec(command, { cwd });
|
|
4897
|
+
var execCommand = async ({ cwd, env, command }) => {
|
|
4898
|
+
await exec(command, { cwd, env });
|
|
4893
4899
|
};
|
|
4894
4900
|
|
|
4895
4901
|
// src/feature/site/index.ts
|
|
@@ -4912,9 +4918,14 @@ var siteFeature = defineFeature({
|
|
|
4912
4918
|
const fingerprint = await generateCacheKey(buildProps.cacheKey);
|
|
4913
4919
|
return build3(fingerprint, async (write) => {
|
|
4914
4920
|
const cwd = join11(directories.root, dirname7(ctx.stackConfig.file));
|
|
4921
|
+
const env = {};
|
|
4922
|
+
for (const name2 of props.build?.configs ?? []) {
|
|
4923
|
+
env[`CONFIG_${constantCase10(name2)}`] = name2;
|
|
4924
|
+
}
|
|
4915
4925
|
await execCommand({
|
|
4916
4926
|
cwd,
|
|
4917
|
-
command: buildProps.command
|
|
4927
|
+
command: buildProps.command,
|
|
4928
|
+
env
|
|
4918
4929
|
});
|
|
4919
4930
|
await write("HASH", fingerprint);
|
|
4920
4931
|
return {
|
|
@@ -5387,7 +5398,7 @@ var storeFeature = defineFeature({
|
|
|
5387
5398
|
|
|
5388
5399
|
// src/feature/table/index.ts
|
|
5389
5400
|
import { $ as $17, Group as Group17 } from "@awsless/formation";
|
|
5390
|
-
import { constantCase as
|
|
5401
|
+
import { constantCase as constantCase11 } from "change-case";
|
|
5391
5402
|
import { toSeconds as toSeconds7 } from "@awsless/duration";
|
|
5392
5403
|
var tableFeature = defineFeature({
|
|
5393
5404
|
name: "table",
|
|
@@ -5469,8 +5480,8 @@ var tableFeature = defineFeature({
|
|
|
5469
5480
|
name,
|
|
5470
5481
|
billingMode: "PAY_PER_REQUEST",
|
|
5471
5482
|
streamEnabled: !!props.stream,
|
|
5472
|
-
streamViewType: props.stream &&
|
|
5473
|
-
tableClass:
|
|
5483
|
+
streamViewType: props.stream && constantCase11(props.stream?.type),
|
|
5484
|
+
tableClass: constantCase11(props.class),
|
|
5474
5485
|
hashKey: props.hash,
|
|
5475
5486
|
rangeKey: props.sort,
|
|
5476
5487
|
attribute: attributeDefinitions(),
|
|
@@ -5485,7 +5496,7 @@ var tableFeature = defineFeature({
|
|
|
5485
5496
|
name: name2,
|
|
5486
5497
|
hashKey: index.hash,
|
|
5487
5498
|
rangeKey: index.sort,
|
|
5488
|
-
projectionType:
|
|
5499
|
+
projectionType: constantCase11(index.projection)
|
|
5489
5500
|
})),
|
|
5490
5501
|
deletionProtectionEnabled: ctx.appConfig.removal === "retain"
|
|
5491
5502
|
},
|
|
@@ -6020,7 +6031,7 @@ import { $ as $22, Group as Group23 } from "@awsless/formation";
|
|
|
6020
6031
|
import { join as join12, dirname as dirname8 } from "path";
|
|
6021
6032
|
import { mebibytes as mebibytes4 } from "@awsless/size";
|
|
6022
6033
|
import { days as days6, seconds as seconds9, toDays as toDays5, toSeconds as toSeconds8 } from "@awsless/duration";
|
|
6023
|
-
import { constantCase as
|
|
6034
|
+
import { constantCase as constantCase12 } from "change-case";
|
|
6024
6035
|
import { fileURLToPath as fileURLToPath2 } from "url";
|
|
6025
6036
|
import { glob as glob3 } from "glob";
|
|
6026
6037
|
var __dirname2 = dirname8(fileURLToPath2(import.meta.url));
|
|
@@ -6313,7 +6324,7 @@ var imageFeature = defineFeature({
|
|
|
6313
6324
|
});
|
|
6314
6325
|
}
|
|
6315
6326
|
ctx.bind(
|
|
6316
|
-
`IMAGE_${
|
|
6327
|
+
`IMAGE_${constantCase12(ctx.stack.name)}_${constantCase12(id)}_ENDPOINT`,
|
|
6317
6328
|
domainName ?? distribution.domainName
|
|
6318
6329
|
);
|
|
6319
6330
|
ctx.shared.add("image", "distribution-id", id, distribution.id);
|
|
@@ -6327,7 +6338,7 @@ import { $ as $23, Group as Group24 } from "@awsless/formation";
|
|
|
6327
6338
|
import { join as join13, dirname as dirname9 } from "path";
|
|
6328
6339
|
import { mebibytes as mebibytes5 } from "@awsless/size";
|
|
6329
6340
|
import { days as days7, seconds as seconds10, toDays as toDays6, toSeconds as toSeconds9 } from "@awsless/duration";
|
|
6330
|
-
import { constantCase as
|
|
6341
|
+
import { constantCase as constantCase13 } from "change-case";
|
|
6331
6342
|
import { fileURLToPath as fileURLToPath3 } from "url";
|
|
6332
6343
|
import { glob as glob4 } from "glob";
|
|
6333
6344
|
var __dirname3 = dirname9(fileURLToPath3(import.meta.url));
|
|
@@ -6592,7 +6603,7 @@ var iconFeature = defineFeature({
|
|
|
6592
6603
|
});
|
|
6593
6604
|
}
|
|
6594
6605
|
ctx.bind(
|
|
6595
|
-
`ICON_${
|
|
6606
|
+
`ICON_${constantCase13(ctx.stack.name)}_${constantCase13(id)}_ENDPOINT`,
|
|
6596
6607
|
domainName ?? distribution.domainName
|
|
6597
6608
|
);
|
|
6598
6609
|
ctx.shared.add("icon", "distribution-id", id, distribution.id);
|
|
@@ -7996,7 +8007,7 @@ var auth = (program2) => {
|
|
|
7996
8007
|
|
|
7997
8008
|
// src/cli/command/bind.ts
|
|
7998
8009
|
import { log as log17 } from "@awsless/clui";
|
|
7999
|
-
import { constantCase as
|
|
8010
|
+
import { constantCase as constantCase14 } from "change-case";
|
|
8000
8011
|
import { spawn } from "child_process";
|
|
8001
8012
|
var bind = (program2) => {
|
|
8002
8013
|
program2.command("bind").argument("[command...]", "The command to execute").option("--config <string...>", "List of config values that will be accessable", (v) => v.split(",")).description(`Bind your site environment variables to a command`).action(async (commands9 = [], opts) => {
|
|
@@ -8025,10 +8036,10 @@ var bind = (program2) => {
|
|
|
8025
8036
|
const configList = opts.config ?? [];
|
|
8026
8037
|
const configs = {};
|
|
8027
8038
|
for (const name of configList) {
|
|
8028
|
-
configs[`CONFIG_${
|
|
8039
|
+
configs[`CONFIG_${constantCase14(name)}`] = name;
|
|
8029
8040
|
}
|
|
8030
8041
|
if (configList.length ?? 0 > 0) {
|
|
8031
|
-
log17.note("Bind Config", configList.map((v) => color.label(
|
|
8042
|
+
log17.note("Bind Config", configList.map((v) => color.label(constantCase14(v))).join("\n"));
|
|
8032
8043
|
}
|
|
8033
8044
|
if (commands9.length === 0) {
|
|
8034
8045
|
return "No command to execute.";
|
|
@@ -903,7 +903,8 @@ var SitesSchema = z29.record(
|
|
|
903
903
|
),
|
|
904
904
|
cacheKey: z29.union([LocalEntrySchema.transform((v) => [v]), LocalEntrySchema.array()]).describe(
|
|
905
905
|
`Specifies the files and directories to generate the cache key for your custom build command.`
|
|
906
|
-
)
|
|
906
|
+
),
|
|
907
|
+
configs: z29.string().array().describe("Define the config values for your build command.")
|
|
907
908
|
}).optional().describe(`Specifies the build process for sites that need a build step.`),
|
|
908
909
|
static: z29.union([LocalDirectorySchema, z29.boolean()]).optional().describe(
|
|
909
910
|
"Specifies the path to the static files directory. Additionally you can also pass `true` when you don't have local static files, but still want to make an S3 bucket."
|
|
Binary file
|
|
Binary file
|
|
Binary file
|