sveltekit-adapter-middy 0.1.0 → 0.2.0

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sveltekit-adapter-middy",
3
- "version": "0.1.0",
3
+ "version": "0.2.0",
4
4
  "description": "SvelteKit adapter for AWS Lambda with Middy",
5
5
  "type": "module",
6
6
  "engines": {
@@ -35,21 +35,31 @@
35
35
  "git:unit-staged": "node --test",
36
36
  "git:test-staged": "npm run git:unit-staged",
37
37
  "lint": "biome check --write --no-errors-on-unmatched",
38
- "test": "npm run test:lint && npm run test:unit && npm run test:types && npm run test:sast && npm run test:perf && npm run test:dast",
39
- "test:sast": "npm run test:sast:license && npm run test:sast:lockfile && npm run test:sast:semgrep && npm run test:sast:trufflehog && npm run test:sast:trivy",
40
- "test:sast:license": "license-check-and-add check -f license.json",
38
+ "test": "npm run test:lint && npm run test:unit && npm run test:mutation && npm run test:types && npm run test:sast && npm run test:perf && npm run test:dast",
39
+ "test:sast": "npm run test:sast:license && npm run test:sast:lockfile && npm run test:sast:semgrep && npm run test:sast:trufflehog && npm run test:sast:gitleaks && npm run test:sast:actionlint && npm run test:sast:zizmor && npm run test:sast:trivy",
40
+ "test:sast:actionlint": "actionlint",
41
+ "test:sast:gitleaks": "npm run test:sast:gitleaks:dir && npm run test:sast:gitleaks:git",
42
+ "test:sast:gitleaks:dir": "gitleaks dir . --redact --no-banner",
43
+ "test:sast:gitleaks:git": "gitleaks git . --redact --no-banner",
44
+ "test:sast:license": "license-check-and-add check -f .license.config.json",
41
45
  "test:sast:lockfile": "lockfile-lint --path package-lock.json --type npm --allowed-hosts npm --validate-https",
42
- "test:sast:semgrep": "semgrep scan --config auto",
43
- "test:sast:trivy": "trivy fs --scanners vuln,license --include-dev-deps --ignored-licenses 0BSD,Apache-2.0,BSD-1-Clause,BSD-2-Clause,BSD-3-Clause,CC0-1.0,CC-BY-4.0,ISC,MIT,Python-2.0 --exit-code 1 --disable-telemetry .",
46
+ "test:sast:semgrep": "semgrep scan --config auto --error",
47
+ "test:sast:trivy": "trivy fs --scanners vuln,license --include-dev-deps --ignored-licenses 0BSD,Apache-2.0,BSD-1-Clause,BSD-2-Clause,BSD-3-Clause,CC0-1.0,CC-BY-4.0,ISC,MIT,Python-2.0,LGPL-3.0-or-later,MPL-2.0,BlueOak-1.0.0,Unlicense --exit-code 1 --skip-files '**/bun.lock' --disable-telemetry .",
44
48
  "test:sast:trufflehog": "trufflehog filesystem --only-verified --log-level=-1 ./",
49
+ "test:sast:zizmor": "zizmor .github",
45
50
  "test:lint": "biome check --staged --no-errors-on-unmatched",
46
51
  "test:unit": "node --test --test-force-exit --experimental-test-coverage --test-coverage-lines=80 --test-coverage-branches=70 --test-coverage-functions=80 --test-coverage-exclude=sveltekitMiddleware.js --test-coverage-exclude=handler.js --test-coverage-exclude=index.js ./*.test.js",
52
+ "test:mutation": "stryker run",
47
53
  "test:types": "tstyche",
48
54
  "test:perf": "node --test --test-concurrency=1 ./*.perf.js",
49
55
  "test:dast": "npm run test:dast:fuzz",
50
56
  "test:dast:fuzz": "node --test ./*.fuzz.js",
51
- "release:license:add": "license-check-and-add add -f license.json",
52
- "release:license:remove": "license-check-and-add remove -f license.json"
57
+ "rm": "npm run rm:macos && npm run rm:node_modules && npm run rm:lock",
58
+ "rm:macos": "find . -name '.DS_Store' -type f -delete",
59
+ "rm:lock": "find . -name 'package-lock.json' -type f -delete",
60
+ "rm:node_modules": "find . -name 'node_modules' -type d -prune -exec rm -rf '{}' +",
61
+ "release:license:add": "license-check-and-add add -f .license.config.json",
62
+ "release:license:remove": "license-check-and-add remove -f .license.config.json"
53
63
  },
