nrwl / nx

Smart Monorepos · Fast CI
https://nx.dev
MIT License
23.77k stars 2.37k forks source link

[Vite] Invalid published package using project.json files #28687

Open gperdomor opened 3 weeks ago

gperdomor commented 3 weeks ago

Current Behavior

Packages bundled with vite are published without compiled code, only package.json file

Expected Behavior

Package should be published and ready to use with all the compiled code

GitHub Repo

No response

Steps to Reproduce

  1. Create an empty workspace
  2. Create a library using vite as bundler and project.json file
  3. Run local registry
  4. Run the publish target
  5. Download and decompress tgz file from verdaccio
  6. Check the sources :(

Nx Report

nx report

NX Report complete - copy this into the issue template

Node : 22.10.0 OS : darwin-x64 Native Target : x86_64-macos npm : 10.9.0

nx (global) : 20.0.6 nx : 20.0.6 @nx/js : 20.0.6 @nx/eslint : 20.0.6 @nx/workspace : 20.0.6 @nx/devkit : 20.0.6 @nx/eslint-plugin : 20.0.6 @nx/vite : 20.0.6 @nx/web : 20.0.6 typescript : 5.5.4

Registered Plugins: @nx/js/typescript @nx/vite/plugin @nx/eslint/plugin

Failure Logs

No response

Package Manager Version

No response

Operating System

Additional Information

I also created two vite libraries, one with project.json file and the other without them and I notice this behavior:

xiongemi commented 3 weeks ago

i tried it locally that i could see the compiled code. here are my steps:

what does your project.json look like? what does your release-publish target look like?

gperdomor commented 2 weeks ago

@xiongemi check this repo to reproduce it... It's a fresh repo and I created the libs using nx console

Here you can see the builded code for both libs Image

Both are published without issues Image

Then I downloaded and uncompress the files... This is the result Image

lib-b (vite + project.json) only includes package.json and readme

gperdomor commented 1 week ago

Hi folks... Did you was able to check this? @xiongemi @AgentEnder