Permalink
Browse files

feat(project): initial implementation

  • Loading branch information...
doktordirk committed Sep 11, 2016
1 parent f231675 commit 04dc1e6353ae05f8362102b75f76cdd1ff53c237
@@ -0,0 +1,14 @@
# EditorConfig is awesome: http://EditorConfig.org
# top-most EditorConfig file
root = true
# Unix-style newlines with a newline ending every file
[*]
end_of_line = lf
insert_final_newline = true
# 2 space indentation
[**.*]
indent_style = space
indent_size = 2
@@ -0,0 +1,4 @@
{
"extends": "./node_modules/spoonx-tools/.eslintrc.json",
"rules": {}
}
@@ -0,0 +1,6 @@
node_modules
jspm_packages
bower_components
.idea
.DS_STORE
build/reports
@@ -0,0 +1,3 @@
jspm_packages
bower_components
.idea
@@ -0,0 +1,24 @@
{
"output": true,
"plugins": {
"lint": {
"maximum-line-length": false,
"heading-style": "atx",
"no-duplicate-headings": false,
"no-undefined-references": false,
"no-shortcut-reference-link": false,
"no-heading-punctuation": ".,;:!",
"list-item-indent": false
}
},
"settings": {
"gfm": true,
"bullet": "*",
"closeAtx": false,
"fences": true,
"listItemIndent": "1",
"rule": "-",
"ruleRepetition": 10,
"ruleSpaces": false
}
}
@@ -0,0 +1,15 @@
language: node_js
node_js:
- '5.7.0'
before_install:
- npm install -g jspm
- jspm config registries.github.auth U3Bvb25YOjY2NWIxYWQ2ZTM4ZjUxZGNjMzcwNDBkYzMxYjgxZGVkZjE1M2RjYjg=
before_script:
- jspm -v
- jspm i
- export DISPLAY=:99.0
- sh -e /etc/init.d/xvfb start
notifications:
email:
on_success: change
on_failure: change
@@ -0,0 +1,5 @@
# Contributing
We'd love for you to contribute and to make this project even better than it is today!
If this interests you, please begin by reading our [contributing guidelines](https://github.com/SpoonX/about/blob/master/CONTRIBUTING.md).
The [contributing document](https://github.com/SpoonX/about/blob/master/CONTRIBUTING.md) will provide you with all the information you need to get started.
@@ -1,2 +1,82 @@
# aurelia-config
Configuration plugin that allows you to expose your configuration.
Aurelia-config is configuration loader and handler (using [homefront](https://www.npmjs.com/package/homefront)) that allows you to expose and centralize your configuration.
[![Gitter](https://img.shields.io/gitter/room/nwjs/nw.js.svg?maxAge=2592000?style=plastic)](https://gitter.im/SpoonX/Dev)
This library is an unofficial plugin for the [Aurelia](http://www.aurelia.io/) platform and simplifies plugin configuration by collecting them in a single place.
> To keep up to date on [Aurelia](http://www.aurelia.io/), please visit and subscribe to [the official blog](http://blog.durandal.io/). If you have questions, we invite you to [join us on Gitter](https://gitter.im/aurelia/discuss). If you would like to have deeper insight into our development process, please install the [ZenHub](https://zenhub.io) Chrome Extension and visit any of our repository's boards. You can get an overview of all Aurelia work by visiting [the framework board](https://github.com/aurelia/framework#boards).
## Overview
Sick of configuring every plugin separately, inconsistent naming and one plugin not knowing what the other does. Here comes the solution. One app config file for all your plugin. It works as follows:
At aurelia configuration you tell aurelia-config which plugin defaults it should load and the app config objects you want to merge into that sequentially. Then it (optionally) calls sequentially the plugin configurations on them with the (plugin namepsaced) merged settings.
The merged settings (as an instance of [homefront](https://www.npmjs.com/package/homefront)) can be easily accessed from everywhere in your app or your plugins. The usage of namespaces per plugins and a Configuration resolver even simplifies that.
- One config to rule them all
- Automatically load and merge plugin and app configs
- Namespaces and a Configuration resolver allow easier access of selected config segments
- All [homefront](https://www.npmjs.com/package/homefront) methods are available on the config instance.
## Used By
This library is used by plugins and applications.
## Uses
- [homefront](https://www.npmjs.com/package/homefront).
## Documentation
You can find usage examples and the documentation at [aurelia-config-doc](http://aurelia-config.spoonx.org/).
The [changelog](doc/changelog.md) provides you with information about important changes.
## Installation for plugin developers
Run `jspm i aurelia-config` from your plugin root resp. `npm i aurelia-config --save`.
## Installation for applications
### Aureli-Cli
Run `npm i aurelia-config --save` from your project root.
Aurelia-config makes use [homefront](https://www.npmjs.com/package/homefront). So, add following to the `build.bundles.dependencies` section of `aurelia-project/aurelia.json`.
```js
"dependencies": [
// ...
{
"name": "homefront",
"path": "../node_modules/homefront/dist",
"main": "index"
},
"aurelia-config",
// ...
],
```
### Jspm
Run `jspm i aurelia-config` from your project root.
Add `aurelia-config` to the `bundles.dist.aurelia.includes` section of `build/bundles.js`.
If the installation results in having forks, try resolving them by running:
```sh
jspm inspect --forks
jspm resolve --only registry:package-name@version
```
### Webpack
Run `npm i aurelia-config --save` from your project root.
Add `'aurelia-config'` in the `coreBundles.aurelia section` of your `webpack.config.js`.
### Typescript
Npm-based installations pick up the typings automatically. For Jspm-based installations, run `typings i github:spoonx/aurelia-config` or add `"aurelia-config": "github:spoonx/aurelia-config",` to your `typings.json` and run `typings i`.
@@ -0,0 +1,17 @@
{
"root": "./doc",
"plugins": [
"edit-link",
"github"
],
"pluginsConfig": {
"edit-link": {
"base": "https://github.com/SpoonX/aurelia-plugin-skeleton/edit/master/doc",
"label": "Edit This Page"
},
"github": {
"url": "https://github.com/spoonx/aurelia-plugin-skeleton"
}
}
}
@@ -0,0 +1,26 @@
{
"name": "aurelia-config",
"version": "0.0.1",
"description": "A configuration service for aurelia plugins.",
"keywords": [
"aurelia",
"plugin",
"configuration"
],
"homepage": "https://github.com/SpoonX/aurelia-config",
"main": "dist/commonjs/aurelia-config.js",
"moduleType": "node",
"license": "MIT",
"author": "SpoonX <info@spoonx.nl>",
"repository": {
"type": "git",
"url": "https://github.com/SpoonX/aurelia-config"
},
"dependencies": {
"aurelia-dependency-injection": "^1.0.0",
"aurelia-framework": "^1.0.1",
"aurelia-loader": "^1.0.0",
"aurelia-logging": "^1.0.0",
"homefront": "^1.2.0"
}
}
@@ -0,0 +1,74 @@
System.config({
defaultJSExtensions: true,
transpiler: false,
paths: {
"github:*": "jspm_packages/github/*",
"npm:*": "jspm_packages/npm/*"
},
map: {
"aurelia-dependency-injection": "npm:aurelia-dependency-injection@1.0.0",
"aurelia-framework": "npm:aurelia-framework@1.0.1",
"aurelia-loader": "npm:aurelia-loader@1.0.0",
"aurelia-loader-default": "npm:aurelia-loader-default@1.0.0",
"aurelia-logging": "npm:aurelia-logging@1.0.0",
"aurelia-pal-browser": "npm:aurelia-pal-browser@1.0.0",
"aurelia-polyfills": "npm:aurelia-polyfills@1.0.0",
"homefront": "npm:homefront@1.2.0",
"npm:aurelia-binding@1.0.1": {
"aurelia-logging": "npm:aurelia-logging@1.0.0",
"aurelia-metadata": "npm:aurelia-metadata@1.0.0",
"aurelia-pal": "npm:aurelia-pal@1.0.0",
"aurelia-task-queue": "npm:aurelia-task-queue@1.0.0"
},
"npm:aurelia-dependency-injection@1.0.0": {
"aurelia-metadata": "npm:aurelia-metadata@1.0.0",
"aurelia-pal": "npm:aurelia-pal@1.0.0"
},
"npm:aurelia-framework@1.0.1": {
"aurelia-binding": "npm:aurelia-binding@1.0.1",
"aurelia-dependency-injection": "npm:aurelia-dependency-injection@1.0.0",
"aurelia-loader": "npm:aurelia-loader@1.0.0",
"aurelia-logging": "npm:aurelia-logging@1.0.0",
"aurelia-metadata": "npm:aurelia-metadata@1.0.0",
"aurelia-pal": "npm:aurelia-pal@1.0.0",
"aurelia-path": "npm:aurelia-path@1.0.0",
"aurelia-task-queue": "npm:aurelia-task-queue@1.0.0",
"aurelia-templating": "npm:aurelia-templating@1.0.0"
},
"npm:aurelia-loader-default@1.0.0": {
"aurelia-loader": "npm:aurelia-loader@1.0.0",
"aurelia-metadata": "npm:aurelia-metadata@1.0.0",
"aurelia-pal": "npm:aurelia-pal@1.0.0"
},
"npm:aurelia-loader@1.0.0": {
"aurelia-metadata": "npm:aurelia-metadata@1.0.0",
"aurelia-path": "npm:aurelia-path@1.0.0"
},
"npm:aurelia-metadata@1.0.0": {
"aurelia-pal": "npm:aurelia-pal@1.0.0"
},
"npm:aurelia-pal-browser@1.0.0": {
"aurelia-pal": "npm:aurelia-pal@1.0.0"
},
"npm:aurelia-polyfills@1.0.0": {
"aurelia-pal": "npm:aurelia-pal@1.0.0"
},
"npm:aurelia-task-queue@1.0.0": {
"aurelia-pal": "npm:aurelia-pal@1.0.0"
},
"npm:aurelia-templating@1.0.0": {
"aurelia-binding": "npm:aurelia-binding@1.0.1",
"aurelia-dependency-injection": "npm:aurelia-dependency-injection@1.0.0",
"aurelia-loader": "npm:aurelia-loader@1.0.0",
"aurelia-logging": "npm:aurelia-logging@1.0.0",
"aurelia-metadata": "npm:aurelia-metadata@1.0.0",
"aurelia-pal": "npm:aurelia-pal@1.0.0",
"aurelia-path": "npm:aurelia-path@1.0.0",
"aurelia-task-queue": "npm:aurelia-task-queue@1.0.0"
},
"npm:homefront@1.2.0": {
"extend": "npm:extend@3.0.0"
}
}
});
@@ -0,0 +1,41 @@
# Overview
Sick of configuring every plugin separately, inconsistent naming and one plugin not knowing what the other does. Here comes the solution. One app config file for all your plugin. It works as follows:
At aurelia configuration you tell aurelia-config which plugin defaults it should load and the app config objects you want to merge into that sequentially. Then it (optionally) calls sequentially the plugin configurations on them with the (plugin namepsaced) merged settings.
The merged settings (as an instance of [homefront](https://www.npmjs.com/package/homefront)) can be easily accessed from everywhere in your app or your plugins. The usage of aliass per plugins and a Configuration resolver even simplifies that.
- One config to rule them all
- Automatically load and merge plugin and app configs
- Namespaces and a Configuration resolver allow easier access of selected config segments
- All [homefront](https://www.npmjs.com/package/homefront) methods are available on the config instance.
## Used By
This library is used by plugins and applications.
## Uses
- [homefront](https://www.npmjs.com/package/homefront).
## Quick Homefront api overview
Since aurelia-configs Config class extends [homefront](https://www.npmjs.com/package/homefront), all of homefront's methods are available on the Config instance or a segments of it (when made with config.use('alias')). Some of the methods homefronts gives you are:
```js
// contains the data in a single object
.data
// recursively merges given sources into data.
.merge(sources)
// Fetches value of given key.
.fetch(key, defaultValue)
//Convenience method. Calls .fetch(), and on null result calls .put() using provided toPut.
.fetchOrPut(key, toPut)
// Sets value for a key (creates object in path when not found).
.put(key, value)
// Removes value by key.
.remove(key)
// Search and return keys and values that match given string.
.search(phrase)
```
Keys can be dot separated strings or an array of keys
@@ -0,0 +1,7 @@
# Summary
* [Introduction](README.md)
* [Installation](installation.md)
* [Usage](usage.md)
* [Changelog](CHANGELOG.md)
* [License](license.md)
@@ -0,0 +1 @@
{"classes":[],"methods":[],"properties":[],"events":[]}
Oops, something went wrong.

0 comments on commit 04dc1e6

Please sign in to comment.