tinesoft / nxrocks

Set of Nx plugins to enhance your Nx workspace (even more!)
MIT License
307 stars 34 forks source link

[Feature] Flutter Pub Command #234

Closed denny99 closed 1 month ago

denny99 commented 1 month ago

Is your feature request related to a problem? Please describe

With the new fix i wanted to update our pipelines to use only nx commands to build our flutter app. The pipeline uses two commands that might not be possible right now with the plugin:

flutter pub run build_runner build flutter pub run flutter_launcher_icons:main

Describe the idea you'd like

It would be nice to be able to use the flutter pub command directly from nx

Describe alternatives you've considered

Right now im using a specific working directory to execute the pub commands. With multiple projects this won't work.

Additional context

No response

tinesoft commented 1 month ago

Done in https://github.com/tinesoft/nxrocks/releases/tag/nx-flutter%2Fv9.3.0 !

the syntax to run your pub commands above is:

$ nx pub-run your-flutterapp --executable="build_runner build"  
$ nx pub-run your-flutterapp --executable=flutter_launcher_icons:main 

or

$ nx run your-flutterapp:pub-run --executabe="build_runner build" 
$ nx run your-flutterapp:pub-run --executabe=flutter_launcher_icons:main 

💡 Note the "" around the first executable command, because it has spaces

See README.md for all the commands available

denny99 commented 1 month ago

Tine you're awesome! :)

But i think you broke the package for regular npm users.

npm ERR! code EUNSUPPORTEDPROTOCOL npm ERR! Unsupported URL Type "workspace:": workspace:*

Might be related to your changes of the dependencies

tinesoft commented 1 month ago

Oh shout!

The release process was supposed to replace those "workspace:*" references, by the actual version of internal packages used by the plugin... I must have missed something in the config.

Ok thank you for letting me know (didn't catch that during my e2e) I'll try to fix that tonight, when I have access to my dev machine again.

tinesoft commented 1 month ago

Which package manager are you using? if not NPM Is the installation working for that package manager ?

denny99 commented 1 month ago

 ERR_PNPM_WORKSPACE_PKG_NOT_FOUND  In : "@nxrocks/common@workspace:*" is in the dependencies but no package named "@nxrocks/common" is present in the workspace    This is the error with pnpm.  

denny99 commented 1 month ago

Yarn is smart enough to ask me, which versions i want to use, as it cannot resolve the version either

tinesoft commented 1 month ago

FIxed in latest https://github.com/tinesoft/nxrocks/releases/tag/nx-flutter%2Fv9.3.1