Skip to content

Commit

Permalink
refactor(structure): Move files around
Browse files Browse the repository at this point in the history
  • Loading branch information
trevorgerhardt committed Feb 26, 2019
1 parent d36fc34 commit ab45b17
Show file tree
Hide file tree
Showing 10 changed files with 468 additions and 627 deletions.
9 changes: 2 additions & 7 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,11 @@
sudo: false
language: node_js
cache:
yarn: true
notifications:
email: false
node_js:
- '8'
before_install:
- yarn global add codecov
- '10'
scripts:
- yarn test -- --coverage --coverage-paths src/**/*.js
- codecov
- yarn test
- yarn run build
after_success:
- yarn run semantic-release
Expand Down
3 changes: 0 additions & 3 deletions babel.config.js

This file was deleted.

2 changes: 1 addition & 1 deletion jest.config.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module.exports = {
testPathIgnorePatterns: ['<rootDir>/src/.next/', '<rootDir>/node_modules/']
testPathIgnorePatterns: ['<rootDir>/.next/', '<rootDir>/node_modules/']
}
2 changes: 1 addition & 1 deletion src/next.config.js → next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ const {PHASE_PRODUCTION_SERVER} =
: require('next-server/constants')

const config = {
publicRuntimeConfig: {
env: {
CACHE_DATA: process.env.CACHE_DATA, // Only used in Development
MAPBOX_ACCESS_TOKEN: process.env.MAPBOX_ACCESS_TOKEN
}
Expand Down
2 changes: 1 addition & 1 deletion now.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"version": 2,
"builds": [
{"src": "src/next.config.js", "use": "@now/next"}
{"src": "next.config.js", "use": "@now/next"}
],
"env": {
"MAPBOX_ACCESS_TOKEN": "@mapbox-access-token"
Expand Down
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
"description": "Isochrone & accessibility analysis",
"main": "src/index.js",
"scripts": {
"build": "next build src",
"dev": "node --require dotenv/config node_modules/.bin/next src",
"build": "next build",
"dev": "node --require dotenv/config node_modules/.bin/next",
"predev": "yarn",
"semantic-release": "semantic-release",
"start": "next start src",
"start": "next start",
"test": "jest",
"test-debug": "node --inspect-brk node_modules/.bin/jest --runInBand"
},
Expand Down Expand Up @@ -35,7 +35,7 @@
"jsolines": "^2.1.1",
"lodash": "^4.17.10",
"mapbox-gl": "^0.53.0",
"next": "latest",
"next": "v8.0.3",
"next-cookies": "^1.1.2",
"node-fetch": "^2.3.0",
"react": "v16.8.3",
Expand Down
4 changes: 2 additions & 2 deletions src/pages/_app.js → pages/_app.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import nextCookies from 'next-cookies'
import React from 'react'
import {Provider} from 'react-redux'

import defaultStore from '../../store.json'
import {getOrCreateStore} from '../with-redux-store'
import defaultStore from '../store.json'
import {getOrCreateStore} from '../src/with-redux-store'

const iconLink = 'https://d2f1n6ed3ipuic.cloudfront.net/conveyal-128x128.png'

Expand Down
12 changes: 6 additions & 6 deletions src/pages/index.js → pages/index.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import {connect} from 'react-redux'

import actions from '../actions'
import Application from '../components/application'
import message from '../message'
import * as select from '../selectors'
import configureTaui from '../services/config'
import actions from '../src/actions'
import Application from '../src/components/application'
import message from '../src/message'
import * as select from '../src/selectors'
import configureTaui from '../src/services/config'

import '../style.css'
import '../src/style.css'

// Set the title
if (typeof document !== 'undefined') document.title = message('Title')
Expand Down
11 changes: 5 additions & 6 deletions src/env.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import get from 'lodash/get'
import getConfig from 'next/config'

const configs = getConfig()

export default get(configs, 'publicRuntimeConfig', {})
// Options must be explicit
export default {
CACHE_DATA: process.env.CACHE_DATA,
MAPBOX_ACCESS_TOKEN: process.env.MAPBOX_ACCESS_TOKEN
}
Loading

0 comments on commit ab45b17

Please sign in to comment.