Skip to content

Commit

Permalink
[removed] .js files from repo root
Browse files Browse the repository at this point in the history
Also reorganized a few things:

index.js => modules/index.js
modules/helpers => modules/utils
script => scripts

Fixes remix-run#256
  • Loading branch information
mjackson committed Sep 1, 2014
1 parent e57112e commit bb7b666
Show file tree
Hide file tree
Showing 58 changed files with 210 additions and 267 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
examples/_*
examples/build
node_modules

2 changes: 1 addition & 1 deletion .npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ CONTRIBUTING.md
bower.json
examples
karma.conf.js
script
scripts
specs
webpack.config.js
1 change: 0 additions & 1 deletion ActiveState.js

This file was deleted.

1 change: 0 additions & 1 deletion AsyncState.js

This file was deleted.

1 change: 0 additions & 1 deletion DefaultRoute.js

This file was deleted.

1 change: 0 additions & 1 deletion Link.js

This file was deleted.

1 change: 0 additions & 1 deletion NotFoundRoute.js

This file was deleted.

1 change: 0 additions & 1 deletion Redirect.js

This file was deleted.

1 change: 0 additions & 1 deletion Route.js

This file was deleted.

1 change: 0 additions & 1 deletion Routes.js

This file was deleted.

337 changes: 156 additions & 181 deletions dist/react-router.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions dist/react-router.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion examples/animations/app.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/** @jsx React.DOM */
var React = require('react');
var Router = require('../../index');
var Router = require('../../modules');
var Routes = Router.Routes;
var Route = Router.Route;
var Link = Router.Link;
Expand Down
2 changes: 1 addition & 1 deletion examples/auth-flow/app.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/** @jsx React.DOM */
var React = require('react');
var Router = require('../../index');
var Router = require('../../modules');
var Route = Router.Route;
var Routes = Router.Routes;
var Link = Router.Link;
Expand Down
2 changes: 1 addition & 1 deletion examples/data-flow/app.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/** @jsx React.DOM */
var React = require('react');
var Router = require('../../index');
var Router = require('../../modules');
var Route = Router.Route;
var Routes = Router.Routes;
var Link = Router.Link;
Expand Down
2 changes: 1 addition & 1 deletion examples/dynamic-segments/app.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/** @jsx React.DOM */
var React = require('react');
var Router = require('../../index');
var Router = require('../../modules');
var Route = Router.Route;
var Routes = Router.Routes;
var Redirect = Router.Redirect;
Expand Down
2 changes: 1 addition & 1 deletion examples/master-detail/app.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/** @jsx React.DOM */
var React = require('react');
var Router = require('../../index');
var Router = require('../../modules');
var Route = Router.Route;
var DefaultRoute = Router.DefaultRoute;
var Routes = Router.Routes;
Expand Down
2 changes: 1 addition & 1 deletion examples/partial-app-loading/app.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/** @jsx React.DOM */
var React = require('react');
var Router = require('../../index');
var Router = require('../../modules');
var Route = Router.Route;
var Routes = Router.Routes;
var Link = Router.Link;
Expand Down
2 changes: 1 addition & 1 deletion examples/partial-app-loading/dashboard.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/** @jsx React.DOM */

var React = require('react');
var ReactRouter = require('../../index');
var ReactRouter = require('../../modules');
var Link = ReactRouter.Link;

