Skip to content

Commit

Permalink
fix: Copy cxx-js.d.ts to the build output directory
Browse files Browse the repository at this point in the history
  • Loading branch information
robertoraggi committed Sep 22, 2023
1 parent b4d9922 commit 27f4d50
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion packages/cxx-frontend/scripts/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -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} */
Expand Down
4 changes: 2 additions & 2 deletions packages/cxx-frontend/src/cxx-js.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ interface Lexer {
tokenText(): string;
}

export interface CXX {
export type CXX = {
Control: Control;
DiagnosticsClient: DiagnosticsClient;
Preprocessor: Preprocessor;
Expand All @@ -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,
Expand Down

0 comments on commit 27f4d50

Please sign in to comment.