-
-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(all): initial commit of skeleton
- Loading branch information
1 parent
6b5bf9e
commit 51a036d
Showing
35 changed files
with
524 additions
and
5 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,5 @@ | ||
node_modules | ||
jspm_packages | ||
bower_components | ||
.idea | ||
.DS_STORE |
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,3 @@ | ||
# 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/DurandalProject/about/blob/master/CONTRIBUTING.md). The contributing document will provide you with all the information you need to get started. Once you have read that, you will need to also [sign our CLA](http://goo.gl/forms/dI8QDDSyKR) before we can accept a Pull Request from you. More information on the process is included in the [contributor's guide](https://github.com/DurandalProject/about/blob/master/CONTRIBUTING.md). |
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
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 |
---|---|---|
@@ -1,2 +1,55 @@ | ||
# skeleton-plugin | ||
A starter kit for building an Aurelia plugin. | ||
# aurelia-skeleton-plugin | ||
|
||
This skeleton is part of the [Aurelia](http://www.aurelia.io/) platform. It sets up a standard aurelia plugin using gulp to build your ES6 code with the Babel compiler. Karma/Jasmine testing is also configured. | ||
|
||
> 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 [our Gitter Channel](https://gitter.im/aurelia/discuss). | ||
## Building The Code | ||
|
||
To build the code, follow these steps. | ||
|
||
1. Ensure that [NodeJS](http://nodejs.org/) is installed. This provides the platform on which the build tooling runs. | ||
2. From the project folder, execute the following command: | ||
|
||
```shell | ||
npm install | ||
``` | ||
3. Ensure that [Gulp](http://gulpjs.com/) is installed. If you need to install it, use the following command: | ||
|
||
```shell | ||
npm install -g gulp | ||
``` | ||
4. To build the code, you can now run: | ||
|
||
```shell | ||
gulp build | ||
``` | ||
5. You will find the compiled code in the `dist` folder, available in three module formats: AMD, CommonJS and ES6. | ||
|
||
6. See `gulpfile.js` for other tasks related to generating the docs and linting. | ||
|
||
## Running The Tests | ||
|
||
To run the unit tests, first ensure that you have followed the steps above in order to install all dependencies and successfully build the library. Once you have done that, proceed with these additional steps: | ||
|
||
1. Ensure that the [Karma](http://karma-runner.github.io/) CLI is installed. If you need to install it, use the following command: | ||
|
||
```shell | ||
npm install -g karma-cli | ||
``` | ||
2. Ensure that [jspm](http://jspm.io/) is installed. If you need to install it, use the following commnand: | ||
|
||
```shell | ||
npm install -g jspm | ||
``` | ||
3. Install the client-side dependencies with jspm: | ||
|
||
```shell | ||
jspm install | ||
``` | ||
|
||
4. You can now run the tests with this command: | ||
|
||
```shell | ||
karma start | ||
``` |
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,23 @@ | ||
module.exports = { | ||
filename: '', | ||
filenameRelative: '', | ||
blacklist: [], | ||
whitelist: [], | ||
modules: '', | ||
sourceMap: true, | ||
sourceMapName: '', | ||
sourceRoot: '', | ||
moduleRoot: '', | ||
moduleIds: false, | ||
experimental: false, | ||
format: { | ||
comments: false, | ||
compact: false, | ||
indent: { | ||
parentheses: true, | ||
adjustMultilineComment: true, | ||
style: " ", | ||
base: 0 | ||
} | ||
} | ||
}; |
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 @@ | ||
var path = require('path'); | ||
|
||
var appRoot = 'src/'; | ||
|
||
module.exports = { | ||
root: appRoot, | ||
source: appRoot + '**/*.js', | ||
html: appRoot + '**/*.html', | ||
style: 'styles/**/*.css', | ||
output: 'dist/', | ||
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,9 @@ | ||
var gulp = require('gulp'); | ||
var paths = require('../paths'); | ||
var del = require('del'); | ||
var vinylPaths = require('vinyl-paths'); | ||
|
||
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,10 @@ | ||
var gulp = require('gulp'); | ||
var tools = require('aurelia-tools'); | ||
|
||
gulp.task('update-own-deps', function(){ | ||
tools.updateOwnDependenciesFromLocalRepositories(); | ||
}); | ||
|
||
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,14 @@ | ||
var gulp = require('gulp'); | ||
var tools = require('aurelia-tools'); | ||
var paths = require('../paths'); | ||
var yuidoc = require('gulp-yuidoc'); | ||
|
||
gulp.task('doc-generate', function(){ | ||
return gulp.src(paths.source) | ||
.pipe(yuidoc.parser(null, 'api.json')) | ||
.pipe(gulp.dest(paths.doc)); | ||
}); | ||
|
||
gulp.task('doc', ['doc-generate'], function(){ | ||
tools.transformAPIModel(paths.doc); | ||
}); |
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 jshint = require('gulp-jshint'); | ||
var stylish = require('jshint-stylish'); | ||
|
||
gulp.task('lint', function() { | ||
return gulp.src(paths.source) | ||
.pipe(jshint()) | ||
.pipe(jshint.reporter(stylish)); | ||
}); |
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,36 @@ | ||
var gulp = require('gulp'); | ||
var runSequence = require('run-sequence'); | ||
var paths = require('../paths'); | ||
var changelog = require('conventional-changelog'); | ||
var fs = require('fs'); | ||
var bump = require('gulp-bump'); | ||
var args = require('../args'); | ||
|
||
gulp.task('bump-version', function(){ | ||
return gulp.src(['./package.json', './bower.json']) | ||
.pipe(bump({type:args.bump })) //major|minor|patch|prerelease | ||
.pipe(gulp.dest('./')); | ||
}); | ||
|
||
gulp.task('changelog', function(callback) { | ||
var pkg = JSON.parse(fs.readFileSync('./package.json', 'utf-8')); | ||
|
||
return changelog({ | ||
repository: pkg.repository.url, | ||
version: pkg.version, | ||
file: paths.doc + '/CHANGELOG.md' | ||
}, function(err, log) { | ||
fs.writeFileSync(paths.doc + '/CHANGELOG.md', log); | ||
}); | ||
}); | ||
|
||
gulp.task('prepare-release', function(callback){ | ||
return runSequence( | ||
'build', | ||
'lint', | ||
'bump-version', | ||
'doc', | ||
'changelog', | ||
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,25 @@ | ||
var gulp = require('gulp'); | ||
var karma = require('karma').server; | ||
|
||
/** | ||
* Run test once and exit | ||
*/ | ||
gulp.task('test', function (done) { | ||
karma.start({ | ||
configFile: __dirname + '/../../karma.conf.js', | ||
singleRun: true | ||
}, function(e) { | ||
done(); | ||
}); | ||
}); | ||
|
||
/** | ||
* Watch for file changes and re-run tests on each change | ||
*/ | ||
gulp.task('tdd', function (done) { | ||
karma.start({ | ||
configFile: __dirname + '/../../karma.conf.js' | ||
}, function(e) { | ||
done(); | ||
}); | ||
}); |
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 @@ | ||
<template> | ||
Hello, world! | ||
</template> |
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 @@ | ||
define(["exports"], function (exports) { | ||
"use strict"; | ||
|
||
var _classCallCheck = function (instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }; | ||
|
||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
|
||
var HelloWorld = exports.HelloWorld = function HelloWorld() { | ||
_classCallCheck(this, HelloWorld); | ||
}; | ||
}); |
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,12 @@ | ||
define(["exports"], function (exports) { | ||
"use strict"; | ||
|
||
exports.install = install; | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
|
||
function install(aurelia) { | ||
aurelia.globalizeResources("./hello-world"); | ||
} | ||
}); |
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 @@ | ||
<template> | ||
Hello, world! | ||
</template> |
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 @@ | ||
"use strict"; | ||
|
||
var _classCallCheck = function (instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }; | ||
|
||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
|
||
var HelloWorld = exports.HelloWorld = function HelloWorld() { | ||
_classCallCheck(this, HelloWorld); | ||
}; |
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 @@ | ||
"use strict"; | ||
|
||
exports.install = install; | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
|
||
function install(aurelia) { | ||
aurelia.globalizeResources("./hello-world"); | ||
} |
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 @@ | ||
<template> | ||
Hello, world! | ||
</template> |
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 @@ | ||
export class HelloWorld {} |
Oops, something went wrong.