var Dashboard = React.createClass({
Expand Down
2 changes: 1 addition & 1 deletion examples/query-params/app.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/** @jsx React.DOM */
var React = require('react');
var Router = require('../../index');
var Router = require('../../modules');
var Route = Router.Route;
var Routes = Router.Routes;
var Link = Router.Link;
Expand Down
2 changes: 1 addition & 1 deletion examples/shared-root/app.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/** @jsx React.DOM */
var React = require('react');
var Router = require('../../index');
var Router = require('../../modules');
var Route = Router.Route;
var Routes = Router.Routes;
var Link = Router.Link;
Expand Down
2 changes: 1 addition & 1 deletion examples/simple-master-detail/app.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/** @jsx React.DOM */
var React = require('react');
var Router = require('../../index');
var Router = require('../../modules');
var Route = Router.Route;
var Routes = Router.Routes;
var Link = Router.Link;
Expand Down
2 changes: 1 addition & 1 deletion examples/transitions/app.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/** @jsx React.DOM */
var React = require('react');
var Router = require('../../index');
var Router = require('../../modules');
var Route = Router.Route;
var Routes = Router.Routes;
var Link = Router.Link;
Expand Down
1 change: 0 additions & 1 deletion goBack.js

This file was deleted.

12 changes: 0 additions & 12 deletions index.js

This file was deleted.

1 change: 0 additions & 1 deletion makeHref.js

This file was deleted.

18 changes: 0 additions & 18 deletions modules/Router.js

This file was deleted.

2 changes: 1 addition & 1 deletion modules/actions/LocationActions.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
var LocationDispatcher = require('../dispatchers/LocationDispatcher');
var makePath = require('../helpers/makePath');
var makePath = require('../utils/makePath');

/**
* Actions that modify the URL.
Expand Down
6 changes: 3 additions & 3 deletions modules/components/Link.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
var React = require('react');
var ActiveState = require('../mixins/ActiveState');
var transitionTo = require('../actions/LocationActions').transitionTo;
var withoutProperties = require('../helpers/withoutProperties');
var hasOwnProperty = require('../helpers/hasOwnProperty');
var makeHref = require('../helpers/makeHref');
var withoutProperties = require('../utils/withoutProperties');
var hasOwnProperty = require('../utils/hasOwnProperty');
var makeHref = require('../utils/makeHref');
var warning = require('react/lib/warning');

function isLeftClickEvent(event) {
Expand Down
2 changes: 1 addition & 1 deletion modules/components/Route.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
var React = require('react');
var withoutProperties = require('../helpers/withoutProperties');
var withoutProperties = require('../utils/withoutProperties');

/**
* A map of <Route> component props that are reserved for use by the
Expand Down
6 changes: 3 additions & 3 deletions modules/components/Routes.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ var copyProperties = require('react/lib/copyProperties');
var Promise = require('when/lib/Promise');
var LocationActions = require('../actions/LocationActions');
var Route = require('../components/Route');
var Path = require('../helpers/Path');
var Redirect = require('../helpers/Redirect');
var Transition = require('../helpers/Transition');
var Path = require('../utils/Path');
var Redirect = require('../utils/Redirect');
var Transition = require('../utils/Transition');
var HashLocation = require('../locations/HashLocation');
var HistoryLocation = require('../locations/HistoryLocation');
var RefreshLocation = require('../locations/RefreshLocation');
Expand Down
15 changes: 15 additions & 0 deletions modules/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
exports.goBack = require('./actions/LocationActions').goBack;
exports.replaceWith = require('./actions/LocationActions').replaceWith;
exports.transitionTo = require('./actions/LocationActions').transitionTo;

exports.DefaultRoute = require('./components/DefaultRoute');
exports.Link = require('./components/Link');
exports.NotFoundRoute = require('./components/NotFoundRoute');
exports.Redirect = require('./components/Redirect');
exports.Route = require('./components/Route');
exports.Routes = require('./components/Routes');

exports.makeHref = require('./utils/makeHref');

exports.ActiveState = require('./mixins/ActiveState');
exports.AsyncState = require('./mixins/AsyncState');
2 changes: 1 addition & 1 deletion modules/locations/HashLocation.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
var invariant = require('react/lib/invariant');
var ExecutionEnvironment = require('react/lib/ExecutionEnvironment');
var getWindowPath = require('../helpers/getWindowPath');
var getWindowPath = require('../utils/getWindowPath');

function getHashPath() {
return window.location.hash.substr(1);
Expand Down
2 changes: 1 addition & 1 deletion modules/locations/HistoryLocation.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
var invariant = require('react/lib/invariant');
var ExecutionEnvironment = require('react/lib/ExecutionEnvironment');
var getWindowPath = require('../helpers/getWindowPath');
var getWindowPath = require('../utils/getWindowPath');

var _onChange;

Expand Down
2 changes: 1 addition & 1 deletion modules/locations/RefreshLocation.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
var invariant = require('react/lib/invariant');
var ExecutionEnvironment = require('react/lib/ExecutionEnvironment');
var getWindowPath = require('../helpers/getWindowPath');
var getWindowPath = require('../utils/getWindowPath');

/**
* A Location that uses full page refreshes. This is used as
Expand Down
2 changes: 1 addition & 1 deletion modules/mixins/AsyncState.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
var React = require('react');
var resolveAsyncState = require('../helpers/resolveAsyncState');
var resolveAsyncState = require('../utils/resolveAsyncState');

/**
* A mixin for route handler component classes that fetch at least
Expand Down
2 changes: 1 addition & 1 deletion modules/stores/PathStore.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ var warning = require('react/lib/warning');
var EventEmitter = require('events').EventEmitter;
var LocationActions = require('../actions/LocationActions');
var LocationDispatcher = require('../dispatchers/LocationDispatcher');
var supportsHistory = require('../helpers/supportsHistory');
var supportsHistory = require('../utils/supportsHistory');
var HistoryLocation = require('../locations/HistoryLocation');
var RefreshLocation = require('../locations/RefreshLocation');

Expand Down
2 changes: 1 addition & 1 deletion modules/stores/RouteStore.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
var React = require('react');
var invariant = require('react/lib/invariant');
var warning = require('react/lib/warning');
var Path = require('../helpers/Path');
var Path = require('../utils/Path');

var _namedRoutes = {};

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,7 @@
"name": "react-router",
"version": "0.6.1",
"description": "A complete routing library for React.js",
"tags": [
"react",
"router"
],
"main": "./index",
"main": "./modules/index",
"repository": {
"type": "git",
"url": "https://github.com/rackt/react-router.git"
Expand Down Expand Up @@ -54,6 +50,10 @@
"qs": "2.2.2",
"when": "^3.4.4"
},
"tags": [
"react",
"router"
],
"keywords": [
"react",
"react-component",
Expand Down
1 change: 0 additions & 1 deletion replaceWith.js

This file was deleted.

4 changes: 0 additions & 4 deletions script/build

This file was deleted.

4 changes: 4 additions & 0 deletions scripts/build
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/sh
mkdir -p dist
NODE_ENV=production node_modules/.bin/browserify modules/index.js -t browserify-shim -t envify --detect-globals false -s ReactRouter > dist/react-router.js
node_modules/.bin/uglifyjs dist/react-router.js --compress warnings=false > dist/react-router.min.js
1 change: 0 additions & 1 deletion script/build-examples → scripts/build-examples
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
#!/bin/sh
webpack --devtool inline-source-map "$@"

1 change: 0 additions & 1 deletion script/preview-release → scripts/preview-release
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
#!/bin/sh
node_modules/rf-release/node_modules/.bin/changelog -t preview -s

3 changes: 1 addition & 2 deletions script/release → scripts/release
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#!/bin/sh
script/build
scripts/build
node_modules/.bin/release

1 change: 0 additions & 1 deletion script/test → scripts/test
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
#!/bin/sh
node_modules/.bin/karma start "$@"

2 changes: 1 addition & 1 deletion specs/Path.spec.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
require('./helper');
var Path = require('../modules/helpers/Path');
var Path = require('../modules/utils/Path');

describe('Path.extractParamNames', function () {
describe('when a pattern contains no dynamic segments', function () {
Expand Down
1 change: 0 additions & 1 deletion transitionTo.js

This file was deleted.

0 comments on commit bb7b666

Please sign in to comment.