@awsless/awsless 0.0.590 → 0.0.592

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 CHANGED
@@ -3072,7 +3072,7 @@ import { aws as aws5 } from "@terraforge/aws";
3072
3072
  // src/feature/function/util.ts
3073
3073
  import { generateFileHash } from "@awsless/ts-file-cache";
3074
3074
  import { aws as aws4 } from "@terraforge/aws";
3075
- import { Future, Group as Group3, resolveInputs } from "@terraforge/core";
3075
+ import { findInputDeps, Group as Group3, Output as Output4, resolveInputs } from "@terraforge/core";
3076
3076
  import deepmerge from "deepmerge";
3077
3077
  import { basename as basename3 } from "path";
3078
3078
 
@@ -3114,13 +3114,11 @@ var build = (type, name, builder, props) => {
3114
3114
  const cacheFile = getBuildPath(type, name, "cache.json");
3115
3115
  const cache = await readCache(cacheFile);
3116
3116
  if (cache && cache.version === version && !process.env.NO_CACHE) {
3117
- console.log("RETURN CACHE");
3118
3117
  return {
3119
3118
  ...cache.data,
3120
3119
  cached: true
3121
3120
  };
3122
3121
  }
3123
- console.log("UN CACHE");
3124
3122
  const time = createTimer();
3125
3123
  const meta = await callback(async (file, data2) => {
3126
3124
  const path = getBuildPath(type, name, file);
@@ -3478,8 +3476,12 @@ var createLambdaFunction = (parentGroup, ctx, ns, id, local) => {
3478
3476
  })
3479
3477
  });
3480
3478
  const statements = [];
3479
+ const statementDeps = /* @__PURE__ */ new Set();
3481
3480
  const addPermission = (...permissions) => {
3482
3481
  statements.push(...permissions);
3482
+ for (const dep of findInputDeps(permissions)) {
3483
+ statementDeps.add(dep);
3484
+ }
3483
3485
  };
