@opennextjs/aws 3.9.9 → 3.9.10

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.
@@ -1,10 +1,12 @@
1
1
  import * as buildHelper from "../../helper.js";
2
2
  /**
3
- * Next 16.1+ removes `skipTrailingSlashRedirect` from the config in `required-server-files.json`.
3
+ * Next 16.1.0-16.1.4 has missing fields in `required-server-files.json`:
4
+ * - `skipTrailingSlashRedirect`
5
+ * - `serverExternalPackages`
4
6
  *
5
- * This patch adds it back in by compiling and importing the user's `next.config.js` file.
7
+ * This patch adds them back in by compiling and importing the user's `next.config.js` file.
6
8
  *
7
- * It is a regression in https://github.com/vercel/next.js/pull/86830
8
- * TODO(#1082): revisit when Next is fixed
9
+ * It is a regression in https://github.com/vercel/next.js/pull/86830 (16.1.0)
10
+ * Fixed in https://github.com/vercel/next.js/pull/88733 (16.1.4)
9
11
  */
10
12
  export declare function patchOriginalNextConfig(options: buildHelper.BuildOptions): Promise<void>;
@@ -4,15 +4,18 @@ import { build } from "esbuild";
4
4
  import { inlineRequireResolvePlugin } from "../../../plugins/inline-require-resolve.js";
5
5
  import * as buildHelper from "../../helper.js";
6
6
  /**
7
- * Next 16.1+ removes `skipTrailingSlashRedirect` from the config in `required-server-files.json`.
7
+ * Next 16.1.0-16.1.4 has missing fields in `required-server-files.json`:
8
+ * - `skipTrailingSlashRedirect`
9
+ * - `serverExternalPackages`
8
10
  *
9
- * This patch adds it back in by compiling and importing the user's `next.config.js` file.
11
+ * This patch adds them back in by compiling and importing the user's `next.config.js` file.
10
12
  *
11
- * It is a regression in https://github.com/vercel/next.js/pull/86830
12
- * TODO(#1082): revisit when Next is fixed
13
+ * It is a regression in https://github.com/vercel/next.js/pull/86830 (16.1.0)
14
+ * Fixed in https://github.com/vercel/next.js/pull/88733 (16.1.4)
13
15
  */
14
16
  export async function patchOriginalNextConfig(options) {
15
- if (buildHelper.compareSemver(options.nextVersion, "<", "16.1.0")) {
17
+ if (buildHelper.compareSemver(options.nextVersion, "<", "16.1.0") ||
18
+ buildHelper.compareSemver(options.nextVersion, ">=", "16.1.4")) {
16
19
  return;
17
20
  }
18
21
  // The manifests in both `.next` and `.next/standalone` folders
@@ -22,9 +25,10 @@ export async function patchOriginalNextConfig(options) {
22
25
  if (fs.existsSync(manifestPath)) {
23
26
  const manifest = JSON.parse(await fs.promises.readFile(manifestPath, "utf-8"));
24
27
  if (manifest.config.skipTrailingSlashRedirect === undefined) {
25
- const { skipTrailingSlashRedirect } = await importNextConfigFromSource(options);
28
+ const { skipTrailingSlashRedirect, serverExternalPackages } = await importNextConfigFromSource(options);
26
29
  manifest.config.skipTrailingSlashRedirect =
27
30
  skipTrailingSlashRedirect ?? false;
31
+ manifest.config.serverExternalPackages = serverExternalPackages ?? [];
28
32
  await fs.promises.writeFile(manifestPath, JSON.stringify(manifest, null, 2), "utf-8");
29
33
  if (fs.existsSync(manifestStandalonePath)) {
30
34
  await fs.promises.writeFile(manifestStandalonePath, JSON.stringify(manifest, null, 2), "utf-8");
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "access": "public"
4
4
  },
5
5
  "name": "@opennextjs/aws",
6
- "version": "3.9.9",
6
+ "version": "3.9.10",
7
7
  "bin": {
8
8
  "open-next": "./dist/index.js"
9
9
  },