@awsless/awsless 0.0.612 → 0.0.613

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
@@ -3188,8 +3188,6 @@ import { toMebibytes as toMebibytes2 } from "@awsless/size";
3188
3188
  import { pascalCase } from "change-case";
3189
3189
 
3190
3190
  // src/util/cache.ts
3191
- import { createHash } from "node:crypto";
3192
- import { createReadStream as createReadStream2 } from "node:fs";
3193
3191
  import { lstat as lstat2, readdir } from "node:fs/promises";
3194
3192
  import { join as join7 } from "node:path";
3195
3193
  var generateCacheKey = async (directories2) => {
@@ -3198,15 +3196,15 @@ var generateCacheKey = async (directories2) => {
3198
3196
  for (const file of files) {
3199
3197
  hashes[file] = await createHashFromFile(file);
3200
3198
  }
3201
- return createHash("md5").update(JSON.stringify(hashes)).digest("hex");
3199
+ return Bun.MD5.hash(JSON.stringify(hashes), "hex");
3202
3200
  };
3203
- var createHashFromFile = (file) => {
3204
- return new Promise((resolve) => {
3205
- const hash = createHash("md5");
3206
- const stream = createReadStream2(file);
3207
- stream.on("data", (data) => hash.update(data));
3208
- stream.on("end", () => resolve(hash.digest("hex")));
3209
- });
3201
+ var createHashFromFile = async (filePath) => {
3202
+ const hasher = new Bun.MD5();
3203
+ const stream = Bun.file(filePath).stream();
3204
+ for await (const chunk3 of stream) {
3205
+ hasher.update(chunk3);
3206
+ }
3207
+ return hasher.digest("hex");
3210
3208
  };
3211
3209
  var listAllFiles = async (list3) => {
3212
3210
  const files = [];
@@ -3217,7 +3215,7 @@ var listAllFiles = async (list3) => {
3217
3215
  recursive: true,
3218
3216
  withFileTypes: true
3219
3217
  });
3220
- files.push(...dirents.filter((d) => d.isFile()).map((file) => join7(file.path, file.name)));
3218
+ files.push(...dirents.filter((d) => d.isFile()).map((file) => join7(file.parentPath, file.name)));
3221
3219
  } else if (stat4.isFile()) {
3222
3220
  files.push(entry);
3223
3221
  }
@@ -3226,9 +3224,9 @@ var listAllFiles = async (list3) => {
3226
3224
  };
3227
3225
 
3228
3226
  // src/util/id.ts
3229
- import { createHash as createHash2 } from "crypto";
3227
+ import { createHash } from "crypto";
3230
3228
  var shortId = (ns) => {
3231
- return createHash2("md5").update(ns).digest("hex").substring(0, 10);
3229
+ return createHash("md5").update(ns).digest("hex").substring(0, 10);
3232
3230
  };
3233
3231
 
3234
3232
  // src/util/temp.ts
@@ -3264,7 +3262,7 @@ var formatFilterPattern = (filters) => {
3264
3262
 
3265
3263
  // src/feature/function/build/bundle/bundle.ts
3266
3264
  import JSZip2 from "jszip";
3267
- import { createReadStream as createReadStream3 } from "node:fs";
3265
+ import { createReadStream as createReadStream2 } from "node:fs";
3268
3266
  import { readdir as readdir3 } from "node:fs/promises";
3269
3267
  import { join as join9, relative as relative2 } from "node:path";
3270
3268
  var zipBundle = async ({ directory }) => {
@@ -3277,7 +3275,7 @@ var zipBundle = async ({ directory }) => {
3277
3275
  if (file.isFile()) {
3278
3276
  const path = join9(file.path, file.name);
3279
3277
  const rel = relative2(directory, path);
3280
- zip.file(rel, createReadStream3(path));
3278
+ zip.file(rel, createReadStream2(path));
3281
3279
  }
3282
3280
  }
3283
3281
  return zip.generateAsync({
@@ -3290,7 +3288,7 @@ var zipBundle = async ({ directory }) => {
3290
3288
  };
3291
3289
 
3292
3290
  // src/feature/function/build/typescript/rolldown.ts
3293
- import { createHash as createHash3 } from "crypto";
3291
+ import { createHash as createHash2 } from "crypto";
3294
3292
  import { rolldown } from "rolldown";
3295
3293
  import { importAsString } from "rollup-plugin-string-import";
3296
3294
  var bundleTypeScriptWithRolldown = async ({
@@ -3336,7 +3334,7 @@ var bundleTypeScriptWithRolldown = async ({
3336
3334
  chunkFileNames: `[name].${ext}`,
3337
3335
  minify
3338
3336
  });
3339
- const hash = createHash3("sha1");
3337
+ const hash = createHash2("sha1");
3340
3338
  const files = [];
3341
3339
  for (const item of result.output) {
3342
3340
  if (item.type !== "chunk") {
@@ -6534,7 +6532,7 @@ import deepmerge4 from "deepmerge";
6534
6532
  import { join as join16 } from "path";
6535
6533
 
6536
6534
  // src/feature/instance/build/executable.ts
6537
- import { createHash as createHash4 } from "crypto";
6535
+ import { createHash as createHash3 } from "crypto";
6538
6536
  import { readFile as readFile4 } from "fs/promises";
6539
6537
  import { join as join15 } from "path";
6540
6538
  var buildExecutable = async (input, outputPath, architecture) => {
@@ -6561,7 +6559,7 @@ ${result.logs?.map((log30) => log30.message).join("\n")}`);
6561
6559
  }
6562
6560
  const file = await readFile4(filePath);
6563
6561
  return {
6564
- hash: createHash4("sha1").update(file).update("x86_64").digest("hex"),
6562
+ hash: createHash3("sha1").update(file).update("x86_64").digest("hex"),
6565
6563
  file
6566
6564
  };
6567
6565
  };
@@ -7265,7 +7263,7 @@ async function handler(event) {
7265
7263
  `;
7266
7264
 
7267
7265
  // src/feature/router/index.ts
7268
- import { createHash as createHash5 } from "node:crypto";
7266
+ import { createHash as createHash4 } from "node:crypto";
7269
7267
  var routerFeature = defineFeature({
7270
7268
  name: "router",
7271
7269
  onApp(ctx) {
@@ -7617,7 +7615,7 @@ var routerFeature = defineFeature({
7617
7615
  version: new Future((resolve) => {
7618
7616
  $combine(...versions).then((versions2) => {
7619
7617
  const combined = versions2.filter((v) => !!v).sort().join(",");
7620
- const version = createHash5("sha1").update(combined).digest("hex");
7618
+ const version = createHash4("sha1").update(combined).digest("hex");
7621
7619
  resolve(version);
7622
7620
  });
7623
7621
  })
Binary file
Binary file
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@awsless/awsless",
3
- "version": "0.0.612",
3
+ "version": "0.0.613",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "sideEffects": false,
@@ -34,22 +34,22 @@
34
34
  },
35
35
  "peerDependencies": {
36
36
  "@awsless/big-float": "^0.1.5",
37
- "@awsless/duration": "^0.0.4",
38
37
  "@awsless/cloudwatch": "^0.0.1",
39
38
  "@awsless/clui": "^0.0.8",
40
39
  "@awsless/json": "^0.0.10",
41
- "@awsless/dynamodb": "^0.3.8",
42
- "@awsless/lambda": "^0.0.35",
40
+ "@awsless/duration": "^0.0.4",
43
41
  "@awsless/iot": "^0.0.3",
42
+ "@awsless/mqtt": "^0.0.2",
43
+ "@awsless/lambda": "^0.0.35",
44
+ "@awsless/open-search": "^0.0.21",
44
45
  "@awsless/s3": "^0.0.21",
45
- "@awsless/sns": "^0.0.10",
46
- "@awsless/sqs": "^0.0.16",
47
46
  "@awsless/redis": "^0.0.14",
48
- "@awsless/open-search": "^0.0.21",
49
- "@awsless/validate": "^0.1.3",
50
- "@awsless/weak-cache": "^0.0.1",
47
+ "@awsless/sqs": "^0.0.16",
48
+ "@awsless/sns": "^0.0.10",
51
49
  "@awsless/ssm": "^0.0.7",
52
- "@awsless/mqtt": "^0.0.2"
50
+ "@awsless/dynamodb": "^0.3.8",
51
+ "@awsless/validate": "^0.1.3",
52
+ "@awsless/weak-cache": "^0.0.1"
53
53
  },
54
54
  "dependencies": {
55
55
  "@arcanyx/cidr-slicer": "^0.3.0",
@@ -78,7 +78,7 @@
78
78
  "@terraforge/core": "^0.0.19",
79
79
  "@terraforge/terraform": "^0.0.14",
80
80
  "@types/aws-lambda": "^8.10.110",
81
- "@types/bun": "1.3.8",
81
+ "@types/bun": "1.3.9",
82
82
  "@types/chunk": "^0.0.0",
83
83
  "@types/decompress": "^4.2.4",
84
84
  "@types/folder-hash": "^4.0.4",
@@ -140,15 +140,15 @@
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",
144
+ "@awsless/clui": "^0.0.8",
143
145
  "@awsless/duration": "^0.0.4",
144
146
  "@awsless/json": "^0.0.10",
145
- "@awsless/cloudwatch": "^0.0.1",
146
147
  "@awsless/graphql": "^0.0.9",
148
+ "@awsless/scheduler": "^0.0.4",
147
149
  "@awsless/validate": "^0.1.3",
148
150
  "@awsless/size": "^0.0.2",
149
- "@awsless/clui": "^0.0.8",
150
- "@awsless/ts-file-cache": "^0.0.12",
151
- "@awsless/scheduler": "^0.0.4"
151
+ "@awsless/ts-file-cache": "^0.0.12"
152
152
  },
153
153
  "devDependencies": {
154
154
  "@hono/node-server": "1.19.9",