Skip to content

Commit

Permalink
Add override for import types (#9)
Browse files Browse the repository at this point in the history
Move `@mappable-world/mappable-types/import` override to generated
package part from example.
  • Loading branch information
matthew44-mappable committed Mar 18, 2024
1 parent bb30e24 commit 3f66dab
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 8 deletions.
2 changes: 1 addition & 1 deletion template/example/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"compilerOptions": {
"strict": false,
"rootDirs": ["./", "../"],
"types": ["./types.d.ts"]
"types": ["./types.d.ts", "../types/index.d.ts"]
},
"include": ["./**/*.ts", "./**/*.tsx"]
}
6 changes: 0 additions & 6 deletions template/example/types.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,4 @@ declare global {
}
}

declare module '@mappable-world/mappable-types/import' {
interface Import {
(pkg: '%PACKAGE_NAME%'): Promise<typeof import('../src/index')>;
}
}

export {};
2 changes: 1 addition & 1 deletion template/t_ttsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"extends": ["@mappable-world/mappable-cli"],
"compilerOptions": {
"lib": ["dom", "dom.iterable", "esnext"],
"typeRoots": ["./node_modules/@types", "./node_modules/@mappable-world"]
"typeRoots": ["./node_modules/@types", "./node_modules/@mappable-world", "./types"]
},
"include": ["./src", "./node_modules/@mappable-world/mappable-cli/index.d.ts"]
}
7 changes: 7 additions & 0 deletions template/types/index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
declare module '@mappable-world/mappable-types/import' {
interface Import {
(pkg: '%PACKAGE_NAME%'): Promise<typeof import('../src/index')>;
}
}

export {};

0 comments on commit 3f66dab

Please sign in to comment.