Cherry picks from the 17.1.3 upgrade branch that ensure we are adding the @nx/node plugin dependency in the correct way:
@nx/node is no longer a package dependency for the @simondot/nx-firebase package
@simondotm/nx-firebase:init generator is called when creating a firebase application, and it now only adds @nx/node as a workspace dependency, but no longer attempts to run the @nx/node:init generator or add other @nx/node plugin dependencies (not necessary)
The @simondotm/nx-firebase:function generator does require that @nx/node is available in the workspace, since it imports it, but since firebase function projects have to generated after firebase apps, we are good
Since @simondotm/nx-firebase:function calls the @nx/node:app generator, it will internally call its own @nx/node:init generator which will bring any related Nx plugin it needs into the workspace at the correct nx version - eg. @nx/eslint, @nx/js, @nx/jest, @nx/esbuild
All of these changes should ensure the plugin has a smaller scope of concerns, and plays nicely with current & future Nx versions & workspaces.
😅
Note that @nx/linter was renamed to @nx/eslilnt at some point in the Nx release timeline, so I'm going to remove all checks for Nx packages unrelated to this plugin from unit & e2e tests; it's just too much hassle to keep on top of Nx changes.
Cherry picks from the 17.1.3 upgrade branch that ensure we are adding the @nx/node plugin dependency in the correct way:
@nx/node
is no longer a package dependency for the@simondot/nx-firebase
package@simondotm/nx-firebase:init
generator is called when creating a firebase application, and it now only adds@nx/node
as a workspace dependency, but no longer attempts to run the@nx/node:init
generator or add other@nx/node
plugin dependencies (not necessary)@simondotm/nx-firebase:function
generator does require that@nx/node
is available in the workspace, since it imports it, but since firebase function projects have to generated after firebase apps, we are good@simondotm/nx-firebase:function
calls the@nx/node:app
generator, it will internally call its own@nx/node:init
generator which will bring any related Nx plugin it needs into the workspace at the correct nx version - eg.@nx/eslint
,@nx/js
,@nx/jest
,@nx/esbuild
All of these changes should ensure the plugin has a smaller scope of concerns, and plays nicely with current & future Nx versions & workspaces. 😅
Note that
@nx/linter
was renamed to@nx/eslilnt
at some point in the Nx release timeline, so I'm going to remove all checks for Nx packages unrelated to this plugin from unit & e2e tests; it's just too much hassle to keep on top of Nx changes.A follow up PR will clean this up.
Also fixed a json format error in template