Skip to content

Commit

Permalink
Update build tooling
Browse files Browse the repository at this point in the history
  • Loading branch information
taion committed Apr 22, 2016
1 parent ce0baf8 commit d34f9eb
Show file tree
Hide file tree
Showing 8 changed files with 91 additions and 35 deletions.
20 changes: 12 additions & 8 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
{
"stage": 0,
"loose": "all",
"optional": [
"runtime"
],
"plugins": [
"dev-expression"
]
"presets": ["react"],
"plugins": ["dev-expression", "transform-runtime"],

"env": {
"cjs": {
"presets": ["es2015-loose", "stage-0"],
"plugins": ["add-module-exports"]
},
"es": {
"presets": ["es2015-loose-native-modules", "stage-0"]
}
}
}
39 changes: 36 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,37 @@
node_modules
# Logs
logs
*.log
.DS_Store
lib
npm-debug.log*

# Runtime data
pids
*.pid
*.seed

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
coverage

# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# node-waf configuration
.lock-wscript

# Compiled binary addons (http://nodejs.org/api/addons.html)
build/Release

# Dependency directory
node_modules

# Optional npm cache directory
.npm

# Optional REPL history
.node_repl_history

# Transpiled code
/es
/lib
9 changes: 1 addition & 8 deletions karma.conf.babel.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,7 @@ export default config => {
webpack: {
module: {
loaders: [
{
test: /\.js$/,
exclude: /node_modules/,
loader: 'babel',
query: {
plugins: ['./test/fixtures/babelRelayPlugin'],
},
},
{ test: /\.js$/, exclude: /node_modules/, loader: 'babel' },
],
},
plugins: [
Expand Down
2 changes: 1 addition & 1 deletion karma.conf.js
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
require('babel-core/register');
require('babel-register');
module.exports = require('./karma.conf.babel.js');
42 changes: 28 additions & 14 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,16 @@
"lib"
],
"main": "lib/index.js",
"jsnext:main": "es/index.js",
"scripts": {
"build": "rimraf lib && babel src -d lib",
"build": "npm run build-cjs && npm run build-es",
"build-cjs": "rimraf lib && BABEL_ENV=cjs babel src -d lib",
"build-es": "rimraf es && BABEL_ENV=es babel src -d es",
"build-fixtures": "babel-node test/fixtures/updateSchema.js",
"karma": "BABEL_ENV=cjs karma start",
"lint": "eslint src test *.js",
"prepublish": "npm run build",
"test": "npm run lint && npm run build-fixtures && karma start"
"test": "npm run lint && npm run build-fixtures && npm run karma"
},
"repository": {
"type": "git",
Expand All @@ -28,9 +32,9 @@
},
"homepage": "https://github.com/relay-tools/react-router-relay#readme",
"dependencies": {
"babel-runtime": "^5.8.38",
"babel-runtime": "^6.6.1",
"invariant": "^2.2.1",
"lodash": "^4.10.0",
"lodash": "^4.11.1",
"react-static-container": "^1.0.1"
},
"peerDependencies": {
Expand All @@ -39,23 +43,33 @@
"react-router": ">=2.3.0"
},
"devDependencies": {
"babel": "^5.8.38",
"babel-core": "^5.8.38",
"babel-eslint": "^4.1.8",
"babel-loader": "^5.4.0",
"babel-plugin-dev-expression": "^0.1.0",
"babel-cli": "^6.7.7",
"babel-core": "^6.7.7",
"babel-eslint": "^6.0.3",
"babel-loader": "^6.2.4",
"babel-plugin-add-module-exports": "^0.1.2",
"babel-plugin-dev-expression": "^0.2.1",
"babel-plugin-transform-runtime": "^6.7.5",
"babel-polyfill": "^6.7.4",
"babel-preset-es2015": "^6.6.0",
"babel-preset-es2015-loose": "^7.0.0",
"babel-preset-es2015-loose-native-modules": "^1.0.0",
"babel-preset-react": "^6.5.0",
"babel-preset-stage-0": "^6.5.0",
"babel-register": "^6.7.2",
"babel-relay-plugin": "^0.8.0",
"chai": "^3.5.0",
"eslint": "^1.10.3",
"eslint-config-airbnb": "^5.0.1",
"eslint-plugin-react": "^3.16.1",
"eslint": "^2.8.0",
"eslint-config-airbnb": "^7.0.0",
"eslint-plugin-jsx-a11y": "^0.6.2",
"eslint-plugin-react": "^4.3.0",
"graphql": "^0.4.18",
"graphql-relay": "^0.3.6",
"karma": "^0.13.22",
"karma-chrome-launcher": "^0.2.3",
"karma-firefox-launcher": "^0.1.7",
"karma-mocha": "^0.2.2",
"karma-mocha-reporter": "^2.0.0",
"karma-mocha-reporter": "^2.0.1",
"karma-sinon-chai": "^1.2.0",
"karma-sourcemap-loader": "^0.3.7",
"karma-webpack": "^1.7.0",
Expand All @@ -69,6 +83,6 @@
"rimraf": "^2.5.2",
"sinon": "^1.17.3",
"sinon-chai": "^2.8.0",
"webpack": "^1.12.15"
"webpack": "^1.13.0"
}
}
9 changes: 9 additions & 0 deletions test/.babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"passPerPreset": true,
"presets": [
{ "plugins": ["./fixtures/babelRelayPlugin"] },
"react",
"es2015-loose",
"stage-0"
]
}
3 changes: 3 additions & 0 deletions test/fixtures/.babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"presets": ["es2015-loose", "stage-0"]
}
2 changes: 1 addition & 1 deletion test/index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import 'babel/polyfill';
import 'babel-polyfill';

const testsContext = require.context('.', true, /\.spec\.js$/);
testsContext.keys().forEach(testsContext);

0 comments on commit d34f9eb

Please sign in to comment.