Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

what could be a deployment strategy with pubspec on dart

Tags:

dart

What would be the best way to actually deploy dart code that has pubspec.yaml dependencies? A common thing I've done in the past was to create demos and deploy to github pages. Now that pub uses symbolic links the dependencies do not get pushed to github. Also wondering if this should be a bug to file for pub, being able to deploy with dependencies.

like image 229
adam-singer Avatar asked Sep 09 '12 05:09

adam-singer


People also ask

What is a Pubspec file in Dart?

Every pub package needs some metadata so it can specify its dependencies. Pub packages that are shared with others also need to provide some other information so users can discover them. All of this metadata goes in the package's pubspec: a file named pubspec.

What is the purpose of Pubspec yaml?

The pubspec is written in YAML, which is human readable, but be aware that white space (tabs v spaces) matters. The pubspec file specifies dependencies that the project requires, such as particular packages (and their versions), fonts, or image files.

Should I commit my Pubspec lock file?

For application packages, we recommend that you commit the pubspec. lock file. Versioning the pubspec. lock file ensures changes to transitive dependencies are explicit.

Where is Pubspec yaml in flutter?

yaml" file is inside "test" folder, while you're running the "flutter pub get" command inside the "mobile" folder. Try moving that file from inside of "test" folder to the "mobile" folder; where your "lib", "ios", "android" folders are. Then only "flutter pub get" command will work.


1 Answers

We aren't there yet, but pub will in the future support a deploy command. That will do things like run dart2js and concatenate/minify your code. It will also physically bring in all of your dependencies so you don't have symlinks. The end result will be a single directory that contains everything your package needs to run.

like image 92
munificent Avatar answered Oct 06 '22 15:10

munificent