Skip to content

Commit 709cef3

Browse files
committed
fix next.config.ts
1 parent f3f9e3d commit 709cef3

File tree

10 files changed

+102
-226
lines changed

10 files changed

+102
-226
lines changed

package.json

+1-3
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,7 @@
3636
"docs:start:fern-prod": "turbo start:fern-prod",
3737
"docs:start:fern-dev": "turbo start:fern-dev",
3838
"fdr:generate": "pnpm fern generate --api fdr --local && pnpm --filter=@fern-api/fdr-sdk compile",
39-
"navigation:generate": "pnpm fern generate --api navigation --local",
40-
"postinstall": "update-ts-references"
39+
"navigation:generate": "pnpm fern generate --api navigation --local"
4140
},
4241
"devDependencies": {
4342
"@babel/core": "^7.23.7",
@@ -89,7 +88,6 @@
8988
"turbo": "^2.1.2",
9089
"typescript": "5.4.3",
9190
"typescript-plugin-css-modules": "^5.1.0",
92-
"update-ts-references": "^3.3.0",
9391
"vitest": "^1.6.0"
9492
},
9593
"resolutions": {

packages/ui/chatbot/tsconfig.json

+9-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,15 @@
66
},
77
{
88
"path": "../components"
9+
},
10+
{
11+
"path": "./tsconfig.app.json"
12+
},
13+
{
14+
"path": "./tsconfig.node.json"
915
}
1016
],
11-
"compilerOptions": {}
17+
"compilerOptions": {
18+
"composite": true
19+
}
1220
}

packages/ui/docs-bundle/next.config.js packages/ui/docs-bundle/next.config.ts

+11-11
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
1+
import createWithBundleAnalyzer from "@next/bundle-analyzer";
2+
import { withSentryConfig } from "@sentry/nextjs";
3+
import type { RemotePattern } from "next/dist/shared/lib/image-config";
4+
import type { NextConfig } from "next/types";
5+
16
const cdnUri = process.env.NEXT_PUBLIC_CDN_URI != null ? new URL("/", process.env.NEXT_PUBLIC_CDN_URI) : undefined;
27

3-
const DOCS_FILES_ALLOWLIST = [
8+
const DOCS_FILES_ALLOWLIST: RemotePattern[] = [
49
{
510
protocol: "https",
611
hostname: "fdr-prod-docs-files.s3.us-east-1.amazonaws.com",
@@ -23,7 +28,7 @@ const DOCS_FILES_ALLOWLIST = [
2328
},
2429
];
2530

26-
function isTruthy(value) {
31+
function isTruthy(value: string | undefined) {
2732
if (value == null) {
2833
return false;
2934
} else if (typeof value === "string") {
@@ -42,8 +47,7 @@ if (isTruthy(process.env.TRAILING_SLASH)) {
4247
SENTRY_TUNNEL_ROUTE += "/";
4348
}
4449

45-
/** @type {import('next').NextConfig} */
46-
const nextConfig = {
50+
const nextConfig: NextConfig = {
4751
reactStrictMode: true,
4852
transpilePackages: [
4953
"next-mdx-remote",
@@ -147,18 +151,14 @@ const nextConfig = {
147151
},
148152
};
149153

150-
const withBundleAnalyzer = require("@next/bundle-analyzer")({
154+
const withBundleAnalyzer = createWithBundleAnalyzer({
151155
enabled: isTruthy(process.env.ANALYZE),
152156
});
153157

154-
module.exports = withBundleAnalyzer(nextConfig);
155-
156158
// Injected content via Sentry wizard below
157159

158-
const { withSentryConfig } = require("@sentry/nextjs");
159-
160-
module.exports = withSentryConfig(
161-
module.exports,
160+
export default withSentryConfig(
161+
withBundleAnalyzer(nextConfig),
162162
{
163163
// For all available options, see:
164164
// https://github.com/getsentry/sentry-webpack-plugin#options

packages/ui/docs-bundle/tsconfig.json

+3-8
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,9 @@
44
"outDir": "./dist",
55
"rootDir": "."
66
},
7-
"exclude": [
8-
"node_modules"
9-
],
10-
"include": [
11-
"./src/**/*",
12-
".next/types/**/*.ts",
13-
"__mocks__"
14-
],
7+
"exclude": ["node_modules"],
8+
"include": ["./src/**/*", ".next/types/**/*.ts", "__mocks__"],
9+
"files": ["./next.config.ts"],
1510
"references": [
1611
{
1712
"path": "../../commons/core-utils"

packages/ui/fontawesome-cdn/next.config.js

-5
This file was deleted.
+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import createWithBundleAnalyzer from "@next/bundle-analyzer";
2+
import type { NextConfig } from "next";
3+
4+
const nextConfig: NextConfig = {};
5+
6+
const withBundleAnalyzer = createWithBundleAnalyzer({
7+
enabled: process.env.ANALYZE === "1",
8+
});
9+
10+
export default withBundleAnalyzer(nextConfig);

packages/ui/fontawesome-cdn/tsconfig.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,6 @@
55
"rootDir": "."
66
},
77
"exclude": ["node_modules"],
8-
"include": ["./src/**/*", ".next/types/**/*.ts", "__mocks__"]
8+
"include": ["./src/**/*", ".next/types/**/*.ts", "__mocks__"],
9+
"files": ["./next.config.ts"]
910
}

packages/ui/local-preview-bundle/next.config.js packages/ui/local-preview-bundle/next.config.ts

+7-5
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
1-
/** @type {import('next').NextConfig} */
2-
const nextConfig = {
1+
import createWithBundleAnalyzer from "@next/bundle-analyzer";
2+
import type { NextConfig } from "next/types";
3+
4+
const nextConfig: NextConfig = {
35
transpilePackages: ["next-mdx-remote"],
46
productionBrowserSourceMaps: process.env.ENABLE_SOURCE_MAPS === "true",
57
reactProductionProfiling: process.env.ENABLE_SOURCE_MAPS === "true",
@@ -14,8 +16,8 @@ const nextConfig = {
1416
output: "export",
1517
};
1618

17-
const withBundleAnalyzer = require("@next/bundle-analyzer")({
18-
enabled: process.env.ANALYZE === "true",
19+
const withBundleAnalyzer = createWithBundleAnalyzer({
20+
enabled: process.env.ANALYZE === "1",
1921
});
2022

21-
module.exports = withBundleAnalyzer(nextConfig);
23+
export default withBundleAnalyzer(nextConfig);

packages/ui/local-preview-bundle/tsconfig.json

+3-7
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,9 @@
44
"outDir": "./dist",
55
"rootDir": "."
66
},
7-
"exclude": [
8-
"node_modules"
9-
],
10-
"include": [
11-
"./src/**/*",
12-
".next/types/**/*.ts"
13-
],
7+
"exclude": ["node_modules"],
8+
"include": ["./src/**/*", ".next/types/**/*.ts"],
9+
"files": ["./next.config.ts"],
1410
"references": [
1511
{
1612
"path": "../../commons/core-utils"

0 commit comments

Comments
 (0)