Skip to content

Commit

Permalink
Init project
Browse files Browse the repository at this point in the history
  • Loading branch information
usulpro committed Nov 22, 2016
1 parent 496a035 commit e47e223
Show file tree
Hide file tree
Showing 40 changed files with 1,659 additions and 249 deletions.
3 changes: 3 additions & 0 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"presets": ["es2015", "stage-0", "react"]
}
29 changes: 29 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
"extends": "airbnb",
"parser": "babel-eslint",
"rules": {
"arrow-body-style": 0,
"prefer-arrow-callback": 0,
"func-names": 0,
"eqeqeq": 1,
"no-unused-vars": 1,
"react/jsx-no-bind": 1,
"react/jsx-uses-react": 1,
"react/prefer-stateless-function": 0,
// indentation
"indent": [ 2, 4 ],
"max-len": [1, 100],
// comment
'spaced-comment': ['warn', 'always', {
exceptions: ['-', '+','todo'],
markers: ['=', '!'] // space here to support sprockets directives
}],
"no-use-before-define": [ 2, { "functions": false } ],
},
"parserOptions": {
"ecmaVersion": 6,
"ecmaFeatures": {
"experimentalObjectRestSpread": true
}
}
}
4 changes: 2 additions & 2 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
node_modules
develop
.#develop
example
src
docs
doc
.babelrc
.eslintrc
.scripts
Expand Down
11 changes: 11 additions & 0 deletions .scripts/get_gh_pages_url.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
// IMPORTANT
// ---------
// This is an auto generated file with React CDK.
// Do not modify this file.

const parse = require('git-url-parse');
var ghUrl = process.argv[2];
const parsedUrl = parse(ghUrl);

const ghPagesUrl = 'https://' + parsedUrl.owner + '.github.io/' + parsedUrl.name;
console.log(ghPagesUrl);
6 changes: 6 additions & 0 deletions .scripts/lint.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
var path = require('path');
var shell = require('shelljs');
var chalk = require('chalk');
var lint = ['node_modules', '.bin', 'eslint'].join(path.sep);

shell.exec(lint + ' src --ext .jsx,.js --color');
6 changes: 6 additions & 0 deletions .scripts/lintfix.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
var path = require('path');
var shell = require('shelljs');
var chalk = require('chalk');
var lint = ['node_modules', '.bin', 'eslint'].join(path.sep);

shell.exec(lint + ' src --ext .jsx,.js --fix');
33 changes: 33 additions & 0 deletions .scripts/mocha_runner.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
// IMPORTANT
// ---------
// This is an auto generated file with React CDK.
// Do not modify this file.
// Use `.scripts/user/pretest.js instead`.

require('babel-core/register');
require('babel-polyfill');

// Add jsdom support, which is required for enzyme.
var jsdom = require('jsdom').jsdom;

var exposedProperties = ['window', 'navigator', 'document'];

global.document = jsdom('');
global.window = document.defaultView;
Object.keys(document.defaultView).forEach((property) => {
if (typeof global[property] === 'undefined') {
exposedProperties.push(property);
global[property] = document.defaultView[property];
}
});

global.navigator = {
userAgent: 'node.js'
};

process.on('unhandledRejection', function (error) {
console.error('Unhandled Promise Rejection:');
console.error(error && error.stack || error);
});

// require('./user/pretest.js');
6 changes: 6 additions & 0 deletions .scripts/npm-postpublish.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
var path = require('path');
var shell = require('shelljs');
var chalk = require('chalk');
var babel = ['node_modules', '.bin', 'babel'].join(path.sep);

shell.echo(chalk.blue('Package was published'))
14 changes: 14 additions & 0 deletions .scripts/npm-prepublish.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
var path = require('path');
var shell = require('shelljs');
var chalk = require('chalk');
var babel = ['node_modules', '.bin', 'babel'].join(path.sep);

shell.echo(chalk.blue('Transpiling \'src\' into ES5 ...'));
shell.echo('');

shell.rm('-rf', 'dist');
shell.exec(babel + ' --ignore tests,stories,story.jsx src --out-dir dist');

shell.echo('');
shell.echo(chalk.blue('Transpiling completed.'));
shell.echo('');
7 changes: 7 additions & 0 deletions .scripts/prepublish.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
echo "Transpiling 'src' into ES5 ..."
if [ -e dist ]
then
rm -r dist
fi
./node_modules/.bin/babel --ignore tests,stories --plugins "transform-runtime" ./src --out-dir ./dist
echo "Transpiling completed."
43 changes: 43 additions & 0 deletions .scripts/publish_storybook.cmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
@echo off

setlocal enabledelayedexpansion

set GIT_URL_CMD=git config --get remote.origin.url
for /F "usebackq delims=" %%v in (`%GIT_URL_CMD%`) do set GIT_URL=%%v

