Skip to content

Commit 18b6297

Browse files
committed
📦 ⚡ Significantly restructure the directories
Subfolders for each type of list. No longer export ImmutableListView as a default; name everything.
1 parent b52a99c commit 18b6297

21 files changed

+41
-30
lines changed

.npmignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
1-
**/__tests__
1+
**/__tests__/
2+
/scripts/
3+
src/test-utils.js

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
"jest": {
1818
"preset": "react-native",
1919
"setupFiles": [
20-
"./src/__tests__/setup.js"
20+
"./scripts/setup-jest.js"
2121
],
2222
"testRegex": "/src/.*__tests__/.+\\.test\\.js$",
2323
"modulePathIgnorePatterns": [
File renamed without changes.

src/EmptyListView.js renamed to src/ImmutableListView/EmptyListView.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ import { Text, ListView } from 'react-native';
55

66
import ImmutableListView from './ImmutableListView';
77

8-
import styles from './styles';
9-
import utils from './utils';
8+
import styles from '../styles';
9+
import utils from '../utils';
1010

1111
/**
1212
* A ListView that displays a single item showing that there is nothing to display.
@@ -84,4 +84,4 @@ class EmptyListView extends PureComponent {
8484

8585
}
8686

87-
export default EmptyListView;
87+
export { EmptyListView };

src/ImmutableListView.js renamed to src/ImmutableListView/ImmutableListView.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@ import PropTypes from 'prop-types';
33
import React, { PureComponent } from 'react';
44
import { Text, ListView, InteractionManager } from 'react-native';
55

6-
import styles from './styles';
7-
import utils from './utils';
6+
import styles from '../styles';
7+
import utils from '../utils';
88

9-
import EmptyListView from './EmptyListView';
9+
import { EmptyListView } from './EmptyListView';
1010

1111
/**
1212
* A ListView capable of displaying {@link https://facebook.github.io/immutable-js/ Immutable} data

src/__tests__/EmptyListView.test.js renamed to src/ImmutableListView/__tests__/EmptyListView.test.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import React from 'react';
22
import renderer from 'react-test-renderer';
33

4-
import { renderers } from './testUtils';
4+
import { renderers } from '../../test-utils';
55

6-
import EmptyListView from '../EmptyListView';
6+
import { EmptyListView } from '../EmptyListView';
77

88
describe('EmptyListView', () => {
99
it('renders with default text', () => {

src/__tests__/ImmutableListView.test.js renamed to src/ImmutableListView/__tests__/ImmutableListView.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import renderer from 'react-test-renderer';
44

55
import ImmutableListView from '../ImmutableListView';
66

7-
import { data, renderers, expectors } from './testUtils';
7+
import { data, renderers, expectors } from '../../test-utils';
88

99
describe('ImmutableListView', () => {
1010
it('renders with empty data', () => {

src/ImmutableListView/index.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
export { default } from './ImmutableListView';
2+
export * from './EmptyListView';

0 commit comments

Comments
 (0)