From 62a56ba4a27c914b1dd068d95b98eb88b39545af Mon Sep 17 00:00:00 2001 From: Christian Llontop Date: Tue, 3 Sep 2024 23:01:26 -0500 Subject: [PATCH] Generate type declarations for parser package --- packages/parser/package.json | 1 + packages/parser/rspack.config.js | 4 ++-- packages/parser/tsconfig.json | 1 + packages/parser/tsconfig.types.json | 6 ++++++ 4 files changed, 10 insertions(+), 2 deletions(-) create mode 100644 packages/parser/tsconfig.types.json diff --git a/packages/parser/package.json b/packages/parser/package.json index 86a6cb3..30246e7 100644 --- a/packages/parser/package.json +++ b/packages/parser/package.json @@ -16,6 +16,7 @@ } }, "scripts": { + "build:types": "tsc --project tsconfig.types.json", "build": "rspack build", "lint": "biome format", "lint:fix": "biome format --write" diff --git a/packages/parser/rspack.config.js b/packages/parser/rspack.config.js index bb3e3e2..3d062cd 100644 --- a/packages/parser/rspack.config.js +++ b/packages/parser/rspack.config.js @@ -1,5 +1,5 @@ -import { fileURLToPath } from 'url'; -import { dirname, resolve } from 'path'; +import { fileURLToPath } from "url"; +import { dirname, resolve } from "path"; import { defineConfig } from "@rspack/cli"; const __filename = fileURLToPath(import.meta.url); diff --git a/packages/parser/tsconfig.json b/packages/parser/tsconfig.json index 110fa97..93cbef0 100644 --- a/packages/parser/tsconfig.json +++ b/packages/parser/tsconfig.json @@ -12,6 +12,7 @@ "isolatedModules": true, "jsx": "preserve", "allowSyntheticDefaultImports": true, + "declaration": true, "sourceMap": true, "outDir": "./dist", "baseUrl": "./", diff --git a/packages/parser/tsconfig.types.json b/packages/parser/tsconfig.types.json new file mode 100644 index 0000000..a4930c1 --- /dev/null +++ b/packages/parser/tsconfig.types.json @@ -0,0 +1,6 @@ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "emitDeclarationOnly": true + } +}