Skip to content

Commit

Permalink
Improved release scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
mtscout6 committed Mar 23, 2015
1 parent ae09caa commit e57b7a4
Show file tree
Hide file tree
Showing 51 changed files with 560 additions and 997 deletions.
18 changes: 7 additions & 11 deletions .gitignore
@@ -1,18 +1,14 @@
*~
.DS_Store
npm-debug.log
test_bundle.js
test-built/*
.idea
transpiled/*
docs/*.html
docs/assets/bundle.js
cjs/*

node_modules
amd/*
ie8/bundle.js
lib/*
amd/
!tools/amd/
lib/
!tools/lib/
dist/
!tools/dist/
docs-built/
ie8/bundle.js
tmp-bower-repo/
tmp-docs-repo/
8 changes: 4 additions & 4 deletions .npmignore
@@ -1,11 +1,11 @@
node_modules/
docs/
docs-built/
test-built/
test/
tools/
.gitignore
.travis.yml
Gruntfile.js
karma.ci.js
karma.dev.js
test_bundle.js
karma.conf.js
tmp-docs-repo/
tmp-bower-repo/
17 changes: 17 additions & 0 deletions CONTRIBUTING.md
Expand Up @@ -3,10 +3,27 @@
We welcome community support with both pull requests and reporting bugs. Please
don't hesitate to jump in.

## Current Issues

Feel free to tackle any currently open
[issue](https://github.com/react-bootstrap/react-bootstrap/issues). The issues
tagged with "help wanted" are especially open.

## Tests

All commits that fix bugs or add features need a test.

## Code Style

Please adhere to the current code styling. We have included an `.editorconfig`
at the repo's root to facilitate uniformity regardless of your editor. See the
[editor config site](http://editorconfig.org/) for integration details.

We use [ESLint](http://eslint.org/) for all JavaScript Linting. There should be
no linting errors and no new warnings for new work. You are welcome to configure
your editor to use ESLint or the `npm test` command will run unit tests and the
linter.

## Commit Subjects for Public API Changes

If your patch **changes the API or fixes a bug** please use one of the following
Expand Down
18 changes: 11 additions & 7 deletions README.md
Expand Up @@ -8,7 +8,7 @@ Under active development - APIs will change.

## Docs

A [docs site](http://react-bootstrap.github.io) with live editable examples is a work in progress
See the [documentation](http://react-bootstrap.github.io) with live editable examples.

### Bootstrap Version

Expand All @@ -25,11 +25,15 @@ and many [contributors](https://github.com/react-bootstrap/react-bootstrap/graph

- [react-router-bootstrap](https://github.com/mtscout6/react-router-bootstrap) - Integration with [react-router](https://github.com/rackt/react-router).

## Contributions
## Local Setup

- Install the dependencies with `npm install`
- Run tests `npm test`
- Run tests in watch mode `npm run test-watch`
- Run the docs site in development mode with `npm run docs-run`. This will watch
for file changes as you work. Simply refresh the page to see the updates.
- Build with `npm run build`

Yes please!
## Contributions

- Run `npm install`, `npm run test-watch` to run tests while you develop (however this hides any build errors, you can see these with `grunt build`)
- Add tests for any new or changed functionality
- See [issues](https://github.com/stevoland/react-bootstrap/issues) for some ideas
- Follow existing style
Yes please! See the [contributing guidelines](https://github.com/react-bootstrap/react-bootstrap/blob/master/CONTRIBUTING.md) for details.
11 changes: 0 additions & 11 deletions docs/.gitignore-template

This file was deleted.

10 changes: 10 additions & 0 deletions docs/README.docs.md
@@ -0,0 +1,10 @@
# React Bootstrap Documentation Website

This website is single page app built on
[React](http://facebook.github.io/react/), with styles and structure taken from
the [Bootstrap](http://getbootstrap.com/) docs website. The app is statically
generated to HTML via node and then hosted it by pushing HTML to [GitHub
Pages](http://pages.github.com/).

Source can be found in the
[react-bootstrap](https://github.com/react-bootstrap/react-bootstrap) repo.
40 changes: 29 additions & 11 deletions docs/build.js 100755 → 100644
@@ -1,15 +1,33 @@
/* eslint no-var: 0 */
'use strict';
import path from 'path';
import Root from './src/Root';
import fsp from 'fs-promise';
import { exec, spawn } from 'child-process-promise';

