Hi all,
Some time ago I made this video about how to easily clone a dartpad in webstorm:
Now dartpad stores their snippet as gist, and as gist allow only a flat project structure, every dartpad has a flat structure. With the following files:
index.html, main.dart and styles.css.
Now the problem is that, pub doesn't really seem to support this structure. So if you are going to include packages, and transformers, things become a bit less easy then as this video suggests.
This is because `pub serve .` won't work. Webstorm does some magic however, at least in Webstorm 10, I could get any kind of snippet to work.
/usr/local/opt/dart/libexec/bin/pub serve packages --port=63372
Loading source assets...
Serving angular2.angular2_NgIf packages on http://localhost:63372
Build completed successfully
[packages] GET /angular2/src/reflection/reflection.dart => angular2.angular2_NgIf|packages/angular2/src/reflection/reflection.dart
[packages] GET /angular2/src/reflection/reflection_capabilities.dart => angular2.angular2_NgIf|packages/angular2/src/reflection/reflection_capabilities.dart
[packages] GET /angular2/angular2.dart => angular2.angular2_NgIf|packages/angular2/angular2.dart
[packages] GET /angular2/src/reflection/reflector.dart => angular2.angular2_NgIf|packages/angular2/src/reflection/reflector.dart
[packages] GET /angular2/src/reflection/types.dart => angular2.angular2_NgIf|packages/angular2/src/reflection/types.dart
[packages] GET /angular2/src/reflection/platform_reflection_capabilities.dart => angular2.angular2_NgIf|packages/angular2/src/reflection/platform_reflection_capabilities.dart
But now in Webstorm 11, this doesn't work, as there is no packages directory anymore.
I think it would be great if pub would support something like `pub serve .` or maybe some convention like `pub serve dartpad` or `pub serve gist`.
This is just so that people can easily share code. So if someone at slack ask, "hi all, how I could I setup oauth2 github authencitation with only client side code in dart?"
Clone it in your editor, and it will run out of the box.
I'm trying to setup some kind of community driven dart cookbook, and this website also uses gists as backend with the same convention as dartpad (index.html/main.dart/styles.css).
I want to make sure every snippet on this website pass the following quality standard: "every dartpad/gist will run directly out of the box in your editor."
I can only make this promise, if dart allows to run a flat structure