if %GIT_URL%=="" (
echo This project is not configured with a remote git repo
exit 1
)

if exist .out (
rmdir /S /Q .out
)

md .out

call build-storybook -o .out

cd .out

git init
git config user.name "GH Pages Bot"
git config user.email "windows@ghbot.com"
git add .
git commit -m "Deploy Storybook to GitHub Pages"
git push --force --quiet !GIT_URL! master:gh-pages

cd ..
rmdir /S /Q .out

set GHP_URL_CMD=node .scripts/get_gh_pages_url.js !GIT_URL!
for /F "usebackq delims=" %%w in (`%GHP_URL_CMD%`) do set GHP_URL=%%w

echo ## Deploy >storybook.md
echo Storybook deployed to: [!GHP_URL!](!GHP_URL!)>>storybook.md

echo .
echo Storybook deployed to: !GHP_URL!
echo See the %cd%\storybook.md

endlocal
4 changes: 4 additions & 0 deletions .scripts/test-watch.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/bash

./node_modules/.bin/mocha --require .scripts/mocha_runner src/**/tests/**/*.js --watch --watch-extensions jsx

4 changes: 4 additions & 0 deletions .scripts/test.cmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
@echo off
call .\node_modules\.bin\mocha --require .scripts/mocha_runner src/**/tests/**/*.js
rem Please no errors

3 changes: 3 additions & 0 deletions .storybook/addons.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import 'storybook-addon-material-ui';
import '@kadira/storybook/addons';
import '@kadira/storybook-addon-options/register';
20 changes: 20 additions & 0 deletions .storybook/config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import * as storybook from '@kadira/storybook';
import { setOptions } from '@kadira/storybook-addon-options';

setOptions({
name: 'React Theming',
url: 'https://github.com/sm-react/react-theming',
goFullScreen: true,
showLeftPanel: true,
showDownPanel: true,
showSearchBox: false,
downPanelInRight: false,
});

storybook.configure(
() => {
require('../src/stories');
require('../src/ThemeSwitcher.story');
},
module
);
49 changes: 49 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
## Changelog

### v0.1.0

* Initial project with:

- React Storybook

- storybook-addon-material-ui

- React Theme Provider


* Scripts:

- npm start

- npm publish

- npm run lint

- npm run lintfix


* App structure:

- App.jsx

- Header.jsx

- Intro.jsx

- ThemeSwitcher.jsx

* Themes:

- Light Theme

- Dark Theme

- Gray Theme

- CSSrules

* Readme

* Github Page Live Demo


74 changes: 74 additions & 0 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
# Contributor Covenant Code of Conduct

## Our Pledge

In the interest of fostering an open and welcoming environment, we as
contributors and maintainers pledge to making participation in our project and
our community a harassment-free experience for everyone, regardless of age, body
size, disability, ethnicity, gender identity and expression, level of experience,
nationality, personal appearance, race, religion, or sexual identity and
orientation.

## Our Standards

Examples of behavior that contributes to creating a positive environment
include:

* Using welcoming and inclusive language
* Being respectful of differing viewpoints and experiences
* Gracefully accepting constructive criticism
* Focusing on what is best for the community
* Showing empathy towards other community members

Examples of unacceptable behavior by participants include:

* The use of sexualized language or imagery and unwelcome sexual attention or
advances
* Trolling, insulting/derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or electronic
address, without explicit permission
* Other conduct which could reasonably be considered inappropriate in a
professional setting

## Our Responsibilities

Project maintainers are responsible for clarifying the standards of acceptable
behavior and are expected to take appropriate and fair corrective action in
response to any instances of unacceptable behavior.

Project maintainers have the right and responsibility to remove, edit, or
reject comments, commits, code, wiki edits, issues, and other contributions
that are not aligned to this Code of Conduct, or to ban temporarily or
permanently any contributor for other behaviors that they deem inappropriate,
threatening, offensive, or harmful.

## Scope

This Code of Conduct applies both within project spaces and in public spaces
when an individual is representing the project or its community. Examples of
representing a project or community include using an official project e-mail
address, posting via an official social media account, or acting as an appointed
representative at an online or offline event. Representation of a project may be
further defined and clarified by project maintainers.

## Enforcement

Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported by contacting the project team at welcome@sm-artlight.com. All
complaints will be reviewed and investigated and will result in a response that
is deemed necessary and appropriate to the circumstances. The project team is
obligated to maintain confidentiality with regard to the reporter of an incident.
Further details of specific enforcement policies may be posted separately.

Project maintainers who do not follow or enforce the Code of Conduct in good
faith may face temporary or permanent repercussions as determined by other
members of the project's leadership.

## Attribution

This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
available at [http://contributor-covenant.org/version/1/4][version]

[homepage]: http://contributor-covenant.org
[version]: http://contributor-covenant.org/version/1/4/
Loading

0 comments on commit e47e223

Please sign in to comment.