require('babel/register');
const repoRoot = path.resolve(__dirname, '../');
const docsBuilt = path.join(repoRoot, 'docs-built');

var fs = require('fs');
var path = require('path');
var Root = require('./src/Root');
const license = path.join(repoRoot, 'LICENSE');
const readmeSrc = path.join(__dirname, 'README.docs.md');
const readmeDest = path.join(docsBuilt, 'README.md');

Root.getPages()
.forEach(function (fileName) {
var RootHTML = Root.renderToString({initialPath: fileName});
export default function BuildDocs() {
console.log('Building: '.cyan + 'docs'.green);

fs.writeFileSync(path.join(__dirname, '../docs-built', fileName), RootHTML);
});
return exec(`rm -rf ${docsBuilt}`)
.then(() => fsp.mkdir(docsBuilt))
.then(() => {
let writes = Root
.getPages()
.map(fileName => {
let RootHTML = Root.renderToString({initialPath: fileName});
return fsp.writeFile(path.join(docsBuilt, fileName), RootHTML);
});

return Promise.all(writes.concat([
exec(`webpack --config webpack.docs.js -p --bail`),
exec(`cp ${license} ${docsBuilt}`),
exec(`cp ${readmeSrc} ${readmeDest}`)
]));
})
.then(() => console.log('Built: '.cyan + 'docs'.green));
}
3 changes: 3 additions & 0 deletions docs/client.js
Expand Up @@ -11,4 +11,7 @@ import Root from './src/Root';
// For React devtools
window.React = React;

const blah = 4;
blah = 5;

React.render(<Root {...window.INITIAL_PROPS} />, document);
31 changes: 13 additions & 18 deletions docs/server.js
@@ -1,28 +1,24 @@
'use strict';
import express from 'express';
import path from 'path';
import url from 'url';
import webpack from 'webpack';
import webpackMiddleware from 'webpack-dev-middleware';
import webpackConfigBuilder from '../webpack/webpack.config';
import Root from './src/Root';

var express = require('express');

var development = process.env.NODE_ENV !== 'production';
var app = express();
var path = require('path');
const development = process.env.NODE_ENV !== 'production';
let app = express();

