nuxt / module-builder

Complete solution to build and ship Nuxt modules.
MIT License
211 stars 22 forks source link

Empty `.d.ts` files generated when referencing internal TypeScript definitions during `nuxt-module-build build` #285

Open chadwickellis opened 2 weeks ago

chadwickellis commented 2 weeks ago

Problem

When using nuxt-module-build build, empty .d.ts files are generated if internal TypeScript interfaces are referenced.

Steps to Reproduce

  1. Open the StackBlitz reproduction
  2. Run the dev:prepare command
  3. Run the prepack command

Expected Behavior

The .d.ts files should contain the expected type definitions without being empty.

Actual Behavior

The .d.ts files are empty when internal TypeScript interfaces are referenced.

chadwickellis commented 2 weeks ago

By downgrading @nuxt/kit, @nuxt/schema, and nuxt to version 3.11.x and locking @nuxt/module-builder to version 0.7.0, the nuxt-module-build build command no longer generates empty .d.ts files:

{
  "dependencies": {
-    "@nuxt/kit": "^3.12.1",
+    "@nuxt/kit": "~3.11.2"
  },
  "devDependencies": {
-    "@nuxt/module-builder": "^0.7.0",
-    "@nuxt/schema": "^3.12.1",
-    "nuxt": "^3.12.1",
+    "@nuxt/module-builder": "0.7.0",
+    "@nuxt/schema": "~3.11.2",
+    "nuxt": "~3.11.2"
  }
}

You can see a StackBlitz reproduction.