Skip to content

Commit

Permalink
Fix typescript errors in template
Browse files Browse the repository at this point in the history
  • Loading branch information
Heiner Pöpping committed Dec 3, 2024
1 parent f837e59 commit 3bf6a26
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 12 deletions.
1 change: 1 addition & 0 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,7 @@ async function createChaynsApp({
fs.mkdirSync(path.join(destination, '/src/types'));
}
await copyFile(getTemplatePath(`../templates/api-v5/shared/ts/src/types/global.d.ts`), path.join(destination, '/src/types/global.d.ts'));
await copyFile(getTemplatePath(`../templates/api-v5/shared/ts/src/types/environment.d.ts`), path.join(destination, '/src/types/environment.d.ts'));
}

const fileDestination = path.join(destination, 'toolkit.config.js');
Expand Down
9 changes: 9 additions & 0 deletions templates/api-v5/shared/ts/src/types/environment.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
declare namespace NodeJS {
interface ProcessEnv {
PUBLIC_BUILD_ENV: string;
PUBLIC_BUILD_VERSION: string;

/* add custom env variables here */
PUBLIC_YOUR_WEBAPI_URL: string;
}
}
11 changes: 0 additions & 11 deletions templates/api-v5/shared/ts/src/types/global.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,3 @@ declare module '*.svg?url' {
const value: string;
export = value;
}

interface ImportMetaEnv {
PUBLIC_BUILD_ENV: string;
PUBLIC_BUILD_VERSION: string;

/* add custom env variables here */
}

interface ImportMeta {
readonly env: ImportMetaEnv
}
1 change: 0 additions & 1 deletion templates/api-v5/shared/ts/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
],
"moduleResolution": "Node",
"target": "ES2020",
"module": "ES2020",
"noEmit": true,
"skipLibCheck": true,
"strict": true
Expand Down

0 comments on commit 3bf6a26

Please sign in to comment.