Skip to content

Commit 3aed6ee

Browse files
committed
fix(types): temporary fix for projects using older typescript versions
1 parent c470b85 commit 3aed6ee

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

scripts/collection-copy.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,17 @@ async function collectionCopy(rootDir: string) {
1010

1111
// we don't to copy the src svgs to collection
1212
await fs.remove(join(rootDir, 'dist', 'collection', 'svg'));
13+
14+
// this is temporary!!!!
15+
// removing the `type` from the d.ts export
16+
// to make it easier for users migrating between
17+
// of older versions of angular and typescript
18+
// to the newer verisons, where the `type` keyword
19+
// is used. This is a megahack, no doubt.
20+
const typesDist = join(rootDir, 'dist', 'types', 'index.d.ts');
21+
let types = await fs.readFile(typesDist, 'utf8');
22+
types = types.replace('export type', 'export');
23+
await fs.writeFile(typesDist, types);
1324
}
1425

1526
collectionCopy(join(__dirname, '..'));

0 commit comments

Comments
 (0)