opennextjs / opennextjs-aws

Open-source Next.js adapter for AWS
https://opennext.js.org
MIT License
4.14k stars 126 forks source link

refactor: code simplification #627

Closed vicb closed 5 days ago

vicb commented 1 week ago

A few refactors I had accumulated in a branch.

Some of them depends on recent TS which is why it's updated.

Contains the auto fixes from biome

changeset-bot[bot] commented 1 week ago

⚠️ No Changeset found

Latest commit: d8167c387bf0bac63e882839908a403caf74ec83

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

pkg-pr-new[bot] commented 1 week ago

Open in Stackblitz

pnpm add https://pkg.pr.new/@opennextjs/aws@627

commit: d8167c3

github-actions[bot] commented 1 week ago

Coverage Report

Status Category Percentage Covered / Total
🔵 Lines 22.48% 1648 / 7329
🔵 Statements 22.48% 1648 / 7329
🔵 Functions 56.32% 98 / 174
🔵 Branches 70.3% 412 / 586
File Coverage
File Stmts Branches Functions Lines Uncovered Lines
Changed Files
packages/open-next/src/adapters/dynamo-provider.ts 0% 0% 0% 0% 1-78
packages/open-next/src/adapters/server-adapter.ts 0% 0% 0% 0% 1-40
packages/open-next/src/adapters/util.ts 0% 100% 100% 0% 3-37
packages/open-next/src/build/createAssets.ts 0% 0% 0% 0% 1-246
packages/open-next/src/build/createMiddleware.ts 0% 0% 0% 0% 1-83
packages/open-next/src/build/createServerBundle.ts 0% 0% 0% 0% 1-313
packages/open-next/src/build/helper.ts 0% 0% 0% 0% 1-356
packages/open-next/src/build/edge/createEdgeBundle.ts 0% 0% 0% 0% 1-229
packages/open-next/src/core/patchAsyncStorage.ts 0% 0% 0% 0% 1-39
packages/open-next/src/core/requestHandler.ts 0% 0% 0% 0% 1-222
packages/open-next/src/core/require-hooks.ts 0% 0% 0% 0% 1-152
packages/open-next/src/core/util.ts 0% 0% 0% 0% 1-106
packages/open-next/src/core/routing/matcher.ts 78.13% 67.39% 91.66% 78.13% 36-38, 47-51, 56-58, 61, 100, 102, 105, 108, 118-119, 161-163, 272-274, 276-289, 368-407
packages/open-next/src/core/routing/util.ts 70.99% 86.66% 86.36% 70.99% 170-192, 216-265, 289-290, 358-360, 375, 486-507
packages/open-next/src/core/routing/i18n/accept-header.ts 0% 100% 100% 0% 17-141
packages/open-next/src/http/openNextResponse.ts 1.47% 0% 0% 1.47% 30-405
packages/open-next/src/http/util.ts 80% 75% 100% 80% 8-9, 13, 26-29
packages/open-next/src/overrides/converters/aws-cloudfront.ts 69.84% 80.76% 100% 69.84% 105-106, 154-213
packages/open-next/src/overrides/converters/edge.ts 0% 0% 0% 0% 1-112
packages/open-next/src/overrides/tagCache/constants.ts 0% 0% 0% 0% 1-25
packages/open-next/src/overrides/wrappers/node.ts 0% 0% 0% 0% 1-69
packages/open-next/src/plugins/replacement.ts 0% 0% 0% 0% 1-106
packages/open-next/src/types/aws-lambda.ts 0% 0% 0% 0%
packages/open-next/src/types/next-types.ts 0% 0% 0% 0%
packages/utils/src/index.ts 0% 0% 0% 0% 1-16
Generated in workflow #732 for commit d8167c3 by the Vitest Coverage Report Action