@awsless/awsless 0.0.342 → 0.0.344

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 -7
  2. package/package.json +9 -9
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);
@@ -2325,6 +2326,7 @@ var createLambdaFunction = (group, ctx, ns, id, local2) => {
2325
2326
  new aws2.lambda.SourceCodeUpdate(group, "update", {
2326
2327
  functionName: lambda.name,
2327
2328
  version: Asset.fromFile(getBuildPath("function", name, "HASH")),
2329
+ architecture: props.architecture,
2328
2330
  code
2329
2331
  });
2330
2332
  ctx.onEnv((name2, value) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@awsless/awsless",
3
- "version": "0.0.342",
3
+ "version": "0.0.344",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "sideEffects": false,
@@ -28,16 +28,16 @@
28
28
  }
29
29
  },
30
30
  "peerDependencies": {
31
- "@awsless/lambda": "^0.0.26",
32
31
  "@awsless/iot": "^0.0.2",
33
32
  "@awsless/open-search": "^0.0.15",
34
- "@awsless/redis": "^0.0.12",
33
+ "@awsless/lambda": "^0.0.26",
35
34
  "@awsless/s3": "^0.0.18",
36
- "@awsless/sns": "^0.0.7",
35
+ "@awsless/redis": "^0.0.12",
37
36
  "@awsless/sqs": "^0.0.7",
38
- "@awsless/validate": "^0.0.15",
37
+ "@awsless/sns": "^0.0.7",
38
+ "@awsless/weak-cache": "^0.0.1",
39
39
  "@awsless/ssm": "^0.0.7",
40
- "@awsless/weak-cache": "^0.0.1"
40
+ "@awsless/validate": "^0.0.15"
41
41
  },
42
42
  "dependencies": {
43
43
  "@arcanyx/cidr-slicer": "^0.3.0",
@@ -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
111
  "@awsless/size": "^0.0.1",
112
+ "@awsless/graphql": "^0.0.9",
113
+ "@awsless/formation": "^0.0.53",
114
114
  "@awsless/ts-file-cache": "^0.0.1",
115
115
  "@awsless/validate": "^0.0.15",
116
- "@awsless/graphql": "^0.0.9"
116
+ "@awsless/duration": "^0.0.1"
117
117
  },
118
118
  "scripts": {
119
119
  "test": "pnpm code test",