Skip to content

Commit 0193046

Browse files
committed
[changed] Move built components to lib directory
In the past this library has suffered from accidentally pushing this repo directly to npm without the built components. There has been a separate repo to which the built source has been pushed and later deployed from. While the approach is feasible it prevents you from using the `npm link` feature, for easy testing of changes in your own application. This should address concerns like react-bootstrap#325, react-bootstrap#218, and any others like them that I have missed. In particular this is the fix for an automated setup as mentioned in react-bootstrap#292. If you are currently using components directly from this library, then you will need to change your reference path. For example `require('react-bootstrap/Alert')` should now be `require('react-bootstrap/lib/Alert')`. `require('react-bootstrap').Alert` will still work. This applies to both CommonJS and AMD usages.
1 parent 3f1a679 commit 0193046

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+200
-194
lines changed

.gitignore

+2-1
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,5 @@ docs/*.html
1010
docs/assets/bundle.js
1111
cjs/*
1212
amd/*
13-
ie8/bundle.js
13+
ie8/bundle.js
14+
lib/*

Gruntfile.js

+6-6
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,13 @@ module.exports = function (grunt) {
88
expand: true,
99
cwd: 'src/',
1010
src: ['**/*.js'],
11-
dest: 'amd/'
11+
dest: 'amd/lib'
1212
},
1313
transpiled: {
1414
expand: true,
1515
cwd: 'transpiled/',
1616
src: ['**/*.js'],
17-
dest: 'amd/'
17+
dest: 'amd/lib'
1818
}
1919
},
2020

@@ -35,17 +35,17 @@ module.exports = function (grunt) {
3535
expand: true,
3636
cwd: 'transpiled/',
3737
src: ['**/*.js'],
38-
dest: 'cjs/'
38+
dest: 'lib/'
3939
},
4040
{
4141
expand: true,
4242
cwd: 'src/',
4343
src: ['**/*.js'],
44-
dest: 'cjs/'
44+
dest: 'lib/'
4545
},
4646
{
4747
src: ['**/*'],
48-
dest: 'cjs/',
48+
dest: 'lib/',
4949
cwd: 'tools/cjs',
5050
expand: true
5151
}
@@ -88,7 +88,7 @@ module.exports = function (grunt) {
8888

8989
clean: {
9090
transpiled: ['transpiled'],
91-
cjs: ['cjs'],
91+
cjs: ['lib'],
9292
amd: ['amd'],
9393
test: ['test-built']
9494
},

docs/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
},
2525
"scripts": {
2626
"test": "echo \"Error: no test specified\" && exit 1",
27-
"start": "supervisor -w .,../cjs -i node_modules server.js",
27+
"start": "supervisor -w .,../lib -i node_modules server.js",
2828
"build": "node build.js && browserify client.js | uglifyjs -cm 2>/dev/null > ./assets/bundle.js",
2929
"start-prod": "NODE_ENV=production node server.js"
3030
},

docs/src/ComponentsPage.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@
33
var React = require('react');
44
var fs = require('fs');
55

6-
var Affix = require('../../cjs/Affix');
7-
var Nav = require('../../cjs/Nav');
8-
var SubNav = require('../../cjs/SubNav');
9-
var NavItem = require('../../cjs/NavItem');
6+
var Affix = require('../../lib/Affix');
7+
var Nav = require('../../lib/Nav');
8+
var SubNav = require('../../lib/SubNav');
9+
var NavItem = require('../../lib/NavItem');
1010

1111
var NavMain = require('./NavMain');
1212
var PageHeader = require('./PageHeader');

