-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit d214f77
Showing
62 changed files
with
5,087 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"extends": "./node_modules/aurelia-tools/.eslintrc" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
node_modules | ||
jspm_packages | ||
bower_components | ||
.idea | ||
.DS_STORE | ||
build/reports | ||
*.bat |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"esnext": true | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
jspm_packages | ||
bower_components | ||
.idea |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
The MIT License (MIT) | ||
|
||
Copyright (c) 2015 Alain Mereaux | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,136 @@ | ||
# aurelia-firebase | ||
|
||
[![Join the chat at https://gitter.im/PulsarBlow/aurelia-firebase](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/PulsarBlow/aurelia-firebase?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) [![Circle CI](https://circleci.com/gh/PulsarBlow/aurelia-firebase/tree/master.svg?style=svg)](https://circleci.com/gh/PulsarBlow/aurelia-firebase/tree/master) | ||
|
||
A Firebase plugin for [Aurelia](http://aurelia.io/) that supports Promises. | ||
Developed from scratch following aurelia's spirit. | ||
|
||
This is an early version which comes with : | ||
|
||
- A complete firebase password authentication support | ||
- A reactive collection providing auto-sync with Firebase server. | ||
|
||
This version is a work in progress, and lacks some Firebase features : | ||
|
||
- Full Query support (order, startAt, endAt etc..) | ||
- Priorities | ||
- Transactions | ||
|
||
Play with the demo : https://aureliaonfire.azurewebsites.net | ||
|
||
# Installation | ||
|
||
|
||
#### Install via JSPM | ||
Go into your project and verify it's already `npm install`'ed and `jspm install`'ed. Now execute following command to install the plugin via JSPM: | ||
|
||
``` | ||
jspm install aurelia-firebase | ||
``` | ||
|
||
this will add the plugin into your `jspm_packages` folder as well as an mapping-line into your `config.js` as: | ||
|
||
``` | ||
"aurelia-firebase": "github:[email protected]", | ||
``` | ||
|
||
If you're feeling experimental or cannot wait for the next release, you could also install the latest version by executing: | ||
``` | ||
jspm install aurelia-firebase=github:pulsarblow/aurelia-firebase@master | ||
``` | ||
|
||
|
||
#### Migrate from aurelia-app to aurelia-app="main" | ||
You'll need to register the plugin when your aurelia app is bootstrapping. If you have an aurelia app because you cloned a sample, there's a good chance that the app is bootstrapping based on default conventions. In that case, open your **index.html** file and look at the *body* tag. | ||
``` html | ||
<body aurelia-app> | ||
``` | ||
Change the *aurelia-app* attribute to *aurelia-app="main"*. | ||
``` html | ||
<body aurelia-app="main"> | ||
``` | ||
The aurelia framework will now bootstrap the application by looking for your **main.js** file and executing the exported *configure* method. Go ahead and add a new **main.js** file with these contents: | ||
``` javascript | ||
export function configure(aurelia) { | ||
aurelia.use | ||
.standardConfiguration() | ||
.developmentLogging(); | ||
|
||
aurelia.start().then(a => a.setRoot('app', document.body)); | ||
} | ||
|
||
``` | ||
|
||
#### Load the plugin | ||
During bootstrapping phase, you can now include the validation plugin: | ||
|
||
``` javascript | ||
export function configure(aurelia) { | ||
aurelia.use | ||
.standardConfiguration() | ||
.developmentLogging() | ||
.plugin('aurelia-firebase'); //Add this line to load the plugin | ||
|
||
aurelia.start().then(a => a.setRoot('app', document.body)); | ||
} | ||
``` | ||
|
||
# Getting started | ||
|
||
TBD... | ||
|
||
#Configuration | ||
##One config to rule them all | ||
The firebase plugin has one global configuration instance, which is passed to an optional callback function when you first install the plugin: | ||
``` javascript | ||
export function configure(aurelia) { | ||
aurelia.use | ||
.standardConfiguration() | ||
.developmentLogging() | ||
.plugin('aurelia-firebase', (config) => { config.setFirebaseUrl('https://myapp.firebaseio.com/'); }); | ||
|
||
aurelia.start().then(a => a.setRoot('app', document.body)); | ||
} | ||
``` | ||
|
||
>Note: if you want to access the global configuration instance at a later point in time, you can inject it: | ||
``` javascript | ||
import {Configuration} from 'aurelia-firebase'; | ||
import {inject} from 'aurelia-framework'; | ||
|
||
>@inject(Configuration) | ||
export class MyVM{ | ||
constructor(config) | ||
{ | ||
|
||
> } | ||
} | ||
``` | ||
|
||
##Possible configuration | ||
>Note: all these can be chained: | ||
``` javascript | ||
(config) => { config.setFirebaseUrl('https://myapp.firebaseio.com/').setMonitorAuthChange(true); } | ||
``` | ||
|
||
###config.setFirebaseUrl(firebaseUrl: string) | ||
``` javascript | ||
(config) => { config.setFirebaseUrl('https://myapp.firebaseio.com/'); } | ||
``` | ||
Sets the Firebase URL where your app answers. | ||
This is required and the plugin will not start if not provided. | ||
|
||
###config.setMonitorAuthChange(monitorAuthChange: boolean) | ||
``` javascript | ||
(config) => { config.setMonitorAuthChange(true); } | ||
``` | ||
When set to true, the authentication manager will monitor authentication changes for the current user | ||
The default value is false. | ||
|
||
#AuthenticationManager | ||
|
||
The authentication manager handles authentication aspects in the plugin. | ||
|
||
#ReactiveCollection | ||
|
||
The ReactiveCollection class handles firebase data synchronization. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
{ | ||
"name": "aurelia-firebase", | ||
"version": "0.1.0-beta", | ||
"description": "A Firebase plugin for Aurelia.", | ||
"keywords": [ | ||
"aurelia", | ||
"firebase", | ||
"plugin" | ||
], | ||
"homepage": "https://github.com/PulsarBlow/aurelia-firebase", | ||
"license": "MIT", | ||
"authors": [ | ||
"Alain Méreaux <[email protected]>" | ||
], | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/PulsarBlow/aurelia-firebase" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
var yargs = require('yargs'); | ||
|
||
var argv = yargs.argv, | ||
validBumpTypes = "major|minor|patch|prerelease".split("|"), | ||
bump = (argv.bump || 'patch').toLowerCase(); | ||
|
||
if(validBumpTypes.indexOf(bump) === -1) { | ||
throw new Error('Unrecognized bump "' + bump + '".'); | ||
} | ||
|
||
module.exports = { | ||
bump: bump | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
module.exports = { | ||
modules: 'system', | ||
moduleIds: false, | ||
comments: false, | ||
compact: false, | ||
stage:2, | ||
optional: [ | ||
"es7.decorators", | ||
"es7.classProperties" | ||
] | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
var path = require('path'); | ||
|
||
var appRoot = 'src/'; | ||
var outputRoot = 'dist/'; | ||
|
||
module.exports = { | ||
root: appRoot, | ||
source: appRoot + '**/*.js', | ||
html: appRoot + '**/*.html', | ||
css: appRoot + '**/*.css', | ||
style: 'styles/**/*.css', | ||
output: outputRoot, | ||
doc:'./doc', | ||
e2eSpecsSrc: 'test/e2e/src/*.js', | ||
e2eSpecsDist: 'test/e2e/dist/' | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
var gulp = require('gulp'); | ||
var runSequence = require('run-sequence'); | ||
var to5 = require('gulp-babel'); | ||
var paths = require('../paths'); | ||
var compilerOptions = require('../babel-options'); | ||
var assign = Object.assign || require('object.assign'); | ||
|
||
gulp.task('build-html-es6', function () { | ||
return gulp.src(paths.html) | ||
.pipe(gulp.dest(paths.output + 'es6')); | ||
}); | ||
|
||
gulp.task('build-es6', ['build-html-es6'], function () { | ||
return gulp.src(paths.source) | ||
.pipe(gulp.dest(paths.output + 'es6')); | ||
}); | ||
|
||
gulp.task('build-html-commonjs', function () { | ||
return gulp.src(paths.html) | ||
.pipe(gulp.dest(paths.output + 'commonjs')); | ||
}); | ||
|
||
gulp.task('build-commonjs', ['build-html-commonjs'], function () { | ||
return gulp.src(paths.source) | ||
.pipe(to5(assign({}, compilerOptions, {modules:'common'}))) | ||
.pipe(gulp.dest(paths.output + 'commonjs')); | ||
}); | ||
|
||
gulp.task('build-html-amd', function () { | ||
return gulp.src(paths.html) | ||
.pipe(gulp.dest(paths.output + 'amd')); | ||
}); | ||
|
||
gulp.task('build-amd', ['build-html-amd'], function () { | ||
return gulp.src(paths.source) | ||
.pipe(to5(assign({}, compilerOptions, {modules:'amd'}))) | ||
.pipe(gulp.dest(paths.output + 'amd')); | ||
}); | ||
|
||
gulp.task('build-html-system', function () { | ||
return gulp.src(paths.html) | ||
.pipe(gulp.dest(paths.output + 'system')); | ||
}); | ||
|
||
gulp.task('build-system', ['build-html-system'], function () { | ||
return gulp.src(paths.source) | ||
.pipe(to5(assign({}, compilerOptions, {modules:'system'}))) | ||
.pipe(gulp.dest(paths.output + 'system')); | ||
}); | ||
|
||
gulp.task('build', function(callback) { | ||
return runSequence( | ||
'clean', | ||
['build-es6', 'build-commonjs', 'build-amd', 'build-system'], | ||
callback | ||
); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
var gulp = require('gulp'); | ||
var paths = require('../paths'); | ||
var del = require('del'); | ||
var vinylPaths = require('vinyl-paths'); | ||
|
||
// deletes all files in the output path | ||
gulp.task('clean', function() { | ||
return gulp.src([paths.output]) | ||
.pipe(vinylPaths(del)); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
var gulp = require('gulp'); | ||
var tools = require('aurelia-tools'); | ||
|
||
// source code for the tasks called in this file | ||
// is located at: https://github.com/aurelia/tools/blob/master/src/dev.js | ||
|
||
// updates dependencies in this folder | ||
// from folders in the parent directory | ||
gulp.task('update-own-deps', function() { | ||
tools.updateOwnDependenciesFromLocalRepositories(); | ||
}); | ||
|
||
// quickly pulls in all of the aurelia | ||
// github repos, placing them up one directory | ||
// from where the command is executed, | ||
// then runs `npm install` | ||
// and `gulp build` for each repo | ||
gulp.task('build-dev-env', function () { | ||
tools.buildDevEnv(); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
var gulp = require('gulp'); | ||
var paths = require('../paths'); | ||
var typedoc = require('gulp-typedoc'); | ||
var typedocExtractor = require('gulp-typedoc-extractor'); | ||
var runSequence = require('run-sequence'); | ||
|
||
gulp.task('doc-generate', function(){ | ||
return gulp.src([paths.output + 'amd/*.d.ts', paths.doc + '/core-js.d.ts', './jspm_packages/github/aurelia/*/*.d.ts']) | ||
.pipe(typedoc({ | ||
target: 'es6', | ||
includeDeclarations: true, | ||
json: paths.doc + '/api.json', | ||
name: paths.packageName + '-docs', | ||
mode: 'modules', | ||
excludeExternals: true, | ||
ignoreCompilerErrors: false, | ||
version: true | ||
})); | ||
}); | ||
|
||
gulp.task('doc-extract', function(){ | ||
return gulp.src([paths.doc + '/api.json']) | ||
.pipe(typedocExtractor(paths.output + 'amd/' + paths.packageName)) | ||
.pipe(gulp.dest(paths.doc)); | ||
}); | ||
|
||
gulp.task('doc', function(callback){ | ||
return runSequence( | ||
'doc-generate', | ||
'doc-extract', | ||
callback | ||
); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
var gulp = require('gulp'); | ||
var paths = require('../paths'); | ||
var eslint = require('gulp-eslint'); | ||
|
||
// runs eslint on all .js files | ||
gulp.task('lint', function() { | ||
return gulp.src(paths.source) | ||
.pipe(eslint()) | ||
.pipe(eslint.format()) | ||
.pipe(eslint.failOnError()); | ||
}); |
Oops, something went wrong.