Skip to content
This repository has been archived by the owner on Dec 6, 2019. It is now read-only.

86-absolute-path-imports #88

Merged
merged 4 commits into from
Nov 8, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion .babelrc
Original file line number Diff line number Diff line change
@@ -1,8 +1,16 @@
{
"presets": ["react-native-stage-0/decorator-support"],
"plugins": [
["module-resolver", {
"root": ["./src"],
"extensions": [".android.js", ".ios.js", ".js"]
}]
],
"env": {
"development": {
"plugins": ["transform-react-jsx-source"]
"plugins": [
"transform-react-jsx-source"
]
}
}
}
7 changes: 6 additions & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ module.exports = {
"jest",
],
"rules": {
"import/no-extraneous-dependencies": ["error", { "devDependencies": true }],
"import/no-extraneous-dependencies": 0,
"react/jsx-filename-extension": 0,
"react/jsx-curly-brace-presence": 0,
"react/prefer-stateless-function": [2, { "ignorePureComponents": true }],
Expand All @@ -17,6 +17,11 @@ module.exports = {
"jsx-a11y/media-has-caption": 0,
"global-require": 0,
},
"settings": {
"import/resolver": {
"babel-module": {}
}
},
"env": {
"jest/globals": true,
"browser": true,
Expand Down
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,13 @@
"@storybook/react-native": "^3.2.14",
"appr": "conrad-vanl/appr#commit-statuses",
"babel-eslint": "^8.0.1",
"babel-plugin-module-resolver": "3.0.0-beta.5",
"babel-preset-react-native-stage-0": "^1.0.1",
"danger": "^2.0.0-alpha.20",
"dotenv": "^4.0.0",
"eslint": "^4.10.0",
"eslint-config-airbnb": "^16.1.0",
"eslint-import-resolver-babel-module": "^4.0.0-beta.3",
"eslint-plugin-import": "^2.8.0",
"eslint-plugin-jest": "21.2.0",
"eslint-plugin-jsx-a11y": "6.0.2",
Expand All @@ -32,7 +34,7 @@
"start": "npm run create-app-entrypoint && npm run run-with-settings 'react-native-scripts start'",
"android": "npm run create-app-entrypoint && npm run run-with-settings 'react-native-scripts android'",
"ios": "npm run create-app-entrypoint && npm run run-with-settings 'react-native-scripts ios'",
"web": "npm run create-app-entrypoint && npm run run-with-settings 'react-scripts start'",
"web": "npm run create-app-entrypoint && NODE_PATH=./src npm run run-with-settings 'react-scripts start'",
"build": "npm run create-app-entrypoint && npm run run-with-settings 'react-scripts build'",
"build-storybook": "npm run create-storybook-entrypoint && npm run storybook-load-stories && build-storybook -c src/.storybook/web -s public",
"test": "npm run lint && npm run jest",
Expand Down
6 changes: 3 additions & 3 deletions src/@modules/Audio/Audio.stories.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ import { storiesOf } from '@storybook/react-native';
import {
View,
} from 'react-native';
import Play from '../../@primitives/icons/Play';
import Pause from '../../@primitives/icons/Pause';
import Play from '@primitives/icons/Play';
import Pause from '@primitives/icons/Pause';

import ThemeProvider from '../../@primitives/ThemeProvider';
import ThemeProvider from '@primitives/ThemeProvider';
import Audio from './';

storiesOf('Audio', module)
Expand Down
6 changes: 3 additions & 3 deletions src/@modules/Audio/Audio.tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ import renderer from 'react-test-renderer';
import {
View,
} from 'react-native';
import ThemeProvider from '../../@primitives/ThemeProvider';
import ThemeProvider from '@primitives/ThemeProvider';
import Play from '@primitives/icons/Play';
import Pause from '@primitives/icons/Pause';
import Audio from './';
import Play from '../../@primitives/icons/Play';
import Pause from '../../@primitives/icons/Pause';

it('renders correctly', () => {
const tree = renderer.create(
Expand Down
2 changes: 1 addition & 1 deletion src/@modules/Audio/AudioPause.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import PropTypes from 'prop-types';
import {
TouchableHighlight,
} from 'react-native';
import onlyPropTypes from '../../@utils/onlyPropTypes';
import onlyPropTypes from '@utils/onlyPropTypes';

export class AudioPause extends PureComponent {
static propTypes = {
Expand Down
2 changes: 1 addition & 1 deletion src/@modules/Audio/AudioPlay.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import PropTypes from 'prop-types';
import {
TouchableHighlight,
} from 'react-native';
import onlyPropTypes from '../../@utils/onlyPropTypes';
import onlyPropTypes from '@utils/onlyPropTypes';

export class AudioPlay extends PureComponent {
static propTypes = {
Expand Down
2 changes: 1 addition & 1 deletion src/@modules/Audio/AudioSeeker.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React, { PureComponent } from 'react';
import getContext from 'recompose/getContext';
import compose from 'recompose/compose';
import PropTypes from 'prop-types';
import Seeker from '../../@primitives/Seeker';
import Seeker from '@primitives/Seeker';

export class AudioSeeker extends PureComponent {
static propTypes = {
Expand Down
2 changes: 1 addition & 1 deletion src/@modules/FooterNav/FooterNavLink.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {
View,
} from 'react-native';
import PropTypes from 'prop-types';
import NavLink from '../NativeWebRouter/NavLink';
import NavLink from '@modules/NativeWebRouter/NavLink';

const styles = StyleSheet.create({
container: {
Expand Down
2 changes: 1 addition & 1 deletion src/@modules/Header/Header.stories.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React from 'react';

import { storiesOf } from '@storybook/react-native';

import Header from './';
import Header from '@modules/Header';

storiesOf('Header', module)
.add('renders', () => <Header />);
Expand Down
2 changes: 1 addition & 1 deletion src/@primitives/FontLoader/index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Component } from 'react';
import { Font } from 'expo';
import PropTypes from 'prop-types';
import FONTS from '../../assets/fonts';
import FONTS from 'assets/fonts';

export default class FontLoader extends Component {
static propTypes = {
Expand Down
12 changes: 6 additions & 6 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ import {
} from 'react-native';
import { Provider as ReduxProvider } from 'react-redux';
import { ApolloProvider } from 'react-apollo';
import { Router, Route, AndroidBackButton } from './@modules/NativeWebRouter';
import * as pages from './pages';
import ThemeProvider from './@primitives/ThemeProvider';
import FontLoader from './@primitives/FontLoader';
import Store from './@data/Store';
import Client from './@data/Client';
import { Router, Route, AndroidBackButton } from '@modules/NativeWebRouter';
import * as pages from 'pages';
import ThemeProvider from '@primitives/ThemeProvider';
import FontLoader from '@primitives/FontLoader';
import Store from '@data/Store';
import Client from '@data/Client';

const App = () => (
<ApolloProvider client={Client}>
Expand Down
16 changes: 8 additions & 8 deletions src/pages/Feed.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@ import React from 'react';
import {
View,
} from 'react-native';
import Header from '../@modules/Header';
import FooterNav from '../@modules/FooterNav';
import H1 from '../@primitives/H1';
import Umbrella from '../@primitives/icons/Umbrella';
import { Desktop, Mobile } from '../@primitives/MediaQuery';
import Audio from '../@modules/Audio';
import Play from '../@primitives/icons/Play';
import Pause from '../@primitives/icons/Pause';
import Header from '@modules/Header';
import FooterNav from '@modules/FooterNav';
import H1 from '@primitives/H1';
import Umbrella from '@primitives/icons/Umbrella';
import { Desktop, Mobile } from '@primitives/MediaQuery';
import Audio from '@modules/Audio';
import Play from '@primitives/icons/Play';
import Pause from '@primitives/icons/Pause';

export default function Feed() {
return (
Expand Down
4 changes: 2 additions & 2 deletions src/pages/Sections.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ import {
StyleSheet,
View,
} from 'react-native';
import Header from '../@modules/Header';
import FooterNav from '../@modules/FooterNav';
import Header from '@modules/Header';
import FooterNav from '@modules/FooterNav';

const styles = StyleSheet.create({
container: {
Expand Down
37 changes: 33 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1112,6 +1112,16 @@ babel-plugin-minify-type-constructors@^0.2.0:
dependencies:
babel-helper-is-void-0 "^0.2.0"

babel-plugin-module-resolver@3.0.0-beta.5:
version "3.0.0-beta.5"
resolved "https://registry.yarnpkg.com/babel-plugin-module-resolver/-/babel-plugin-module-resolver-3.0.0-beta.5.tgz#8e2873d841e4c800994a19e54ca5e2d08db9dd42"
dependencies:
find-babel-config "^1.1.0"
glob "^7.1.2"
pkg-up "^2.0.0"
reselect "^3.0.1"
resolve "^1.4.0"

babel-plugin-module-resolver@^2.7.1:
version "2.7.1"
resolved "https://registry.yarnpkg.com/babel-plugin-module-resolver/-/babel-plugin-module-resolver-2.7.1.tgz#18be3c42ddf59f7a456c9e0512cd91394f6e4be1"
Expand Down Expand Up @@ -3688,6 +3698,15 @@ eslint-config-react-app@^2.0.1:
version "2.0.1"
resolved "https://registry.yarnpkg.com/eslint-config-react-app/-/eslint-config-react-app-2.0.1.tgz#fd0503da01ae608f0c6ae8861de084975142230e"

eslint-import-resolver-babel-module@^4.0.0-beta.3:
version "4.0.0-beta.3"
resolved "https://registry.yarnpkg.com/eslint-import-resolver-babel-module/-/eslint-import-resolver-babel-module-4.0.0-beta.3.tgz#b9d6fbec09863c25c6f23304662c3ca068bddc64"
dependencies:
babel-jest "^20.0.3"
jest "^20.0.3"
pkg-up "^2.0.0"
resolve "^1.3.3"

eslint-import-resolver-node@^0.3.1:
version "0.3.1"
resolved "https://registry.yarnpkg.com/eslint-import-resolver-node/-/eslint-import-resolver-node-0.3.1.tgz#4422574cde66a9a7b099938ee4d508a199e0e3cc"
Expand Down Expand Up @@ -4271,7 +4290,7 @@ finalhandler@1.1.0:
statuses "~1.3.1"
unpipe "~1.0.0"

find-babel-config@^1.0.1:
find-babel-config@^1.0.1, find-babel-config@^1.1.0:
version "1.1.0"
resolved "https://registry.yarnpkg.com/find-babel-config/-/find-babel-config-1.1.0.tgz#acc01043a6749fec34429be6b64f542ebb5d6355"
dependencies:
Expand Down Expand Up @@ -5831,7 +5850,7 @@ jest-validate@^20.0.3:
leven "^2.1.0"
pretty-format "^20.0.3"

jest@20.0.4, jest@^20.0.4:
jest@20.0.4, jest@^20.0.3, jest@^20.0.4:
version "20.0.4"
resolved "https://registry.yarnpkg.com/jest/-/jest-20.0.4.tgz#3dd260c2989d6dad678b1e9cc4d91944f6d602ac"
dependencies:
Expand Down Expand Up @@ -7458,6 +7477,12 @@ pkg-dir@^2.0.0:
dependencies:
find-up "^2.1.0"

pkg-up@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/pkg-up/-/pkg-up-2.0.0.tgz#c819ac728059a461cab1c3889a2be3c49a004d7f"
dependencies:
find-up "^2.1.0"

plist@2.0.1:
version "2.0.1"
resolved "https://registry.yarnpkg.com/plist/-/plist-2.0.1.tgz#0a32ca9481b1c364e92e18dc55c876de9d01da8b"
Expand Down Expand Up @@ -8871,6 +8896,10 @@ reqwest@2.0.5:
version "2.0.5"
resolved "https://registry.yarnpkg.com/reqwest/-/reqwest-2.0.5.tgz#00fb15ac4918c419ca82b43f24c78882e66039a1"

reselect@^3.0.1:
version "3.0.1"
resolved "https://registry.yarnpkg.com/reselect/-/reselect-3.0.1.tgz#efdaa98ea7451324d092b2b2163a6a1d7a9a2147"

resolve-cwd@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/resolve-cwd/-/resolve-cwd-2.0.0.tgz#00a9f7387556e27038eae232caa372a6a59b665a"
Expand Down Expand Up @@ -8900,7 +8929,7 @@ resolve@1.1.7:
version "1.1.7"
resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.1.7.tgz#203114d82ad2c5ed9e8e0411b3932875e889e97b"

resolve@^1.1.6, resolve@^1.2.0, resolve@^1.3.2:
resolve@^1.1.6, resolve@^1.2.0, resolve@^1.3.2, resolve@^1.3.3, resolve@^1.4.0:
version "1.5.0"
resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.5.0.tgz#1f09acce796c9a762579f31b2c1cc4c3cddf9f36"
dependencies:
Expand Down Expand Up @@ -10272,7 +10301,7 @@ vm-browserify@0.0.4:
dependencies:
indexof "0.0.1"

"vm2@github:patriksimek/vm2#custom_files":
vm2@patriksimek/vm2#custom_files:
version "3.5.0"
resolved "https://codeload.github.com/patriksimek/vm2/tar.gz/7e82f90ac705fc44fad044147cb0df09b4c79a57"

Expand Down