if (development) {
require('babel/register');
var path = require('path');
var url = require('url');
var webpack = require('webpack');
var webpackMiddleware = require('webpack-dev-middleware');
var webpackConfig = require('../webpack/webpack.config')({
let webpackConfig = webpackConfigBuilder({
development: development,
docs: true
});
var publicPath = webpackConfig.output.publicPath;
let publicPath = webpackConfig.output.publicPath;

webpackConfig.output.path = '/';
webpackConfig.output.publicPath = undefined;

var Root = require('./src/Root');

app = app
.use(webpackMiddleware(webpack(webpackConfig), {
noInfo: false,
Expand All @@ -32,9 +28,8 @@ if (development) {
}
}))
.use(function renderApp(req, res) {
var fileName = url.parse(req.url).pathname;
var RootHTML = Root.renderToString({initialPath: fileName});

let fileName = url.parse(req.url).pathname;
let RootHTML = Root.renderToString({initialPath: fileName});
res.send(RootHTML);
});
} else {
Expand Down
8 changes: 4 additions & 4 deletions docs/src/ComponentsPage.js
Expand Up @@ -2,10 +2,10 @@

import React from 'react';

import Affix from '../../lib/Affix';
import Nav from '../../lib/Nav';
import SubNav from '../../lib/SubNav';
import NavItem from '../../lib/NavItem';
import Affix from '../../src/Affix';
import Nav from '../../src/Nav';
import SubNav from '../../src/SubNav';
import NavItem from '../../src/NavItem';

import NavMain from './NavMain';
import PageHeader from './PageHeader';
Expand Down
4 changes: 2 additions & 2 deletions docs/src/NavMain.js
@@ -1,7 +1,7 @@
import React from 'react';
import Router from 'react-router-component';
import Navbar from '../../lib/Navbar';
import Nav from '../../lib/Nav';
import Navbar from '../../src/Navbar';
import Nav from '../../src/Nav';

const InternalLink = Router.Link;

Expand Down
80 changes: 40 additions & 40 deletions docs/src/ReactPlayground.js
@@ -1,46 +1,46 @@
/* eslint-disable */
import React from 'react';
import classSet from 'react/lib/cx';
import Accordion from '../../lib/Accordion';
import Alert from '../../lib/Alert';
import Badge from '../../lib/Badge';
import Button from '../../lib/Button';
import ButtonGroup from '../../lib/ButtonGroup';
import ButtonToolbar from '../../lib/ButtonToolbar';
import CollapsableMixin from '../../lib/CollapsableMixin';
import Carousel from '../../lib/Carousel';
import CarouselItem from '../../lib/CarouselItem';
import Col from '../../lib/Col';
import DropdownButton from '../../lib/DropdownButton';
import Glyphicon from '../../lib/Glyphicon';
import Grid from '../../lib/Grid';
import Input from '../../lib/Input';
import Jumbotron from '../../lib/Jumbotron';
import Label from '../../lib/Label';
import ListGroup from '../../lib/ListGroup';
import ListGroupItem from '../../lib/ListGroupItem';
import Nav from '../../lib/Nav';
import Navbar from '../../lib/Navbar';
import NavItem from '../../lib/NavItem';
import MenuItem from '../../lib/MenuItem';
import Modal from '../../lib/Modal';
import ModalTrigger from '../../lib/ModalTrigger';
import OverlayTrigger from '../../lib/OverlayTrigger';
import OverlayMixin from '../../lib/OverlayMixin';
import PageHeader from '../../lib/PageHeader';
import PageItem from '../../lib/PageItem';
import Pager from '../../lib/Pager';
import Panel from '../../lib/Panel';
import PanelGroup from '../../lib/PanelGroup';
import Popover from '../../lib/Popover';
import ProgressBar from '../../lib/ProgressBar';
import Row from '../../lib/Row';
import SplitButton from '../../lib/SplitButton';
import TabbedArea from '../../lib/TabbedArea';
import Table from '../../lib/Table';
import TabPane from '../../lib/TabPane';
import Tooltip from '../../lib/Tooltip';
import Well from '../../lib/Well';
import Accordion from '../../src/Accordion';
import Alert from '../../src/Alert';
import Badge from '../../src/Badge';
import Button from '../../src/Button';
import ButtonGroup from '../../src/ButtonGroup';
import ButtonToolbar from '../../src/ButtonToolbar';
import CollapsableMixin from '../../src/CollapsableMixin';
import Carousel from '../../src/Carousel';
import CarouselItem from '../../src/CarouselItem';
import Col from '../../src/Col';
import DropdownButton from '../../src/DropdownButton';
import Glyphicon from '../../src/Glyphicon';
import Grid from '../../src/Grid';
import Input from '../../src/Input';
import Jumbotron from '../../src/Jumbotron';
import Label from '../../src/Label';
import ListGroup from '../../src/ListGroup';
import ListGroupItem from '../../src/ListGroupItem';
import Nav from '../../src/Nav';
import Navbar from '../../src/Navbar';
import NavItem from '../../src/NavItem';
import MenuItem from '../../src/MenuItem';
import Modal from '../../src/Modal';
import ModalTrigger from '../../src/ModalTrigger';
import OverlayTrigger from '../../src/OverlayTrigger';
import OverlayMixin from '../../src/OverlayMixin';
import PageHeader from '../../src/PageHeader';
import PageItem from '../../src/PageItem';
import Pager from '../../src/Pager';
import Panel from '../../src/Panel';
import PanelGroup from '../../src/PanelGroup';
import Popover from '../../src/Popover';
import ProgressBar from '../../src/ProgressBar';
import Row from '../../src/Row';
import SplitButton from '../../src/SplitButton';
import TabbedArea from '../../src/TabbedArea';
import Table from '../../src/Table';
import TabPane from '../../src/TabPane';
import Tooltip from '../../src/Tooltip';
import Well from '../../src/Well';
/* eslint-enable */

import {CodeMirror, IS_NODE} from './CodeMirror';
Expand Down
2 changes: 1 addition & 1 deletion karma.conf.js
@@ -1,5 +1,5 @@
/* eslint no-var: 0 */
require('babel/register');
require('./register-babel');

var webpackConfig = require('./webpack/test.config.js');
var isCI = process.env.CONTINUOUS_INTEGRATION === 'true';
Expand Down

0 comments on commit e57b7a4

Please sign in to comment.