3484
3486
  ctx.onPermission((statement) => {
3485
3487
  addPermission(statement);
@@ -3487,7 +3489,7 @@ var createLambdaFunction = (parentGroup, ctx, ns, id, local) => {
3487
3489
  const policy = new aws4.iam.RolePolicy(group, "policy", {
3488
3490
  role: role.name,
3489
3491
  name: "lambda-policy",
3490
- policy: new Future(async (resolve) => {
3492
+ policy: new Output4(statementDeps, async (resolve) => {
3491
3493
  const list3 = await resolveInputs(statements);
3492
3494
  resolve(
3493
3495
  JSON.stringify({
@@ -4574,7 +4576,7 @@ import { fileURLToPath } from "node:url";
4574
4576
  import { days as days6, seconds as seconds6, toDays as toDays5, toSeconds as toSeconds5 } from "@awsless/duration";
4575
4577
  import { mebibytes as mebibytes2, toMebibytes as toMebibytes3 } from "@awsless/size";
4576
4578
  import { aws as aws13 } from "@terraforge/aws";
4577
- import { Future as Future2, resolveInputs as resolveInputs2 } from "@terraforge/core";
4579
+ import { Output as Output5, findInputDeps as findInputDeps2, resolveInputs as resolveInputs2 } from "@terraforge/core";
4578
4580
  import { pascalCase as pascalCase2 } from "change-case";
4579
4581
  var createPrebuildLambdaFunction = (group, ctx, ns, id, props) => {
4580
4582
  let name;
@@ -4629,8 +4631,12 @@ var createPrebuildLambdaFunction = (group, ctx, ns, id, props) => {
4629
4631
  })
4630
4632
  });
4631
4633
  const statements = [];
4634
+ const statementDeps = /* @__PURE__ */ new Set();
4632
4635
  const addPermission = (...permissions) => {
4633
4636
  statements.push(...permissions);
4637
+ for (const dep of findInputDeps2(permissions)) {
4638
+ statementDeps.add(dep);
4639
+ }
4634
4640
  };
4635
4641
  ctx.onPermission((statement) => {
4636
4642
  addPermission(statement);
@@ -4638,7 +4644,7 @@ var createPrebuildLambdaFunction = (group, ctx, ns, id, props) => {
4638
4644
  const policy = new aws13.iam.RolePolicy(group, "policy", {
4639
4645
  role: role.name,
4640
4646
  name: "lambda-policy",
4641
- policy: new Future2(async (resolve) => {
4647
+ policy: new Output5(statementDeps, async (resolve) => {
4642
4648
  const list3 = await resolveInputs2(statements);
4643
4649
  resolve(
4644
4650
  JSON.stringify({
@@ -6504,7 +6510,7 @@ import { toDays as toDays8, toSeconds as toSeconds8 } from "@awsless/duration";
6504
6510
  import { toMebibytes as toMebibytes4 } from "@awsless/size";
6505
6511
  import { generateFileHash as generateFileHash2 } from "@awsless/ts-file-cache";
6506
6512
  import { aws as aws26 } from "@terraforge/aws";
6507
- import { Future as Future3, Group as Group25, resolveInputs as resolveInputs3 } from "@terraforge/core";
6513
+ import { Group as Group25, Output as Output7, findInputDeps as findInputDeps3, resolveInputs as resolveInputs3 } from "@terraforge/core";
6508
6514
  import { constantCase as constantCase11, pascalCase as pascalCase3 } from "change-case";
6509
6515
  import deepmerge4 from "deepmerge";
6510
6516
  import { join as join16 } from "path";
@@ -6635,10 +6641,11 @@ var createFargateTask = (parentGroup, ctx, ns, id, local) => {
6635
6641
  }
6636
6642
  );
6637
6643
  const statements = [];
6644
+ const statementDeps = /* @__PURE__ */ new Set();
6638
6645
  const policy = new aws26.iam.RolePolicy(group, "policy", {
6639
6646
  role: role.name,
6640
6647
  name: "task-policy",
6641
- policy: new Future3(async (resolve) => {
6648
+ policy: new Output7(statementDeps, async (resolve) => {
6642
6649
  const list3 = await resolveInputs3(statements);
6643
6650
  resolve(
6644
6651
  JSON.stringify({
@@ -6652,8 +6659,14 @@ var createFargateTask = (parentGroup, ctx, ns, id, local) => {
6652
6659
  );
6653
6660
  })
6654
6661
  });
6662
+ const addPermission = (...permissions) => {
6663
+ statements.push(...permissions);
6664
+ for (const dep of findInputDeps3(permissions)) {
6665
+ statementDeps.add(dep);
6666
+ }
6667
+ };
6655
6668
  ctx.onPermission((statement) => {
6656
- statements.push(statement);
6669
+ addPermission(statement);
6657
6670
  });
6658
6671
  let logGroup;
6659
6672
  if (props.log.retention && props.log.retention.value > 0n) {
@@ -6679,6 +6692,7 @@ var createFargateTask = (parentGroup, ctx, ns, id, local) => {
6679
6692
  STACK: ctx.stackConfig.name
6680
6693
  };
6681
6694
  const variables = {};
6695
+ const variableDeps = /* @__PURE__ */ new Set();
6682
6696
  const task2 = new aws26.ecs.TaskDefinition(
6683
6697
  group,
6684
6698
  "task",
@@ -6695,7 +6709,7 @@ var createFargateTask = (parentGroup, ctx, ns, id, local) => {
6695
6709
  operatingSystemFamily: "LINUX"
6696
6710
  },
6697
6711
  trackLatest: true,
6698
- containerDefinitions: new Future3(async (resolve) => {
6712
+ containerDefinitions: new Output7(variableDeps, async (resolve) => {
6699
6713
  const data = await resolveInputs3(variables);
6700
6714
  const { s3Bucket, s3Key } = await resolveInputs3({
6701
6715
  s3Bucket: code.bucket,
@@ -6840,6 +6854,9 @@ var createFargateTask = (parentGroup, ctx, ns, id, local) => {
6840
6854
  );
6841
6855
  ctx.onEnv((name2, value) => {
6842
6856
  variables[name2] = value;
6857
+ for (const dep of findInputDeps3([value])) {
6858
+ variableDeps.add(dep);
6859
+ }
6843
6860
  });
6844
6861
  variables.APP = ctx.appConfig.name;
6845
6862
  variables.APP_ID = ctx.appId;
@@ -7025,7 +7042,7 @@ var metricFeature = defineFeature({
7025
7042
 
7026
7043
  // src/feature/router/index.ts
7027
7044
  import { days as days7, seconds as seconds9, toSeconds as toSeconds10, years } from "@awsless/duration";
7028
- import { Future as Future4, Group as Group28 } from "@terraforge/core";
7045
+ import { Future, Group as Group28 } from "@terraforge/core";
7029
7046
  import { aws as aws29 } from "@terraforge/aws";
7030
7047
  import { camelCase as camelCase7, constantCase as constantCase13 } from "change-case";
7031
7048
 
@@ -7580,7 +7597,7 @@ var routerFeature = defineFeature({
7580
7597
  {
7581
7598
  distributionId: distribution.id,
7582
7599
  paths,
7583
- version: new Future4((resolve) => {
7600
+ version: new Future((resolve) => {
7584
7601
  $combine(...versions).then((versions2) => {
7585
7602
  const combined = versions2.filter((v) => !!v).sort().join(",");
7586
7603
  const version = createHash5("sha1").update(combined).digest("hex");
@@ -8284,7 +8301,7 @@ var createApp = (props) => {
8284
8301
  };
8285
8302
 
8286
8303
  // src/cli/ui/complex/build-assets.ts
8287
- import { color as color2, log as log10 } from "@awsless/clui";
8304
+ import { log as log10 } from "@awsless/clui";
8288
8305
  import { loadWorkspace } from "@awsless/ts-file-cache";
8289
8306
  import { capitalCase as capitalCase3 } from "change-case";
8290
8307
  import wildstring from "wildstring";
@@ -8303,14 +8320,16 @@ var buildAssets = async (builders, stackFilters, showResult = false) => {
8303
8320
  }
8304
8321
  const results = [];
8305
8322
  await log10.task({
8306
- initialMessage: `Building (1/${filteredBuilders.length}) assets...`,
8323
+ initialMessage: `Building assets...`,
8307
8324
  successMessage: "Done building assets.",
8308
8325
  errorMessage: "Failed building assets.",
8309
8326
  async task(ctx) {
8310
8327
  const workspace = await loadWorkspace(directories.root);
8311
8328
  let i = 0;
8312
8329
  for (const builder of filteredBuilders) {
8313
- ctx.updateMessage(`Building (${++i}/${filteredBuilders.length}) assets...`);
8330
+ ctx.updateMessage(
8331
+ `Building (${++i}/${filteredBuilders.length}) ${color.info(builder.name)} ${builder.type}...`
8332
+ );
8314
8333
  try {
8315
8334
  const result = await build(builder.type, builder.name, builder.builder, {
8316
8335
  workspace
@@ -8329,7 +8348,7 @@ var buildAssets = async (builders, stackFilters, showResult = false) => {
8329
8348
  if (showResult) {
8330
8349
  log10.table({
8331
8350
  head: ["Type", "Resource", ...Object.keys(results.at(0)?.result ?? {})].map((v) => capitalCase3(v)),
8332
- body: results.map((r) => [color2.magenta(r.type), r.name, ...Object.values(r.result ?? {})])
8351
+ body: results.map((r) => [color.info(r.type), r.name, ...Object.values(r.result ?? {})])
8333
8352
  });
8334
8353
  }
8335
8354
  };
Binary file
Binary file
Binary file
package/dist/prebuild.js CHANGED
@@ -6,7 +6,7 @@ import { join as join2 } from "path";
6
6
  import { days, seconds, toDays, toSeconds } from "@awsless/duration";
7
7
  import { mebibytes, toMebibytes } from "@awsless/size";
8
8
  import { aws } from "@terraforge/aws";
9
- import { Future, resolveInputs } from "@terraforge/core";
9
+ import { Output, findInputDeps, resolveInputs } from "@terraforge/core";
10
10
  import { pascalCase } from "change-case";
11
11
  import { writeFile } from "fs/promises";
12
12
  import { join } from "path";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@awsless/awsless",
3
- "version": "0.0.590",
3
+ "version": "0.0.592",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "sideEffects": false,
@@ -35,21 +35,21 @@
35
35
  "peerDependencies": {
36
36
  "@awsless/cloudwatch": "^0.0.1",
37
37
  "@awsless/big-float": "^0.1.5",
38
+ "@awsless/clui": "^0.0.8",
38
39
  "@awsless/duration": "^0.0.4",
39
40
  "@awsless/dynamodb": "^0.3.8",
41
+ "@awsless/json": "^0.0.10",
40
42
  "@awsless/iot": "^0.0.3",
41
- "@awsless/lambda": "^0.0.35",
42
43
  "@awsless/mqtt": "^0.0.2",
43
- "@awsless/json": "^0.0.10",
44
- "@awsless/clui": "^0.0.8",
45
44
  "@awsless/open-search": "^0.0.21",
45
+ "@awsless/lambda": "^0.0.35",
46
46
  "@awsless/s3": "^0.0.21",
47
- "@awsless/sns": "^0.0.10",
48
47
  "@awsless/redis": "^0.0.14",
49
- "@awsless/validate": "^0.1.3",
50
48
  "@awsless/sqs": "^0.0.16",
51
- "@awsless/ssm": "^0.0.7",
52
- "@awsless/weak-cache": "^0.0.1"
49
+ "@awsless/sns": "^0.0.10",
50
+ "@awsless/validate": "^0.1.3",
51
+ "@awsless/weak-cache": "^0.0.1",
52
+ "@awsless/ssm": "^0.0.7"
53
53
  },
54
54
  "dependencies": {
55
55
  "@arcanyx/cidr-slicer": "^0.3.0",
@@ -140,14 +140,14 @@
140
140
  "zod": "^3.24.2",
141
141
  "zod-to-json-schema": "^3.24.3",
142
142
  "@awsless/big-float": "^0.1.5",
143
+ "@awsless/cloudwatch": "^0.0.1",
143
144
  "@awsless/clui": "^0.0.8",
144
145
  "@awsless/duration": "^0.0.4",
145
- "@awsless/json": "^0.0.10",
146
146
  "@awsless/graphql": "^0.0.9",
147
+ "@awsless/json": "^0.0.10",
147
148
  "@awsless/size": "^0.0.2",
148
149
  "@awsless/scheduler": "^0.0.4",
149
150
  "@awsless/ts-file-cache": "^0.0.12",
150
- "@awsless/cloudwatch": "^0.0.1",
151
151
  "@awsless/validate": "^0.1.3"
152
152
  },
153
153
  "devDependencies": {