Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem with lib build #87

Open
2 of 3 tasks
xxxKOTxxx opened this issue Mar 20, 2023 · 3 comments
Open
2 of 3 tasks

Problem with lib build #87

xxxKOTxxx opened this issue Mar 20, 2023 · 3 comments

Comments

@xxxKOTxxx
Copy link

xxxKOTxxx commented Mar 20, 2023

Hello.

At first I want to thank You for this plugin!

I'm just researching Nx for handling components library monorepo and found that in my Vue3 library dist apsent package.json file. It's also missing in generated library folder. I added it manually, but it's not copied by builder to related dist folder.

In React and TS library it's present, but not in Vue one. First idea was that it's missing because of Vite buildling in development mode by default, but changing configuration to production does not solved an issue.

I have an idea to copy file manually but it looks "hacky". I beleave there is prettier solution. Maybe I missing something or doing something wrong because of lack of expirience with Nx?

Can You help me or suggest some workaround?

Tasks

  • Copy project package.json to dist in app/lib build executore
  • Add support for project package.json in library generator
    • Add --publishable flag to library generator (--importPath may be necessary as well)
  • Add E2E test in e2e/vue3-vite-e2e/tests/library.spec.ts
@sampullman
Copy link
Contributor

This plugin was created before Nx supported package.json in individual projects. I thought we added support for that a few months ago, but none of our projects use that feature, and I don't see an E2E test for it.

Supporting package.json should not be too difficult, but might take some time.

@sampullman
Copy link
Contributor

Sorry for the delay! We're not 100% sure how to fix this perfectly yet, but will need it soon in our own projects as well.

I added it manually, but it's not copied by builder to related dist folder.

This part will be fixed tomorrow, and further improvements should come soon.

sampullman pushed a commit that referenced this issue Apr 7, 2023
fix: nx version issue
fix: e2e test string match
sampullman pushed a commit that referenced this issue Apr 7, 2023
fix: nx version issue
fix: e2e test string match
@sampullman
Copy link
Contributor

A fix for this was just released in 0.24.0, we'll keep this issue open as a reminder that project package.json handling can still be improved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants