Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Develop #7

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ node_modules/

# Framework files
.next/
out/

# Mac files
.DS_Store
8 changes: 7 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@ cache:
directories:
- node_modules

script:
install:
- npm install

script:
- npm run prettier:check

after_success:
- now --target staging
- npm run lh -- --pwa=100 --perf=96 --seo=100 --a11y=90 --bp=90 https://spindlewtf.remi.now.sh
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,3 +46,11 @@ $ npm run prettier:fix
### Deployment

Deployment is done via [ZEIT Now](https://zeit.co/docs).

### CI

On the CI (Travis) the service 'lighthouse' is run to test performance, quality, and correctness.

### Testing

[ Coming soon ]
8 changes: 7 additions & 1 deletion next.config.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
module.exports = {
target: 'serverless'
target: 'serverless',
exportPathMap: function() {
return {
'/': { page: '/' },
'/post': { page: '/posts' }
};
}
};
4 changes: 2 additions & 2 deletions now.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": 2,
"builds": [{ "src": "next.config.js", "use": "@now/next" }],
"alias": "spindle.wtf"
"builds": [{ "src": "package.json", "use": "@now/next" }],
"alias": ["spindle.wtf"]
}
6,592 changes: 5,908 additions & 684 deletions package-lock.json

Large diffs are not rendered by default.

13 changes: 10 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"version": "1.0.0",
"description": "",
"dependencies": {
"next": "^8.0.1",
"next": "^8.1.0",
"react": "^16.8.2",
"react-dom": "^16.8.2"
},
Expand All @@ -13,15 +13,22 @@
"eslint-plugin-jsx-a11y": "^6.2.1",
"eslint-plugin-prettier": "^3.0.1",
"eslint-plugin-react": "^7.12.4",
"prettier": "^1.16.4"
"lighthouse-ci": "^1.6.0",
"lighthousebot": "git+https://github.com/GoogleChromeLabs/lighthousebot.git",
"npm": "^6.8.0",
"prettier": "^1.16.4",
"serve": "^10.1.2"
},
"scripts": {
"dev": "next",
"build": "next build",
"start": "next start",
"export": "next export",
"prettier:check": "prettier --check $npm_package_nextFiles",
"prettier:fix": "prettier --write $npm_package_nextFiles",
"test:lint": "tslint --project ./tsconfig.json"
"test:lint": "tslint --project ./tsconfig.json",
"now-build": "next build",
"lh": "lighthousebot"
},
"nextFiles": "{{components,epics,lib,mutations,pages,reducers,scripts,test,themes,types},__{tests,mocks,generated}__}/**/*.js",
"repository": {
Expand Down
26 changes: 26 additions & 0 deletions pages/_document.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
// _document is only rendered on the server side and not on the client side
// Event handlers like onClick can't be added to this file

// ./pages/_document.js
import Document, { Html, Head, Main, NextScript } from 'next/document';

class MyDocument extends Document {
static async getInitialProps(ctx) {
const initialProps = await Document.getInitialProps(ctx);
return { ...initialProps };
}

render() {
return (
<Html lang="eng">
<Head />
<body>
<Main />
<NextScript />
</body>
</Html>
);
}
}

export default MyDocument;