From 27f4d504281d13634fd7edaf137586446d8c6740 Mon Sep 17 00:00:00 2001 From: Roberto Raggi Date: Fri, 22 Sep 2023 12:58:38 +0200 Subject: [PATCH] fix: Copy cxx-js.d.ts to the build output directory --- packages/cxx-frontend/scripts/build.js | 3 ++- packages/cxx-frontend/src/cxx-js.d.ts | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/packages/cxx-frontend/scripts/build.js b/packages/cxx-frontend/scripts/build.js index 7570ed66..528a3ea2 100644 --- a/packages/cxx-frontend/scripts/build.js +++ b/packages/cxx-frontend/scripts/build.js @@ -40,8 +40,9 @@ async function main() { await $`cp ${projectRootSourcePath}/README.md .`; await $`cp ${projectRootSourcePath}/CHANGELOG.md .`; await $`cp ${projectRootSourcePath}/build.em/src/js/cxx-js.js src`; - await $`mkdir -p dist/wasm/`; + await $`mkdir -p dist/wasm/ dist/dts/`; await $`cp ${projectRootSourcePath}/build.em/src/js/cxx-js.wasm dist/wasm`; + await $`cp ${cxxFrontendSourcePath}/src/*.d.ts dist/dts/`; await $`npm exec --package-typescript tsc`; /** @type{esbuild.BuildOptions} */ diff --git a/packages/cxx-frontend/src/cxx-js.d.ts b/packages/cxx-frontend/src/cxx-js.d.ts index 1edc08cb..2abfb28e 100644 --- a/packages/cxx-frontend/src/cxx-js.d.ts +++ b/packages/cxx-frontend/src/cxx-js.d.ts @@ -77,7 +77,7 @@ interface Lexer { tokenText(): string; } -export interface CXX { +export type CXX = { Control: Control; DiagnosticsClient: DiagnosticsClient; Preprocessor: Preprocessor; @@ -99,7 +99,7 @@ export interface CXX { getEndLocation(handle: number, unitHandle: number): SourceLocation; getLiteralValue(handle: number): string | undefined; getIdentifierValue(handle: number): string | undefined; -} +}; export default function ({ wasm,