54
64
  "license": "MIT",
55
65
  "keywords": [
@@ -82,18 +92,23 @@
82
92
  "url": "https://github.com/sponsors/willfarrell"
83
93
  },
84
94
  "devDependencies": {
85
- "@biomejs/biome": "^2.0.0",
86
- "@commitlint/cli": "^20.0.0",
87
- "@commitlint/config-conventional": "^20.0.0",
88
- "fast-check": "^4.0.0",
89
- "husky": "^9.0.0",
95
+ "@biomejs/biome": "^2.5.3",
96
+ "@commitlint/cli": "^21.2.1",
97
+ "@commitlint/config-conventional": "^21.2.0",
98
+ "@stryker-mutator/core": "^9.0.0",
99
+ "fast-check": "^4.9.0",
100
+ "husky": "^9.1.7",
90
101
  "license-check-and-add": "4.0.5",
91
- "tinybench": "^6.0.0",
92
- "tstyche": "^6.0.0"
102
+ "tinybench": "^6.0.2",
103
+ "tstyche": "^7.2.1",
104
+ "typescript": "^6.0.3"
105
+ },
106
+ "overrides": {
107
+ "qs": "^6.15.2"
93
108
  },
94
109
  "dependencies": {
95
- "@datastream/string": "0.0.42",
96
- "@middy/core": "^7.0.0",
97
- "esbuild": "^0.27.0"
110
+ "@datastream/string": "0.5.0",
111
+ "@middy/core": "^7.7.0",
112
+ "esbuild": "^0.28.1"
98
113
  }
99
114
  }
@@ -14,9 +14,8 @@ const lambdaHandler = async (event, context, { signal: _signal }) => {
14
14
  const queryString = rawQueryString ? `?${rawQueryString}` : "";
15
15
  const url = `${headers.origin}${path}${queryString}`;
16
16
 
17
- const encoding = isBase64Encoded
18
- ? "base64"
19
- : (headers["content-encoding"] ?? "utf-8");
17
+ // Buffer.from defaults a missing encoding to utf-8
18
+ const encoding = isBase64Encoded ? "base64" : headers["content-encoding"];
20
19
  const body =
21
20
  typeof rawBody === "string" ? Buffer.from(rawBody, encoding) : rawBody;
22
21
 
@@ -53,7 +52,7 @@ const lambdaHandler = async (event, context, { signal: _signal }) => {
53
52
  }
54
53
 
55
54
  if (rendered.body) {
56
- response.body = Readable.from(rendered.body);
55
+ response.body = Readable.fromWeb(rendered.body);
57
56
  }
58
57
 
59
58
  return response;
@@ -22,7 +22,7 @@ const sveltekitMiddleware = () => {
22
22
  pattern: formActionPattern,
23
23
  replacement: formActionReplacement,
24
24
  });
25
- request.response.body.pipe(stream);
25
+ request.response.body = request.response.body.pipe(stream);
26
26
  }
27
27
  };
28
28
  return {
package/license.json DELETED
@@ -1,26 +0,0 @@
1
- {
2
- "license": "license.template",
3
- "licenseFormats": {
4
- "js|ts": {
5
- "eachLine": {
6
- "prepend": "// "
7
- }
8
- }
9
- },
10
- "ignoreFile": ".gitignore",
11
- "ignore": [
12
- ".github/**/*",
13
- ".husky/**/*",
14
- "fixtures/*",
15
- "commitlint.config.cjs",
16
- "LICENSE",
17
- "license.template",
18
- "**/.gitignore",
19
- "**/*.fuzz.js",
20
- "**/*.perf.js",
21
- "**/*.test.js",
22
- "**/*.md",
23
- "**/*.yml",
24
- ".DS_Store"
25
- ]
26
- }
package/license.template DELETED
@@ -1,2 +0,0 @@
1
- Copyright 2026 will Farrell, and sveltekit-adapter-middy contributors.
2
- SPDX-License-Identifier: MIT