Skip to content
This repository has been archived by the owner on Nov 25, 2020. It is now read-only.

Commit

Permalink
feat(project): new build tasks with typings and bundled
Browse files Browse the repository at this point in the history
  • Loading branch information
doktordirk committed Jul 28, 2016
1 parent 86eae9d commit a915bce
Show file tree
Hide file tree
Showing 27 changed files with 744 additions and 246 deletions.
6 changes: 0 additions & 6 deletions .eslintrc

This file was deleted.

6 changes: 6 additions & 0 deletions .eslintrc.json
@@ -0,0 +1,6 @@
{
"extends": "./node_modules/aurelia-tools/.eslintrc.json",
"rules": {
"consistent-return": 0
}
}
24 changes: 24 additions & 0 deletions .remarkrc
@@ -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
}
}
15 changes: 15 additions & 0 deletions .travis.yml
@@ -0,0 +1,15 @@
language: node_js
node_js:
- '0.12'
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
38 changes: 38 additions & 0 deletions bower.json
@@ -0,0 +1,38 @@
{
"name": "aurelia-form",
"version": "0.1.6",
"description": "Makes working with forms just a tad more pleasant.",
"keywords": [
"aurelia",
"bootstrap",
"component",
"components",
"custom components",
"form",
"forms",
"input",
"plugin",
"schema",
"translation"
],
"homepage": "https://github.com/SpoonX/aurelia-form",
"main": "dist/commonjs/aurelia-form.js",
"moduleType": "node",
"license": "MIT",
"author": "RWOverdijk <wesley@spoonx.nl> (http://spoonx.nl/)",
"contributors": [
"bas080 <bas080@hotmail.com> (http://spoonx.nl)"
],
"repository": {
"type": "git",
"url": "https://github.com/SpoonX/aurelia-form"
},
"dependencies": {
"aurelia-dependency-injection": "^1.0.0-rc.1.0.0",
"aurelia-framework": "^1.0.0-rc.1.0.0",
"aurelia-logging": "^1.0.0-rc.1.0.0",
"aurelia-validatejs": "^0.6.0",
"aurelia-view-manager": "^0.0.5",
"extend": "^3.0.0"
}
}
11 changes: 5 additions & 6 deletions build/args.js
@@ -1,14 +1,13 @@
var yargs = require('yargs'); var yargs = require('yargs');


var argv = yargs.argv; var argv = yargs.argv,
var validBumpTypes = 'major|minor|patch|prerelease'.split('|'); validBumpTypes = "major|minor|patch|prerelease".split("|"),
var bump = (argv.bump || 'patch').toLowerCase(); bump = (argv.bump || 'patch').toLowerCase();


if (validBumpTypes.indexOf(bump) === -1) { if(validBumpTypes.indexOf(bump) === -1) {
throw new Error('Unrecognized bump "' + bump + '".'); throw new Error('Unrecognized bump "' + bump + '".');
} }


module.exports = { module.exports = {
bump: bump, bump: bump
depth: parseInt(argv.depth || '0')
}; };
27 changes: 23 additions & 4 deletions build/babel-options.js
Expand Up @@ -2,7 +2,7 @@ var path = require('path');
var paths = require('./paths'); var paths = require('./paths');


exports.base = function() { exports.base = function() {
return { var config = {
filename: '', filename: '',
filenameRelative: '', filenameRelative: '',
sourceMap: true, sourceMap: true,
Expand All @@ -11,14 +11,27 @@ exports.base = function() {
moduleIds: false, moduleIds: false,
comments: false, comments: false,
compact: false, compact: false,
code:true, code: true,
presets: [ 'es2015-loose', 'stage-1'], presets: [ 'es2015-loose', 'stage-1' ],
plugins: [ plugins: [
'syntax-flow', 'syntax-flow',
'transform-decorators-legacy', 'transform-decorators-legacy',
'transform-flow-strip-types'
] ]
}; };
if (!paths.useTypeScriptForDTS) {
config.plugins.push(
['babel-dts-generator', {
packageName: paths.packageName,
typings: '',
suppressModulePath: true,
suppressComments: false,
memberOutputFilter: /^_.*/,
suppressAmbientDeclaration: true
}]
);
};
config.plugins.push('transform-flow-strip-types');
return config;
} }


exports.commonjs = function() { exports.commonjs = function() {
Expand All @@ -44,3 +57,9 @@ exports.es2015 = function() {
options.presets = ['stage-1'] options.presets = ['stage-1']
return options; return options;
}; };

exports['native-modules'] = function() {
var options = exports.base();
options.presets[0] = 'es2015-loose-native-modules';
return options;
}
35 changes: 29 additions & 6 deletions build/paths.js
@@ -1,13 +1,36 @@
var path = require('path');
var fs = require('fs');

// hide warning //
var emitter = require('events');
emitter.defaultMaxListeners = 5;

var appRoot = 'src/'; var appRoot = 'src/';
var outputRoot = 'dist/'; var pkg = JSON.parse(fs.readFileSync('./package.json', 'utf-8'));


module.exports = { var paths = {
root: appRoot, root: appRoot,
source: appRoot + '**/*.js', source: appRoot + '**/*.js',
html: appRoot + '**/*.html',
style: 'styles/**/*.css', style: 'styles/**/*.css',
output: outputRoot, output: 'dist/',
doc:'./doc', doc:'./doc',
e2eSpecsSrc: 'test/e2e/src/*.js', test: 'test/**/*.js',
e2eSpecsDist: 'test/e2e/dist/' exampleSource: 'doc/example/',
exampleOutput: 'doc/example-dist/',
packageName: pkg.name,
ignore: [],
useTypeScriptForDTS: false,
importsToAdd: [], // eg. non-concated local imports in the main file as they will get removed during the build process
importsToIgnoreForDts: ['extend'], // imports that are only used internally. no need to d.ts export them
jsResources: [appRoot + 'component/**/*.js'], // js to transpile, but not be concated and keeping their relative path
resources: appRoot + '{**/*.css,**/*.html}',
sort: true,
concat: true
}; };

// files to be traspiled (and concated if selected)
paths.mainSource = [paths.source].concat(paths.jsResources.map(function(resource) {return '!' + resource;}));
// files to be linted
paths.lintSource = paths.source;

module.exports = paths;

0 comments on commit a915bce

Please sign in to comment.