Skip to content

Commit

Permalink
Release 2.2.0-beta3
Browse files Browse the repository at this point in the history
  • Loading branch information
Hartorn authored Sep 12, 2017
2 parents 69ecdbb + ffe1d86 commit 080cd55
Show file tree
Hide file tree
Showing 120 changed files with 2,541 additions and 2,190 deletions.
29 changes: 29 additions & 0 deletions .gitattributes
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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,4 @@ dist
/user
/util
index.js
.history
25 changes: 14 additions & 11 deletions .travis.yml
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
9 changes: 7 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,14 @@

[![NPM](https://nodei.co/npm/focus-core.png?downloads=true&downloadRank=true&stars=true)](https://nodei.co/npm/focus-core/)

[![Join the chat at https://gitter.im/KleeGroup/focus](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/KleeGroup/focus?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
[![master](https://travis-ci.org/KleeGroup/focus-core.svg?branch=master)](https://travis-ci.org/KleeGroup/focus-core)
[![develop](https://travis-ci.org/KleeGroup/focus-core.svg?branch=develop)](https://travis-ci.org/KleeGroup/focus-core)


[![Dependencies Status](https://david-dm.org/KleeGroup/focus-core.svg)](https://david-dm.org/KleeGroup/focus-core)
[![Dev Dependencies Status](https://david-dm.org/KleeGroup/focus-core/dev-status.svg)](https://david-dm.org/KleeGroup/focus-core?type=dev)
[![Peer Dependencies Status](https://david-dm.org/KleeGroup/focus-core/peer-status.svg)](https://david-dm.org/KleeGroup/focus-core?type=peer)

![Build Status](https://travis-ci.org/KleeGroup/focus.svg)
[![Package Quality](http://npm.packagequality.com/shield/focus-core.svg)](http://packagequality.com/#?package=focus-core)

**Currently in dev**
Expand Down
15 changes: 15 additions & 0 deletions jest-config.js
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']
}
129 changes: 48 additions & 81 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,25 +1,11 @@
{
"name": "focus-core",
"version": "2.1.1",
"version": "2.2.0-beta3",
"description": "Focus library core part.",
"main": "index.js",
"babel": {
"presets": [
"stage-0",
"react",
"es2015"
],
"plugins": [
"transform-class-properties",
"transform-decorators-legacy",
"add-module-exports",
"transform-proto-to-assign",
[
"transform-es2015-classes",
{
"loose": true
}
]
"focus"
]
},
"repository": {
Expand All @@ -39,81 +25,62 @@
"url": "https://github.com/KleeGroup/focus-core/issues"
},
"scripts": {
"babelify": "better-npm-run babelify",
"bundle": "better-npm-run bundle",
"test": "mocha src/**/__tests__/**/*.js",
"test:watch": "mocha src/**/__tests__/**/*.js -w",
"build": "better-npm-run babelify && better-npm-run bundle"
"build": "better-npm-run babelify",
"test": "better-npm-run test",
"test:watch": "better-npm-run test-watch",
"prepare": "npm run build",
"lint": "eslint src --ext .js,.jsx --ignore-pattern __tests__ --ignore-pattern example --ignore-pattern awesomplete",
"lint:error": "eslint src --ext .js,.jsx --ignore-pattern __tests__ --ignore-pattern example --ignore-pattern awesomplete --quiet",
"fix-lint": "eslint src/** --ext .js,.jsx --fix --ignore-pattern __tests__ --ignore-pattern example --ignore-pattern awesomplete"
},
"betterScripts": {
"babelify": {
"env": {
"BABEL_ENV": "production",
"LEGACY_EXPORTS": "true"
},
"command": "node scripts/babelify.js"
},
"bundle": {
"command": "webpack --progress",
"test": {
"command": "jest --config jest-config.js --runInBand --no-cache",
"env": {
"DEV": false,
"NODE_ENV": "production",
"LIBRARY_NAME": "FocusCore",
"MINIMIFY": false,
"PACKAGE_JSON_PATH": "../"
"BABEL_ENV": "production",
"LEGACY_EXPORTS": "true"
}
},
"test-watch": {
"command": "jest --config jest-config.js --runInBand --watch ",
"env": {
"BABEL_ENV": "production",
"LEGACY_EXPORTS": "true"
}
}
},
"peerDependencies": {
"moment": "2.18.1",
"numeral": "2.0.6",
"react": "15.4.2",
"react-dom": "15.4.2"
},
"dependencies": {
"@types/flux": "^0.0.30",
"@types/node": "^6.0.38",
"flux": "^2.0.3",
"i18next-client": "^1.11.4",
"immutable": "^3.7.3",
"keymirror": "^0.1.1",
"lodash": "^3.9.1",
"object-assign": "^2.0.0",
"uuid": "^2.0.1"
"flux": "3.1.3",
"i18next": "9.0.0",
"immutable": "3.8.1",
"lodash": "3.10.1",
"object-assign": "4.1.1",
"uuid": "3.1.0"
},
"devDependencies": {
"babel": "^6.3.26",
"babel-cli": "^6.4.0",
"babel-core": "^6.4.0",
"babel-eslint": "4.1.3",
"babel-loader": "^6.2.1",
"babel-plugin-add-module-exports": "^0.1.2",
"babel-plugin-runtime": "^1.0.7",
"babel-plugin-transform-class-properties": "^6.4.0",
"babel-plugin-transform-decorators-legacy": "^1.3.4",
"babel-plugin-transform-es2015-classes": "^6.5.2",
"babel-plugin-transform-proto-to-assign": "^6.5.0",
"babel-preset-es2015": "^6.3.13",
"babel-preset-react": "^6.3.13",
"babel-preset-stage-0": "^6.3.13",
"babel-runtime": "^6.3.19",
"better-npm-run": "0.0.5",
"chai": "^3.2.0",
"chai-subset": "^1.1.0",
"css-loader": "^0.19.0",
"eslint": "1.5.1",
"eslint-config-focus": "0.3.0",
"eslint-plugin-filenames": "0.1.1",
"eslint-plugin-react": "3.5.0",
"express": "^4.12.2",
"extract-text-webpack-plugin": "^0.8.2",
"file-loader": "^0.8.4",
"jquery": "^2.1.4",
"json-loader": "^0.5.3",
"mocha": "^2.3.2",
"moment": "^2.10.6",
"node-sass": "^3.3.3",
"numeral": "^1.5.3",
"react": "^15.2.1",
"react-addons-test-utils": "^15.2.1",
"react-dom": "^15.2.1",
"react-hot-loader": "^1.3.0",
"sass-loader": "^3.0.0",
"source-map-loader": "^0.1.5",
"style-loader": "^0.12.4",
"url-loader": "^0.5.6",
"webpack": "^1.12.2",
"webpack-dev-server": "^1.11.0",
"webpack-focus": "^0.11.0"
"babel-jest": "21.0.2",
"babel-preset-focus": "1.0.0-beta1",
"better-npm-run": "0.1.0",
"eslint-config-focus": "0.6.0",
"jest-cli": "21.0.2",
"jsdom": "11.2.0",
"moment": "2.18.1",
"numeral": "2.0.6",
"react": "15.4.2",
"react-addons-test-utils": "15.4.2",
"react-dom": "15.4.2"
}
}
}
82 changes: 37 additions & 45 deletions scripts/babelify.js
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);
// });
// });
});
Loading

0 comments on commit 080cd55

Please sign in to comment.