Skip to content

Commit

Permalink
tweak build stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
josephjclark committed Nov 3, 2024
1 parent 870ac36 commit 9006d54
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 10 deletions.
2 changes: 2 additions & 0 deletions packages/fhir-ndr-et/.prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
types
src/builders.js
15 changes: 10 additions & 5 deletions packages/fhir-ndr-et/build/build.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,19 +30,24 @@ const generate = async () => {
await mkdir('dist', { recursive: true });
await mkdir('types', { recursive: true });

await writeFile('types/builders.d.ts', withDisclaimer(dts));


await writeFile('src/builders.js', withDisclaimer(src));

const args = [
'--allowJs',
'--declaration',
'--emitDeclarationOnly',
'--lib es2020',
`--declarationDir ${path.resolve('types')}`,
];

// Now build typings for index and utils
exec(`pnpm exec tsc ${args.join(' ')} src/index.ts`);
exec(`pnpm exec tsc ${args.join(' ')} src/index.ts`, {}, () => {
setTimeout(async () => {
// Overwrite builders.d.ts because typescript makes a mess of it
await writeFile('types/builders.d.ts', withDisclaimer(dts));
}, 500)
});

};
generate();
5 changes: 0 additions & 5 deletions packages/fhir-ndr-et/types/builders.d.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@

// THIS FILE WAS AUTO-GENERATED
// DO NOT MAKE CHANGES MANUALLY OR THEY WILL BE LOST
// SEE THE README FILE FOR DETAILS


// THIS FILE WAS AUTO-GENERATED
// DO NOT MAKE CHANGES MANUALLY OR THEY WILL BE LOST
// SEE THE README FILE FOR DETAILS
Expand Down

0 comments on commit 9006d54

Please sign in to comment.