docs/src/GettingStartedPage.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ var Page = React.createClass({
3434
$ npm install react-bootstrap\n\
3535
'}</code></pre>
3636
<pre><code className="js">{'\
37-
var Alert = require(\'react-bootstrap/Alert\');\n\
37+
var Alert = require(\'react-bootstrap/lib/Alert\');\n\
3838
// or\n\
3939
var Alert = require(\'react-bootstrap\').Alert;\
4040
'}</code></pre>
@@ -47,7 +47,7 @@ var Page = React.createClass({
4747
$ bower install react-bootstrap\n\
4848
'}</code></pre>
4949
<pre><code className="js">{'\
50-
var Alert = require(\'react-bootstrap/Alert\');\n\
50+
var Alert = require(\'react-bootstrap/lib/Alert\');\n\
5151
// or\n\
5252
var Alert = require(\'react-bootstrap\').Alert;\
5353
'}</code></pre>

docs/src/NavMain.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22

33
var React = require('react');
44
var Router = require('react-router-component');
5-
var Navbar = require('../../cjs/Navbar');
6-
var Nav = require('../../cjs/Nav');
5+
var Navbar = require('../../lib/Navbar');
6+
var Nav = require('../../lib/Nav');
77

88
var InternalLink = Router.Link;
99

docs/src/ReactPlayground.js

+39-39
Original file line numberDiff line numberDiff line change
@@ -2,45 +2,45 @@ var React = require('react');
22
var classSet = require('react/lib/cx');
33
var CodeMirror = global.CodeMirror;
44
var JSXTransformer = global.JSXTransformer;
5-
var Accordion = require('../../cjs/Accordion');
6-
var Alert = require('../../cjs/Alert');
7-
var Badge = require('../../cjs/Badge');
8-
var Button = require('../../cjs/Button');
9-
var ButtonGroup = require('../../cjs/ButtonGroup');
10-
var ButtonToolbar = require('../../cjs/ButtonToolbar');
11-
var Carousel = require('../../cjs/Carousel');
12-
var CarouselItem = require('../../cjs/CarouselItem');
13-
var Col = require('../../cjs/Col');
14-
var DropdownButton = require('../../cjs/DropdownButton');
15-
var Glyphicon = require('../../cjs/Glyphicon');
16-
var Grid = require('../../cjs/Grid');
17-
var Input = require('../../cjs/Input');
18-
var Jumbotron = require('../../cjs/Jumbotron');
19-
var Label = require('../../cjs/Label');
20-
var ListGroup = require('../../cjs/ListGroup');
21-
var ListGroupItem = require('../../cjs/ListGroupItem');
22-
var Nav = require('../../cjs/Nav');
23-
var Navbar = require('../../cjs/Navbar');
24-
var NavItem = require('../../cjs/NavItem');
25-
var MenuItem = require('../../cjs/MenuItem');
26-
var Modal = require('../../cjs/Modal');
27-
var ModalTrigger = require('../../cjs/ModalTrigger');
28-
var OverlayTrigger = require('../../cjs/OverlayTrigger');
29-
var OverlayMixin = require('../../cjs/OverlayMixin');
30-
var PageHeader = require('../../cjs/PageHeader');
31-
var PageItem = require('../../cjs/PageItem');
32-
var Pager = require('../../cjs/Pager');
33-
var Panel = require('../../cjs/Panel');
34-
var PanelGroup = require('../../cjs/PanelGroup');
35-
var Popover = require('../../cjs/Popover');
36-
var ProgressBar = require('../../cjs/ProgressBar');
37-
var Row = require('../../cjs/Row');
38-
var SplitButton = require('../../cjs/SplitButton');
39-
var TabbedArea = require('../../cjs/TabbedArea');
40-
var Table = require('../../cjs/Table');
41-
var TabPane = require('../../cjs/TabPane');
42-
var Tooltip = require('../../cjs/Tooltip');
43-
var Well = require('../../cjs/Well');
5+
var Accordion = require('../../lib/Accordion');
6+
var Alert = require('../../lib/Alert');
7+
var Badge = require('../../lib/Badge');
8+
var Button = require('../../lib/Button');
9+
var ButtonGroup = require('../../lib/ButtonGroup');
10+
var ButtonToolbar = require('../../lib/ButtonToolbar');
11+
var Carousel = require('../../lib/Carousel');
12+
var CarouselItem = require('../../lib/CarouselItem');
13+
var Col = require('../../lib/Col');
14+
var DropdownButton = require('../../lib/DropdownButton');
15+
var Glyphicon = require('../../lib/Glyphicon');
16+
var Grid = require('../../lib/Grid');
17+
var Input = require('../../lib/Input');
18+
var Jumbotron = require('../../lib/Jumbotron');
19+
var Label = require('../../lib/Label');
20+
var ListGroup = require('../../lib/ListGroup');
21+
var ListGroupItem = require('../../lib/ListGroupItem');
22+
var Nav = require('../../lib/Nav');
23+
var Navbar = require('../../lib/Navbar');
24+
var NavItem = require('../../lib/NavItem');
25+
var MenuItem = require('../../lib/MenuItem');
26+
var Modal = require('../../lib/Modal');
27+
var ModalTrigger = require('../../lib/ModalTrigger');
28+
var OverlayTrigger = require('../../lib/OverlayTrigger');
29+
var OverlayMixin = require('../../lib/OverlayMixin');
30+
var PageHeader = require('../../lib/PageHeader');
31+
var PageItem = require('../../lib/PageItem');
32+
var Pager = require('../../lib/Pager');
33+
var Panel = require('../../lib/Panel');
34+
var PanelGroup = require('../../lib/PanelGroup');
35+
var Popover = require('../../lib/Popover');
36+
var ProgressBar = require('../../lib/ProgressBar');
37+
var Row = require('../../lib/Row');
38+
var SplitButton = require('../../lib/SplitButton');
39+
var TabbedArea = require('../../lib/TabbedArea');
40+
var Table = require('../../lib/Table');
41+
var TabPane = require('../../lib/TabPane');
42+
var Tooltip = require('../../lib/Tooltip');
43+
var Well = require('../../lib/Well');
4444

4545
var IS_MOBILE = typeof navigator !== 'undefined' && (
4646
navigator.userAgent.match(/Android/i)

ie8/src.js

+16-16
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
11
/** @jsx React.DOM */
22
var React = require('react');
3-
var Button = require('../cjs/Button');
4-
var DropdownButton = require('../cjs/DropdownButton');
5-
var MenuItem = require('../cjs/MenuItem');
6-
var Accordion = require('../cjs/Accordion');
7-
var Panel = require('../cjs/Panel');
8-
var ButtonToolbar = require('../cjs/ButtonToolbar');
9-
var OverlayTrigger = require('../cjs/OverlayTrigger');
10-
var Tooltip = require('../cjs/Tooltip');
11-
var Alert = require('../cjs/Alert');
12-
var TabbedArea = require('../cjs/TabbedArea');
13-
var TabPane = require('../cjs/TabPane');
14-
var Modal = require('../cjs/Modal');
15-
var OverlayMixin = require('../cjs/OverlayMixin');
16-
var Popover = require('../cjs/Popover');
17-
var Carousel = require('../cjs/Carousel');
18-
var CarouselItem = require('../cjs/CarouselItem');
3+
var Button = require('../lib/Button');
4+
var DropdownButton = require('../lib/DropdownButton');
5+
var MenuItem = require('../lib/MenuItem');
6+
var Accordion = require('../lib/Accordion');
7+
var Panel = require('../lib/Panel');
8+
var ButtonToolbar = require('../lib/ButtonToolbar');
9+
var OverlayTrigger = require('../lib/OverlayTrigger');
10+
var Tooltip = require('../lib/Tooltip');
11+
var Alert = require('../lib/Alert');
12+
var TabbedArea = require('../lib/TabbedArea');
13+
var TabPane = require('../lib/TabPane');
14+
var Modal = require('../lib/Modal');
15+
var OverlayMixin = require('../lib/OverlayMixin');
16+
var Popover = require('../lib/Popover');
17+
var Carousel = require('../lib/Carousel');
18+
var CarouselItem = require('../lib/CarouselItem');
1919

2020
var dropdownInstance = (
2121
<DropdownButton title="Dropdown">

package.json

+6-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,12 @@
1010
"scripts": {
1111
"build": "./node_modules/.bin/grunt build",
1212
"test-watch": "./node_modules/.bin/grunt watch 2>&1 >/dev/null & ./node_modules/karma/bin/karma start karma.dev.js",
13-
"test": "./node_modules/.bin/grunt build && ./node_modules/karma/bin/karma start karma.ci.js"
13+
"test": "./node_modules/.bin/grunt build && ./node_modules/karma/bin/karma start karma.ci.js",
14+
"prepublish": "./node_modules/.bin/grunt build"
15+
},
16+
"main": "lib/main.js",
17+
"directories": {
18+
"lib": "lib/"
1419
},
1520
"keywords": [
1621
"react",

test/AlertSpec.jsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
var React = require('react');
44
var ReactTestUtils = require('react/lib/ReactTestUtils');
5-
var Alert = require('../cjs/Alert');
5+
var Alert = require('../lib/Alert');
66

77
describe('Alert', function () {
88
it('Should output a alert with message', function () {
@@ -73,4 +73,4 @@ describe('Alert', function () {
7373
);
7474
assert.ok(instance.getDOMNode().className.match(/\balert-danger\b/));
7575
});
76-
});
76+
});

test/BadgeSpec.jsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
var React = require('react');
44
var ReactTestUtils = require('react/lib/ReactTestUtils');
5-
var Badge = require('../cjs/Badge');
5+
var Badge = require('../lib/Badge');
66

77
describe('Badge', function () {
88
it('Should output a badge with content', function () {

test/BootstrapMixinSpec.jsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
var React = require('react');
44
var ReactTestUtils = require('react/lib/ReactTestUtils');
5-
var BootstrapMixin = require('../cjs/BootstrapMixin');
5+
var BootstrapMixin = require('../lib/BootstrapMixin');
66

77
var Component;
88

@@ -189,4 +189,4 @@ describe('BootstrapMixin', function () {
189189
assert.deepEqual(instance.getBsClassSet(), {'btn': true, 'btn-xs': true});
190190
});
191191
});
192-
});
192+
});

test/ButtonGroupSpec.jsx

+3-3
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22

33
var React = require('react');
44
var ReactTestUtils = require('react/lib/ReactTestUtils');
5-
var ButtonGroup = require('../cjs/ButtonGroup');
6-
var Button = require('../cjs/Button');
5+
var ButtonGroup = require('../lib/ButtonGroup');
6+
var Button = require('../lib/Button');
77

88
describe('ButtonGroup', function () {
99
it('Should output a button group', function () {
@@ -50,4 +50,4 @@ describe('ButtonGroup', function () {
5050
);
5151
assert.ok(instance.getDOMNode().className.match(/\bbtn-group-justified\b/));
5252
});
53-
});
53+
});

test/ButtonSpec.jsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
var React = require('react');
44
var ReactTestUtils = require('react/lib/ReactTestUtils');
5-
var Button = require('../cjs/Button');
5+
var Button = require('../lib/Button');
66

77
describe('Button', function () {
88
it('Should output a button', function () {

test/ButtonToolbarSpec.jsx

+4-4
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22

33
var React = require('react');
44
var ReactTestUtils = require('react/lib/ReactTestUtils');
5-
var ButtonToolbar = require('../cjs/ButtonToolbar');
6-
var ButtonGroup = require('../cjs/ButtonGroup');
7-
var Button = require('../cjs/Button');
5+
var ButtonToolbar = require('../lib/ButtonToolbar');
6+
var ButtonGroup = require('../lib/ButtonGroup');
7+
var Button = require('../lib/Button');
88

99
describe('ButtonToolbar', function () {
1010
it('Should output a button toolbar', function () {
@@ -21,4 +21,4 @@ describe('ButtonToolbar', function () {
2121
assert.ok(instance.getDOMNode().className.match(/\bbtn-toolbar\b/));
2222
assert.equal(instance.getDOMNode().getAttribute('role'), 'toolbar');
2323
});
24-
});
24+
});

test/CarouselSpec.jsx

+3-3
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22

33
var React = require('react');
44
var ReactTestUtils = require('react/lib/ReactTestUtils');
5-
var Carousel = require('../cjs/Carousel');
6-
var CarouselItem = require('../cjs/CarouselItem');
5+
var Carousel = require('../lib/Carousel');
6+
var CarouselItem = require('../lib/CarouselItem');
77

88
describe('Carousel', function () {
99
it('Should show the correct item', function () {
@@ -73,4 +73,4 @@ describe('Carousel', function () {
7373
)[0]
7474
);
7575
});
76-
});
76+
});

test/CustomPropTypesSpec.jsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
var React = require('react');
44
var ReactTestUtils = require('react/lib/ReactTestUtils');
5-
var CustomPropTypes = require('../cjs/utils/CustomPropTypes');
5+
var CustomPropTypes = require('../lib/utils/CustomPropTypes');
66

77
describe('CustomPropTypes', function () {
88

test/DropdownButtonSpec.jsx

+5-5
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22

33
var React = require('react');
44
var ReactTestUtils = require('react/lib/ReactTestUtils');
5-
var DropdownButton = require('../cjs/DropdownButton');
6-
var MenuItem = require('../cjs/MenuItem');
7-
var DropdownMenu = require('../cjs/DropdownMenu');
8-
var Button = require('../cjs/Button');
5+
var DropdownButton = require('../lib/DropdownButton');
6+
var MenuItem = require('../lib/MenuItem');
7+
var DropdownMenu = require('../lib/DropdownMenu');
8+
var Button = require('../lib/Button');
99

1010
describe('DropdownButton', function () {
1111
var instance;
@@ -203,4 +203,4 @@ describe('DropdownButton', function () {
203203
var carets = button.getElementsByClassName('caret');
204204
assert.equal(carets.length, 0);
205205
});
206-
});
206+
});

test/DropdownMenuSpec.jsx

+3-3
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22

33
var React = require('react');
44
var ReactTestUtils = require('react/lib/ReactTestUtils');
5-
var DropdownMenu = require('../cjs/DropdownMenu');
6-
var MenuItem = require('../cjs/MenuItem');
5+
var DropdownMenu = require('../lib/DropdownMenu');
6+
var MenuItem = require('../lib/MenuItem');
77

88
describe('DropdownMenu', function () {
99
it('Should render menu correctly', function () {
@@ -100,4 +100,4 @@ describe('DropdownMenu', function () {
100100
ReactTestUtils.findRenderedDOMComponentWithTag(menuItems[1], 'a').getDOMNode()
101101
.dispatchEvent(evt);
102102
});
103-
});
103+
});

0 commit comments

Comments
 (0)