diff --git a/package.json b/package.json index 18cb180f9..c59307cd9 100644 --- a/package.json +++ b/package.json @@ -26,6 +26,7 @@ "url": "https://github.com/travi/admin.travi.org-components/issues" }, "homepage": "https://github.com/travi/admin.travi.org-components#readme", + "main": "lib/main.js", "devDependencies": { "@kadira/storybook": "1.20.0", "@travi/any": "0.1.1", diff --git a/src/main.js b/src/main.js new file mode 100644 index 000000000..80c3a8b18 --- /dev/null +++ b/src/main.js @@ -0,0 +1,9 @@ +export {default as createIndex} from './index'; +export {default as createPrimaryNav} from './theme/nav/primary-nav'; +export {default as createWrap} from './theme/wrap/wrap'; +export {default as createNotFound} from './errors/not-found'; +export {default as createServerError} from './errors/server-error'; +export {default as createResourceList} from './resources/list/list'; +export {default as createMaybeList} from './resources/list/maybe-list'; +export {default as createResource} from './resources/individual/resource'; +export {default as createUser} from './resources/individual/users/user'; diff --git a/test/unit/errors/not-found-test.js b/test/unit/errors/not-found-test.js index 15b1d0ed3..dfea7b20e 100644 --- a/test/unit/errors/not-found-test.js +++ b/test/unit/errors/not-found-test.js @@ -4,7 +4,7 @@ import reactDom from 'react-dom/server'; import {assert} from 'chai'; import skinDeep from 'skin-deep'; -import createNotFound from '../../../src/errors/not-found'; +import {createNotFound} from '../../../src/main'; suite('not found', () => { const NotFound = createNotFound(React); diff --git a/test/unit/errors/server-error-test.js b/test/unit/errors/server-error-test.js index 943dc00a3..fa871ab3a 100644 --- a/test/unit/errors/server-error-test.js +++ b/test/unit/errors/server-error-test.js @@ -4,10 +4,10 @@ import reactDom from 'react-dom/server'; import {assert} from 'chai'; import skinDeep from 'skin-deep'; -import createNotFound from '../../../src/errors/server-error'; +import {createServerError} from '../../../src/main'; suite('server error', () => { - const ServerError = createNotFound(React); + const ServerError = createServerError(React); test('that displayName is set', () => { assert.equal(ServerError.displayName, 'ServerError'); diff --git a/test/unit/index-test.js b/test/unit/index-test.js index cf2be8a0e..23cc14821 100644 --- a/test/unit/index-test.js +++ b/test/unit/index-test.js @@ -4,7 +4,7 @@ import reactDom from 'react-dom/server'; import {assert} from 'chai'; import skinDeep from 'skin-deep'; -import createIndex from '../../src/index'; +import { createIndex } from '../../src/main'; suite('index', () => { const Index = createIndex(React); diff --git a/test/unit/resources/individual/resource-test.js b/test/unit/resources/individual/resource-test.js index 8b179e79c..f1ecf954f 100644 --- a/test/unit/resources/individual/resource-test.js +++ b/test/unit/resources/individual/resource-test.js @@ -6,7 +6,7 @@ import any from '@travi/any'; import {assert} from 'chai'; import skinDeep from 'skin-deep'; -import createResource from '../../../../src/resources/individual/resource'; +import {createResource} from '../../../../src/main'; const Resource = createResource(React); suite('resource component test', () => { diff --git a/test/unit/resources/individual/users/user-test.js b/test/unit/resources/individual/users/user-test.js index d18654f52..a202ba2f8 100644 --- a/test/unit/resources/individual/users/user-test.js +++ b/test/unit/resources/individual/users/user-test.js @@ -7,7 +7,7 @@ import any from '@travi/any'; import {assert} from 'chai'; import skinDeep from 'skin-deep'; -import createUser from '../../../../../src/resources/individual/users/user'; +import {createUser} from '../../../../../src/main'; const User = createUser(React); suite('user component test', () => { diff --git a/test/unit/resources/list/list-test.js b/test/unit/resources/list/list-test.js index cc8e2c97a..ab9c9cfe9 100644 --- a/test/unit/resources/list/list-test.js +++ b/test/unit/resources/list/list-test.js @@ -5,7 +5,7 @@ import {assert} from 'chai'; import any from '@travi/any'; import styles from '../../../helpers/style-fakes'; -import createResourceList from '../../../../src/resources/list/list'; +import {createResourceList} from '../../../../src/main'; const ResourceList = createResourceList(React); function assertSimpleResourceRenders(listItem, resource) { diff --git a/test/unit/resources/list/maybe-list-test.js b/test/unit/resources/list/maybe-list-test.js index f200b23c6..65a577bb7 100644 --- a/test/unit/resources/list/maybe-list-test.js +++ b/test/unit/resources/list/maybe-list-test.js @@ -4,7 +4,7 @@ import skinDeep from 'skin-deep'; import {assert} from 'chai'; import any from '@travi/any'; -import createMaybeList from '../../../../src/resources/list/maybe-list'; +import {createMaybeList} from '../../../../src/main'; const MaybeList = createMaybeList(React); suite('maybe-list component', () => { diff --git a/test/unit/theme/primary-nav-test.jsx b/test/unit/theme/primary-nav-test.jsx index 59d7fa3cb..1b2a456ca 100644 --- a/test/unit/theme/primary-nav-test.jsx +++ b/test/unit/theme/primary-nav-test.jsx @@ -6,7 +6,7 @@ import cheerio from 'cheerio'; import {assert} from 'chai'; import HistoryWrapper from '../../helpers/history-wrapper'; -import createPrimaryNav from '../../../src/theme/nav/primary-nav'; +import {createPrimaryNav} from '../../../src/main'; const PrimaryNav = createPrimaryNav(React); diff --git a/test/unit/theme/wrap/wrapper-test.jsx b/test/unit/theme/wrap/wrapper-test.jsx index 176884733..1d4fea4be 100644 --- a/test/unit/theme/wrap/wrapper-test.jsx +++ b/test/unit/theme/wrap/wrapper-test.jsx @@ -4,7 +4,7 @@ import any from '@travi/any'; import {assert} from 'chai'; import skinDeep from 'skin-deep'; -import createWrap from '../../../../src/theme/wrap/wrap'; +import {createWrap} from '../../../../src/main'; suite('wrapper component', () => { const Wrap = createWrap(React);