Skip to content

Commit

Permalink
♻️ Migrate the website and blog to Next.js (#177)
Browse files Browse the repository at this point in the history
* ➕ Add next react and react-dom dependencies
🔧 Add .next folder to .gitignore
* 🔧 Setup flow, standard, husky and lint-staged
🔧 Setup Husky and Lint-Staged with Standard pre-commit hook
🔧 Use standard with snazzy
🔧 Setup flow
* 🔧 Setup absolute imports
* ⬆️ Upgrade jest
* ✨ Add apiCall and apiClients
* ✨ Add theme to _app page
* ✨ Add Wrapper component
* ✨ Add Header component
* ✨ Add Biography component
* ✨ Add flexboxgrid to _app page
* ➕ Add lazysizes
* ✨ Add BlogPost component
* ✨ Add Writings component to Index page
* ✨ Add OpenSource component
* ✨ Add fetchPost and transformPost to ghost api client
* ➕ Add disqus-react dependency
* ✨ Add blog/[slug].js page
* 🔥 Deprecate old website
* 🚚 Move page components into components directory
* ✨ Add isCompressed prop to wrapper
* 🐛 Fix Link usage on dynamic page
* ✨ Add Prism.js to blog/[slug] page
* ✨ Add theme adjustments for blog post page
* ✨ Move blog to SSG markdown rendered
* 🔧 Add .vercel to .gitignore
* 👷 Update travis node version
* 🔧 Update node version
* 📝 Update README
* 🔧 Bump package.json version
* 🔥 Replace moment.js with date-fns
* ✨ Add NavigationMenu component
* ✨ Add blog page
* ✨ Unify Layout on a single component used at app level
* ✨ Add favicons and manifest.json
* ✨ Add next-seo to setup SEO
* 🔥 Remove Disqus
* ✨ Add NewsletterSubscribe component to blog post
* 🎨 Adjust --text light color
* ✨ Add 404 page
* ✨ Optimize BlogPost image sizes
* 🏷️ Type page functions properly
* ✨ Add ShareLinks component to Blog/[slug] page
* 🔧 Fix lint-staged scripts
* ✨ Add gtag and track page views
* 🔥 Remove apiCache
* ✨ Render Posts grouped by year at Writings
* 🔥 Deprecate coveralls for codecov
* 🔧 Remove before_install grunt-cli from travis
* ✅ Add pages specs
* ✨ Add LQPI images for BlogPost previews
* 🎨 Improve spacing consistency on Wrapper
* ✅ Mock Date.now
  • Loading branch information
carloscuesta committed Jun 24, 2020
1 parent f0e8c03 commit 0a9d14c
Show file tree
Hide file tree
Showing 249 changed files with 12,737 additions and 6,282 deletions.
13 changes: 13 additions & 0 deletions .flowconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
[ignore]
<PROJECT_ROOT>/.next

[include]

[libs]

[lints]

[options]

emoji=true
module.name_mapper='src\/\(.*\)$' -> '<PROJECT_ROOT>/src/\1'
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ node_modules
# Coverage
coverage

# Next
.next
.vercel

# OSX Files
*.DS_Store

Expand Down
7 changes: 3 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
language: node_js
node_js:
- 10.16.3
before_install: npm install -g grunt-cli
- 12.17.0
script:
- npm test
after_script: cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js
- npm run test
- npm run test:coverage
notifications:
email: false
slack:
Expand Down
5 changes: 2 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,8 @@

[![Build Status](https://img.shields.io/travis/com/carloscuesta/carloscuesta.me?style=flat-square)](https://travis-ci.com/carloscuesta/carloscuesta.me)
[![Code Climate](https://img.shields.io/codeclimate/github/carloscuesta/carloscuesta.me.svg?style=flat-square)](https://codeclimate.com/github/carloscuesta/carloscuesta.me/)
[![Coverage](https://img.shields.io/coveralls/carloscuesta/carloscuesta.me.svg?style=flat-square)](https://coveralls.io/github/carloscuesta/carloscuesta.me)
[![Coverage](https://img.shields.io/codecov/c/github/carloscuesta/carloscuesta.me?style=flat-square)](https://codecov.io/gh/carloscuesta/carloscuesta.me)
[![Dependencies](https://img.shields.io/david/carloscuesta/carloscuesta.me.svg?style=flat-square)](https://david-dm.org/carloscuesta/carloscuesta.me)
[![DevDependencies](https://img.shields.io/david/dev/carloscuesta/carloscuesta.me.svg?style=flat-square)](https://david-dm.org/carloscuesta/carloscuesta.me#info=devDependencies)
[![Digital Ocean](https://img.shields.io/badge/deployed-digitalocean-0080ff.svg?style=flat-square)](https://m.do.co/c/5347e65ea75c)

**Carlos Cuesta** personal site, built on [NodeJS](http://nodejs.org) using [Express](http://expressjs.com), [Pug](https://pugjs.org), [Sass](http://sass-lang.com) and [Ghost](http://ghost.org) as a blog system.
**Carlos Cuesta** personal site, built with [Next.js](https://nextjs.org/).
4 changes: 0 additions & 4 deletions carloscuesta.js

This file was deleted.

28 changes: 0 additions & 28 deletions gruntfile.js

This file was deleted.

5 changes: 5 additions & 0 deletions jsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"compilerOptions": {
"baseUrl": "."
}
}
116 changes: 81 additions & 35 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,58 +1,104 @@
{
"name": "carloscuesta.me",
"version": "1.0.0",
"version": "5.0.0",
"engines": {
"node": ">=12.17.0"
"node": "12"
},
"description": "Carlos Cuesta website.",
"main": "carloscuesta.js",
"scripts": {
"start": "pm2 start carloscuesta.js",
"start:dev": "NODE_ENV=development nodemon carloscuesta.js",
"build": "next build",
"dev": "next",
"start": "pm2 start npm --name 'carloscuesta' -- start",
"test": "npm run test:lint && npm run test:flow && npm run test:unit",
"test:flow": "flow",
"test:lint": "standard | snazzy",
"test:lint:fix": "standard --fix | snazzy",
"test:unit": "jest --coverage",
"lint": "standard",
"pagespeed": "grunt",
"test": "npm run lint && npm run test:unit && npm run pagespeed"
},
"standard": {
"ignore": [
"src/public/"
]
"test:watch": "NODE_ENV=test TZ=UTC jest --watch",
"test:coverage": "codecov"
},
"repository": {
"type": "git",
"url": "git+https://github.com/carloscuesta/carloscuesta.me.git"
},
"keywords": [
"Carlos",
"Cuesta",
"website"
],
"author": "Carlos Cuesta",
"license": "MIT",
"bugs": {
"url": "https://github.com/carloscuesta/carloscuesta.me/issues"
},
"homepage": "https://github.com/carloscuesta/carloscuesta.me#readme",
"dependencies": {
"compression": "^1.7.4",
"dotenv": "^8.2.0",
"express": "^4.17.1",
"memory-cache": "^0.2.0",
"moment": "^2.24.0",
"node-fetch": "^2.6.0",
"node-sass-middleware": "^0.11.0",
"oauth": "^0.9.15",
"pug": "^2.0.4",
"striptags": "^3.1.1"
"date-fns": "^2.14.0",
"flexboxgrid": "^6.3.1",
"gray-matter": "^4.0.2",
"lazysizes": "^5.2.2",
"lodash.groupby": "^4.6.0",
"next": "^9.4.4",
"next-seo": "^4.5.0",
"react": "^16.13.1",
"react-dom": "^16.13.1",
"remark": "^12.0.0",
"remark-external-links": "^6.1.0",
"remark-html": "^11.0.2"
},
"devDependencies": {
"coveralls": "^3.0.7",
"grunt": "^1.0.4",
"grunt-pagespeed": "^2.0.1",
"jest": "^24.9.0",
"nodemon": "^2.0.1",
"standard": "^14.3.3",
"supertest": "^4.0.2"
"@babel/preset-flow": "^7.10.1",
"babel-eslint": "^10.1.0",
"codecov": "^3.7.0",
"eslint-plugin-flowtype": "^5.1.3",
"flow-bin": "^0.125.1",
"husky": "^4.2.5",
"identity-obj-proxy": "^3.0.0",
"jest": "^26.0.1",
"jest-fetch-mock": "^3.0.3",
"lint-staged": "^10.2.7",
"react-test-renderer": "16.13.1",
"snazzy": "^8.0.0",
"standard": "^14.3.3"
},
"babel": {
"presets": [
"next/babel",
"@babel/preset-flow"
]
},
"standard": {
"parser": "babel-eslint",
"env": [
"jest"
],
"ignore": [
"public/**/*"
],
"plugins": [
"flowtype"
],
"globals": [
"fetch"
]
},
"husky": {
"hooks": {
"pre-commit": "lint-staged"
}
},
"lint-staged": {
"*.js": [
"npm run test:lint:fix",
"npm run test:flow"
]
},
"jest": {
"collectCoverageFrom": [
"src/**/*.{js,jsx}",
"!src/**/__tests__/*.{js,jsx}"
],
"moduleNameMapper": {
"^.+\\.css$": "identity-obj-proxy",
"src/(.*)$": "<rootDir>/src/$1"
},
"testMatch": [
"<rootDir>/**/*.(spec).(js)"
]
}
}
11 changes: 11 additions & 0 deletions public/browserconfig.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<browserconfig>
<msapplication>
<tile>
<square70x70logo src="/favicon/ms-icon-70x70.png"/>
<square150x150logo src="/favicon/ms-icon-150x150.png"/>
<square310x310logo src="/favicon/ms-icon-310x310.png"/>
<TileColor>#FF5252</TileColor>
</tile>
</msapplication>
</browserconfig>
Binary file added public/favicon/android-icon-144x144.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/favicon/android-icon-192x192.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/favicon/android-icon-36x36.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/favicon/android-icon-48x48.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/favicon/android-icon-512x512.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/favicon/android-icon-72x72.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/favicon/android-icon-96x96.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/favicon/apple-icon-114x114.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/favicon/apple-icon-120x120.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/favicon/apple-icon-144x144.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/favicon/apple-icon-152x152.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/favicon/apple-icon-180x180.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/favicon/apple-icon-57x57.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/favicon/apple-icon-60x60.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/favicon/apple-icon-72x72.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/favicon/apple-icon-76x76.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/favicon/apple-icon-precomposed.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/favicon/apple-icon.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/favicon/favicon-16x16.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/favicon/favicon-32x32.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/favicon/favicon-96x96.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/favicon/favicon.ico
Binary file not shown.
Binary file added public/favicon/ms-icon-144x144.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/favicon/ms-icon-150x150.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/favicon/ms-icon-310x310.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/favicon/ms-icon-70x70.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes
52 changes: 52 additions & 0 deletions public/manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
{
"name": "Carlos Cuesta",
"short_name": "Carlos Cuesta",
"theme_color": "#FF5252",
"background_color": "#FF5252",
"display": "minimal-ui",
"start_url": "/",
"icons": [
{
"src": "\/favicon\/android-icon-36x36.png",
"sizes": "36x36",
"type": "image\/favicon\/png",
"density": "0.75"
},
{
"src": "\/favicon\/android-icon-48x48.png",
"sizes": "48x48",
"type": "image\/favicon\/png",
"density": "1.0"
},
{
"src": "\/favicon\/android-icon-72x72.png",
"sizes": "72x72",
"type": "image\/favicon\/png",
"density": "1.5"
},
{
"src": "\/favicon\/android-icon-96x96.png",
"sizes": "96x96",
"type": "image\/favicon\/png",
"density": "2.0"
},
{
"src": "\/favicon\/android-icon-144x144.png",
"sizes": "144x144",
"type": "image\/favicon\/png",
"density": "3.0"
},
{
"src": "\/favicon\/android-icon-192x192.png",
"sizes": "192x192",
"type": "image\/favicon\/png",
"density": "4.0"
},
{
"src": "\/favicon\/android-icon-512x512.png",
"sizes": "512x512",
"type": "image\/favicon\/png",
"density": "4.0"
}
]
}
1 change: 1 addition & 0 deletions public/prism/prism.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 comment on commit 0a9d14c

@vercel
Copy link

@vercel vercel bot commented on 0a9d14c Jun 24, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.