toolsplus / nx-forge

Atlassian Forge plugin for Nx
https://toolsplus.github.io/nx-forge/
MIT License
17 stars 4 forks source link

Missing dependencies and peer conflicts #61

Closed dpsthree closed 5 months ago

dpsthree commented 5 months ago

I tried setting up a project this afternoon and had to do some work to figure out dependencies. Following the directions of the readme I ran into the following issues:

While the last step makes sense from a "standard NX usage point of view", it was still missing something I had to just know to follow the getting started guide. There are probably other versions of nx and associated tools that would have worked, but 16.10.0 was easy to standardize on.

dpsthree commented 5 months ago

Choosing Vite as my build tool also seemed to create some getting-started friction. I had to manually remove the base href in index.html despite including the baseHref in the build options. I also needed to add "base: './'," to the vite config so that it produces relative paths for resource bundles.

tbinna commented 5 months ago

Thanks for the report, @dpsthree. Some of these issues should be fixed in the beta branch that includes updates for Nx 17.

Lock the versions of nx, @nrwl/workspace, and @nx/node to 16.10.0 to remove peer dependency warnings.

I created #62 to keep track of this.

Manually install @nx/devkit with fixed version 16.10.0.

This should be fixed in the beta branch.

After generating a project and app I had to add @nx/react to the project manually.

This is not required if you want to write a Forge app without Custom UI. For Custom UI apps the step here includes installing the @nx/react. Do you think this should be mentioned somewhere else?

I have never tested this with a vite build target but the required changes that you described sound quite similar to the steps documented here. I guess we could have a section in the docs to describe the steps required to configure different builders (webpack, vite) for Custom UI projects. I created #63 if you would like to have a go at this.

If you want to test the Nx 17/beta branch, you can migrate nx to the latest 17 version following the Nx guide and then nx migrate @toolsplus/nx-forge@3.0.0-beta.3 (there may be a way to run these two commands in one go but I am not sure how).

dpsthree commented 5 months ago

This is not required if you want to write a Forge app without Custom UI. For Custom UI apps the step here includes installing the @nx/react. Do you think this should be mentioned somewhere else?

I probably just missed that line. Thanks

I have never tested this with a vite build target but the required changes that you described sound quite similar to the steps documented here. I guess we could have a section in the docs to describe the steps required to configure different builders (webpack, vite) for Custom UI projects. I created #63 if you would like to have a go at this.

I'm struggling with several issues related to Nx 16 and Vite that are not related to this plugin. I think I will try the 17 branch for a bit before looking further down this path.

If you want to test the Nx 17/beta branch, you can migrate nx to the latest 17 version following the Nx guide and then nx migrate @toolsplus/nx-forge@3.0.0-beta.3 (there may be a way to run these two commands in one go but I am not sure how).

I'm working with a new project so I will try a fresh install.

dpsthree commented 5 months ago

Working through this a second time with the beta branch was a lot smoother. There was still one adjustment that I had to make. It was necessary to remove the base href from the index file of the client application.

tbinna commented 5 months ago

Closing this issue. Most of the mentioned points should be covered in nx-forge@3.0.0. The items not covered in the release have separate issues.