-
Notifications
You must be signed in to change notification settings - Fork 17
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
Showing
120 changed files
with
2,541 additions
and
2,190 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,29 @@ | ||
# Handle line endings automatically for files detected as text | ||
# and leave all files detected as binary untouched. | ||
* text=auto | ||
|
||
# | ||
# The above will handle all files NOT found below | ||
# | ||
# These files are text and should be normalized (Convert crlf => lf) | ||
*.css text | ||
*.js text | ||
*.jsx text | ||
*.json text | ||
*.html text | ||
*.scss text | ||
*.txt text | ||
*.xml text | ||
*.yml text | ||
*.md text | ||
*.svg text | ||
|
||
|
||
# These files are binary and should be left untouched | ||
# (binary is a macro for -text -diff) | ||
*.pdf binary | ||
*.gif binary | ||
*.ico binary | ||
*.jpg binary | ||
*.jpeg binary | ||
*.png binary |
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 |
---|---|---|
|
@@ -19,3 +19,4 @@ dist | |
/user | ||
/util | ||
index.js | ||
.history |
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,16 +1,19 @@ | ||
sudo: false | ||
language: node_js | ||
node_js: | ||
- '4.2' | ||
before_deploy: 'npm run build' | ||
deploy: | ||
provider: npm | ||
email: [email protected] | ||
api_key: | ||
secure: dXLVThdNse9zbaGrmiXgNo2F+LAdvxHQsXgRnw0t/CcX3OGVDqLtCYB6WkhJcP0xWdxKxTLDhVZ6QGgwbnUSeluNO7Jzc5lkpfnWDuRvqWvO0KjAQ5qEoZm4Hk9ov8QK+3M1x3+mZE/gOr0pVWXB0P00POCG564lTFuyApi/IOU= | ||
skip_cleanup: true | ||
on: | ||
branch: develop | ||
- 6 | ||
- node | ||
branches: | ||
only: | ||
- v2.x.x | ||
- master | ||
- develop | ||
cache: | ||
directories: | ||
- node_modules | ||
- node_modules | ||
notifications: | ||
slack: | ||
rooms: | ||
secure: RQQcU2dSAzxPdYElQld3LJBZ3q83WFXrEab7BFVesWuwZCTwKiBN4v4RGDLarEUXetvmXcHUkbprIajDs/imk2ajbG8b1l4zU+4FLB8bd/+Xa3OVposUCh+P6PA3HoTa7LyLCpN0O7LcLkbyKRO3tjTpUtW05yn9IPJ9chykUNo= | ||
on_success: change # default: always | ||
on_failure: always # default: always |
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 |
---|---|---|
@@ -0,0 +1,15 @@ | ||
module.exports = { | ||
globals: { | ||
__DEV__: true | ||
}, | ||
automock: false, | ||
unmockedModulePathPatterns: [ | ||
'<rootDir>/node_modules/react', | ||
'<rootDir>/node_modules/react-dom', | ||
'<rootDir>/node_modules/react-addons-test-utils', | ||
'<rootDir>/node_modules/fbjs', | ||
'<rootDir>/node_modules/numeral', | ||
'<rootDir>/node_modules/i18next', | ||
], | ||
testPathIgnorePatterns: ['/node_modules/', 'fixture.js', '.history', '.localhistory', 'test-focus.jsx'] | ||
} |
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,66 +1,58 @@ | ||
var fs = require('fs'); | ||
var path = require('path'); | ||
var babel = require('babel-core'); | ||
let fs = require('fs'); | ||
let path = require('path'); | ||
// var babel = require('babel-core'); | ||
|
||
var babelOptions = { | ||
"presets": [ | ||
"es2015", | ||
"stage-0", | ||
"react" | ||
], | ||
"plugins": [ | ||
"add-module-exports", | ||
"transform-class-properties", | ||
"transform-decorators-legacy", | ||
"transform-proto-to-assign", | ||
["transform-es2015-classes", {"loose": true}] | ||
// var babelOptions = { | ||
// "presets": [ | ||
// "focus" | ||
// ], | ||
// sourceMaps: 'inline' | ||
// }; | ||
|
||
], | ||
sourceMaps: 'inline' | ||
}; | ||
|
||
var walk = function(dir) { | ||
var files = []; | ||
var list = fs.readdirSync(dir); | ||
list.forEach(function(file) { | ||
var walk = function (dir) { | ||
let files = []; | ||
let list = fs.readdirSync(dir); | ||
list.forEach(function (file) { | ||
file = dir + '/' + file; | ||
var stat = fs.statSync(file); | ||
let stat = fs.statSync(file); | ||
if (stat && stat.isDirectory()) files = files.concat(walk(file)); | ||
else files.push(file); | ||
}); | ||
return files; | ||
}; | ||
|
||
var filterFiles = function(files) { | ||
return files.filter(function(file) { | ||
return !file.match(/(example|__tests__)/) && (file.match(/\.js$/) || file.match(/\.d.ts$/)); | ||
let filterFiles = function (files) { | ||
return files.filter(function (file) { | ||
return (!file.match(/(example|__tests__)/) && file.match(/\.js$/)); | ||
}); | ||
}; | ||
|
||
function ensureDirectoryExistence(filePath) { | ||
var dirname = path.dirname(filePath); | ||
let dirname = path.dirname(filePath); | ||
if (fs.existsSync(dirname)) { | ||
return true; | ||
} | ||
ensureDirectoryExistence(dirname); | ||
fs.mkdirSync(dirname); | ||
} | ||
|
||
var files = filterFiles(walk('./src')); | ||
files.forEach(function(file) { | ||
if (file.match(/\.d.ts$/)) { | ||
var newFile = file.replace('./src', '.'); | ||
ensureDirectoryExistence(newFile); | ||
fs.createReadStream(file).pipe(fs.createWriteStream(newFile)); | ||
} else { | ||
babel.transformFile(file, babelOptions, function(err, result) { | ||
if (err) console.error(err); | ||
var newFile = file.replace('./src', '.'); | ||
ensureDirectoryExistence(newFile); | ||
fs.writeFile(newFile, result.code, function(err) { | ||
if (err) console.error(err); | ||
console.log('Babelified ' + file); | ||
}); | ||
}); | ||
} | ||
let files = filterFiles(walk('./src')); | ||
files.forEach(function (file) { | ||
let newFile = file.replace('./src', '.'); | ||
ensureDirectoryExistence(newFile); | ||
fs.createReadStream(file).pipe(fs.createWriteStream(newFile)); | ||
// fs.writeFile(newFile, result.code, function (err) { | ||
// if (err) console.error(err); | ||
// console.log('Babelified ' + file); | ||
// }); | ||
|
||
// babel.transformFile(file, babelOptions, function(err, result) { | ||
// if (err) console.error(err); | ||
// var newFile = file.replace('./src', '.'); | ||
// ensureDirectoryExistence(newFile); | ||
// fs.writeFile(newFile, result.code, function(err) { | ||
// if (err) console.error(err); | ||
// console.log('Babelified ' + file); | ||
// }); | ||
// }); | ||
}); |
Oops, something went wrong.