@awsless/awsless 0.0.455 → 0.0.456

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
@@ -2400,6 +2400,12 @@ import { days as days3, toDays as toDays3, toSeconds } from "@awsless/duration";
2400
2400
  import { toMebibytes } from "@awsless/size";
2401
2401
  import { pascalCase } from "change-case";
2402
2402
 
2403
+ // src/util/id.ts
2404
+ import { createHash as createHash2 } from "crypto";
2405
+ var shortId = (ns) => {
2406
+ return createHash2("md5").update(ns).digest("hex").substring(0, 10);
2407
+ };
2408
+
2403
2409
  // src/util/temp.ts
2404
2410
  import { mkdir as mkdir3, readdir, rm as rm2 } from "fs/promises";
2405
2411
  import { join as join7 } from "path";
@@ -2459,7 +2465,7 @@ var zipBundle = async ({ directory }) => {
2459
2465
  };
2460
2466
 
2461
2467
  // src/feature/function/build/bundle/cache.ts
2462
- import { createHash as createHash2 } from "node:crypto";
2468
+ import { createHash as createHash3 } from "node:crypto";
2463
2469
  import { createReadStream as createReadStream3 } from "node:fs";
2464
2470
  import { lstat as lstat2, readdir as readdir3 } from "node:fs/promises";
2465
2471
  import { join as join9 } from "node:path";
@@ -2469,11 +2475,11 @@ var bundleCacheKey = async (props) => {
2469
2475
  for (const file of files) {
2470
2476
  hashes[file] = await createHashFromFile(file);
2471
2477
  }
2472
- return createHash2("md5").update(JSON.stringify(hashes)).digest("hex");
2478
+ return createHash3("md5").update(JSON.stringify(hashes)).digest("hex");
2473
2479
  };
2474
2480
  var createHashFromFile = (file) => {
2475
2481
  return new Promise((resolve) => {
2476
- const hash = createHash2("md5");
2482
+ const hash = createHash3("md5");
2477
2483
  const stream = createReadStream3(file);
2478
2484
  stream.on("data", (data) => hash.update(data));
2479
2485
  stream.on("end", () => resolve(hash.digest("hex")));
@@ -2511,8 +2517,7 @@ var createLambdaFunction = (group, ctx, ns, id, local) => {
2511
2517
  appName: ctx.app.name,
2512
2518
  stackName: ctx.stack.name,
2513
2519
  resourceType: ns,
2514
- resourceName: id,
2515
- postfix: ctx.appId
2520
+ resourceName: shortId(`${id}:${ctx.appId}`)
2516
2521
  });
2517
2522
  } else {
2518
2523
  name = formatGlobalResourceName({
@@ -2523,8 +2528,7 @@ var createLambdaFunction = (group, ctx, ns, id, local) => {
2523
2528
  roleName = formatGlobalResourceName({
2524
2529
  appName: ctx.app.name,
2525
2530
  resourceType: ns,
2526
- resourceName: id,
2527
- postfix: ctx.appId
2531
+ resourceName: shortId(`${id}:${ctx.appId}`)
2528
2532
  });
2529
2533
  }
2530
2534
  const props = deepmerge(ctx.appConfig.defaults.function, local);
@@ -2599,6 +2603,7 @@ var createLambdaFunction = (group, ctx, ns, id, local) => {
2599
2603
  }
2600
2604
  const role = new $3.aws.iam.Role(group, "role", {
2601
2605
  name: roleName,
2606
+ description: name,
2602
2607
  assumeRolePolicy: JSON.stringify({
2603
2608
  Version: "2012-10-17",
2604
2609
  Statement: [
@@ -3475,14 +3480,6 @@ var queueFeature = defineFeature({
3475
3480
  // src/feature/rest/index.ts
3476
3481
  import { $ as $11, Group as Group11 } from "@awsless/formation";
3477
3482
  import { constantCase as constantCase7 } from "change-case";
3478
-
3479
- // src/util/id.ts
3480
- import { createHash as createHash3 } from "crypto";
3481
- var shortId = (ns) => {
3482
- return createHash3("md5").update(ns).digest("hex").substring(0, 10);
3483
- };
3484
-
3485
- // src/feature/rest/index.ts
3486
3483
  var restFeature = defineFeature({
3487
3484
  name: "rest",
3488
3485
  onApp(ctx) {
@@ -6064,7 +6061,7 @@ var del2 = (program2) => {
6064
6061
  });
6065
6062
  await task("Deleting the stacks to AWS", async (update) => {
6066
6063
  await workspace.delete(app, {
6067
- filters
6064
+ filters: stackNames
6068
6065
  });
6069
6066
  await pullRemoteState(app, state2);
6070
6067
  update("Done deleting the stacks to AWS.");
@@ -6455,7 +6452,7 @@ var deploy = (program2) => {
6455
6452
  });
6456
6453
  await task("Deploying the stacks to AWS", async (update) => {
6457
6454
  await workspace.deploy(app, {
6458
- filters
6455
+ filters: stackNames
6459
6456
  });
6460
6457
  await pullRemoteState(app, state2);
6461
6458
  update("Done deploying the stacks to AWS.");
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@awsless/awsless",
3
- "version": "0.0.455",
3
+ "version": "0.0.456",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "sideEffects": false,
@@ -28,19 +28,19 @@
28
28
  }
29
29
  },
30
30
  "peerDependencies": {
31
- "@awsless/iot": "^0.0.3",
32
31
  "@awsless/dynamodb": "^0.1.5",
33
32
  "@awsless/json": "^0.0.8",
34
- "@awsless/mqtt": "^0.0.2",
35
33
  "@awsless/lambda": "^0.0.31",
34
+ "@awsless/mqtt": "^0.0.2",
36
35
  "@awsless/open-search": "^0.0.17",
37
36
  "@awsless/redis": "^0.0.13",
37
+ "@awsless/validate": "^0.0.19",
38
+ "@awsless/weak-cache": "^0.0.1",
39
+ "@awsless/iot": "^0.0.3",
38
40
  "@awsless/s3": "^0.0.20",
39
- "@awsless/sqs": "^0.0.8",
40
41
  "@awsless/sns": "^0.0.10",
41
- "@awsless/ssm": "^0.0.7",
42
- "@awsless/validate": "^0.0.19",
43
- "@awsless/weak-cache": "^0.0.1"
42
+ "@awsless/sqs": "^0.0.8",
43
+ "@awsless/ssm": "^0.0.7"
44
44
  },
45
45
  "dependencies": {
46
46
  "@arcanyx/cidr-slicer": "^0.3.0",
@@ -116,14 +116,14 @@
116
116
  "zip-a-folder": "^3.1.6",
117
117
  "zod": "^3.24.2",
118
118
  "zod-to-json-schema": "^3.24.3",
119
+ "@awsless/formation": "^0.0.68",
120
+ "@awsless/graphql": "^0.0.9",
119
121
  "@awsless/duration": "^0.0.3",
120
122
  "@awsless/code": "^0.0.10",
121
- "@awsless/graphql": "^0.0.9",
122
123
  "@awsless/size": "^0.0.2",
123
- "@awsless/formation": "^0.0.68",
124
+ "@awsless/validate": "^0.0.19",
124
125
  "@awsless/json": "^0.0.8",
125
- "@awsless/ts-file-cache": "^0.0.12",
126
- "@awsless/validate": "^0.0.19"
126
+ "@awsless/ts-file-cache": "^0.0.12"
127
127
  },
128
128
  "devDependencies": {
129
129
  "@node-rs/bcrypt": "^1.10.5"