From 9006d548a44054362b7bb0e1f7bf547a3c7e0e89 Mon Sep 17 00:00:00 2001 From: Joe Clark Date: Sun, 3 Nov 2024 10:09:06 +0000 Subject: [PATCH] tweak build stuff --- packages/fhir-ndr-et/.prettierignore | 2 ++ packages/fhir-ndr-et/build/build.ts | 15 ++++++++++----- packages/fhir-ndr-et/types/builders.d.ts | 5 ----- 3 files changed, 12 insertions(+), 10 deletions(-) create mode 100644 packages/fhir-ndr-et/.prettierignore diff --git a/packages/fhir-ndr-et/.prettierignore b/packages/fhir-ndr-et/.prettierignore new file mode 100644 index 000000000..0411e7253 --- /dev/null +++ b/packages/fhir-ndr-et/.prettierignore @@ -0,0 +1,2 @@ +types +src/builders.js \ No newline at end of file diff --git a/packages/fhir-ndr-et/build/build.ts b/packages/fhir-ndr-et/build/build.ts index c79f67aff..01a3d8025 100644 --- a/packages/fhir-ndr-et/build/build.ts +++ b/packages/fhir-ndr-et/build/build.ts @@ -30,10 +30,9 @@ 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', @@ -41,8 +40,14 @@ const generate = async () => { '--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(); diff --git a/packages/fhir-ndr-et/types/builders.d.ts b/packages/fhir-ndr-et/types/builders.d.ts index f1a330c7f..1c982067a 100644 --- a/packages/fhir-ndr-et/types/builders.d.ts +++ b/packages/fhir-ndr-et/types/builders.d.ts @@ -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