Skip to content

Commit

Permalink
Release 0.3.1 (#378)
Browse files Browse the repository at this point in the history
  • Loading branch information
dkchv authored Nov 14, 2017
1 parent e33e7aa commit 353019d
Show file tree
Hide file tree
Showing 713 changed files with 29,920 additions and 13,118 deletions.
10 changes: 10 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
[*]
indent_style = space
end_of_line = lf
indent_size = 2
charset = utf-8
trim_trailing_whitespace = true

[*.md]
max_line_length = 0
trim_trailing_whitespace = false
12 changes: 12 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
node_modules/**
**/node_modules/**
build/**
.tmp/**
mocks/**
docs/**
*.json
*.md
*.less
*.scss
*.svg
git
7 changes: 6 additions & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
module.exports = {
'extends': ['plugin:chronobank-react/recommended']
root: true,
extends: ['plugin:chronobank-react/recommended'],
rules: {
'space-before-function-paren': ['error', 'always'],
'import/no-extraneous-dependencies': 'off' // TODO Use webpack resolver possible to solve issues with aliased modules
}
};
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ coverage/
*.bac

/build
/report
.truffle-solidity-loader
/coverage
yarn.lock
Expand Down
58 changes: 32 additions & 26 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,27 +1,33 @@
sudo: required
sudo: true
dist: trusty
os: linux
group: stable
language: node_js
node_js: 7.9.0

install:
- npm install
- export NODE_ENV=''

script:
- npm run testrpc > /dev/null &
- sleep 5 && npm run bridge > /dev/null &
- sleep 60 && npm run contracts
- npm test -- --coverage

after_script:
- cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js

notifications:
slack: chrono-dev:a6jsr4kW5U4uxrGNOxygOWGF
email: false

cache:
directories:
- node_modules
branches:
only:
- master
- develop
jobs:
include:
- stage: build docker image
script:
- npm config set NPM_CONFIG_LOGLEVEL error
- npm install --silent
- npm run testrpc > /dev/null &
- sleep 5 && npm run bridge > /dev/null &
- sleep 60 && npm run contracts --silent
- npm test -- --coverage
- npm run build --silent
- FULL_GCR_KEY="-----BEGIN PRIVATE KEY-----\n"$GCR_KEY"\n-----END PRIVATE KEY-----\n"
- sed -i -e "s%\PWD%$FULL_GCR_KEY%g" gcregistry.json
- sed -i -e "s%branch%$TRAVIS_BRANCH%g" Dockerfile
- cat Dockerfile
- docker login -u _json_key -p "$(cat gcregistry.json)" https://gcr.io
- rm -rf gcregistry.json
- |
if [ "$TRAVIS_TAG" == "" ]; then
IMAGE_TAG_NAME="latest"
elif [ "$TRAVIS_TAG" != "" ]; then
IMAGE_TAG_NAME="$TRAVIS_TAG"
fi;
- docker build --quiet -t gcr.io/deep-wares-144610/$TRAVIS_BRANCH/chronomint:$IMAGE_TAG_NAME .
- docker push gcr.io/deep-wares-144610/$TRAVIS_BRANCH/chronomint:$IMAGE_TAG_NAME
- kill -9 $(ps ax | grep testrpc)
- kill -9 $(ps ax | grep bridge.js)
6 changes: 6 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
FROM node:7.9-slim
RUN mkdir -p /usr/src/app
WORKDIR /usr/src/app
COPY . /usr/src/app
EXPOSE 3000
CMD npm start
6 changes: 3 additions & 3 deletions config/babel.dev.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ module.exports = {
'babel-preset-react',
'babel-preset-env',
'babel-preset-react-hmre',
'babel-preset-stage-0'
'babel-preset-stage-0',
].map(require.resolve),
plugins: [
'babel-plugin-transform-decorators-legacy',
Expand All @@ -16,6 +16,6 @@ module.exports = {
'babel-plugin-transform-react-constant-elements',
'babel-plugin-transform-class-properties',
'babel-plugin-react-css-modules',
'react-hot-loader/babel'
].map(require.resolve)
'react-hot-loader/babel',
].map(require.resolve),
}
6 changes: 3 additions & 3 deletions config/babel.prod.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ module.exports = {
presets: [
'babel-preset-env',
'babel-preset-react',
'babel-preset-stage-0'
'babel-preset-stage-0',
].map(require.resolve),
plugins: [
'babel-plugin-transform-decorators-legacy',
Expand All @@ -13,6 +13,6 @@ module.exports = {
'babel-plugin-transform-object-rest-spread',
'babel-plugin-transform-react-constant-elements',
'babel-plugin-transform-class-properties',
'babel-plugin-react-css-modules'
].map(require.resolve)
'babel-plugin-react-css-modules',
].map(require.resolve),
}
100 changes: 100 additions & 0 deletions config/import-sort-style.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
/* eslint-disable */

function isComponent(imported) {
return /^components\//g.test(imported.moduleName)
}

function isPage(imported) {
return /^pages\//g.test(imported.moduleName)
}

function isDao(imported) {
return /^dao\//g.test(imported.moduleName)
}

function isModels(imported) {
return /^models\//g.test(imported.moduleName)
}

function isNetwork(imported) {
return /^network\//g.test(imported.moduleName)
}

function isRedux(imported) {
return /^redux\//g.test(imported.moduleName)
}

function isUtils(imported) {
return /^utils\//g.test(imported.moduleName)
}

function isStyle(imported) {
return /\.(?:css|less|scss)$/g.test(imported.moduleName)
}

function style(styleApi) {
const {
and,
hasNoMember,
hasMember,
isAbsoluteModule,
isRelativeModule,
member,
not,
naturally,
unicode
} = styleApi

return [
// import "foo"
{ match: and(hasNoMember, isAbsoluteModule) },
{ separator: false },

// import something "foo"
{ match: and(hasMember, isAbsoluteModule, not(isDao), not(isModels), not(isNetwork), not(isRedux), not(isComponent), not(isPage), not(isUtils)), sort: member(unicode) },
{ separator: false },

// DAO > Models > Actions > Components > Utils > Other > Styles

// import something "dao/"
{ match: and(hasMember, isAbsoluteModule, isDao), sort: member(naturally) },
{ separator: false },

// import something "models/"
{ match: and(hasMember, isAbsoluteModule, isModels), sort: member(naturally) },
{ separator: false },

// import something "network/"
{ match: and(hasMember, isAbsoluteModule, isNetwork), sort: member(naturally) },
{ separator: false },

// import something "redux/"
{ match: and(hasMember, isAbsoluteModule, isRedux), sort: member(naturally) },
{ separator: false },

// import something "pages/"
{ match: and(hasMember, isAbsoluteModule, isPage), sort: member(naturally) },
{ separator: false },

// import something "components/"
{ match: and(hasMember, isAbsoluteModule, isComponent), sort: member(naturally) },
{ separator: false },

// import something "utils/"
{ match: and(hasMember, isAbsoluteModule, isUtils), sort: member(naturally) },
{ separator: false },

// import something "./foo"
{ match: and(hasMember, isRelativeModule, not(isStyle)), sort: member(naturally) },
{ separator: true },

// import "./foo.css"
{ match: and(isStyle, isRelativeModule) },
{ separator: true }

]
}

Object.defineProperty(exports, '__esModule', { value: true })

exports.default = style
53 changes: 27 additions & 26 deletions config/webpack.config.base.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@

let path = require('path')

process.traceDeprecation = true

// TODO: hide this behind a flag and eliminate dead code on eject.
// This shouldn't be exposed to the user.
let isInNodeModules = path.basename(path.resolve(path.join(__dirname, '..', '..'))) === 'node_modules'
let relativePath = isInNodeModules ? '../../..' : '..'

let isInDebugMode = process.argv.some(arg =>
let isInDebugMode = process.argv.some((arg) =>
arg.indexOf('--debug-template') > -1
)

Expand All @@ -26,39 +26,40 @@ const buildConfig = (factory) => {
entry,
output,
babel,
plugins
plugins,
devtool,
} = factory({
srcPath,
indexHtmlPath,
faviconPath,
buildPath
buildPath,
})

return {
devtool: 'source-map',
devtool: devtool || 'source-map',
entry,
output,
plugins,
resolve: {
modules: [
srcPath,
'node_modules'
'node_modules',
],
extensions: ['.js', '.jsx', '.json', '.scss', '.css'],
alias: {
'@': path.join(__dirname, '..', 'src')
}
'@': path.join(__dirname, '..', 'src'),
},
},
node: {
fs: 'empty'
fs: 'empty',
},
module: {
rules: [
{
test: /(\.js|\.jsx)$/,
include: srcPath,
loader: 'babel-loader',
query: babel
query: babel,
},
{
test: /(\.scss)$/,
Expand All @@ -71,12 +72,12 @@ const buildConfig = (factory) => {
ident: 'postcss',
plugins: () => [
require('postcss-cssnext')(),
require('postcss-modules-values')
]
}
require('postcss-modules-values'),
],
},
},
{ loader: 'sass-loader', options: { sourceMap: true, outputStyle: 'expanded' } }
]
{ loader: 'sass-loader', options: { sourceMap: true, outputStyle: 'expanded' } },
],
},
{
test: /(\.css)$/,
Expand All @@ -88,34 +89,34 @@ const buildConfig = (factory) => {
sourceMap: true,
plugins: () => [
require('postcss-cssnext')(),
require('postcss-modules-values')
]
}
}
]
require('postcss-modules-values'),
],
},
},
],
},
{
test: /\.json$/,
loader: 'json-loader'
loader: 'json-loader',
},
{
test: /\.(jpg|png|gif)$/,
loader: 'file-loader'
loader: 'file-loader',
},
{ test: /\.eot(\?v=\d+.\d+.\d+)?$/, loader: 'file-loader' },
{ test: /\.otf(\?v=\d+.\d+.\d+)?$/, loader: 'file-loader' },
{ test: /\.woff(2)?(\?v=[0-9]\.[0-9]\.[0-9])?$/, use: [ { loader: 'url-loader', options: { limit: '10000', mimetype: 'application/font-woff' } } ] },
{ test: /\.ttf(\?v=\d+\.\d+\.\d+)?$/, use: [ { loader: 'url-loader', options: { limit: '10000', mimetype: 'octet-stream' } } ] },
{ test: /\.svg(\?v=\d+\.\d+\.\d+)?$/, use: [ { loader: 'url-loader', options: { limit: '10000', mimetype: 'image/svg+xml' } } ] }
{ test: /\.svg(\?v=\d+\.\d+\.\d+)?$/, use: [ { loader: 'url-loader', options: { limit: '10000', mimetype: 'image/svg+xml' } } ] },
// {
// test: /\.sol/,
// loader: 'truffle-solidity'
// }
]
}
],
},
}
}

module.exports = {
buildConfig
buildConfig,
}
Loading

0 comments on commit 353019d

Please sign in to comment.