@awsless/awsless 0.0.257 → 0.0.258

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.
Files changed (2) hide show
  1. package/dist/bin.js +9 -6
  2. package/package.json +7 -5
package/dist/bin.js CHANGED
@@ -2070,6 +2070,7 @@ var zipFiles = (files) => {
2070
2070
  };
2071
2071
 
2072
2072
  // src/feature/function/util.ts
2073
+ import { hashElement } from "folder-hash";
2073
2074
  var createLambdaFunction = (group, ctx, ns, id, local2) => {
2074
2075
  let name;
2075
2076
  if ("stackConfig" in ctx) {
@@ -2103,18 +2104,20 @@ var createLambdaFunction = (group, ctx, ns, id, local2) => {
2103
2104
  });
2104
2105
  } else if (basename4(props.file) === "dockerfile") {
2105
2106
  ctx.registerBuild("function", name, async (build3) => {
2106
- const version = Math.random().toString();
2107
- return build3(version, async () => {
2107
+ const basePath2 = dirname6(props.file);
2108
+ const version = await hashElement(basePath2);
2109
+ return build3(version.hash, async () => {
2108
2110
  const repoName = formatGlobalResourceName(ctx.appConfig.name, "function", "repository", "-");
2109
2111
  await exec(`docker build -t ${name} .`, {
2110
- cwd: dirname6(props.file)
2112
+ cwd: basePath2
2111
2113
  });
2112
2114
  await exec(
2113
2115
  `docker tag ${name}:latest ${ctx.accountId}.dkr.ecr.${ctx.appConfig.region}.amazonaws.com/${repoName}:${name}`,
2114
- {
2115
- cwd: dirname6(props.file)
2116
- }
2116
+ { cwd: basePath2 }
2117
2117
  );
2118
+ return {
2119
+ size: ""
2120
+ };
2118
2121
  });
2119
2122
  });
2120
2123
  const image = new aws.ecr.Image(group, "image", {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@awsless/awsless",
3
- "version": "0.0.257",
3
+ "version": "0.0.258",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "sideEffects": false,
@@ -34,9 +34,9 @@
34
34
  "@awsless/s3": "^0.0.10",
35
35
  "@awsless/sns": "^0.0.7",
36
36
  "@awsless/sqs": "^0.0.7",
37
- "@awsless/ssm": "^0.0.7",
38
37
  "@awsless/validate": "^0.0.14",
39
- "@awsless/weak-cache": "^0.0.1"
38
+ "@awsless/weak-cache": "^0.0.1",
39
+ "@awsless/ssm": "^0.0.7"
40
40
  },
41
41
  "dependencies": {
42
42
  "@aws-appsync/utils": "^1.5.0",
@@ -60,6 +60,7 @@
60
60
  "@types/aws-lambda": "^8.10.110",
61
61
  "@types/chunk": "^0.0.0",
62
62
  "@types/decompress": "^4.2.4",
63
+ "@types/folder-hash": "^4.0.4",
63
64
  "@types/mime-types": "^2.1.2",
64
65
  "@types/pretty-hrtime": "^1.0.1",
65
66
  "@types/promise-dag": "^1.0.4",
@@ -78,6 +79,7 @@
78
79
  "event-iterator": "^2.0.0",
79
80
  "fastq": "^1.16.0",
80
81
  "filesize": "^10.0.7",
82
+ "folder-hash": "^4.0.4",
81
83
  "glob": "^10.3.9",
82
84
  "graphql": "^16.7.1",
83
85
  "json5": "^2.2.3",
@@ -99,9 +101,9 @@
99
101
  "zod": "^3.21.4",
100
102
  "zod-to-json-schema": "^3.22.3",
101
103
  "@awsless/duration": "^0.0.1",
102
- "@awsless/formation": "^0.0.28",
103
- "@awsless/graphql": "^0.0.9",
104
104
  "@awsless/size": "^0.0.1",
105
+ "@awsless/graphql": "^0.0.9",
106
+ "@awsless/formation": "^0.0.28",
105
107
  "@awsless/validate": "^0.0.14",
106
108
  "@awsless/code": "^0.0.10"
107
109
  },