Skip to content

Commit

Permalink
Fix node env types
Browse files Browse the repository at this point in the history
  • Loading branch information
mkleszcz committed May 3, 2023
1 parent b688387 commit 3370170
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 4 deletions.
6 changes: 6 additions & 0 deletions packages/api-client/env.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
namespace NodeJS {
interface ProcessEnv {
NODE_ENV: string;
NEXT_PUBLIC_BASE_API_URL: string;
}
}
3 changes: 2 additions & 1 deletion packages/api-client/helpers.ts
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
export const apiURL = (value: string) => process.env.NEXT_PUBLIC_BASE_API_URL + value;
const PUBLIC_BASE_API_URL = process.env.NEXT_PUBLIC_BASE_API_URL ?? '/api';
export const apiURL = (value: string) => PUBLIC_BASE_API_URL + value;
2 changes: 1 addition & 1 deletion packages/api-client/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"noFallthroughCasesInSwitch": true
},
"files": [],
"include": [],
"include": ["env.d.ts"],
"references": [
{
"path": "./tsconfig.lib.json"
Expand Down
5 changes: 4 additions & 1 deletion packages/graphql/schema/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import { GraphQLSchema } from 'graphql/type';

import { builder } from '../builder';
import '../types';
import './environment';
Expand All @@ -6,4 +8,5 @@ import './service';
import './serviceVersion';
import './version';

export default builder.toSchema();
const schema: GraphQLSchema = builder.toSchema();
export default schema;
5 changes: 5 additions & 0 deletions packages/prisma/env.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
namespace NodeJS {
interface ProcessEnv {
NODE_ENV: string;
}
}
2 changes: 1 addition & 1 deletion packages/prisma/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"noFallthroughCasesInSwitch": true
},
"files": [],
"include": [],
"include": ["env.d.ts"],
"references": [
{
"path": "./tsconfig.lib.json"
Expand Down

0 comments on commit 3370170

Please sign in to comment.