Skip to content
This repository has been archived by the owner on Sep 11, 2018. It is now read-only.

Commit

Permalink
Merge pull request #86 from davezuko/refactor/structure
Browse files Browse the repository at this point in the history
refactor(project): rename client directory to src
  • Loading branch information
David Zukowski committed Sep 15, 2015
2 parents 2d180c4 + 49f98c6 commit 64ec424
Show file tree
Hide file tree
Showing 19 changed files with 20 additions and 20 deletions.
34 changes: 17 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -121,20 +121,20 @@ import MyComponent from '../../components/my-component'; // without alias
import MyComponent from 'components/my-component'; // with alias

// Available aliases:
actions => '~/client/actions'
components => '~/client/components'
constants => '~/client/constants'
containers => '~/client/containers'
dispatchers => '~/client/dispatchers'
layouts => '~/client/layouts'
models => '~/client/models'
reducers => '~/client/reducers'
routes => '~/client/routes'
services => '~/client/services'
stores => '~/client/stores'
styles => '~/client/styles'
utils => '~/client/utils'
views => '~/client/views'
actions => '~/src/actions'
components => '~/src/components'
constants => '~/src/constants'
containers => '~/src/containers'
dispatchers => '~/src/dispatchers'
layouts => '~/src/layouts'
models => '~/src/models'
reducers => '~/src/reducers'
routes => '~/src/routes'
services => '~/src/services'
stores => '~/src/stores'
styles => '~/src/styles'
utils => '~/src/utils'
views => '~/src/views'
```

### Globals
Expand All @@ -160,14 +160,14 @@ Styles
All `.scss` imports will be run through the sass-loader, extracted during production builds, and ignored during server builds. If you're requiring styles from a base styles directory (useful for generic, app-wide styles) in your JS, you can make use of the `styles` alias, e.g.:

```js
// ~/client/components/some/nested/component/index.jsx
// ~/src/components/some/nested/component/index.jsx
import `styles/core.scss`;
```

Furthermore, this `styles` directory is aliased for sass imports, which further eliminates manual directory traversing. An example nested `.scss` file:

```scss
// current path: ~/client/styles/some/nested/style.scss
// current path: ~/src/styles/some/nested/style.scss
// what used to be this:
@import '../../base';

Expand All @@ -178,7 +178,7 @@ Furthermore, this `styles` directory is aliased for sass imports, which further
Testing
-------

To add a unit test, simply create `.spec.js` file anywhere in `~/client`. The entry point for Karma uses webpack's custom require to load all these files, and both Mocha and Chai will be available to you within your test without the need to import them.
To add a unit test, simply create `.spec.js` file anywhere in `~/src`. The entry point for Karma uses webpack's custom require to load all these files, and both Mocha and Chai will be available to you within your test without the need to import them.

Utilities
---------
Expand Down
2 changes: 1 addition & 1 deletion config/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const config = new Map();
// NOTE: Due to limitations with Webpack's custom require, which is used for
// looking up all *.spec.js files, if you edit dir_src you _must_ also edit
// the path in ~/karma.entry.js.
config.set('dir_src', 'client');
config.set('dir_src', 'src');
config.set('dir_dist', 'dist');

config.set('server_host', 'localhost');
Expand Down
4 changes: 2 additions & 2 deletions karma.entry.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Require all ".spec.js" files in ~/client.
var context = require.context('./client', true, /.+\.spec\.js$/);
// Require all ".spec.js" files in ~/src.
var context = require.context('./src', true, /.+\.spec\.js$/);
context.keys().forEach(context);
module.exports = context;
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.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit 64ec424

Please sign in to comment.