Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
module.exports = {
preset: 'ts-jest',
testEnvironment: 'jsdom',
setupFiles: ['<rootDir>/setupJest.js'],
testPathIgnorePatterns: [
'<rootDir>/node_modules/',
'<rootDir>/*.js',
Expand Down
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,9 @@
"prettier": "^3.4.2",
"semantic-release": "^24.2.1",
"ts-jest": "^29.2.5",
"typescript": "^5.7.3"
"typescript": "^5.7.3",
"ts-node": "^10.9.2",
"whatwg-fetch": "^3.6.20"
},
"peerDependencies": {
"next": "^14",
Expand Down
1 change: 1 addition & 0 deletions setupJest.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
const fetch = require("whatwg-fetch")
4 changes: 2 additions & 2 deletions src/provider/public-env-provider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ type PublicEnvProviderProps = PropsWithChildren;
* </PublicEnvProvider>
* ```
*/
export const PublicEnvProvider: FC<PublicEnvProviderProps> = async ({
export const PublicEnvProvider: FC<PublicEnvProviderProps> = ({
children,
}) => {
await connection(); // Opt into dynamic rendering
connection(); // Opt into dynamic rendering

// This value will be evaluated at runtime
const publicEnv = getPublicEnv();
Expand Down
4 changes: 2 additions & 2 deletions src/script/public-env-script.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ type PublicEnvScriptProps = {
* </head>
* ```
*/
export const PublicEnvScript: FC<PublicEnvScriptProps> = async ({ nonce }) => {
await connection(); // Opt into dynamic rendering
export const PublicEnvScript: FC<PublicEnvScriptProps> = ({ nonce }) => {
connection(); // Opt into dynamic rendering

// This value will be evaluated at runtime
const publicEnv = getPublicEnv();
Expand Down
5 changes: 3 additions & 2 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,9 @@
"strict": true,
"target": "es2022",
"rootDir": "src",
"outDir": "build"
"outDir": "build",
"skipLibCheck": true
},
"include": ["src/**/*.ts", "src/**/*.tsx"],
"include": ["next-env.d.ts", "src/**/*.ts", "src/**/*.tsx"],
"exclude": ["node_modules", "**/__mocks__/*.ts", "**/*.spec.ts"]
}