@awsless/awsless 0.0.342 → 0.0.343

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 +8 -7
  2. package/package.json +6 -6
package/dist/bin.js CHANGED
@@ -2200,7 +2200,8 @@ import { hashElement } from "folder-hash";
2200
2200
  import { exec } from "promisify-child-process";
2201
2201
  var buildDockerImage = async (opts) => {
2202
2202
  const platform = opts.architecture === "arm64" ? "linux/arm64" : "linux/amd64";
2203
- const buildResponse = await exec(`docker buildx build --platform ${platform} -t ${opts.name} .`, {
2203
+ await exec(`docker image rm ${opts.name}:latest`);
2204
+ const buildResponse = await exec(`docker buildx build --platform ${platform} -t ${opts.name}:latest .`, {
2204
2205
  cwd: opts.cwd
2205
2206
  });
2206
2207
  if (buildResponse.code !== 0) {
@@ -2211,9 +2212,10 @@ var buildDockerImage = async (opts) => {
2211
2212
  throw new Error(`Docker image inspect failed: ${response.stderr}`);
2212
2213
  }
2213
2214
  const data = JSON.parse(response.stdout);
2215
+ const image = data[0];
2214
2216
  return {
2215
- id: data[0].Id,
2216
- size: data[0].Size
2217
+ id: image.Id,
2218
+ size: image.Size
2217
2219
  };
2218
2220
  };
2219
2221
 
@@ -2238,8 +2240,8 @@ var createLambdaFunction = (group, ctx, ns, id, local2) => {
2238
2240
  let code;
2239
2241
  if (props.runtime === "container") {
2240
2242
  ctx.registerBuild("function", name, async (build3) => {
2241
- const basePath2 = dirname6(props.file);
2242
- const version = await hashElement(basePath2, {
2243
+ const cwd = dirname6(props.file);
2244
+ const version = await hashElement(cwd, {
2243
2245
  files: {
2244
2246
  exclude: ["stack.json"]
2245
2247
  }
@@ -2247,8 +2249,7 @@ var createLambdaFunction = (group, ctx, ns, id, local2) => {
2247
2249
  return build3(version.hash + props.architecture, async (write) => {
2248
2250
  const image2 = await buildDockerImage({
2249
2251
  name,
2250
- file: props.file,
2251
- cwd: basePath2,
2252
+ cwd,
2252
2253
  architecture: props.architecture
2253
2254
  });
2254
2255
  await write("HASH", image2.id);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@awsless/awsless",
3
- "version": "0.0.342",
3
+ "version": "0.0.343",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "sideEffects": false,
@@ -28,8 +28,8 @@
28
28
  }
29
29
  },
30
30
  "peerDependencies": {
31
- "@awsless/lambda": "^0.0.26",
32
31
  "@awsless/iot": "^0.0.2",
32
+ "@awsless/lambda": "^0.0.26",
33
33
  "@awsless/open-search": "^0.0.15",
34
34
  "@awsless/redis": "^0.0.12",
35
35
  "@awsless/s3": "^0.0.18",
@@ -108,12 +108,12 @@
108
108
  "zod": "^3.21.4",
109
109
  "zod-to-json-schema": "^3.22.3",
110
110
  "@awsless/code": "^0.0.10",
111
- "@awsless/formation": "^0.0.53",
112
- "@awsless/duration": "^0.0.1",
113
- "@awsless/size": "^0.0.1",
111
+ "@awsless/graphql": "^0.0.9",
114
112
  "@awsless/ts-file-cache": "^0.0.1",
115
113
  "@awsless/validate": "^0.0.15",
116
- "@awsless/graphql": "^0.0.9"
114
+ "@awsless/size": "^0.0.1",
115
+ "@awsless/duration": "^0.0.1",
116
+ "@awsless/formation": "^0.0.53"
117
117
  },
118
118
  "scripts": {
119
119
  "test": "pnpm code test",