Skip to content

Commit 1fe3142

Browse files
committed
Moved back {src/pages => pages} and {src/* => lib/*} due to vercel/next.js#4315
1 parent a0e8e68 commit 1fe3142

23 files changed

+25
-32
lines changed

.babelrc.js

+14-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,17 @@
1-
const env = require('./src/env.config.js');
1+
const AUTO_ENV_VARS = /^REACT_APP_/i;
2+
3+
/**
4+
* Extracts all environment variables starting by REACT_APP_.
5+
*
6+
* @type {Object} An object sub-set of process.env containing only REACT_APP_ variables.
7+
*/
8+
const env = Object.entries(process.env).reduce(
9+
(exports, [key, value]) =>
10+
AUTO_ENV_VARS.test(key)
11+
? { ...exports, [`process.env.${key}`]: value }
12+
: exports,
13+
{},
14+
);
215

316
// TODO Find a way to move this back to package.json
417
module.exports = {

.travis.yml

+3-2
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,9 @@ before_deploy:
1818
deploy:
1919
provider: script
2020
script: >
21-
npx now -t $NOW_TOKEN && npx now alias $CNAME -t $NOW_TOKEN;
22-
npx now rm gilded-rose-visitor --safe --yes -t $NOW_TOKEN || echo "Failed to clean aliases, aborting." >& 2
21+
npx now -t $NOW_TOKEN
22+
&& npx now -t $NOW_TOKEN alias $CNAME
23+
&& (npx now -t $NOW_TOKEN rm gilded-rose-visitor --safe --yes || echo "Failed to clean aliases, aborting." >& 2)
2324
skip_cleanup: true
2425
on:
2526
branch: master
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.

package.json

+5-5
Original file line numberDiff line numberDiff line change
@@ -35,12 +35,12 @@
3535
"redux-mock-store": "^1.5.3"
3636
},
3737
"scripts": {
38-
"dev": "next src",
39-
"build": "next build src",
40-
"start": "next start src",
38+
"dev": "next",
39+
"build": "next build",
40+
"start": "next start",
4141
"lint": "run-p lint:*",
4242
"lint:prettier": "prettier --list-different '**/*'",
43-
"lint:eslint": "eslint --ignore-path .gitignore --ignore-pattern src/serviceWorker.js --ext .js,.jsx .",
43+
"lint:eslint": "eslint --ignore-path .gitignore --ext .js,.jsx .",
4444
"test": "jest"
4545
},
4646
"prettier": {
@@ -81,6 +81,6 @@
8181
"snapshotSerializers": [
8282
"enzyme-to-json/serializer"
8383
],
84-
"setupTestFrameworkScriptFile": "<rootDir>/src/jest.config.js"
84+
"setupTestFrameworkScriptFile": "<rootDir>/setup-tests.js"
8585
}
8686
}

src/pages/_app.jsx pages/_app.jsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import App, { Container } from 'next/app';
33
import { Provider } from 'react-redux';
44
import withRedux from 'next-redux-wrapper';
55
import withReduxSaga from 'next-redux-saga';
6-
import makeStore from '../store';
6+
import makeStore from '../lib/store';
77

88
/**
99
* Redux-connected app, using next-redux-wrapper.

src/pages/index.jsx pages/index.jsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import React from 'react';
22
import { string, number, arrayOf, shape } from 'prop-types';
33
import { connect } from 'react-redux';
4-
import { doStartPollingItems, doFetchItems } from '../actions/item';
4+
import { doStartPollingItems, doFetchItems } from '../lib/actions/item';
55

66
/**
77
* Home page.

src/pages/index.spec.jsx pages/index.spec.jsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import React from 'react';
22
import { Provider } from 'react-redux';
33
import configureStore from 'redux-mock-store';
44
import { mount, shallow } from 'enzyme';
5-
import { doStartPollingItems, doFetchItems } from '../actions/item';
5+
import { doStartPollingItems, doFetchItems } from '../lib/actions/item';
66
import ConnectedIndex, { Index } from '.';
77

88
const itemsStub = {

src/jest.config.js setup-tests.js

File renamed without changes.

src/env.config.js

-12
This file was deleted.

src/next.config.js

-9
This file was deleted.

0 commit comments

Comments
 (0)