From 18852ce299f5724f68db3571b69e740b81b72d89 Mon Sep 17 00:00:00 2001 From: Carlos Cuesta Date: Sat, 26 Oct 2019 18:00:59 +0200 Subject: [PATCH] :recycle: Move website to Next.js (#368) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This commit updates the stack of the gitmoji website to Next.js. This was a thing I wanted to do a long time ago. Our current stack was a little bit outdated and had issues with the Developer UX. The concept is the same, the whole site is built into a Static HTML site. Also we can benefit from using React ⚛️ ❤️ The current stack will be: Next.js React Flow Scss Prettier Jest --- .editorconfig | 4 +- .flowconfig | 12 + .github/CONTRIBUTING.md | 24 +- .gitignore | 3 + .travis.yml | 14 +- gulpfile.babel.js | 77 - next.config.js | 19 + package.json | 93 +- .../static/android-icon-144x144.png | Bin .../static/android-icon-192x192.png | Bin {src => public}/static/android-icon-36x36.png | Bin {src => public}/static/android-icon-48x48.png | Bin {src => public}/static/android-icon-72x72.png | Bin {src => public}/static/android-icon-96x96.png | Bin {src => public}/static/apple-icon-114x114.png | Bin {src => public}/static/apple-icon-120x120.png | Bin {src => public}/static/apple-icon-144x144.png | Bin {src => public}/static/apple-icon-152x152.png | Bin {src => public}/static/apple-icon-180x180.png | Bin {src => public}/static/apple-icon-57x57.png | Bin {src => public}/static/apple-icon-60x60.png | Bin {src => public}/static/apple-icon-72x72.png | Bin {src => public}/static/apple-icon-76x76.png | Bin .../static/apple-icon-precomposed.png | Bin {src => public}/static/apple-icon.png | Bin {src => public}/static/browserconfig.xml | 0 {src => public}/static/favicon-16x16.png | Bin {src => public}/static/favicon-32x32.png | Bin {src => public}/static/favicon-96x96.png | Bin {src => public}/static/favicon.ico | Bin {src => public}/static/gitmoji.gif | Bin {src/images => public/static}/gitmoji.svg | 0 {src => public}/static/manifest.json | 0 {src => public}/static/ms-icon-144x144.png | Bin {src => public}/static/ms-icon-150x150.png | Bin {src => public}/static/ms-icon-310x310.png | Bin {src => public}/static/ms-icon-70x70.png | Bin .../__snapshots__/pages.spec.js.snap | 2875 ++++ src/__tests__/pages.spec.js | 32 + .../__snapshots__/button.spec.js.snap | 17 + .../Button/__tests__/button.spec.js | 11 + src/components/Button/__tests__/stubs.js | 5 + src/components/Button/index.js | 15 + .../ContributorsList/Contributor/index.js | 14 + .../contributorsList.spec.js.snap | 22 + .../__tests__/contributorsList.spec.js | 17 + .../ContributorsList/__tests__/stubs.js | 4 + src/components/ContributorsList/index.js | 37 + src/components/GitmojiList/Gitmoji/index.js | 30 + .../__snapshots__/gitmojiList.spec.js.snap | 183 + .../GitmojiList/__tests__/gitmojiList.spec.js | 11 + src/components/GitmojiList/__tests__/stubs.js | 5 + src/components/GitmojiList/index.js | 29 + .../__tests__/__snapshots__/icon.spec.js.snap | 116 + src/components/Icon/__tests__/icon.spec.js | 16 + src/components/Icon/__tests__/stubs.js | 3 + src/components/Icon/definitions.js | 61 + src/components/Icon/index.js | 14 + src/components/Layout/Footer/index.js | 33 + src/components/Layout/Header/index.js | 36 + src/components/Layout/Logo/index.js | 65 + src/components/Layout/Logo/statuses/index.js | 216 + src/components/Layout/Navigation/index.js | 59 + .../__snapshots__/layout.spec.js.snap | 612 + .../Layout/__tests__/layout.spec.js | 42 + src/components/Layout/__tests__/stubs.js | 3 + src/components/Layout/index.js | 21 + .../__tests__/__snapshots__/seo.spec.js.snap | 5 + src/components/SEO/__tests__/seo.spec.js | 16 + src/components/SEO/__tests__/stubs.js | 4 + src/components/SEO/index.js | 127 + src/data/contributors.json | 542 - src/data/gitmojis.json | 898 +- src/data/schema.json | 82 +- src/pages/_document.js | 56 + src/pages/about.js | 124 + src/pages/contributors.js | 22 + src/pages/index.js | 19 + src/pdf/index.js | 70 - src/pdf/loadEmojis.js | 105 - src/scripts/clipboard.js | 1 - src/scripts/main.js | 5 - src/scripts/notification.js | 1 - src/scripts/notificationFx.js | 3 - src/styles/_includes/_flexbox.scss | 107 +- src/styles/_includes/_menu.scss | 301 +- src/styles/_includes/_notifications.scss | 199 +- src/styles/_includes/_vars.scss | 201 +- src/styles/style.scss | 368 +- src/templates/_includes/_footer.pug | 15 - src/templates/_includes/_icons.pug | 24 - src/templates/_includes/_meta.pug | 33 - src/templates/_includes/_nav.pug | 15 - src/templates/about.pug | 48 - src/templates/contributors.pug | 27 - src/templates/index.pug | 40 - yarn.lock | 10909 +++++++++++----- 97 files changed, 14092 insertions(+), 5125 deletions(-) create mode 100644 .flowconfig delete mode 100644 gulpfile.babel.js create mode 100644 next.config.js rename {src => public}/static/android-icon-144x144.png (100%) rename {src => public}/static/android-icon-192x192.png (100%) rename {src => public}/static/android-icon-36x36.png (100%) rename {src => public}/static/android-icon-48x48.png (100%) rename {src => public}/static/android-icon-72x72.png (100%) rename {src => public}/static/android-icon-96x96.png (100%) rename {src => public}/static/apple-icon-114x114.png (100%) rename {src => public}/static/apple-icon-120x120.png (100%) rename {src => public}/static/apple-icon-144x144.png (100%) rename {src => public}/static/apple-icon-152x152.png (100%) rename {src => public}/static/apple-icon-180x180.png (100%) rename {src => public}/static/apple-icon-57x57.png (100%) rename {src => public}/static/apple-icon-60x60.png (100%) rename {src => public}/static/apple-icon-72x72.png (100%) rename {src => public}/static/apple-icon-76x76.png (100%) rename {src => public}/static/apple-icon-precomposed.png (100%) rename {src => public}/static/apple-icon.png (100%) rename {src => public}/static/browserconfig.xml (100%) rename {src => public}/static/favicon-16x16.png (100%) rename {src => public}/static/favicon-32x32.png (100%) rename {src => public}/static/favicon-96x96.png (100%) rename {src => public}/static/favicon.ico (100%) rename {src => public}/static/gitmoji.gif (100%) rename {src/images => public/static}/gitmoji.svg (100%) rename {src => public}/static/manifest.json (100%) rename {src => public}/static/ms-icon-144x144.png (100%) rename {src => public}/static/ms-icon-150x150.png (100%) rename {src => public}/static/ms-icon-310x310.png (100%) rename {src => public}/static/ms-icon-70x70.png (100%) create mode 100644 src/__tests__/__snapshots__/pages.spec.js.snap create mode 100644 src/__tests__/pages.spec.js create mode 100644 src/components/Button/__tests__/__snapshots__/button.spec.js.snap create mode 100644 src/components/Button/__tests__/button.spec.js create mode 100644 src/components/Button/__tests__/stubs.js create mode 100644 src/components/Button/index.js create mode 100644 src/components/ContributorsList/Contributor/index.js create mode 100644 src/components/ContributorsList/__tests__/__snapshots__/contributorsList.spec.js.snap create mode 100644 src/components/ContributorsList/__tests__/contributorsList.spec.js create mode 100644 src/components/ContributorsList/__tests__/stubs.js create mode 100644 src/components/ContributorsList/index.js create mode 100644 src/components/GitmojiList/Gitmoji/index.js create mode 100644 src/components/GitmojiList/__tests__/__snapshots__/gitmojiList.spec.js.snap create mode 100644 src/components/GitmojiList/__tests__/gitmojiList.spec.js create mode 100644 src/components/GitmojiList/__tests__/stubs.js create mode 100644 src/components/GitmojiList/index.js create mode 100644 src/components/Icon/__tests__/__snapshots__/icon.spec.js.snap create mode 100644 src/components/Icon/__tests__/icon.spec.js create mode 100644 src/components/Icon/__tests__/stubs.js create mode 100644 src/components/Icon/definitions.js create mode 100644 src/components/Icon/index.js create mode 100644 src/components/Layout/Footer/index.js create mode 100644 src/components/Layout/Header/index.js create mode 100644 src/components/Layout/Logo/index.js create mode 100644 src/components/Layout/Logo/statuses/index.js create mode 100644 src/components/Layout/Navigation/index.js create mode 100644 src/components/Layout/__tests__/__snapshots__/layout.spec.js.snap create mode 100644 src/components/Layout/__tests__/layout.spec.js create mode 100644 src/components/Layout/__tests__/stubs.js create mode 100644 src/components/Layout/index.js create mode 100644 src/components/SEO/__tests__/__snapshots__/seo.spec.js.snap create mode 100644 src/components/SEO/__tests__/seo.spec.js create mode 100644 src/components/SEO/__tests__/stubs.js create mode 100644 src/components/SEO/index.js delete mode 100644 src/data/contributors.json create mode 100644 src/pages/_document.js create mode 100644 src/pages/about.js create mode 100644 src/pages/contributors.js create mode 100644 src/pages/index.js delete mode 100644 src/pdf/index.js delete mode 100644 src/pdf/loadEmojis.js delete mode 100644 src/scripts/clipboard.js delete mode 100644 src/scripts/main.js delete mode 100644 src/scripts/notification.js delete mode 100644 src/scripts/notificationFx.js delete mode 100644 src/templates/_includes/_footer.pug delete mode 100644 src/templates/_includes/_icons.pug delete mode 100644 src/templates/_includes/_meta.pug delete mode 100644 src/templates/_includes/_nav.pug delete mode 100644 src/templates/about.pug delete mode 100644 src/templates/contributors.pug delete mode 100644 src/templates/index.pug diff --git a/.editorconfig b/.editorconfig index c4d2095..4c13ead 100644 --- a/.editorconfig +++ b/.editorconfig @@ -2,8 +2,8 @@ root = true [*] -indent_style = tab -tab_width = 4 +indent_style = spaces +tab_width = 2 charset = utf-8 trim_trailing_whitespace = true insert_final_newline = true diff --git a/.flowconfig b/.flowconfig new file mode 100644 index 0000000..5c850f5 --- /dev/null +++ b/.flowconfig @@ -0,0 +1,12 @@ +[ignore] +.*/node_modules/jsonlint/.* + +[include] + +[libs] + +[lints] + +[options] + +[strict] diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index ec6ef6c..ad3e3fb 100644 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -30,13 +30,14 @@ If you would like to add a new emoji to gitmoji, fill the provided `ISSUE_TEMPLA "name": "code (same as code but without ':' replace underscores for dashes _ => - )" } ``` + If you want to find the hexadecimal entity of icon, search for it in this site: http://graphemica.com/ Then, after that you'll need to add a new color to [the vars.scss](https://github.com/carloscuesta/gitmoji/blob/master/src/styles/_includes/_vars.scss) file. You must follow the convention of adding a new item to the `$gitmojis array`. That matches the name that you added at the json file. -## How to start gitmoji and update +## How to start gitmoji If you want to make changes to the site, follow the next steps: @@ -50,24 +51,7 @@ $ cd gitmoji 2. Install the dependencies and start the development task. ```bash -$ npm i && gulp +$ yarn install && yarn run dev ``` -3. Make sure the styles are using a link instead of being inlined. - -_If you are updating the SCSS files and the styles doesn't get updated, go to the `index.pug` and `about.pug` paste the following code_ - -```jade -link(href="css/style.css", type="text/css", rel="stylesheet") -``` - -_Remove this one_ - -```jade -style - include ../../dist/css/style.css -``` - -**After making your changes, inline the styles as before.** - -The project is built with [Pug](http://pugjs.org) and [SCSS](http://sass-lang.com) +The project is built with [Next.js](http://nextjs.org) and [SCSS](http://sass-lang.com) diff --git a/.gitignore b/.gitignore index a975499..ccd7fb9 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,6 @@ dist/ node_modules/ .publish/ +.next +out/ +coverage/ diff --git a/.travis.yml b/.travis.yml index e556f81..13a4c81 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,13 +1,18 @@ language: node_js -node_js: -- 6 +node_js: lts/* cache: directories: - node_modules -script: npm test +script: + - yarn run lint + - yarn run flow + - yarn run test +before_deploy: + - yarn run build + - yarn run export deploy: provider: pages - local-dir: dist + local-dir: out skip-cleanup: true github-token: $GITHUB_PAGES_DEPLOY_TOKEN keep-history: true @@ -18,3 +23,4 @@ deploy: notifications: slack: secure: oTOAM8T5Qo3sZ+oB54OfwRA/F1IFrt3J2TFGobYqSk5GZFBJZ/idlSFmKsMCfqVYTMzNhWlYj4H+isdAVzVh/TgbFKY88/GcbtNG8QYCJcFaWOanIp38XQ2RiSImt5T4aMquq/pFj1cE+CNTIWRoieDteukq/bIT3Z1I8hpz5QCSxAFr0suPSwCv1MLXR0ytVldF16eeTVQ0BR8l4L/K5IBt6ZfnpkebZMS0Q3MCobUosAgE1hIHFYxdXYugfmnG0cO2wtLvXwQWQ6VoRGJdc0iAL4CFJxKORX43Y//T0P5e0dBiGfek7QP5gJk+8qeFd5D2O34pB/POUy2vtFvBKTSsgOhz94fmS5v5M4X60oHsNWYt8AUU9CMicYQ2U2pbYAlttTGN3tguC/usdJRS9kWdn6MbI8T6cjk2BCyriFXXXumLEINiHYexcb0PdAm2Lwc//5QSxCdFPGr5UfdhAfwpNOy21QhvcioGUJbtLuyEMP+F9+ZMYWypfacD507yqtr5Z+rtInp4qOuKwZFSir7IzTBbuEUuxJLagbwUTbT302sYarOPvpAjgzPbPWFuUVigZ1y/SPbdObbolOh2yGEfYwIIIPT8ijKPN+sgDFOr0TJ1ZkB59Kb5zW/pDAykWqf2kmLHCFQGcatPzg1ROrrR5CH6/+LVQKhxUEaGLaE= + email: false diff --git a/gulpfile.babel.js b/gulpfile.babel.js deleted file mode 100644 index eb0c8e2..0000000 --- a/gulpfile.babel.js +++ /dev/null @@ -1,77 +0,0 @@ -'use strict' - -import gulp from 'gulp' -import sass from 'gulp-sass' -import pug from 'gulp-pug' -import pugLint from 'gulp-pug-lint' -import browserSync from 'browser-sync' -import plumber from 'gulp-plumber' -import gitmojis from './src/data/gitmojis.json' -import contributors from './src/data/contributors.json' -import ghPages from 'gulp-gh-pages' - -const baseDirs = { - src: 'src/', - dist: 'dist/' -} - -const routes = { - templates: { - pug: `${baseDirs.src}templates/*.pug`, - _pug: `${baseDirs.src}templates/_includes/*.pug` - }, - styles: { - scss: `${baseDirs.src}styles/*.scss`, - _scss: `${baseDirs.src}styles/_includes/*.scss` - }, - files: { - html: `${baseDirs.dist}`, - css: `${baseDirs.dist}css/`, - deploy: `${baseDirs.dist}**/*`, - staticSrc: `${baseDirs.src}static/**/*`, - staticDist: `${baseDirs.dist}static/` - } -} - -gulp.task('templates', ['styles'], () => { - return gulp.src([routes.templates.pug, '!' + routes.templates._pug]) - .pipe(pugLint()) - .pipe(plumber({})) - .pipe(pug({ - locals: { 'emojis': gitmojis, 'contributors': contributors } - })) - .pipe(gulp.dest(routes.files.html)) - .pipe(browserSync.stream()) -}) - -gulp.task('styles', () => { - return gulp.src(routes.styles.scss) - .pipe(plumber({})) - .pipe(sass({ outputStyle: 'compressed' })) - .pipe(gulp.dest(routes.files.css)) - .pipe(browserSync.stream()) -}) - -gulp.task('serve', ['styles', 'templates'], () => { - browserSync.init({ - server: `${baseDirs.dist}` - }) - - gulp.watch([routes.templates.pug, routes.templates._pug], ['templates']) - gulp.watch([routes.styles.scss, routes.styles._scss], ['styles']) -}) - -gulp.task('build', ['templates', 'styles'], () => { - gulp.src([routes.files.staticSrc]).pipe(gulp.dest(routes.files.staticDist)) -}) - -gulp.task('deploy', () => { - return gulp.src(routes.files.deploy) - .pipe(ghPages({ message: ':rocket: gitmoji website' })) -}) - -gulp.task('dev', ['serve']) - -gulp.task('default', () => { - gulp.start('dev') -}) diff --git a/next.config.js b/next.config.js new file mode 100644 index 0000000..6f05563 --- /dev/null +++ b/next.config.js @@ -0,0 +1,19 @@ +const withSass = require('@zeit/next-sass') +const OptimizeCSSAssetsPlugin = require('optimize-css-assets-webpack-plugin') + +module.exports = withSass({ + exportPathMap: function() { + return { + '/': { page: '/' }, + '/about': { page: '/about' }, + '/contributors': { page: '/contributors' } + } + }, + webpack: (config, { dev, isServer }) => { + if (isServer) return config + + config.optimization.minimizer.push(new OptimizeCSSAssetsPlugin({})) + + return config + } +}) diff --git a/package.json b/package.json index 83eb862..e82fb61 100644 --- a/package.json +++ b/package.json @@ -1,53 +1,68 @@ { "name": "gitmoji", "version": "1.0.0", - "description": "An emoji guide for your commit messages", - "main": "index.js", + "private": true, "scripts": { - "jsonvalidate": "jsonlint ./src/data/gitmojis.json -V ./src/data/schema.json", - "contributors": "curl https://api.github.com/repos/carloscuesta/gitmoji/contributors -o ./src/data/contributors.json", - "build": "gulp build", - "deploy": "gulp deploy", - "start": "npm run contributors && gulp", - "test": "npm run jsonvalidate && gulp build" + "build": "next build", + "dev": "next dev", + "export": "next export && touch out/.nojekyll", + "flow": "flow", + "lint": "prettier --check src/**/*.{js,json,scss}", + "start": "next start", + "test": "jest --coverage", + "validate:gitmojis": "jsonlint ./src/data/gitmojis.json -V ./src/data/schema.json" }, - "repository": { - "type": "git", - "url": "git+https://github.com/carloscuesta/gitmoji.git" + "dependencies": { + "@babel/preset-flow": "^7.0.0", + "@zeit/next-sass": "^1.0.1", + "next": "9.1.1", + "node-sass": "^4.13.0", + "react": "16.11.0", + "react-dom": "16.11.0", + "react-test-renderer": "^16.11.0" }, - "author": "Carlos Cuesta", - "license": "MIT", - "bugs": { - "url": "https://github.com/carloscuesta/gitmoji/issues" + "devDependencies": { + "flow-bin": "^0.110.1", + "husky": "^3.0.9", + "identity-obj-proxy": "^3.0.0", + "jest": "^24.9.0", + "jsonlint": "^1.6.3", + "lint-staged": "^10.0.0-1", + "optimize-css-assets-webpack-plugin": "^5.0.3", + "prettier": "1.18.2" }, - "pugLintConfig": { - "disallowHtmlText": true, - "disallowDuplicateAttributes": true, - "disallowClassAttributeWithStaticValue": true, - "disallowIdAttributeWithStaticValue": true, - "requireLowerCaseAttributes": true + "prettier": { + "semi": false, + "singleQuote": true, + "arrowParens": "always" + }, + "lint-staged": { + "*.{js,jsx}": [ + "prettier --write src/**/*.{js,json,scss}", + "git add" + ] + }, + "husky": { + "hooks": { + "pre-commit": "lint-staged", + "pre-push": "npm run flow && npm run test" + } }, "babel": { "presets": [ - "es2015" + "next/babel", + "@babel/preset-flow" ] }, - "homepage": "https://github.com/carloscuesta/gitmoji#readme", - "dependencies": { - "async": "^2.1.2", - "gulp": "^3.9.1", - "gulp-plumber": "^1.1.0", - "gulp-pug": "^3.3.0", - "gulp-pug-lint": "^0.1.6", - "gulp-sass": "^3.1.0", - "pdfkit": "^0.8.0", - "request": "^2.79.0" - }, - "devDependencies": { - "babel-core": "^6.26.0", - "babel-preset-es2015": "^6.24.1", - "browser-sync": "^2.18.13", - "gulp-gh-pages": "^0.5.4", - "jsonlint": "^1.6.2" + "jest": { + "collectCoverageFrom": [ + "src/**/*.{js,jsx}" + ], + "testMatch": [ + "**/*.(spec).(js)" + ], + "moduleNameMapper": { + "\\.(scss)$": "identity-obj-proxy" + } } } diff --git a/src/static/android-icon-144x144.png b/public/static/android-icon-144x144.png similarity index 100% rename from src/static/android-icon-144x144.png rename to public/static/android-icon-144x144.png diff --git a/src/static/android-icon-192x192.png b/public/static/android-icon-192x192.png similarity index 100% rename from src/static/android-icon-192x192.png rename to public/static/android-icon-192x192.png diff --git a/src/static/android-icon-36x36.png b/public/static/android-icon-36x36.png similarity index 100% rename from src/static/android-icon-36x36.png rename to public/static/android-icon-36x36.png diff --git a/src/static/android-icon-48x48.png b/public/static/android-icon-48x48.png similarity index 100% rename from src/static/android-icon-48x48.png rename to public/static/android-icon-48x48.png diff --git a/src/static/android-icon-72x72.png b/public/static/android-icon-72x72.png similarity index 100% rename from src/static/android-icon-72x72.png rename to public/static/android-icon-72x72.png diff --git a/src/static/android-icon-96x96.png b/public/static/android-icon-96x96.png similarity index 100% rename from src/static/android-icon-96x96.png rename to public/static/android-icon-96x96.png diff --git a/src/static/apple-icon-114x114.png b/public/static/apple-icon-114x114.png similarity index 100% rename from src/static/apple-icon-114x114.png rename to public/static/apple-icon-114x114.png diff --git a/src/static/apple-icon-120x120.png b/public/static/apple-icon-120x120.png similarity index 100% rename from src/static/apple-icon-120x120.png rename to public/static/apple-icon-120x120.png diff --git a/src/static/apple-icon-144x144.png b/public/static/apple-icon-144x144.png similarity index 100% rename from src/static/apple-icon-144x144.png rename to public/static/apple-icon-144x144.png diff --git a/src/static/apple-icon-152x152.png b/public/static/apple-icon-152x152.png similarity index 100% rename from src/static/apple-icon-152x152.png rename to public/static/apple-icon-152x152.png diff --git a/src/static/apple-icon-180x180.png b/public/static/apple-icon-180x180.png similarity index 100% rename from src/static/apple-icon-180x180.png rename to public/static/apple-icon-180x180.png diff --git a/src/static/apple-icon-57x57.png b/public/static/apple-icon-57x57.png similarity index 100% rename from src/static/apple-icon-57x57.png rename to public/static/apple-icon-57x57.png diff --git a/src/static/apple-icon-60x60.png b/public/static/apple-icon-60x60.png similarity index 100% rename from src/static/apple-icon-60x60.png rename to public/static/apple-icon-60x60.png diff --git a/src/static/apple-icon-72x72.png b/public/static/apple-icon-72x72.png similarity index 100% rename from src/static/apple-icon-72x72.png rename to public/static/apple-icon-72x72.png diff --git a/src/static/apple-icon-76x76.png b/public/static/apple-icon-76x76.png similarity index 100% rename from src/static/apple-icon-76x76.png rename to public/static/apple-icon-76x76.png diff --git a/src/static/apple-icon-precomposed.png b/public/static/apple-icon-precomposed.png similarity index 100% rename from src/static/apple-icon-precomposed.png rename to public/static/apple-icon-precomposed.png diff --git a/src/static/apple-icon.png b/public/static/apple-icon.png similarity index 100% rename from src/static/apple-icon.png rename to public/static/apple-icon.png diff --git a/src/static/browserconfig.xml b/public/static/browserconfig.xml similarity index 100% rename from src/static/browserconfig.xml rename to public/static/browserconfig.xml diff --git a/src/static/favicon-16x16.png b/public/static/favicon-16x16.png similarity index 100% rename from src/static/favicon-16x16.png rename to public/static/favicon-16x16.png diff --git a/src/static/favicon-32x32.png b/public/static/favicon-32x32.png similarity index 100% rename from src/static/favicon-32x32.png rename to public/static/favicon-32x32.png diff --git a/src/static/favicon-96x96.png b/public/static/favicon-96x96.png similarity index 100% rename from src/static/favicon-96x96.png rename to public/static/favicon-96x96.png diff --git a/src/static/favicon.ico b/public/static/favicon.ico similarity index 100% rename from src/static/favicon.ico rename to public/static/favicon.ico diff --git a/src/static/gitmoji.gif b/public/static/gitmoji.gif similarity index 100% rename from src/static/gitmoji.gif rename to public/static/gitmoji.gif diff --git a/src/images/gitmoji.svg b/public/static/gitmoji.svg similarity index 100% rename from src/images/gitmoji.svg rename to public/static/gitmoji.svg diff --git a/src/static/manifest.json b/public/static/manifest.json similarity index 100% rename from src/static/manifest.json rename to public/static/manifest.json diff --git a/src/static/ms-icon-144x144.png b/public/static/ms-icon-144x144.png similarity index 100% rename from src/static/ms-icon-144x144.png rename to public/static/ms-icon-144x144.png diff --git a/src/static/ms-icon-150x150.png b/public/static/ms-icon-150x150.png similarity index 100% rename from src/static/ms-icon-150x150.png rename to public/static/ms-icon-150x150.png diff --git a/src/static/ms-icon-310x310.png b/public/static/ms-icon-310x310.png similarity index 100% rename from src/static/ms-icon-310x310.png rename to public/static/ms-icon-310x310.png diff --git a/src/static/ms-icon-70x70.png b/public/static/ms-icon-70x70.png similarity index 100% rename from src/static/ms-icon-70x70.png rename to public/static/ms-icon-70x70.png diff --git a/src/__tests__/__snapshots__/pages.spec.js.snap b/src/__tests__/__snapshots__/pages.spec.js.snap new file mode 100644 index 0000000..242c075 --- /dev/null +++ b/src/__tests__/__snapshots__/pages.spec.js.snap @@ -0,0 +1,2875 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`Pages About should render the page 1`] = ` +Array [ + + + + + heart + + + + + + star + + + + + + twitter + + + + + + + + + + + + + + + + + + + + + , + , +
+ + + gitmoji + + + + + +

+ An emoji guide for your commit messages +

+
, +
+
+

+ About +

+

+ + Gitmoji is an emoji guide for GitHub commit messages + + . Aims to be a standarization cheatsheet - guide for using + + + emojis + + on GitHub's commit messages. +

+

+ + Using emojis + + on + + commit messages + + + provides an + + easy way + + of + + + identifying the purpose or intention of a commit + + with only looking at the emojis used. As there are a lot of different emojis I found the need of creating a guide that can help to use emojis easier. +

+

+ This project is Open Source, that means everyone can participate, suggesting, discussing and adding new emojis. Take a look at the + + + contributing section + + + and + + + guidelines for contributing + + . +

+
+ + + + + GitHub + + + + + + Tweet + +
+
+
+

+ Using gitmoji with + + + gitmoji-cli + +

+

+ An easy solution for using gitmoji from your command line, is to install + + + gitmoji-cli + + . A gitmoji interactive client for using emojis on commit messages. +

+
+        
+          $ npm i -g gitmoji-cli
+        
+      
+
+
+

+ Contributing to gitmoji +

+

+ Contributing to gitmoji it's a piece of cake 🍰! This project it's a static website built with + + Next.js + + . All the gitmojis displayed are rendered from a JSON file. Before submitting any pull request, please follow the next steps: +

+
    +
  1. + + Create an issue + + + filling the template. +
  2. +
  3. + After discussing the idea, feature or suggestion, + + + fork gitmoji + +
  4. +
  5. + Create a new branch with the feature name. (Eg: add-emoji-deploy, fix-website-header) +
  6. +
  7. + Make your changes and send a + + + pull request + + + . +
  8. +
+
+
, + , +] +`; + +exports[`Pages Contributors should render the page 1`] = ` +Array [ + + + + + heart + + + + + + star + + + + + + twitter + + + + + + + + + + + + + + + + + + + + + , + , +
+ + + gitmoji + + + + + +

+ An emoji guide for your commit messages +

+
, +
+
+

+ Contributors +

+
+
+
, + , +] +`; + +exports[`Pages Index should render the page 1`] = ` +Array [ + + + + + heart + + + + + + star + + + + + + twitter + + + + + + + + + + + + + + + + + + + + + , + , +
+ + + gitmoji + + + + + +

+ An emoji guide for your commit messages +

+
, +
+
+
+
+
+ + 🎨 + +
+
+ + :art: + +

+ Improving structure / format of the code. +

+
+
+
+
+
+
+ + ⚡️ + +
+
+ + :zap: + +

+ Improving performance. +

+
+
+
+
+
+
+ + 🔥 + +
+
+ + :fire: + +

+ Removing code or files. +

+
+
+
+
+
+
+ + 🐛 + +
+
+ + :bug: + +

+ Fixing a bug. +

+
+
+
+
+
+
+ + 🚑 + +
+
+ + :ambulance: + +

+ Critical hotfix. +

+
+
+
+
+
+
+ + ✨ + +
+
+ + :sparkles: + +

+ Introducing new features. +

+
+
+
+
+
+
+ + 📝 + +
+
+ + :pencil: + +

+ Writing docs. +

+
+
+
+
+
+
+ + 🚀 + +
+
+ + :rocket: + +

+ Deploying stuff. +

+
+
+
+
+
+
+ + 💄 + +
+
+ + :lipstick: + +

+ Updating the UI and style files. +

+
+
+
+
+
+
+ + 🎉 + +
+
+ + :tada: + +

+ Initial commit. +

+
+
+
+
+
+
+ + ✅ + +
+
+ + :white_check_mark: + +

+ Updating tests. +

+
+
+
+
+
+
+ + 🔒 + +
+
+ + :lock: + +

+ Fixing security issues. +

+
+
+
+
+
+
+ + 🍎 + +
+
+ + :apple: + +

+ Fixing something on macOS. +

+
+
+
+
+
+
+ + 🐧 + +
+
+ + :penguin: + +

+ Fixing something on Linux. +

+
+
+
+
+
+
+ + 🏁 + +
+
+ + :checkered_flag: + +

+ Fixing something on Windows. +

+
+
+
+
+
+
+ + 🤖 + +
+
+ + :robot: + +

+ Fixing something on Android. +

+
+
+
+
+
+
+ + 🍏 + +
+
+ + :green_apple: + +

+ Fixing something on iOS. +

+
+
+
+
+
+
+ + 🔖 + +
+
+ + :bookmark: + +

+ Releasing / Version tags. +

+
+
+
+
+
+
+ + 🚨 + +
+
+ + :rotating_light: + +

+ Removing linter warnings. +

+
+
+
+
+
+
+ + 🚧 + +
+
+ + :construction: + +

+ Work in progress. +

+
+
+
+
+
+
+ + 💚 + +
+
+ + :green_heart: + +

+ Fixing CI Build. +

+
+
+
+
+
+
+ + ⬇️ + +
+
+ + :arrow_down: + +

+ Downgrading dependencies. +

+
+
+
+
+
+
+ + ⬆️ + +
+
+ + :arrow_up: + +

+ Upgrading dependencies. +

+
+
+
+
+
+
+ + 📌 + +
+
+ + :pushpin: + +

+ Pinning dependencies to specific versions. +

+
+
+
+
+
+
+ + 👷 + +
+
+ + :construction_worker: + +

+ Adding CI build system. +

+
+
+
+
+
+
+ + 📈 + +
+
+ + :chart_with_upwards_trend: + +

+ Adding analytics or tracking code. +

+
+
+
+
+
+
+ + ♻️ + +
+
+ + :recycle: + +

+ Refactoring code. +

+
+
+
+
+
+
+ + 🐳 + +
+
+ + :whale: + +

+ Work about Docker. +

+
+
+
+
+
+
+ + ➕ + +
+
+ + :heavy_plus_sign: + +

+ Adding a dependency. +

+
+
+
+
+
+
+ + ➖ + +
+
+ + :heavy_minus_sign: + +

+ Removing a dependency. +

+
+
+
+
+
+
+ + 🔧 + +
+
+ + :wrench: + +

+ Changing configuration files. +

+
+
+
+
+
+
+ + 🌐 + +
+
+ + :globe_with_meridians: + +

+ Internationalization and localization. +

+
+
+
+
+
+
+ + ✏️ + +
+
+ + :pencil2: + +

+ Fixing typos. +

+
+
+
+
+
+
+ + 💩 + +
+
+ + :poop: + +

+ Writing bad code that needs to be improved. +

+
+
+
+
+
+
+ + ⏪ + +
+
+ + :rewind: + +

+ Reverting changes. +

+
+
+
+
+
+
+ + 🔀 + +
+
+ + :twisted_rightwards_arrows: + +

+ Merging branches. +

+
+
+
+
+
+
+ + 📦 + +
+
+ + :package: + +

+ Updating compiled files or packages. +

+
+
+
+
+
+
+ + 👽 + +
+
+ + :alien: + +

+ Updating code due to external API changes. +

+
+
+
+
+
+
+ + 🚚 + +
+
+ + :truck: + +

+ Moving or renaming files. +

+
+
+
+
+
+
+ + 📄 + +
+
+ + :page_facing_up: + +

+ Adding or updating license. +

+
+
+
+
+
+
+ + 💥 + +
+
+ + :boom: + +

+ Introducing breaking changes. +

+
+
+
+
+
+
+ + 🍱 + +
+
+ + :bento: + +

+ Adding or updating assets. +

+
+
+
+
+
+
+ + 👌 + +
+
+ + :ok_hand: + +

+ Updating code due to code review changes. +

+
+
+
+
+
+
+ + ♿️ + +
+
+ + :wheelchair: + +

+ Improving accessibility. +

+
+
+
+
+
+
+ + 💡 + +
+
+ + :bulb: + +

+ Documenting source code. +

+
+
+
+
+
+
+ + 🍻 + +
+
+ + :beers: + +

+ Writing code drunkenly. +

+
+
+
+
+
+
+ + 💬 + +
+
+ + :speech_balloon: + +

+ Updating text and literals. +

+
+
+
+
+
+
+ + 🗃 + +
+
+ + :card_file_box: + +

+ Performing database related changes. +

+
+
+
+
+
+
+ + 🔊 + +
+
+ + :loud_sound: + +

+ Adding logs. +

+
+
+
+
+
+
+ + 🔇 + +
+
+ + :mute: + +

+ Removing logs. +

+
+
+
+
+
+
+ + 👥 + +
+
+ + :busts_in_silhouette: + +

+ Adding contributor(s). +

+
+
+
+
+
+
+ + 🚸 + +
+
+ + :children_crossing: + +

+ Improving user experience / usability. +

+
+
+
+
+
+
+ + 🏗 + +
+
+ + :building_construction: + +

+ Making architectural changes. +

+
+
+
+
+
+
+ + 📱 + +
+
+ + :iphone: + +

+ Working on responsive design. +

+
+
+
+
+
+
+ + 🤡 + +
+
+ + :clown_face: + +

+ Mocking things. +

+
+
+
+
+
+
+ + 🥚 + +
+
+ + :egg: + +

+ Adding an easter egg. +

+
+
+
+
+
+
+ + 🙈 + +
+
+ + :see_no_evil: + +

+ Adding or updating a .gitignore file +

+
+
+
+
+
+
+ + 📸 + +
+
+ + :camera_flash: + +

+ Adding or updating snapshots +

+
+
+
+
+
+
+ + ⚗ + +
+
+ + :alembic: + +

+ Experimenting new things +

+
+
+
+
+
+
+ + 🔍 + +
+
+ + :mag: + +

+ Improving SEO +

+
+
+
+
+
+
+ + ☸️ + +
+
+ + :wheel_of_dharma: + +

+ Work about Kubernetes +

+
+
+
+
+
+
+ + 🏷️ + +
+
+ + :label: + +

+ Adding or updating types (Flow, TypeScript) +

+
+
+
+
+
+
+ + 🌱 + +
+
+ + :seedling: + +

+ Adding or updating seed files +

+
+
+
+
+
+
+ + 🚩 + +
+
+ + :triangular_flag_on_post: + +

+ Adding, updating, or removing feature flags +

+
+
+
+
+
, + , +] +`; diff --git a/src/__tests__/pages.spec.js b/src/__tests__/pages.spec.js new file mode 100644 index 0000000..284ae03 --- /dev/null +++ b/src/__tests__/pages.spec.js @@ -0,0 +1,32 @@ +import renderer from 'react-test-renderer' + +import Index from '../pages/index' +import About from '../pages/about' +import Contributors from '../pages/contributors' + +describe('Pages', () => { + beforeAll(() => { + Math.random = jest.fn().mockReturnValue(1) + }) + + describe('Index', () => { + it('should render the page', () => { + const wrapper = renderer.create() + expect(wrapper).toMatchSnapshot() + }) + }) + + describe('About', () => { + it('should render the page', () => { + const wrapper = renderer.create() + expect(wrapper).toMatchSnapshot() + }) + }) + + describe('Contributors', () => { + it('should render the page', () => { + const wrapper = renderer.create() + expect(wrapper).toMatchSnapshot() + }) + }) +}) diff --git a/src/components/Button/__tests__/__snapshots__/button.spec.js.snap b/src/components/Button/__tests__/__snapshots__/button.spec.js.snap new file mode 100644 index 0000000..9cbaf89 --- /dev/null +++ b/src/components/Button/__tests__/__snapshots__/button.spec.js.snap @@ -0,0 +1,17 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`Button should render the component 1`] = ` + + + + + GitHub + +`; diff --git a/src/components/Button/__tests__/button.spec.js b/src/components/Button/__tests__/button.spec.js new file mode 100644 index 0000000..e531c34 --- /dev/null +++ b/src/components/Button/__tests__/button.spec.js @@ -0,0 +1,11 @@ +import renderer from 'react-test-renderer' + +import Button from '../index' +import * as stubs from './stubs' + +describe('Button', () => { + it('should render the component', () => { + const wrapper = renderer.create(