-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4 from flightjs/npmify
feat: convert to an npm module
- Loading branch information
Showing
21 changed files
with
299 additions
and
275 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,18 @@ | ||
{ | ||
"parser": "babel-eslint", | ||
"extends": [ | ||
"standard" | ||
], | ||
"env": { | ||
"jasmine": true | ||
}, | ||
"rules": { | ||
// overrides of the standard style | ||
"curly": [2, "all"], | ||
"indent": [2, 4], | ||
"max-len": [2, 100, 4], | ||
"semi": [2, "always"], | ||
"space-before-function-paren": [2, {"anonymous": "always", "named": "never"}], | ||
"wrap-iife": [2, "outside"] | ||
} | ||
} |
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,2 @@ | ||
bower_components | ||
node_modules | ||
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 |
---|---|---|
@@ -1,9 +1,20 @@ | ||
sudo: false | ||
language: node_js | ||
cache: | ||
directories: | ||
- node_modules | ||
notifications: | ||
email: false | ||
node_js: | ||
- "0.10" | ||
before_script: | ||
- npm install -g bower | ||
- bower install | ||
- '4' | ||
before_install: | ||
- "export DISPLAY=:99.0" | ||
- "sh -e /etc/init.d/xvfb start" | ||
- npm i -g npm@^2.0.0 | ||
before_script: | ||
- npm prune | ||
- export DISPLAY=:99.0 | ||
- sh -e /etc/init.d/xvfb start | ||
after_success: | ||
- npm run semantic-release | ||
branches: | ||
except: | ||
- "/^v\\d+\\.\\d+\\.\\d+$/" |
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 was deleted.
Oops, something went wrong.
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 was deleted.
Oops, something went wrong.
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 path = require('path'); | ||
|
||
var ROOT_DIRECTORY = path.resolve(__dirname, '..'); | ||
var BUILD_DIRECTORY = path.resolve(ROOT_DIRECTORY, 'dist'); | ||
|
||
module.exports = { | ||
ROOT_DIRECTORY: ROOT_DIRECTORY, | ||
BUILD_DIRECTORY: BUILD_DIRECTORY | ||
}; |
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,47 @@ | ||
'use strict'; | ||
|
||
var constants = require('./constants'); | ||
var webpackConfig = require('./webpack.config.test'); | ||
// entry is determined by karma config 'files' array | ||
webpackConfig.entry = {}; | ||
|
||
module.exports = function (config) { | ||
config.set({ | ||
basePath: constants.ROOT_DIRECTORY, | ||
browsers: [ process.env.TRAVIS ? 'Firefox' : 'Chrome' ], | ||
browserNoActivityTimeout: 60000, | ||
client: { | ||
captureConsole: true, | ||
useIframe: true | ||
}, | ||
files: [ | ||
'node_modules/jquery/dist/jquery.min.js', | ||
'src/specs.context.js' | ||
], | ||
frameworks: [ | ||
'jasmine' | ||
], | ||
plugins: [ | ||
'karma-chrome-launcher', | ||
'karma-firefox-launcher', | ||
'karma-jasmine', | ||
'karma-sourcemap-loader', | ||
'karma-webpack' | ||
], | ||
preprocessors: { | ||
'src/specs.context.js': [ 'webpack', 'sourcemap' ] | ||
}, | ||
reporters: [ 'dots' ], | ||
singleRun: true, | ||
webpack: webpackConfig, | ||
webpackMiddleware: { | ||
stats: { | ||
assetsSort: 'name', | ||
colors: true, | ||
children: false, | ||
chunks: false, | ||
modules: false | ||
} | ||
} | ||
}); | ||
}; |
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,46 @@ | ||
var webpack = require('webpack'); | ||
|
||
var DedupePlugin = webpack.optimize.DedupePlugin; | ||
var OccurenceOrderPlugin = webpack.optimize.OccurenceOrderPlugin; | ||
var UglifyJsPlugin = webpack.optimize.UglifyJsPlugin; | ||
|
||
var plugins = [ | ||
new DedupePlugin(), | ||
new OccurenceOrderPlugin() | ||
]; | ||
|
||
if (process.env.NODE_ENV === 'publish') { | ||
plugins.push( | ||
new UglifyJsPlugin({ | ||
compress: { | ||
dead_code: true, | ||
drop_console: true, | ||
screw_ie8: true, | ||
warnings: true | ||
} | ||
}) | ||
); | ||
} | ||
|
||
module.exports = { | ||
entry: './src', | ||
module: { | ||
loaders: [ | ||
{ | ||
test: /\.jsx?$/, | ||
exclude: /node_modules/, | ||
loader: 'babel-loader' | ||
} | ||
] | ||
}, | ||
resolve: { | ||
alias: { | ||
flight: 'flightjs' | ||
} | ||
}, | ||
output: { | ||
path: './dist', | ||
filename: 'flight-with-observe.js' | ||
}, | ||
plugins: plugins | ||
}; |
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 constants = require('./constants'); | ||
var baseConfig = require('./webpack.config'); | ||
|
||
module.exports = Object.assign(baseConfig, { | ||
output: { | ||
library: 'withObserve', | ||
filename: 'flight-with-observe.js', | ||
libraryTarget: 'umd', | ||
path: constants.BUILD_DIRECTORY | ||
}, | ||
externals: [ | ||
'rx' | ||
] | ||
}); |
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 @@ | ||
var baseConfig = require('./webpack.config'); | ||
|
||
module.exports = Object.assign(baseConfig, { | ||
devtool: 'inline-source-map' | ||
}); |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.