After running through the analysis tool in Dart Editor I am fairly confident that my code is ready for M1 usage. In other words, I think Hipster MVC is ready for Dart Pub, the dart package system.
In the grand tradition of minimum viable products, creating a Dart Pub project is a manual request to the Dart Team. But it requires a few things first:
- Conform your packages to the pub package layout.
- Ensure you have a valid pubspec.yaml file.
- Pick an OSS license and correctly add it to your package. If you don't have one, you can always use Dart's BSD-style license.
- Host your source code in a public location so we can retrieve it.
- Add dartdocs so people can easily use your libraries.
- Update your README to contain a getting started guide.
➜ hipster-mvc git:(master) tree -I docs . ├── HipsterCollection.dart ├── HipsterHistory.dart ├── HipsterModel.dart ├── HipsterRouter.dart ├── HipsterSync.dart ├── HipsterView.dart ├── main.dart └── README.asciidocTo conform to the Dart Pub layout (item #1 in the checklist), I need to move all of that into a lib sub-directory:
➜ hipster-mvc git:(master) mkdir lib ➜ hipster-mvc git:(master) git mv *.dart lib ➜ hipster-mvc git:(master) ✗ git ci -m "Move all code into lib directory" -a [master 5aa2bac] Move all code into lib directory 7 files changed, 0 insertions(+), 0 deletions(-) rename HipsterCollection.dart => lib/HipsterCollection.dart (100%) rename HipsterHistory.dart => lib/HipsterHistory.dart (100%) rename HipsterModel.dart => lib/HipsterModel.dart (100%) rename HipsterRouter.dart => lib/HipsterRouter.dart (100%) rename HipsterSync.dart => lib/HipsterSync.dart (100%) rename HipsterView.dart => lib/HipsterView.dart (100%) rename main.dart => lib/main.dart (100%) ➜ hipster-mvc git:(master) gp origin master Counting objects: 4, done. Delta compression using up to 4 threads. Compressing objects: 100% (3/3), done. Writing objects: 100% (3/3), 563 bytes, done. Total 3 (delta 0), reused 0 (delta 0) To email@example.com:eee-c/hipster-mvc.git 425979e..5aa2bac master -> masterFor #2, I need a
pubspec.yaml. There is not too much to these files, this should suffice:
name: hipster-mvc version: 0.1.0 description: Dart-based MVC framework author: Chris StromI already have the license information in the README (#3). Since the code has always been on GitHub, it is available (#4). I have dartdocs in the code and make it available in the respository: http://eee-c.github.com/hipster-mvc/ (#5). I add brief getting started instructions to the README (#6), which should take care of everything.
With that, I submit a ticket to get the package manually added to pub.dartlang.org. Fingers crossed!