smapiot / piral

🚀 Framework for next generation web apps using micro frontends. ⭐️ Star to support our work!
https://piral.io
MIT License
1.68k stars 125 forks source link

The index.d.ts of a Pilet Is Placed In dist #658

Closed FlorianRappl closed 9 months ago

FlorianRappl commented 9 months ago

Bug Report

For more information, see the CONTRIBUTING guide.

Prerequisites

Environment Details and Version

Ubuntu, Piral CLI 1.4.1

Description

When a new pilet is scaffolded using npm init pilet@latest the generated (via postinstall) declaration is empty (expected) and located in the project's root folder (instead of the dist) folder. I thin this only happens on scaffolding.

Steps to Reproduce

  1. Scaffold a new pilet
  2. Look in the pilet's root folder

Expected behavior

Either nothing (since the pilet.d.ts is anyway empty) should be generated, or an empty file in the dist folder.

Actual behavior

The file is generated in the root folder.

Possible Origin/Solution

I think that the dist is not yet given as the previous "version" of the package.json did not have a proper main specified. Thus, it falls back to the root directory.