The configuration library for AcDart provides support for managing configuration for different environments. In particular it has direct support for production and development enviroments with as much defaulting as possible (in development mode) to make set up as easy as possible.
Instead of relying on text files (such as property files, YAML, JSON etc) the library instead uses Dart based configuration. Thanks to Dart's concise syntax and the fact that it is not a compiled language there is not much downside to this approach.
In the upside, using Dart allows for code completion, tool support for catching typos, refactoring etc.
This library can be used on it's own (e.g. as part of your own custom Dart based Atlassian Connect client framework) or as part of the Atlassian Connect Shelf based server.
The following shows an example of setting up configuration for development and production.
final config = new AcDartConfigFactory.standard( new AcDartConfig( addonKey: 'foo-bar-addon', repoConfig: new AcDartHostRepoConfig.mongo() ), development: () => new AcDartConfig.development(), production: () => new AcDartConfig());
This configuration relies on the default values and will run in development.
From there you can start to tweak settings as you like. For example
development: () => new AcDartConfig.development( installAddonOnStartup: false, repoConfig: new AcDartHostRepoConfig.mongo(dbUrl: AcDartHostRepoConfig.defaultTestMongoUrlStr) ),
will turn off the auto installation of the addon and use mongo on the default test url for development (instead of in memory which is the default).
Add this to your package's pubspec.yaml file:
dependencies: atlassian_connect_config: ^0.4.2
You can install packages from the command line:
$ pub get
Alternatively, your editor might support
Check the docs for your editor to learn more.
Now in your Dart code, you can use:
|0.4.2||Jul 14, 2015|
|0.4.1||Jul 14, 2015|
|0.3.6||Dec 12, 2014|
|0.3.5||Dec 4, 2014|
|0.3.4||Sep 15, 2014|
|0.3.3+1||Aug 13, 2014|
|0.3.3||Aug 13, 2014|
|0.3.2||Jul 8, 2014|
|0.3.1||Jun 3, 2014|
|0.3.0||Apr 30, 2014|
Describes how popular the package is relative to other packages. [more]
Code health derived from static analysis. [more]
Reflects how tidy and up-to-date the package is. [more]
Weighted score of the above. [more]
The package version is not analyzed, because it does not support Dart 2. Until this is resolved, the package will receive a health and maintenance score of 0.
Support Dart 2 in
The SDK constraint in
pubspec.yaml doesn't allow the Dart 2.0.0 release. For information about upgrading it to be Dart 2 compatible, please see https://www.dartlang.org/dart-2#migration.
dartdoc successfully runs on your package's source files. (-10 points)
Dependencies were not resolved.
|Dart SDK||>=1.2.0 <2.0.0|