diff --git a/.npmignore b/.npmignore new file mode 100644 index 0000000..8616a92 --- /dev/null +++ b/.npmignore @@ -0,0 +1,14 @@ +public +src +.eslintignore +.eslintrc.js +.prettierignore +.prettierrc +CODE_OF_CONDUCT.md +CONTRIBUTING.md +gitprofile.config.js +index.html +library.config.js +tailwind.config.js +vite.config.js +stats.html diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 29c428a..0b87373 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -36,3 +36,9 @@ Install dependencies: ```sh npm install ``` + +Run dev server: + +```sh +npm run dev +``` diff --git a/README.md b/README.md index 194f456..e91e5aa 100644 --- a/README.md +++ b/README.md @@ -1,14 +1,20 @@ -

- - GitProfile - -

-

GitProfile

-

A modern, responsive and customizable portfolio builder for Developers!

-

https://arifszn.github.io/gitprofile

+

Easy to use portfolio builder for every GitHub user!

-
+

+ + + + + + + + + + + + +

@@ -18,14 +24,16 @@ Shadow

-**GitProfile** is an easy-to-customize personal dev portfolio builder that is created with React.js. When you manage the code in a GitHub repository, it will automatically render a webpage with the owner's profile information, including a photo, bio, and public repositories. Also, it includes space to highlight your details, job history, education history, skills, and recent blog posts. +What if you could create your portfolio in 5 minutes just by providing your GitHub username and even host it without any cost? Do you want to display your skills, job history, education, or even blog posts on your website? Introducing **GitProfile**. -It's all possible using [GitHub API](https://developer.github.com/v3/) (for automatically populating your website with content) and [Article-api](https://github.com/arifszn/article-api) (for fetching recent blog posts). +**GitProfile** is an easy to use portfolio builder where you can create a portfolio page automatically by just providing your GitHub username. It is built using React.js on top of Vite.js. But it's not necessary to have knowledge on these to get you started. You can make your own copy with zero coding experience. + +**Features:** ✓ [30 Themes](#themes)\ ✓ [Google Analytics](#google-analytics)\ ✓ [Hotjar](#hotjar)\ -✓ [Meta Tags](#meta-tags)\ +✓ [SEO](#seo)\ ✓ [Avatar and Bio](#avatar-and-bio)\ ✓ [Social Links](#social-links)\ ✓ [Skills](#skills)\ @@ -36,12 +44,52 @@ It's all possible using [GitHub API](https://developer.github.com/v3/) (for auto To view a live example, **[click here](https://arifszn.github.io/gitprofile)**. +![Preview](https://arifszn.github.io/assets/img/hosted/gitprofile/preview.png) + ## 🛠 Installation & Set Up +There are two ways to use **GitProfile**. + +- Installing as a NPM package. +- Forking this repo. + +### Installing as a NPM package + +Install via NPM + +``` +npm install @arifszn/gitprofile +``` + +Then, import the package, import and style and provide the config. + +```js +import GitProfile from '@arifszn/gitprofile'; +import '@arifszn/gitprofile/dist/style.css'; + +function App() { + return ( + + ); +} + +export default App; +``` + +List of all config [here](#-customization). + +### Forking this repo + These instructions will get you a copy of the project and deploy your website online! - **[Fork](https://docs.github.com/en/get-started/quickstart/fork-a-repo)** the repo so you have your own project to customize by clicking the fork icon on the top right side. A "fork" is a copy of a repository. -- Rename your forked repository to `username.github.io` in github, where `username` is your GitHub username (or organization name). +- Rename your forked repository to `username.github.io` in GitHub, where `username` is your GitHub username (or organization name). - Go to your repo's **Actions** page and enable workflows. ![Workflows](https://arifszn.github.io/assets/img/hosted/gitprofile/workflows.png) @@ -74,13 +122,9 @@ As this is a vite project, you can also host your website to Netlify, Vercel, He All the magic happens in the file `gitprofile.config.js`. Open it and modify it according to your preference. -These are the default values: - -
-gitprofile.config.js - ```js // gitprofile.config.js + const config = { github: { username: 'arifszn', // Your GitHub org/user name. (Required) @@ -132,8 +176,8 @@ const config = { to: '2014', }, ], + // Display blog posts from your medium or dev.to account. (Optional) blog: { - // Display blog posts from your medium or dev.to account. (Optional) source: 'dev.to', // medium | dev.to username: 'arifszn', limit: 5, // How many posts to display. Max is 10. @@ -147,14 +191,14 @@ const config = { snippetVersion: 6, }, themeConfig: { - default: 'light', + defaultTheme: 'light', // Hides the theme change switch // Useful if you want to support a single color mode disableSwitch: false, - // Should we use the prefers-color-scheme media-query, - // using user system preferences, instead of the hardcoded default + // Should use the prefers-color-scheme media-query, + // using user system preferences, instead of the hardcoded defaultTheme respectPrefersColorScheme: true, // Available themes. To remove any theme, exclude from here. @@ -193,22 +237,18 @@ const config = { // Custom theme customTheme: { - procyon: { - primary: '#fc055b', - secondary: '#219aaf', - accent: '#e8d03a', - neutral: '#2A2730', - 'base-100': '#E3E3ED', - '--rounded-box': '3rem', - '--rounded-btn': '3rem', - }, + primary: '#fc055b', + secondary: '#219aaf', + accent: '#e8d03a', + neutral: '#2A2730', + 'base-100': '#E3E3ED', + '--rounded-box': '3rem', + '--rounded-btn': '3rem', }, }, }; ``` -
- ### Themes There are 30 themes available that can be selected from the dropdown. @@ -220,13 +260,15 @@ The default theme can be specified. module.exports = { // ... themeConfig: { - default: 'light', + defaultTheme: 'light', // ... }, }; ``` -You can create your own custom theme by modifying these values: +![Theme Dropdown](https://arifszn.github.io/assets/img/hosted/gitprofile/theme-dropdown.png) + +You can create your own custom theme by modifying these values. Theme `procyon` will have the custom styles. ```js // gitprofile.config.js @@ -234,34 +276,28 @@ module.exports = { // ... themeConfig: { customTheme: { - procyon: { - primary: '#fc055b', - secondary: '#219aaf', - accent: '#e8d03a', - neutral: '#2A2730', - 'base-100': '#E3E3ED', - '--rounded-box': '3rem', - '--rounded-btn': '3rem', - }, + primary: '#fc055b', + secondary: '#219aaf', + accent: '#e8d03a', + neutral: '#2A2730', + 'base-100': '#E3E3ED', + '--rounded-box': '3rem', + '--rounded-btn': '3rem', }, // ... }, }; ``` -![Theme Dropdown](https://arifszn.github.io/assets/img/hosted/gitprofile/themes-1.png) +![Theme Procyon](https://arifszn.github.io/assets/img/hosted/gitprofile/theme-procyon.png) -Here are some screenshots of different themes.\ -
-![Themes](https://arifszn.github.io/assets/img/hosted/gitprofile/themes-2.png)\ -
-![Themes](https://arifszn.github.io/assets/img/hosted/gitprofile/themes-6.png)\ -
-![Themes](https://arifszn.github.io/assets/img/hosted/gitprofile/themes-7.png) +![Theme Garden](https://arifszn.github.io/assets/img/hosted/gitprofile/theme-garden.png) + +![Theme Night](https://arifszn.github.io/assets/img/hosted/gitprofile/theme-night.png) ### Google Analytics -ezFolio supports both GA3 and GA4. If you do not want to use Google Analytics, keep the `id` empty. +**GitProfile** supports both GA3 and GA4. If you do not want to use Google Analytics, keep the `id` empty. ```js // gitprofile.config.js @@ -273,13 +309,11 @@ module.exports = { }; ``` -Besides tracking visitors, ezFolio will track click events on projects and blog posts, and send them to Google Analytics.\ -
-![Event](https://www.arifszn.com/assets/img/hosted/gitprofile/event.png) +Besides tracking visitors, it will track `click events` on projects and blog posts, and send them to Google Analytics. ### Hotjar -GitProfile supports hotjar. If you do not want to use Hotjar, keep the `id` empty. +**GitProfile** supports hotjar. If you do not want to use Hotjar, keep the `id` empty. ```js // gitprofile.config.js @@ -292,19 +326,17 @@ module.exports = { }; ``` -### Meta Tags +### SEO -Meta tags will be auto-generated from configs dynamically. However, you can also manually add meta tags in `public\index.html`. +Meta tags will be auto-generated from configs dynamically. However, you can also manually add meta tags in `public/index.html`. ### Avatar and Bio -Your github avatar and bio will be displayed here.\ -
-![Avatar Bio](https://arifszn.github.io/assets/img/hosted/gitprofile/avatar-card.png) +Your avatar and bio will be fetched from GitHub automatically. ### Social Links -GitProfile supports linking your social media services you're using, including LinkedIn, Twitter, Facebook, Dribbble, Behance, Medium, dev.to, personal website, phone and email. +You can link your social media services you're using, including LinkedIn, Twitter, Facebook, Dribbble, Behance, Medium, dev.to, personal website, phone and email. ```js // gitprofile.config.js @@ -395,7 +427,7 @@ Empty array will hide the education section. ### Projects -Your public repo from github will be displayed here automatically. You can limit how many projects do you want to be displayed. Also, you can hide forked or specific repo. +Your public repo from GitHub will be displayed here automatically. You can limit how many projects do you want to be displayed. Also, you can hide forked or specific repo. ```js // gitprofile.config.js @@ -433,10 +465,6 @@ module.exports = { The posts are fetched by [Article-api](https://github.com/arifszn/article-api). -## 📢 Please Read - -I intend to keep my works open source. Please do not discourage me by claiming this work by copying it as your own. However, You are open to use this project by forking it and change any code necessary by giving attribute to the original author. Please see this [issue](https://github.com/arifszn/gitprofile/issues/11) for more info. - ## 💖 Support diff --git a/gitprofile.config.js b/gitprofile.config.js index 0a39663..ac6f801 100644 --- a/gitprofile.config.js +++ b/gitprofile.config.js @@ -76,8 +76,8 @@ const config = { to: '2012', }, ], + // Display blog posts from your medium or dev.to account. (Optional) blog: { - // Display blog posts from your medium or dev.to account. (Optional) source: 'dev.to', // medium | dev.to username: 'arifszn', limit: 3, // How many posts to display. Max is 10. @@ -91,14 +91,14 @@ const config = { snippetVersion: 6, }, themeConfig: { - default: 'corporate', + defaultTheme: 'corporate', // Hides the switch in the navbar // Useful if you want to support a single color mode disableSwitch: false, - // Should we use the prefers-color-scheme media-query, - // using user system preferences, instead of the hardcoded default + // Should use the prefers-color-scheme media-query, + // using user system preferences, instead of the hardcoded defaultTheme respectPrefersColorScheme: false, // Available themes. To remove any theme, exclude from here. @@ -137,15 +137,13 @@ const config = { // Custom theme customTheme: { - procyon: { - primary: '#fc055b', - secondary: '#219aaf', - accent: '#e8d03a', - neutral: '#2A2730', - 'base-100': '#E3E3ED', - '--rounded-box': '3rem', - '--rounded-btn': '3rem', - }, + primary: '#fc055b', + secondary: '#219aaf', + accent: '#e8d03a', + neutral: '#2A2730', + 'base-100': '#E3E3ED', + '--rounded-box': '3rem', + '--rounded-btn': '3rem', }, }, }; diff --git a/library.config.js b/library.config.js new file mode 100644 index 0000000..9f3f668 --- /dev/null +++ b/library.config.js @@ -0,0 +1,31 @@ +import { defineConfig } from 'vite'; +import react from '@vitejs/plugin-react'; +import tailwind from 'tailwindcss'; +import autoprefixer from 'autoprefixer'; +import tailwindConfig from './tailwind.config.js'; +import path from 'path'; + +// https://vitejs.dev/config/ +export default defineConfig({ + plugins: [react()], + css: { + postcss: { + plugins: [tailwind(tailwindConfig), autoprefixer], + }, + }, + build: { + lib: { + entry: path.resolve(__dirname, 'src/components/GitProfile.jsx'), + name: 'GitProfile', + fileName: (format) => `gitprofile.${format}.js`, + }, + rollupOptions: { + external: ['react', 'react-dom'], + output: { + globals: { + react: 'React', + }, + }, + }, + }, +}); diff --git a/package-lock.json b/package-lock.json index 51509c3..a45feb8 100644 --- a/package-lock.json +++ b/package-lock.json @@ -914,9 +914,9 @@ } }, "node_modules/caniuse-lite": { - "version": "1.0.30001319", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001319.tgz", - "integrity": "sha512-xjlIAFHucBRSMUo1kb5D4LYgcN1M45qdKP++lhqowDpwJwGkpIRTt5qQqnhxjj1vHcI7nrJxWhCC1ATrCEBTcw==", + "version": "1.0.30001320", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001320.tgz", + "integrity": "sha512-MWPzG54AGdo3nWx7zHZTefseM5Y1ccM7hlQKHRqJkPozUaw3hNbBTMmLn16GG2FUzjR13Cr3NPfhIieX5PzXDA==", "dev": true, "funding": [ { @@ -1106,9 +1106,9 @@ } }, "node_modules/daisyui": { - "version": "2.11.1", - "resolved": "https://registry.npmjs.org/daisyui/-/daisyui-2.11.1.tgz", - "integrity": "sha512-99LD0kheC7v9U/S5jY+b4Nt7ekfpbPCK7fuDBxSxPpuxO1uq6PxEtTIa6DQwlh6/0Sh2CgqDmIQzfdMzdP5DMw==", + "version": "2.13.4", + "resolved": "https://registry.npmjs.org/daisyui/-/daisyui-2.13.4.tgz", + "integrity": "sha512-seLNXMqOV0C2VigLi2OSmVm7LOr+ZcbnHW5f1byjWNhCc0DU8eX/Xc+aqPOynRnofAZ8igciKq6qmAYunewPAQ==", "dev": true, "dependencies": { "color": "^4.2", @@ -1204,9 +1204,9 @@ } }, "node_modules/electron-to-chromium": { - "version": "1.4.89", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.89.tgz", - "integrity": "sha512-z1Axg0Fu54fse8wN4fd+GAINdU5mJmLtcl6bqIcYyzNVGONcfHAeeJi88KYMQVKalhXlYuVPzKkFIU5VD0raUw==", + "version": "1.4.96", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.96.tgz", + "integrity": "sha512-DPNjvNGPabv6FcyjzLAN4C0psN/GgD9rSGvMTuv81SeXG/EX3mCz0wiw9N1tUEnfQXYCJi3H8M0oFPRziZh7rw==", "dev": true }, "node_modules/error-ex": { @@ -1276,9 +1276,9 @@ } }, "node_modules/esbuild": { - "version": "0.14.27", - "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.14.27.tgz", - "integrity": "sha512-MZQt5SywZS3hA9fXnMhR22dv0oPGh6QtjJRIYbgL1AeqAoQZE+Qn5ppGYQAoHv/vq827flj4tIJ79Mrdiwk46Q==", + "version": "0.14.28", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.14.28.tgz", + "integrity": "sha512-YLNprkCcMVKQ5sekmCKEQ3Obu/L7s6+iij38xNKyBeSmSsTWur4Ky/9zB3XIGT8SCJITG/bZwAR2l7YOAXch4Q==", "dev": true, "hasInstallScript": true, "bin": { @@ -1288,32 +1288,32 @@ "node": ">=12" }, "optionalDependencies": { - "esbuild-android-64": "0.14.27", - "esbuild-android-arm64": "0.14.27", - "esbuild-darwin-64": "0.14.27", - "esbuild-darwin-arm64": "0.14.27", - "esbuild-freebsd-64": "0.14.27", - "esbuild-freebsd-arm64": "0.14.27", - "esbuild-linux-32": "0.14.27", - "esbuild-linux-64": "0.14.27", - "esbuild-linux-arm": "0.14.27", - "esbuild-linux-arm64": "0.14.27", - "esbuild-linux-mips64le": "0.14.27", - "esbuild-linux-ppc64le": "0.14.27", - "esbuild-linux-riscv64": "0.14.27", - "esbuild-linux-s390x": "0.14.27", - "esbuild-netbsd-64": "0.14.27", - "esbuild-openbsd-64": "0.14.27", - "esbuild-sunos-64": "0.14.27", - "esbuild-windows-32": "0.14.27", - "esbuild-windows-64": "0.14.27", - "esbuild-windows-arm64": "0.14.27" + "esbuild-android-64": "0.14.28", + "esbuild-android-arm64": "0.14.28", + "esbuild-darwin-64": "0.14.28", + "esbuild-darwin-arm64": "0.14.28", + "esbuild-freebsd-64": "0.14.28", + "esbuild-freebsd-arm64": "0.14.28", + "esbuild-linux-32": "0.14.28", + "esbuild-linux-64": "0.14.28", + "esbuild-linux-arm": "0.14.28", + "esbuild-linux-arm64": "0.14.28", + "esbuild-linux-mips64le": "0.14.28", + "esbuild-linux-ppc64le": "0.14.28", + "esbuild-linux-riscv64": "0.14.28", + "esbuild-linux-s390x": "0.14.28", + "esbuild-netbsd-64": "0.14.28", + "esbuild-openbsd-64": "0.14.28", + "esbuild-sunos-64": "0.14.28", + "esbuild-windows-32": "0.14.28", + "esbuild-windows-64": "0.14.28", + "esbuild-windows-arm64": "0.14.28" } }, "node_modules/esbuild-android-64": { - "version": "0.14.27", - "resolved": "https://registry.npmjs.org/esbuild-android-64/-/esbuild-android-64-0.14.27.tgz", - "integrity": "sha512-LuEd4uPuj/16Y8j6kqy3Z2E9vNY9logfq8Tq+oTE2PZVuNs3M1kj5Qd4O95ee66yDGb3isaOCV7sOLDwtMfGaQ==", + "version": "0.14.28", + "resolved": "https://registry.npmjs.org/esbuild-android-64/-/esbuild-android-64-0.14.28.tgz", + "integrity": "sha512-A52C3zq+9tNwCqZ+4kVLBxnk/WnrYM8P2+QNvNE9B6d2OVPs214lp3g6UyO+dKDhUdefhfPCuwkP8j2A/+szNA==", "cpu": [ "x64" ], @@ -1327,9 +1327,9 @@ } }, "node_modules/esbuild-android-arm64": { - "version": "0.14.27", - "resolved": "https://registry.npmjs.org/esbuild-android-arm64/-/esbuild-android-arm64-0.14.27.tgz", - "integrity": "sha512-E8Ktwwa6vX8q7QeJmg8yepBYXaee50OdQS3BFtEHKrzbV45H4foMOeEE7uqdjGQZFBap5VAqo7pvjlyA92wznQ==", + "version": "0.14.28", + "resolved": "https://registry.npmjs.org/esbuild-android-arm64/-/esbuild-android-arm64-0.14.28.tgz", + "integrity": "sha512-sm0fDEGElZhMC3HLZeECI2juE4aG7uPfMBMqNUhy9CeX399Pz8rC6e78OXMXInGjSdEAwQmCOHmfsP7uv3Q8rA==", "cpu": [ "arm64" ], @@ -1343,9 +1343,9 @@ } }, "node_modules/esbuild-darwin-64": { - "version": "0.14.27", - "resolved": "https://registry.npmjs.org/esbuild-darwin-64/-/esbuild-darwin-64-0.14.27.tgz", - "integrity": "sha512-czw/kXl/1ZdenPWfw9jDc5iuIYxqUxgQ/Q+hRd4/3udyGGVI31r29LCViN2bAJgGvQkqyLGVcG03PJPEXQ5i2g==", + "version": "0.14.28", + "resolved": "https://registry.npmjs.org/esbuild-darwin-64/-/esbuild-darwin-64-0.14.28.tgz", + "integrity": "sha512-nzDd7mQ44FvsFHtOafZdBgn3Li5SMsnMnoz1J2MM37xJmR3wGNTFph88KypjHgWqwbxCI7MXS1U+sN4qDeeW6Q==", "cpu": [ "x64" ], @@ -1359,9 +1359,9 @@ } }, "node_modules/esbuild-darwin-arm64": { - "version": "0.14.27", - "resolved": "https://registry.npmjs.org/esbuild-darwin-arm64/-/esbuild-darwin-arm64-0.14.27.tgz", - "integrity": "sha512-BEsv2U2U4o672oV8+xpXNxN9bgqRCtddQC6WBh4YhXKDcSZcdNh7+6nS+DM2vu7qWIWNA4JbRG24LUUYXysimQ==", + "version": "0.14.28", + "resolved": "https://registry.npmjs.org/esbuild-darwin-arm64/-/esbuild-darwin-arm64-0.14.28.tgz", + "integrity": "sha512-XEq/bLR/glsUl+uGrBimQzOVs/CmwI833fXUhP9xrLI3IJ+rKyrZ5IA8u+1crOEf1LoTn8tV+hInmX6rGjbScw==", "cpu": [ "arm64" ], @@ -1375,9 +1375,9 @@ } }, "node_modules/esbuild-freebsd-64": { - "version": "0.14.27", - "resolved": "https://registry.npmjs.org/esbuild-freebsd-64/-/esbuild-freebsd-64-0.14.27.tgz", - "integrity": "sha512-7FeiFPGBo+ga+kOkDxtPmdPZdayrSzsV9pmfHxcyLKxu+3oTcajeZlOO1y9HW+t5aFZPiv7czOHM4KNd0tNwCA==", + "version": "0.14.28", + "resolved": "https://registry.npmjs.org/esbuild-freebsd-64/-/esbuild-freebsd-64-0.14.28.tgz", + "integrity": "sha512-rTKLgUj/HEcPeE5XZ7IZwWpFx7IWMfprN7QRk/TUJE1s1Ipb58esboIesUpjirJz/BwrgHq+FDG9ChAI8dZAtQ==", "cpu": [ "x64" ], @@ -1391,9 +1391,9 @@ } }, "node_modules/esbuild-freebsd-arm64": { - "version": "0.14.27", - "resolved": "https://registry.npmjs.org/esbuild-freebsd-arm64/-/esbuild-freebsd-arm64-0.14.27.tgz", - "integrity": "sha512-8CK3++foRZJluOWXpllG5zwAVlxtv36NpHfsbWS7TYlD8S+QruXltKlXToc/5ZNzBK++l6rvRKELu/puCLc7jA==", + "version": "0.14.28", + "resolved": "https://registry.npmjs.org/esbuild-freebsd-arm64/-/esbuild-freebsd-arm64-0.14.28.tgz", + "integrity": "sha512-sBffxD1UMOsB7aWMoExmipycjcy3HJGwmqE4GQZUTZvdiH4GhjgUiVdtPyt7kSCdL40JqnWQJ4b1l8Y51oCF4Q==", "cpu": [ "arm64" ], @@ -1407,9 +1407,9 @@ } }, "node_modules/esbuild-linux-32": { - "version": "0.14.27", - "resolved": "https://registry.npmjs.org/esbuild-linux-32/-/esbuild-linux-32-0.14.27.tgz", - "integrity": "sha512-qhNYIcT+EsYSBClZ5QhLzFzV5iVsP1YsITqblSaztr3+ZJUI+GoK8aXHyzKd7/CKKuK93cxEMJPpfi1dfsOfdw==", + "version": "0.14.28", + "resolved": "https://registry.npmjs.org/esbuild-linux-32/-/esbuild-linux-32-0.14.28.tgz", + "integrity": "sha512-+Wxidh3fBEQ9kHcCsD4etlBTMb1n6QY2uXv3rFhVn88CY/JP782MhA57/ipLMY4kOLeSKEuFGN4rtjHuhmRMig==", "cpu": [ "ia32" ], @@ -1423,9 +1423,9 @@ } }, "node_modules/esbuild-linux-64": { - "version": "0.14.27", - "resolved": "https://registry.npmjs.org/esbuild-linux-64/-/esbuild-linux-64-0.14.27.tgz", - "integrity": "sha512-ESjck9+EsHoTaKWlFKJpPZRN26uiav5gkI16RuI8WBxUdLrrAlYuYSndxxKgEn1csd968BX/8yQZATYf/9+/qg==", + "version": "0.14.28", + "resolved": "https://registry.npmjs.org/esbuild-linux-64/-/esbuild-linux-64-0.14.28.tgz", + "integrity": "sha512-7+xgsC4LvR6cnzaBdiljNnPDjbkwzahogN+S9uy9AoYw7ZjPnnXc6sjQAVCbqGb7MEgrWdpa6u/Tao79i4lWxg==", "cpu": [ "x64" ], @@ -1439,9 +1439,9 @@ } }, "node_modules/esbuild-linux-arm": { - "version": "0.14.27", - "resolved": "https://registry.npmjs.org/esbuild-linux-arm/-/esbuild-linux-arm-0.14.27.tgz", - "integrity": "sha512-JnnmgUBdqLQO9hoNZQqNHFWlNpSX82vzB3rYuCJMhtkuaWQEmQz6Lec1UIxJdC38ifEghNTBsF9bbe8dFilnCw==", + "version": "0.14.28", + "resolved": "https://registry.npmjs.org/esbuild-linux-arm/-/esbuild-linux-arm-0.14.28.tgz", + "integrity": "sha512-L5isjmlLbh9E0WVllXiVETbScgMbth/+XkXQii1WwgO1RvLIfaGrVFz8d2n6EH/ImtgYxPYGx+OcvIKQBc91Rg==", "cpu": [ "arm" ], @@ -1455,9 +1455,9 @@ } }, "node_modules/esbuild-linux-arm64": { - "version": "0.14.27", - "resolved": "https://registry.npmjs.org/esbuild-linux-arm64/-/esbuild-linux-arm64-0.14.27.tgz", - "integrity": "sha512-no6Mi17eV2tHlJnqBHRLekpZ2/VYx+NfGxKcBE/2xOMYwctsanCaXxw4zapvNrGE9X38vefVXLz6YCF8b1EHiQ==", + "version": "0.14.28", + "resolved": "https://registry.npmjs.org/esbuild-linux-arm64/-/esbuild-linux-arm64-0.14.28.tgz", + "integrity": "sha512-EjRHgwg+kgXABzyoPGPOPg4d5wZqRnZ/ZAxBDzLY+i6DS8OUfTSlZHWIOZzU4XF7125WxRBg9ULbrFJBl+57Eg==", "cpu": [ "arm64" ], @@ -1471,9 +1471,9 @@ } }, "node_modules/esbuild-linux-mips64le": { - "version": "0.14.27", - "resolved": "https://registry.npmjs.org/esbuild-linux-mips64le/-/esbuild-linux-mips64le-0.14.27.tgz", - "integrity": "sha512-NolWP2uOvIJpbwpsDbwfeExZOY1bZNlWE/kVfkzLMsSgqeVcl5YMen/cedRe9mKnpfLli+i0uSp7N+fkKNU27A==", + "version": "0.14.28", + "resolved": "https://registry.npmjs.org/esbuild-linux-mips64le/-/esbuild-linux-mips64le-0.14.28.tgz", + "integrity": "sha512-krx9SSg7yfiUKk64EmjefOyiEF6nv2bRE4um/LiTaQ6Y/6FP4UF3/Ou/AxZVyR154uSRq63xejcAsmswXAYRsw==", "cpu": [ "mips64el" ], @@ -1487,9 +1487,9 @@ } }, "node_modules/esbuild-linux-ppc64le": { - "version": "0.14.27", - "resolved": "https://registry.npmjs.org/esbuild-linux-ppc64le/-/esbuild-linux-ppc64le-0.14.27.tgz", - "integrity": "sha512-/7dTjDvXMdRKmsSxKXeWyonuGgblnYDn0MI1xDC7J1VQXny8k1qgNp6VmrlsawwnsymSUUiThhkJsI+rx0taNA==", + "version": "0.14.28", + "resolved": "https://registry.npmjs.org/esbuild-linux-ppc64le/-/esbuild-linux-ppc64le-0.14.28.tgz", + "integrity": "sha512-LD0Xxu9g+DNuhsEBV5QuVZ4uKVBMup0xPIruLweuAf9/mHXFnaCuNXUBF5t0DxKl7GQ5MSioKtnb92oMo+QXEw==", "cpu": [ "ppc64" ], @@ -1503,9 +1503,9 @@ } }, "node_modules/esbuild-linux-riscv64": { - "version": "0.14.27", - "resolved": "https://registry.npmjs.org/esbuild-linux-riscv64/-/esbuild-linux-riscv64-0.14.27.tgz", - "integrity": "sha512-D+aFiUzOJG13RhrSmZgrcFaF4UUHpqj7XSKrIiCXIj1dkIkFqdrmqMSOtSs78dOtObWiOrFCDDzB24UyeEiNGg==", + "version": "0.14.28", + "resolved": "https://registry.npmjs.org/esbuild-linux-riscv64/-/esbuild-linux-riscv64-0.14.28.tgz", + "integrity": "sha512-L/DWfRh2P0vxq4Y+qieSNXKGdMg+e9Qe8jkbN2/8XSGYDTPzO2OcAxSujob4qIh7iSl+cknbXV+BvH0YFR0jbg==", "cpu": [ "riscv64" ], @@ -1519,9 +1519,9 @@ } }, "node_modules/esbuild-linux-s390x": { - "version": "0.14.27", - "resolved": "https://registry.npmjs.org/esbuild-linux-s390x/-/esbuild-linux-s390x-0.14.27.tgz", - "integrity": "sha512-CD/D4tj0U4UQjELkdNlZhQ8nDHU5rBn6NGp47Hiz0Y7/akAY5i0oGadhEIg0WCY/HYVXFb3CsSPPwaKcTOW3bg==", + "version": "0.14.28", + "resolved": "https://registry.npmjs.org/esbuild-linux-s390x/-/esbuild-linux-s390x-0.14.28.tgz", + "integrity": "sha512-rrgxmsbmL8QQknWGnAL9bGJRQYLOi2AzXy5OTwfhxnj9eqjo5mSVbJXjgiq5LPUAMQZGdPH5yaNK0obAXS81Zw==", "cpu": [ "s390x" ], @@ -1535,9 +1535,9 @@ } }, "node_modules/esbuild-netbsd-64": { - "version": "0.14.27", - "resolved": "https://registry.npmjs.org/esbuild-netbsd-64/-/esbuild-netbsd-64-0.14.27.tgz", - "integrity": "sha512-h3mAld69SrO1VoaMpYl3a5FNdGRE/Nqc+E8VtHOag4tyBwhCQXxtvDDOAKOUQexBGca0IuR6UayQ4ntSX5ij1Q==", + "version": "0.14.28", + "resolved": "https://registry.npmjs.org/esbuild-netbsd-64/-/esbuild-netbsd-64-0.14.28.tgz", + "integrity": "sha512-h8wntIyOR8/xMVVM6TvJxxWKh4AjmLK87IPKpuVi8Pq0kyk0RMA+eo4PFGk5j2XK0D7dj8PcSF5NSlP9kN/j0A==", "cpu": [ "x64" ], @@ -1551,9 +1551,9 @@ } }, "node_modules/esbuild-openbsd-64": { - "version": "0.14.27", - "resolved": "https://registry.npmjs.org/esbuild-openbsd-64/-/esbuild-openbsd-64-0.14.27.tgz", - "integrity": "sha512-xwSje6qIZaDHXWoPpIgvL+7fC6WeubHHv18tusLYMwL+Z6bEa4Pbfs5IWDtQdHkArtfxEkIZz77944z8MgDxGw==", + "version": "0.14.28", + "resolved": "https://registry.npmjs.org/esbuild-openbsd-64/-/esbuild-openbsd-64-0.14.28.tgz", + "integrity": "sha512-HBv18rVapbuDx52/fhZ/c/w6TXyaQAvRxiDDn5Hz/pBcwOs3cdd2WxeIKlWmDoqm2JMx5EVlq4IWgoaRX9mVkw==", "cpu": [ "x64" ], @@ -1567,9 +1567,9 @@ } }, "node_modules/esbuild-sunos-64": { - "version": "0.14.27", - "resolved": "https://registry.npmjs.org/esbuild-sunos-64/-/esbuild-sunos-64-0.14.27.tgz", - "integrity": "sha512-/nBVpWIDjYiyMhuqIqbXXsxBc58cBVH9uztAOIfWShStxq9BNBik92oPQPJ57nzWXRNKQUEFWr4Q98utDWz7jg==", + "version": "0.14.28", + "resolved": "https://registry.npmjs.org/esbuild-sunos-64/-/esbuild-sunos-64-0.14.28.tgz", + "integrity": "sha512-zlIxePhZxKYheR2vBCgPVvTixgo/ozOfOMoP6RZj8dxzquU1NgeyhjkcRXucbLCtmoNJ+i4PtWwPZTLuDd3bGg==", "cpu": [ "x64" ], @@ -1583,9 +1583,9 @@ } }, "node_modules/esbuild-windows-32": { - "version": "0.14.27", - "resolved": "https://registry.npmjs.org/esbuild-windows-32/-/esbuild-windows-32-0.14.27.tgz", - "integrity": "sha512-Q9/zEjhZJ4trtWhFWIZvS/7RUzzi8rvkoaS9oiizkHTTKd8UxFwn/Mm2OywsAfYymgUYm8+y2b+BKTNEFxUekw==", + "version": "0.14.28", + "resolved": "https://registry.npmjs.org/esbuild-windows-32/-/esbuild-windows-32-0.14.28.tgz", + "integrity": "sha512-am9DIJxXlld1BOAY/VlvBQHMUCPL7S3gB/lnXIY3M4ys0gfuRqPf4EvMwZMzYUbFKBY+/Qb8SRgPRRGhwnJ8Kg==", "cpu": [ "ia32" ], @@ -1599,9 +1599,9 @@ } }, "node_modules/esbuild-windows-64": { - "version": "0.14.27", - "resolved": "https://registry.npmjs.org/esbuild-windows-64/-/esbuild-windows-64-0.14.27.tgz", - "integrity": "sha512-b3y3vTSl5aEhWHK66ngtiS/c6byLf6y/ZBvODH1YkBM+MGtVL6jN38FdHUsZasCz9gFwYs/lJMVY9u7GL6wfYg==", + "version": "0.14.28", + "resolved": "https://registry.npmjs.org/esbuild-windows-64/-/esbuild-windows-64-0.14.28.tgz", + "integrity": "sha512-78PhySDnmRZlsPNp/W/5Fim8iivlBQQxfhBFIqR7xwvfDmCFUSByyMKP7LCHgNtb04yNdop8nJJkJaQ8Xnwgiw==", "cpu": [ "x64" ], @@ -1615,9 +1615,9 @@ } }, "node_modules/esbuild-windows-arm64": { - "version": "0.14.27", - "resolved": "https://registry.npmjs.org/esbuild-windows-arm64/-/esbuild-windows-arm64-0.14.27.tgz", - "integrity": "sha512-I/reTxr6TFMcR5qbIkwRGvldMIaiBu2+MP0LlD7sOlNXrfqIl9uNjsuxFPGEG4IRomjfQ5q8WT+xlF/ySVkqKg==", + "version": "0.14.28", + "resolved": "https://registry.npmjs.org/esbuild-windows-arm64/-/esbuild-windows-arm64-0.14.28.tgz", + "integrity": "sha512-VhXGBTo6HELD8zyHXynV6+L2jWx0zkKnGx4TmEdSBK7UVFACtOyfUqpToG0EtnYyRZ0HESBhzPSVpP781ovmvA==", "cpu": [ "arm64" ], @@ -1649,9 +1649,9 @@ } }, "node_modules/eslint": { - "version": "8.11.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.11.0.tgz", - "integrity": "sha512-/KRpd9mIRg2raGxHRGwW9ZywYNAClZrHjdueHcrVDuO3a6bj83eoTirCCk0M0yPwOjWYKHwRVRid+xK4F/GHgA==", + "version": "8.12.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.12.0.tgz", + "integrity": "sha512-it1oBL9alZg1S8UycLm5YDMAkIhtH6FtAzuZs6YvoGVldWjbS08BkAdb/ymP9LlAyq8koANu32U7Ib/w+UNh8Q==", "dev": true, "dependencies": { "@eslint/eslintrc": "^1.2.1", @@ -2307,9 +2307,9 @@ } }, "node_modules/html-entities": { - "version": "2.3.2", - "resolved": "https://registry.npmjs.org/html-entities/-/html-entities-2.3.2.tgz", - "integrity": "sha512-c3Ab/url5ksaT0WyleslpBEthOzWhrjQbg75y7XUsfSzi3Dgzt0l8w5e7DylRn15MTlMMD58dTfzddNS2kcAjQ==", + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/html-entities/-/html-entities-2.3.3.tgz", + "integrity": "sha512-DV5Ln36z34NNTDgnz0EWGBLZENelNAtkiFA4kyNOG2tDI6Mz1uSWiq1wAKdyjnJwyDiDO7Fa2SO1CTxPXL8VxA==", "dev": true }, "node_modules/ignore": { @@ -2686,9 +2686,9 @@ } }, "node_modules/lilconfig": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/lilconfig/-/lilconfig-2.0.4.tgz", - "integrity": "sha512-bfTIN7lEsiooCocSISTWXkiWJkRqtL9wYtYy+8EK3Y41qh3mpwPU0ycTOgjdY9ErwXCc8QyrQp82bdL0Xkm9yA==", + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/lilconfig/-/lilconfig-2.0.5.tgz", + "integrity": "sha512-xaYmXZtTHPAw5m+xLN8ab9C+3a8YmV3asNSPOATITbtwrfbwaLJj8h66H1WMIpALCkqsIzK3h7oQ+PdX+LQ9Eg==", "dev": true, "engines": { "node": ">=10" @@ -2751,13 +2751,13 @@ } }, "node_modules/micromatch": { - "version": "4.0.4", - "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.4.tgz", - "integrity": "sha512-pRmzw/XUcwXGpD9aI9q/0XOwLNygjETJ8y0ao0wdqprrzDa4YnxLcz7fQRZr8voh8V10kGhABbNcHVk5wHgWwg==", + "version": "4.0.5", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.5.tgz", + "integrity": "sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA==", "dev": true, "dependencies": { - "braces": "^3.0.1", - "picomatch": "^2.2.3" + "braces": "^3.0.2", + "picomatch": "^2.3.1" }, "engines": { "node": ">=8.6" @@ -2797,9 +2797,9 @@ "dev": true }, "node_modules/nanoid": { - "version": "3.3.1", - "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.1.tgz", - "integrity": "sha512-n6Vs/3KGyxPQd6uO0eH4Bv0ojGSUvuLlIHtC3Y0kEO23YRge8H9x1GCzLn28YX0H66pMkxuaeESFq4tKISKwdw==", + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.2.tgz", + "integrity": "sha512-CuHBogktKwpm5g2sRgv83jEy2ijFzBwMoYA60orPDR7ynsLijJDqgsi4RDGj3OJpy3Ieb+LYwiRmIOGyytgITA==", "dev": true, "bin": { "nanoid": "bin/nanoid.cjs" @@ -3175,9 +3175,9 @@ } }, "node_modules/prettier": { - "version": "2.6.0", - "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.6.0.tgz", - "integrity": "sha512-m2FgJibYrBGGgQXNzfd0PuDGShJgRavjUoRCw1mZERIWVSXF0iLzLm+aOqTAbLnC3n6JzUhAA8uZnFVghHJ86A==", + "version": "2.6.1", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.6.1.tgz", + "integrity": "sha512-8UVbTBYGwN37Bs9LERmxCPjdvPxlEowx2urIL6urHzdb3SDq4B/Z6xLFCblrSnE4iKWcS6ziJ3aOYrc1kz/E2A==", "dev": true, "bin": { "prettier": "bin-prettier.js" @@ -4688,9 +4688,9 @@ "dev": true }, "caniuse-lite": { - "version": "1.0.30001319", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001319.tgz", - "integrity": "sha512-xjlIAFHucBRSMUo1kb5D4LYgcN1M45qdKP++lhqowDpwJwGkpIRTt5qQqnhxjj1vHcI7nrJxWhCC1ATrCEBTcw==", + "version": "1.0.30001320", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001320.tgz", + "integrity": "sha512-MWPzG54AGdo3nWx7zHZTefseM5Y1ccM7hlQKHRqJkPozUaw3hNbBTMmLn16GG2FUzjR13Cr3NPfhIieX5PzXDA==", "dev": true }, "chalk": { @@ -4839,9 +4839,9 @@ "dev": true }, "daisyui": { - "version": "2.11.1", - "resolved": "https://registry.npmjs.org/daisyui/-/daisyui-2.11.1.tgz", - "integrity": "sha512-99LD0kheC7v9U/S5jY+b4Nt7ekfpbPCK7fuDBxSxPpuxO1uq6PxEtTIa6DQwlh6/0Sh2CgqDmIQzfdMzdP5DMw==", + "version": "2.13.4", + "resolved": "https://registry.npmjs.org/daisyui/-/daisyui-2.13.4.tgz", + "integrity": "sha512-seLNXMqOV0C2VigLi2OSmVm7LOr+ZcbnHW5f1byjWNhCc0DU8eX/Xc+aqPOynRnofAZ8igciKq6qmAYunewPAQ==", "dev": true, "requires": { "color": "^4.2", @@ -4913,9 +4913,9 @@ } }, "electron-to-chromium": { - "version": "1.4.89", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.89.tgz", - "integrity": "sha512-z1Axg0Fu54fse8wN4fd+GAINdU5mJmLtcl6bqIcYyzNVGONcfHAeeJi88KYMQVKalhXlYuVPzKkFIU5VD0raUw==", + "version": "1.4.96", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.96.tgz", + "integrity": "sha512-DPNjvNGPabv6FcyjzLAN4C0psN/GgD9rSGvMTuv81SeXG/EX3mCz0wiw9N1tUEnfQXYCJi3H8M0oFPRziZh7rw==", "dev": true }, "error-ex": { @@ -4975,170 +4975,170 @@ } }, "esbuild": { - "version": "0.14.27", - "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.14.27.tgz", - "integrity": "sha512-MZQt5SywZS3hA9fXnMhR22dv0oPGh6QtjJRIYbgL1AeqAoQZE+Qn5ppGYQAoHv/vq827flj4tIJ79Mrdiwk46Q==", + "version": "0.14.28", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.14.28.tgz", + "integrity": "sha512-YLNprkCcMVKQ5sekmCKEQ3Obu/L7s6+iij38xNKyBeSmSsTWur4Ky/9zB3XIGT8SCJITG/bZwAR2l7YOAXch4Q==", "dev": true, "requires": { - "esbuild-android-64": "0.14.27", - "esbuild-android-arm64": "0.14.27", - "esbuild-darwin-64": "0.14.27", - "esbuild-darwin-arm64": "0.14.27", - "esbuild-freebsd-64": "0.14.27", - "esbuild-freebsd-arm64": "0.14.27", - "esbuild-linux-32": "0.14.27", - "esbuild-linux-64": "0.14.27", - "esbuild-linux-arm": "0.14.27", - "esbuild-linux-arm64": "0.14.27", - "esbuild-linux-mips64le": "0.14.27", - "esbuild-linux-ppc64le": "0.14.27", - "esbuild-linux-riscv64": "0.14.27", - "esbuild-linux-s390x": "0.14.27", - "esbuild-netbsd-64": "0.14.27", - "esbuild-openbsd-64": "0.14.27", - "esbuild-sunos-64": "0.14.27", - "esbuild-windows-32": "0.14.27", - "esbuild-windows-64": "0.14.27", - "esbuild-windows-arm64": "0.14.27" + "esbuild-android-64": "0.14.28", + "esbuild-android-arm64": "0.14.28", + "esbuild-darwin-64": "0.14.28", + "esbuild-darwin-arm64": "0.14.28", + "esbuild-freebsd-64": "0.14.28", + "esbuild-freebsd-arm64": "0.14.28", + "esbuild-linux-32": "0.14.28", + "esbuild-linux-64": "0.14.28", + "esbuild-linux-arm": "0.14.28", + "esbuild-linux-arm64": "0.14.28", + "esbuild-linux-mips64le": "0.14.28", + "esbuild-linux-ppc64le": "0.14.28", + "esbuild-linux-riscv64": "0.14.28", + "esbuild-linux-s390x": "0.14.28", + "esbuild-netbsd-64": "0.14.28", + "esbuild-openbsd-64": "0.14.28", + "esbuild-sunos-64": "0.14.28", + "esbuild-windows-32": "0.14.28", + "esbuild-windows-64": "0.14.28", + "esbuild-windows-arm64": "0.14.28" } }, "esbuild-android-64": { - "version": "0.14.27", - "resolved": "https://registry.npmjs.org/esbuild-android-64/-/esbuild-android-64-0.14.27.tgz", - "integrity": "sha512-LuEd4uPuj/16Y8j6kqy3Z2E9vNY9logfq8Tq+oTE2PZVuNs3M1kj5Qd4O95ee66yDGb3isaOCV7sOLDwtMfGaQ==", + "version": "0.14.28", + "resolved": "https://registry.npmjs.org/esbuild-android-64/-/esbuild-android-64-0.14.28.tgz", + "integrity": "sha512-A52C3zq+9tNwCqZ+4kVLBxnk/WnrYM8P2+QNvNE9B6d2OVPs214lp3g6UyO+dKDhUdefhfPCuwkP8j2A/+szNA==", "dev": true, "optional": true }, "esbuild-android-arm64": { - "version": "0.14.27", - "resolved": "https://registry.npmjs.org/esbuild-android-arm64/-/esbuild-android-arm64-0.14.27.tgz", - "integrity": "sha512-E8Ktwwa6vX8q7QeJmg8yepBYXaee50OdQS3BFtEHKrzbV45H4foMOeEE7uqdjGQZFBap5VAqo7pvjlyA92wznQ==", + "version": "0.14.28", + "resolved": "https://registry.npmjs.org/esbuild-android-arm64/-/esbuild-android-arm64-0.14.28.tgz", + "integrity": "sha512-sm0fDEGElZhMC3HLZeECI2juE4aG7uPfMBMqNUhy9CeX399Pz8rC6e78OXMXInGjSdEAwQmCOHmfsP7uv3Q8rA==", "dev": true, "optional": true }, "esbuild-darwin-64": { - "version": "0.14.27", - "resolved": "https://registry.npmjs.org/esbuild-darwin-64/-/esbuild-darwin-64-0.14.27.tgz", - "integrity": "sha512-czw/kXl/1ZdenPWfw9jDc5iuIYxqUxgQ/Q+hRd4/3udyGGVI31r29LCViN2bAJgGvQkqyLGVcG03PJPEXQ5i2g==", + "version": "0.14.28", + "resolved": "https://registry.npmjs.org/esbuild-darwin-64/-/esbuild-darwin-64-0.14.28.tgz", + "integrity": "sha512-nzDd7mQ44FvsFHtOafZdBgn3Li5SMsnMnoz1J2MM37xJmR3wGNTFph88KypjHgWqwbxCI7MXS1U+sN4qDeeW6Q==", "dev": true, "optional": true }, "esbuild-darwin-arm64": { - "version": "0.14.27", - "resolved": "https://registry.npmjs.org/esbuild-darwin-arm64/-/esbuild-darwin-arm64-0.14.27.tgz", - "integrity": "sha512-BEsv2U2U4o672oV8+xpXNxN9bgqRCtddQC6WBh4YhXKDcSZcdNh7+6nS+DM2vu7qWIWNA4JbRG24LUUYXysimQ==", + "version": "0.14.28", + "resolved": "https://registry.npmjs.org/esbuild-darwin-arm64/-/esbuild-darwin-arm64-0.14.28.tgz", + "integrity": "sha512-XEq/bLR/glsUl+uGrBimQzOVs/CmwI833fXUhP9xrLI3IJ+rKyrZ5IA8u+1crOEf1LoTn8tV+hInmX6rGjbScw==", "dev": true, "optional": true }, "esbuild-freebsd-64": { - "version": "0.14.27", - "resolved": "https://registry.npmjs.org/esbuild-freebsd-64/-/esbuild-freebsd-64-0.14.27.tgz", - "integrity": "sha512-7FeiFPGBo+ga+kOkDxtPmdPZdayrSzsV9pmfHxcyLKxu+3oTcajeZlOO1y9HW+t5aFZPiv7czOHM4KNd0tNwCA==", + "version": "0.14.28", + "resolved": "https://registry.npmjs.org/esbuild-freebsd-64/-/esbuild-freebsd-64-0.14.28.tgz", + "integrity": "sha512-rTKLgUj/HEcPeE5XZ7IZwWpFx7IWMfprN7QRk/TUJE1s1Ipb58esboIesUpjirJz/BwrgHq+FDG9ChAI8dZAtQ==", "dev": true, "optional": true }, "esbuild-freebsd-arm64": { - "version": "0.14.27", - "resolved": "https://registry.npmjs.org/esbuild-freebsd-arm64/-/esbuild-freebsd-arm64-0.14.27.tgz", - "integrity": "sha512-8CK3++foRZJluOWXpllG5zwAVlxtv36NpHfsbWS7TYlD8S+QruXltKlXToc/5ZNzBK++l6rvRKELu/puCLc7jA==", + "version": "0.14.28", + "resolved": "https://registry.npmjs.org/esbuild-freebsd-arm64/-/esbuild-freebsd-arm64-0.14.28.tgz", + "integrity": "sha512-sBffxD1UMOsB7aWMoExmipycjcy3HJGwmqE4GQZUTZvdiH4GhjgUiVdtPyt7kSCdL40JqnWQJ4b1l8Y51oCF4Q==", "dev": true, "optional": true }, "esbuild-linux-32": { - "version": "0.14.27", - "resolved": "https://registry.npmjs.org/esbuild-linux-32/-/esbuild-linux-32-0.14.27.tgz", - "integrity": "sha512-qhNYIcT+EsYSBClZ5QhLzFzV5iVsP1YsITqblSaztr3+ZJUI+GoK8aXHyzKd7/CKKuK93cxEMJPpfi1dfsOfdw==", + "version": "0.14.28", + "resolved": "https://registry.npmjs.org/esbuild-linux-32/-/esbuild-linux-32-0.14.28.tgz", + "integrity": "sha512-+Wxidh3fBEQ9kHcCsD4etlBTMb1n6QY2uXv3rFhVn88CY/JP782MhA57/ipLMY4kOLeSKEuFGN4rtjHuhmRMig==", "dev": true, "optional": true }, "esbuild-linux-64": { - "version": "0.14.27", - "resolved": "https://registry.npmjs.org/esbuild-linux-64/-/esbuild-linux-64-0.14.27.tgz", - "integrity": "sha512-ESjck9+EsHoTaKWlFKJpPZRN26uiav5gkI16RuI8WBxUdLrrAlYuYSndxxKgEn1csd968BX/8yQZATYf/9+/qg==", + "version": "0.14.28", + "resolved": "https://registry.npmjs.org/esbuild-linux-64/-/esbuild-linux-64-0.14.28.tgz", + "integrity": "sha512-7+xgsC4LvR6cnzaBdiljNnPDjbkwzahogN+S9uy9AoYw7ZjPnnXc6sjQAVCbqGb7MEgrWdpa6u/Tao79i4lWxg==", "dev": true, "optional": true }, "esbuild-linux-arm": { - "version": "0.14.27", - "resolved": "https://registry.npmjs.org/esbuild-linux-arm/-/esbuild-linux-arm-0.14.27.tgz", - "integrity": "sha512-JnnmgUBdqLQO9hoNZQqNHFWlNpSX82vzB3rYuCJMhtkuaWQEmQz6Lec1UIxJdC38ifEghNTBsF9bbe8dFilnCw==", + "version": "0.14.28", + "resolved": "https://registry.npmjs.org/esbuild-linux-arm/-/esbuild-linux-arm-0.14.28.tgz", + "integrity": "sha512-L5isjmlLbh9E0WVllXiVETbScgMbth/+XkXQii1WwgO1RvLIfaGrVFz8d2n6EH/ImtgYxPYGx+OcvIKQBc91Rg==", "dev": true, "optional": true }, "esbuild-linux-arm64": { - "version": "0.14.27", - "resolved": "https://registry.npmjs.org/esbuild-linux-arm64/-/esbuild-linux-arm64-0.14.27.tgz", - "integrity": "sha512-no6Mi17eV2tHlJnqBHRLekpZ2/VYx+NfGxKcBE/2xOMYwctsanCaXxw4zapvNrGE9X38vefVXLz6YCF8b1EHiQ==", + "version": "0.14.28", + "resolved": "https://registry.npmjs.org/esbuild-linux-arm64/-/esbuild-linux-arm64-0.14.28.tgz", + "integrity": "sha512-EjRHgwg+kgXABzyoPGPOPg4d5wZqRnZ/ZAxBDzLY+i6DS8OUfTSlZHWIOZzU4XF7125WxRBg9ULbrFJBl+57Eg==", "dev": true, "optional": true }, "esbuild-linux-mips64le": { - "version": "0.14.27", - "resolved": "https://registry.npmjs.org/esbuild-linux-mips64le/-/esbuild-linux-mips64le-0.14.27.tgz", - "integrity": "sha512-NolWP2uOvIJpbwpsDbwfeExZOY1bZNlWE/kVfkzLMsSgqeVcl5YMen/cedRe9mKnpfLli+i0uSp7N+fkKNU27A==", + "version": "0.14.28", + "resolved": "https://registry.npmjs.org/esbuild-linux-mips64le/-/esbuild-linux-mips64le-0.14.28.tgz", + "integrity": "sha512-krx9SSg7yfiUKk64EmjefOyiEF6nv2bRE4um/LiTaQ6Y/6FP4UF3/Ou/AxZVyR154uSRq63xejcAsmswXAYRsw==", "dev": true, "optional": true }, "esbuild-linux-ppc64le": { - "version": "0.14.27", - "resolved": "https://registry.npmjs.org/esbuild-linux-ppc64le/-/esbuild-linux-ppc64le-0.14.27.tgz", - "integrity": "sha512-/7dTjDvXMdRKmsSxKXeWyonuGgblnYDn0MI1xDC7J1VQXny8k1qgNp6VmrlsawwnsymSUUiThhkJsI+rx0taNA==", + "version": "0.14.28", + "resolved": "https://registry.npmjs.org/esbuild-linux-ppc64le/-/esbuild-linux-ppc64le-0.14.28.tgz", + "integrity": "sha512-LD0Xxu9g+DNuhsEBV5QuVZ4uKVBMup0xPIruLweuAf9/mHXFnaCuNXUBF5t0DxKl7GQ5MSioKtnb92oMo+QXEw==", "dev": true, "optional": true }, "esbuild-linux-riscv64": { - "version": "0.14.27", - "resolved": "https://registry.npmjs.org/esbuild-linux-riscv64/-/esbuild-linux-riscv64-0.14.27.tgz", - "integrity": "sha512-D+aFiUzOJG13RhrSmZgrcFaF4UUHpqj7XSKrIiCXIj1dkIkFqdrmqMSOtSs78dOtObWiOrFCDDzB24UyeEiNGg==", + "version": "0.14.28", + "resolved": "https://registry.npmjs.org/esbuild-linux-riscv64/-/esbuild-linux-riscv64-0.14.28.tgz", + "integrity": "sha512-L/DWfRh2P0vxq4Y+qieSNXKGdMg+e9Qe8jkbN2/8XSGYDTPzO2OcAxSujob4qIh7iSl+cknbXV+BvH0YFR0jbg==", "dev": true, "optional": true }, "esbuild-linux-s390x": { - "version": "0.14.27", - "resolved": "https://registry.npmjs.org/esbuild-linux-s390x/-/esbuild-linux-s390x-0.14.27.tgz", - "integrity": "sha512-CD/D4tj0U4UQjELkdNlZhQ8nDHU5rBn6NGp47Hiz0Y7/akAY5i0oGadhEIg0WCY/HYVXFb3CsSPPwaKcTOW3bg==", + "version": "0.14.28", + "resolved": "https://registry.npmjs.org/esbuild-linux-s390x/-/esbuild-linux-s390x-0.14.28.tgz", + "integrity": "sha512-rrgxmsbmL8QQknWGnAL9bGJRQYLOi2AzXy5OTwfhxnj9eqjo5mSVbJXjgiq5LPUAMQZGdPH5yaNK0obAXS81Zw==", "dev": true, "optional": true }, "esbuild-netbsd-64": { - "version": "0.14.27", - "resolved": "https://registry.npmjs.org/esbuild-netbsd-64/-/esbuild-netbsd-64-0.14.27.tgz", - "integrity": "sha512-h3mAld69SrO1VoaMpYl3a5FNdGRE/Nqc+E8VtHOag4tyBwhCQXxtvDDOAKOUQexBGca0IuR6UayQ4ntSX5ij1Q==", + "version": "0.14.28", + "resolved": "https://registry.npmjs.org/esbuild-netbsd-64/-/esbuild-netbsd-64-0.14.28.tgz", + "integrity": "sha512-h8wntIyOR8/xMVVM6TvJxxWKh4AjmLK87IPKpuVi8Pq0kyk0RMA+eo4PFGk5j2XK0D7dj8PcSF5NSlP9kN/j0A==", "dev": true, "optional": true }, "esbuild-openbsd-64": { - "version": "0.14.27", - "resolved": "https://registry.npmjs.org/esbuild-openbsd-64/-/esbuild-openbsd-64-0.14.27.tgz", - "integrity": "sha512-xwSje6qIZaDHXWoPpIgvL+7fC6WeubHHv18tusLYMwL+Z6bEa4Pbfs5IWDtQdHkArtfxEkIZz77944z8MgDxGw==", + "version": "0.14.28", + "resolved": "https://registry.npmjs.org/esbuild-openbsd-64/-/esbuild-openbsd-64-0.14.28.tgz", + "integrity": "sha512-HBv18rVapbuDx52/fhZ/c/w6TXyaQAvRxiDDn5Hz/pBcwOs3cdd2WxeIKlWmDoqm2JMx5EVlq4IWgoaRX9mVkw==", "dev": true, "optional": true }, "esbuild-sunos-64": { - "version": "0.14.27", - "resolved": "https://registry.npmjs.org/esbuild-sunos-64/-/esbuild-sunos-64-0.14.27.tgz", - "integrity": "sha512-/nBVpWIDjYiyMhuqIqbXXsxBc58cBVH9uztAOIfWShStxq9BNBik92oPQPJ57nzWXRNKQUEFWr4Q98utDWz7jg==", + "version": "0.14.28", + "resolved": "https://registry.npmjs.org/esbuild-sunos-64/-/esbuild-sunos-64-0.14.28.tgz", + "integrity": "sha512-zlIxePhZxKYheR2vBCgPVvTixgo/ozOfOMoP6RZj8dxzquU1NgeyhjkcRXucbLCtmoNJ+i4PtWwPZTLuDd3bGg==", "dev": true, "optional": true }, "esbuild-windows-32": { - "version": "0.14.27", - "resolved": "https://registry.npmjs.org/esbuild-windows-32/-/esbuild-windows-32-0.14.27.tgz", - "integrity": "sha512-Q9/zEjhZJ4trtWhFWIZvS/7RUzzi8rvkoaS9oiizkHTTKd8UxFwn/Mm2OywsAfYymgUYm8+y2b+BKTNEFxUekw==", + "version": "0.14.28", + "resolved": "https://registry.npmjs.org/esbuild-windows-32/-/esbuild-windows-32-0.14.28.tgz", + "integrity": "sha512-am9DIJxXlld1BOAY/VlvBQHMUCPL7S3gB/lnXIY3M4ys0gfuRqPf4EvMwZMzYUbFKBY+/Qb8SRgPRRGhwnJ8Kg==", "dev": true, "optional": true }, "esbuild-windows-64": { - "version": "0.14.27", - "resolved": "https://registry.npmjs.org/esbuild-windows-64/-/esbuild-windows-64-0.14.27.tgz", - "integrity": "sha512-b3y3vTSl5aEhWHK66ngtiS/c6byLf6y/ZBvODH1YkBM+MGtVL6jN38FdHUsZasCz9gFwYs/lJMVY9u7GL6wfYg==", + "version": "0.14.28", + "resolved": "https://registry.npmjs.org/esbuild-windows-64/-/esbuild-windows-64-0.14.28.tgz", + "integrity": "sha512-78PhySDnmRZlsPNp/W/5Fim8iivlBQQxfhBFIqR7xwvfDmCFUSByyMKP7LCHgNtb04yNdop8nJJkJaQ8Xnwgiw==", "dev": true, "optional": true }, "esbuild-windows-arm64": { - "version": "0.14.27", - "resolved": "https://registry.npmjs.org/esbuild-windows-arm64/-/esbuild-windows-arm64-0.14.27.tgz", - "integrity": "sha512-I/reTxr6TFMcR5qbIkwRGvldMIaiBu2+MP0LlD7sOlNXrfqIl9uNjsuxFPGEG4IRomjfQ5q8WT+xlF/ySVkqKg==", + "version": "0.14.28", + "resolved": "https://registry.npmjs.org/esbuild-windows-arm64/-/esbuild-windows-arm64-0.14.28.tgz", + "integrity": "sha512-VhXGBTo6HELD8zyHXynV6+L2jWx0zkKnGx4TmEdSBK7UVFACtOyfUqpToG0EtnYyRZ0HESBhzPSVpP781ovmvA==", "dev": true, "optional": true }, @@ -5155,9 +5155,9 @@ "dev": true }, "eslint": { - "version": "8.11.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.11.0.tgz", - "integrity": "sha512-/KRpd9mIRg2raGxHRGwW9ZywYNAClZrHjdueHcrVDuO3a6bj83eoTirCCk0M0yPwOjWYKHwRVRid+xK4F/GHgA==", + "version": "8.12.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.12.0.tgz", + "integrity": "sha512-it1oBL9alZg1S8UycLm5YDMAkIhtH6FtAzuZs6YvoGVldWjbS08BkAdb/ymP9LlAyq8koANu32U7Ib/w+UNh8Q==", "dev": true, "requires": { "@eslint/eslintrc": "^1.2.1", @@ -5629,9 +5629,9 @@ } }, "html-entities": { - "version": "2.3.2", - "resolved": "https://registry.npmjs.org/html-entities/-/html-entities-2.3.2.tgz", - "integrity": "sha512-c3Ab/url5ksaT0WyleslpBEthOzWhrjQbg75y7XUsfSzi3Dgzt0l8w5e7DylRn15MTlMMD58dTfzddNS2kcAjQ==", + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/html-entities/-/html-entities-2.3.3.tgz", + "integrity": "sha512-DV5Ln36z34NNTDgnz0EWGBLZENelNAtkiFA4kyNOG2tDI6Mz1uSWiq1wAKdyjnJwyDiDO7Fa2SO1CTxPXL8VxA==", "dev": true }, "ignore": { @@ -5900,9 +5900,9 @@ } }, "lilconfig": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/lilconfig/-/lilconfig-2.0.4.tgz", - "integrity": "sha512-bfTIN7lEsiooCocSISTWXkiWJkRqtL9wYtYy+8EK3Y41qh3mpwPU0ycTOgjdY9ErwXCc8QyrQp82bdL0Xkm9yA==", + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/lilconfig/-/lilconfig-2.0.5.tgz", + "integrity": "sha512-xaYmXZtTHPAw5m+xLN8ab9C+3a8YmV3asNSPOATITbtwrfbwaLJj8h66H1WMIpALCkqsIzK3h7oQ+PdX+LQ9Eg==", "dev": true }, "lines-and-columns": { @@ -5956,13 +5956,13 @@ "dev": true }, "micromatch": { - "version": "4.0.4", - "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.4.tgz", - "integrity": "sha512-pRmzw/XUcwXGpD9aI9q/0XOwLNygjETJ8y0ao0wdqprrzDa4YnxLcz7fQRZr8voh8V10kGhABbNcHVk5wHgWwg==", + "version": "4.0.5", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.5.tgz", + "integrity": "sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA==", "dev": true, "requires": { - "braces": "^3.0.1", - "picomatch": "^2.2.3" + "braces": "^3.0.2", + "picomatch": "^2.3.1" } }, "minimatch": { @@ -5993,9 +5993,9 @@ "dev": true }, "nanoid": { - "version": "3.3.1", - "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.1.tgz", - "integrity": "sha512-n6Vs/3KGyxPQd6uO0eH4Bv0ojGSUvuLlIHtC3Y0kEO23YRge8H9x1GCzLn28YX0H66pMkxuaeESFq4tKISKwdw==", + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.2.tgz", + "integrity": "sha512-CuHBogktKwpm5g2sRgv83jEy2ijFzBwMoYA60orPDR7ynsLijJDqgsi4RDGj3OJpy3Ieb+LYwiRmIOGyytgITA==", "dev": true }, "natural-compare": { @@ -6242,9 +6242,9 @@ "dev": true }, "prettier": { - "version": "2.6.0", - "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.6.0.tgz", - "integrity": "sha512-m2FgJibYrBGGgQXNzfd0PuDGShJgRavjUoRCw1mZERIWVSXF0iLzLm+aOqTAbLnC3n6JzUhAA8uZnFVghHJ86A==", + "version": "2.6.1", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.6.1.tgz", + "integrity": "sha512-8UVbTBYGwN37Bs9LERmxCPjdvPxlEowx2urIL6urHzdb3SDq4B/Z6xLFCblrSnE4iKWcS6ziJ3aOYrc1kz/E2A==", "dev": true }, "prettier-linter-helpers": { diff --git a/package.json b/package.json index 2357f3b..a9b37dd 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,6 @@ { - "name": "gitprofile", - "description": "Kickstart your personal portfolio with Github Api and blog", - "private": true, + "name": "@arifszn/gitprofile", + "description": "Create an automatic portfolio based on GitHub profile", "version": "2.0.0", "license": "Apache-2.0", "author": "arifszn", @@ -9,10 +8,30 @@ "type": "git", "url": "https://github.com/arifszn/gitprofile.git" }, + "bugs": { + "url": "https://github.com/arifszn/gitprofile/issues" + }, + "files": [ + "dist/gitprofile.es.js", + "dist/gitprofile.umd.js", + "dist/style.css", + "types" + ], + "main": "./dist/gitprofile.umd.js", + "module": "./dist/gitprofile.es.js", + "exports": { + ".": { + "import": "./dist/gitprofile.es.js", + "require": "./dist/gitprofile.umd.js" + }, + "./dist/style.css": "./dist/style.css" + }, + "typings": "./types/index.d.ts", "scripts": { "dev": "vite", "build": "vite build", "preview": "vite preview", + "build:library": "vite build --config library.config.js", "lint": "eslint --ext .js,.jsx .", "lint:fix": "eslint --ext .js,.jsx --fix .", "prettier": "prettier --check './**/*.{js,jsx,ts,tsx,css,md,json}' --config ./.prettierrc", @@ -43,9 +62,14 @@ "vite": "^2.8.0" }, "keywords": [ + "git-profile", + "gitprofile", + "gitportfolio", "personal-site", "template", "portfolio", + "resume", + "cv", "personal-website", "portfolio-website", "portfolio-site", @@ -54,7 +78,13 @@ "developer-portfolio", "portfolio-project", "github-portfolio", + "tailwind-portfolio", + "vite-portfolio", + "projects", + "open-source", + "git", "react-portfolio", + "github", "github-api" ] } diff --git a/postcss.config.js b/postcss.config.js deleted file mode 100644 index 1776f23..0000000 --- a/postcss.config.js +++ /dev/null @@ -1,7 +0,0 @@ -import tailwind from 'tailwindcss'; -import autoprefixer from 'autoprefixer'; -import tailwindConfig from './tailwind.config.js'; - -export default { - plugins: [tailwind(tailwindConfig), autoprefixer], -}; diff --git a/public/apple-touch-icon.png b/public/apple-touch-icon.png index 485fdef..f22a201 100644 Binary files a/public/apple-touch-icon.png and b/public/apple-touch-icon.png differ diff --git a/public/favicon-16x16.png b/public/favicon-16x16.png index e221115..4088bc2 100644 Binary files a/public/favicon-16x16.png and b/public/favicon-16x16.png differ diff --git a/public/favicon-32x32.png b/public/favicon-32x32.png index 1b22fcf..16f826b 100644 Binary files a/public/favicon-32x32.png and b/public/favicon-32x32.png differ diff --git a/public/favicon.ico b/public/favicon.ico index f67de2d..9a26b73 100644 Binary files a/public/favicon.ico and b/public/favicon.ico differ diff --git a/public/logo.png b/public/logo.png index 1d683dc..2d5f294 100644 Binary files a/public/logo.png and b/public/logo.png differ diff --git a/public/logo192.png b/public/logo192.png index 964d70c..234b74e 100644 Binary files a/public/logo192.png and b/public/logo192.png differ diff --git a/public/logo512.png b/public/logo512.png index 1d683dc..2d5f294 100644 Binary files a/public/logo512.png and b/public/logo512.png differ diff --git a/src/App.jsx b/src/App.jsx index dd2b845..5a777f1 100644 --- a/src/App.jsx +++ b/src/App.jsx @@ -1,205 +1,8 @@ -import axios from 'axios'; -import { Fragment, useCallback, useEffect, useState } from 'react'; -import moment from 'moment'; -import HeadTagEditor from './components/head-tag-editor'; -import ErrorPage from './components/error-page'; -import ThemeChanger from './components/theme-changer'; -import AvatarCard from './components/avatar-card'; -import Details from './components/details'; -import Skill from './components/skill'; -import Experience from './components/experience'; -import Education from './components/education'; -import Project from './components/project'; -import Blog from './components/blog'; -import { getInitialTheme, setupHotjar } from './helpers/utils'; import config from '../gitprofile.config'; +import GitProfile from './components/GitProfile'; function App() { - const [theme, setTheme] = useState(getInitialTheme()); - const [loading, setLoading] = useState(true); - const [profile, setProfile] = useState(null); - const [repo, setRepo] = useState(null); - const [error, setError] = useState(null); - const [rateLimit, setRateLimit] = useState(null); - - useEffect(() => { - if (theme) { - document.documentElement.setAttribute('data-theme', theme); - } - }, [theme]); - - useEffect(() => { - setupHotjar(); - }, []); - - const loadData = useCallback(() => { - axios - .get(`https://api.github.com/users/${config.github.username}`) - .then((response) => { - let data = response.data; - - let profileData = { - avatar: data.avatar_url, - name: data.name ? data.name : '', - bio: data.bio ? data.bio : '', - location: data.location ? data.location : '', - company: data.company ? data.company : '', - }; - - setProfile(profileData); - }) - .then(() => { - let excludeRepo = ``; - - config.github.exclude.projects.forEach((project) => { - excludeRepo += `+-repo:${config.github.username}/${project}`; - }); - - let query = `user:${config.github.username}+fork:${!config.github - .exclude.forks}${excludeRepo}`; - - let url = `https://api.github.com/search/repositories?q=${query}&sort=${config.github.sortBy}&per_page=${config.github.limit}&type=Repositories`; - - axios - .get(url, { - headers: { - 'Content-Type': 'application/vnd.github.v3+json', - }, - }) - .then((response) => { - let data = response.data; - - setRepo(data.items); - }) - .catch((error) => { - handleError(error); - }); - }) - .catch((error) => { - handleError(error); - }) - .finally(() => { - setLoading(false); - }); - }, [setLoading]); - - useEffect(() => { - loadData(); - }, [loadData]); - - const handleError = (error) => { - console.error('Error:', error); - try { - setRateLimit({ - remaining: error.response.headers['x-ratelimit-remaining'], - reset: moment( - new Date(error.response.headers['x-ratelimit-reset'] * 1000) - ).fromNow(), - }); - - if (error.response.status === 403) { - setError(429); - } else if (error.response.status === 404) { - setError(404); - } else { - setError(500); - } - } catch (error2) { - setError(500); - } - }; - - return ( - - -
- {error ? ( - - Please provide correct github username in{' '} - gitprofile.config.js -

- ) : error === 429 ? ( -

- Oh no, you hit the{' '} - - rate limit - - ! Try again later{rateLimit && ` ${rateLimit.reset}`}. -

- ) : ( - `Something went wrong` - ) - } - /> - ) : ( - -
-
-
-
- {!config.themeConfig.disableSwitch && ( - - )} - -
- - - -
-
-
-
- - -
-
-
-
- {/* DO NOT REMOVE/MODIFY THE FOOTER. FOR MORE INFO https://github.com/arifszn/gitprofile#-please-read */} - -
- )} -
- - ); + return ; } export default App; diff --git a/src/index.css b/src/assets/index.css similarity index 100% rename from src/index.css rename to src/assets/index.css diff --git a/src/components/GitProfile.jsx b/src/components/GitProfile.jsx new file mode 100644 index 0000000..9c45cfc --- /dev/null +++ b/src/components/GitProfile.jsx @@ -0,0 +1,293 @@ +import axios from 'axios'; +import { Fragment, useCallback, useEffect, useState } from 'react'; +import moment from 'moment'; +import HeadTagEditor from './head-tag-editor'; +import ErrorPage from './error-page'; +import ThemeChanger from './theme-changer'; +import AvatarCard from './avatar-card'; +import Details from './details'; +import Skill from './skill'; +import Experience from './experience'; +import Education from './education'; +import Project from './project'; +import Blog from './blog'; +import { + genericError, + getInitialTheme, + noConfigError, + notFoundError, + setupHotjar, + tooManyRequestError, + sanitizeConfig, +} from '../helpers/utils'; +import { HelmetProvider } from 'react-helmet-async'; +import PropTypes from 'prop-types'; +import '../assets/index.css'; + +const GitProfile = ({ config }) => { + const [error, setError] = useState( + typeof config === 'undefined' && !config ? noConfigError : null + ); + const [sanitizedConfig] = useState( + typeof config === 'undefined' && !config ? null : sanitizeConfig(config) + ); + const [theme, setTheme] = useState(null); + const [loading, setLoading] = useState(true); + const [profile, setProfile] = useState(null); + const [repo, setRepo] = useState(null); + + useEffect(() => { + if (sanitizedConfig) { + setTheme(getInitialTheme(sanitizedConfig.themeConfig)); + setupHotjar(sanitizedConfig.hotjar); + loadData(); + } + }, [sanitizedConfig]); + + useEffect(() => { + theme && document.documentElement.setAttribute('data-theme', theme); + }, [theme]); + + const loadData = useCallback(() => { + axios + .get(`https://api.github.com/users/${sanitizedConfig.github.username}`) + .then((response) => { + let data = response.data; + + let profileData = { + avatar: data.avatar_url, + name: data.name ? data.name : '', + bio: data.bio ? data.bio : '', + location: data.location ? data.location : '', + company: data.company ? data.company : '', + }; + + setProfile(profileData); + }) + .then(() => { + let excludeRepo = ``; + + sanitizedConfig.github.exclude.projects.forEach((project) => { + excludeRepo += `+-repo:${sanitizedConfig.github.username}/${project}`; + }); + + let query = `user:${ + sanitizedConfig.github.username + }+fork:${!sanitizedConfig.github.exclude.forks}${excludeRepo}`; + + let url = `https://api.github.com/search/repositories?q=${query}&sort=${sanitizedConfig.github.sortBy}&per_page=${sanitizedConfig.github.limit}&type=Repositories`; + + axios + .get(url, { + headers: { + 'Content-Type': 'application/vnd.github.v3+json', + }, + }) + .then((response) => { + let data = response.data; + + setRepo(data.items); + }) + .catch((error) => { + handleError(error); + }); + }) + .catch((error) => { + handleError(error); + }) + .finally(() => { + setLoading(false); + }); + }, [setLoading]); + + const handleError = (error) => { + console.error('Error:', error); + try { + let reset = moment( + new Date(error.response.headers['x-ratelimit-reset'] * 1000) + ).fromNow(); + + if (error.response.status === 403) { + setError(tooManyRequestError(reset)); + } else if (error.response.status === 404) { + setError(notFoundError); + } else { + setError(genericError); + } + } catch (error2) { + setError(genericError); + } + }; + + return ( + + {sanitizedConfig && ( + + )} +
+ {error ? ( + + ) : ( + sanitizedConfig && ( + +
+
+
+
+ {!sanitizedConfig.themeConfig.disableSwitch && ( + + )} + +
+ + + +
+
+
+
+ + +
+
+
+
+ + {/* The below attribution notice shall be + included in all copies or substantial portions of the Software. */} + {/* DO NOT REMOVE/MODIFY THE BELOW FOOTER. */} + {/* SEE 4(C) SECTION OF THE LICENSE FOR MORE DETAILS. */} + {/* https://github.com/arifszn/gitprofile/blob/main/LICENSE */} + +
+ ) + )} +
+
+ ); +}; + +GitProfile.propTypes = { + config: PropTypes.shape({ + github: PropTypes.shape({ + username: PropTypes.string.isRequired, + sortBy: PropTypes.oneOf(['stars', 'updated']), + limit: PropTypes.number, + exclude: PropTypes.shape({ + forks: PropTypes.bool, + projects: PropTypes.array, + }), + }).isRequired, + social: PropTypes.shape({ + linkedin: PropTypes.string, + twitter: PropTypes.string, + facebook: PropTypes.string, + dribbble: PropTypes.string, + behance: PropTypes.string, + medium: PropTypes.string, + devto: PropTypes.string, + website: PropTypes.string, + phone: PropTypes.string, + email: PropTypes.string, + }), + skills: PropTypes.array, + experiences: PropTypes.arrayOf( + PropTypes.shape({ + company: PropTypes.string, + position: PropTypes.string, + from: PropTypes.string, + to: PropTypes.string, + }) + ), + education: PropTypes.arrayOf( + PropTypes.shape({ + institution: PropTypes.string, + degree: PropTypes.string, + from: PropTypes.string, + to: PropTypes.string, + }) + ), + blog: PropTypes.shape({ + source: PropTypes.string, + username: PropTypes.string, + limit: PropTypes.number, + }), + googleAnalytics: PropTypes.shape({ + id: PropTypes.string, + }), + hotjar: PropTypes.shape({ + id: PropTypes.string, + snippetVersion: PropTypes.number, + }), + themeConfig: PropTypes.shape({ + defaultTheme: PropTypes.string, + disableSwitch: PropTypes.bool, + respectPrefersColorScheme: PropTypes.bool, + themes: PropTypes.array, + customTheme: PropTypes.shape({ + primary: PropTypes.string, + secondary: PropTypes.string, + accent: PropTypes.string, + neutral: PropTypes.string, + 'base-100': PropTypes.string, + '--rounded-box': PropTypes.string, + '--rounded-btn': PropTypes.string, + }), + }), + }).isRequired, +}; + +export default GitProfile; diff --git a/src/components/avatar-card/index.jsx b/src/components/avatar-card/index.jsx index bcc94d1..8e8350b 100644 --- a/src/components/avatar-card/index.jsx +++ b/src/components/avatar-card/index.jsx @@ -54,7 +54,7 @@ const AvatarCard = ({ profile, loading }) => { AvatarCard.propTypes = { profile: PropTypes.object, - loading: PropTypes.bool, + loading: PropTypes.bool.isRequired, }; export default AvatarCard; diff --git a/src/components/blog/index.jsx b/src/components/blog/index.jsx index 7a7175e..d71001d 100644 --- a/src/components/blog/index.jsx +++ b/src/components/blog/index.jsx @@ -4,15 +4,14 @@ import { Fragment, useEffect, useState } from 'react'; import { ga, skeleton } from '../../helpers/utils'; import LazyImage from '../lazy-image'; import PropTypes from 'prop-types'; -import config from '../../../gitprofile.config'; -const displaySection = () => { +const displaySection = (blog) => { if ( - typeof config.blog !== 'undefined' && - typeof config.blog.source !== 'undefined' && - typeof config.blog.username !== 'undefined' && - config.blog.source && - config.blog.username + typeof blog !== 'undefined' && + typeof blog.source !== 'undefined' && + typeof blog.username !== 'undefined' && + blog.source && + blog.username ) { return true; } else { @@ -20,20 +19,20 @@ const displaySection = () => { } }; -const Blog = ({ loading }) => { +const Blog = ({ loading, blog, googleAnalytics }) => { const [articles, setArticles] = useState(null); useEffect(() => { - if (displaySection()) { - if (config.blog.source === 'medium') { + if (displaySection(blog)) { + if (blog.source === 'medium') { getMediumArticle({ - user: config.blog.username, + user: blog.username, }).then((res) => { setArticles(res); }); - } else if (config.blog.source === 'dev.to') { + } else if (blog.source === 'dev.to') { getDevtoArticle({ - user: config.blog.username, + user: blog.username, }).then((res) => { setArticles(res); }); @@ -43,7 +42,7 @@ const Blog = ({ loading }) => { const renderSkeleton = () => { let array = []; - for (let index = 0; index < config.blog.limit; index++) { + for (let index = 0; index < blog.limit; index++) { array.push(
@@ -101,7 +100,7 @@ const Blog = ({ loading }) => { const renderArticles = () => { return ( articles && - articles.slice(0, config.blog.limit).map((article, index) => ( + articles.slice(0, blog.limit).map((article, index) => ( { e.preventDefault(); try { - if (config.googleAnalytics?.id) { + if (googleAnalytics?.id) { ga.event({ action: 'Click Blog Post', params: { @@ -122,7 +121,8 @@ const Blog = ({ loading }) => { console.error(error); } - window.open(article.link, '_blank'); + typeof window !== 'undefined' && + window.open(article.link, '_blank'); }} >
@@ -174,7 +174,7 @@ const Blog = ({ loading }) => { return ( - {displaySection() && ( + {displaySection(blog) && (
@@ -207,7 +207,9 @@ const Blog = ({ loading }) => { }; Blog.propTypes = { - loading: PropTypes.bool, + loading: PropTypes.bool.isRequired, + blog: PropTypes.object.isRequired, + googleAnalytics: PropTypes.object.isRequired, }; export default Blog; diff --git a/src/components/details/index.jsx b/src/components/details/index.jsx index e18dcbf..6850ae8 100644 --- a/src/components/details/index.jsx +++ b/src/components/details/index.jsx @@ -14,7 +14,6 @@ import { } from 'react-icons/fa'; import PropTypes from 'prop-types'; import { skeleton } from '../../helpers/utils'; -import config from '../../../gitprofile.config'; const ListItem = ({ icon, title, value, link, skeleton = false }) => { return ( @@ -43,7 +42,7 @@ const ListItem = ({ icon, title, value, link, skeleton = false }) => { ); }; -const Details = ({ profile, loading }) => { +const Details = ({ profile, loading, social, github }) => { const renderSkeleton = () => { let array = []; for (let index = 0; index < 4; index++) { @@ -86,99 +85,89 @@ const Details = ({ profile, loading }) => { } title="GitHub:" - value={config.github.username} - link={`https://github.com/${config.github.username}`} + value={github.username} + link={`https://github.com/${github.username}`} /> - {typeof config.social.twitter !== 'undefined' && - config.social.twitter && ( - } - title="Twitter:" - value={config.social.twitter} - link={`https://twitter.com/${config.social.twitter}`} - /> - )} - {typeof config.social.linkedin !== 'undefined' && - config.social.linkedin && ( - } - title="LinkedIn:" - value={config.social.linkedin} - link={`https://www.linkedin.com/in/${config.social.linkedin}`} - /> - )} - {typeof config.social.dribbble !== 'undefined' && - config.social.dribbble && ( - } - title="Dribbble:" - value={config.social.dribbble} - link={`https://dribbble.com/${config.social.dribbble}`} - /> - )} - {typeof config.social.behance !== 'undefined' && - config.social.behance && ( - } - title="Behance:" - value={config.social.behance} - link={`https://www.behance.net/${config.social.behance}`} - /> - )} - {typeof config.social.facebook !== 'undefined' && - config.social.facebook && ( - } - title="Facebook:" - value={config.social.facebook} - link={`https://www.facebook.com/${config.social.facebook}`} - /> - )} - {typeof config.social.medium !== 'undefined' && - config.social.medium && ( - } - title="Medium:" - value={config.social.medium} - link={`https://medium.com/@${config.social.medium}`} - /> - )} - {typeof config.social.devto !== 'undefined' && - config.social.devto && ( - } - title="Dev:" - value={config.social.devto} - link={`https://dev.to/${config.social.devto}`} - /> - )} - {typeof config.social.website !== 'undefined' && - config.social.website && ( - } - title="Website:" - value={config.social.website} - link={config.social.website} - /> - )} - {typeof config.social.phone !== 'undefined' && - config.social.phone && ( - } - title="Phone:" - value={config.social.phone} - link={`tel:${config.social.phone}`} - /> - )} - {typeof config.social.email !== 'undefined' && - config.social.email && ( - } - title="Email:" - value={config.social.email} - link={`mailto:${config.social.email}`} - /> - )} + {typeof social.twitter !== 'undefined' && social.twitter && ( + } + title="Twitter:" + value={social.twitter} + link={`https://twitter.com/${social.twitter}`} + /> + )} + {typeof social.linkedin !== 'undefined' && social.linkedin && ( + } + title="LinkedIn:" + value={social.linkedin} + link={`https://www.linkedin.com/in/${social.linkedin}`} + /> + )} + {typeof social.dribbble !== 'undefined' && social.dribbble && ( + } + title="Dribbble:" + value={social.dribbble} + link={`https://dribbble.com/${social.dribbble}`} + /> + )} + {typeof social.behance !== 'undefined' && social.behance && ( + } + title="Behance:" + value={social.behance} + link={`https://www.behance.net/${social.behance}`} + /> + )} + {typeof social.facebook !== 'undefined' && social.facebook && ( + } + title="Facebook:" + value={social.facebook} + link={`https://www.facebook.com/${social.facebook}`} + /> + )} + {typeof social.medium !== 'undefined' && social.medium && ( + } + title="Medium:" + value={social.medium} + link={`https://medium.com/@${social.medium}`} + /> + )} + {typeof social.devto !== 'undefined' && social.devto && ( + } + title="Dev:" + value={social.devto} + link={`https://dev.to/${social.devto}`} + /> + )} + {typeof social.website !== 'undefined' && social.website && ( + } + title="Website:" + value={social.website} + link={social.website} + /> + )} + {typeof social.phone !== 'undefined' && social.phone && ( + } + title="Phone:" + value={social.phone} + link={`tel:${social.phone}`} + /> + )} + {typeof social.email !== 'undefined' && social.email && ( + } + title="Email:" + value={social.email} + link={`mailto:${social.email}`} + /> + )} )}
@@ -189,7 +178,9 @@ const Details = ({ profile, loading }) => { Details.propTypes = { profile: PropTypes.object, - loading: PropTypes.bool, + loading: PropTypes.bool.isRequired, + social: PropTypes.object.isRequired, + github: PropTypes.object.isRequired, }; ListItem.propTypes = { diff --git a/src/components/education/index.jsx b/src/components/education/index.jsx index e817c4c..e959df7 100644 --- a/src/components/education/index.jsx +++ b/src/components/education/index.jsx @@ -1,7 +1,6 @@ import { skeleton } from '../../helpers/utils'; import { Fragment } from 'react'; import PropTypes from 'prop-types'; -import config from '../../../gitprofile.config'; const ListItem = ({ time, degree, institution }) => (
  • @@ -15,7 +14,7 @@ const ListItem = ({ time, degree, institution }) => (
  • ); -const Education = ({ loading }) => { +const Education = ({ loading, education }) => { const renderSkeleton = () => { let array = []; for (let index = 0; index < 2; index++) { @@ -41,46 +40,46 @@ const Education = ({ loading }) => { return ( <> - {typeof config.education !== 'undefined' && - config.education.length !== 0 && ( -
    -
    -
    -
    - {loading ? ( - skeleton({ width: 'w-32', height: 'h-8' }) - ) : ( - Education - )} -
    -
    -
    -
      - {loading ? ( - renderSkeleton() - ) : ( - - {config.education.map((item, index) => ( - - ))} - - )} -
    -
    + {typeof education !== 'undefined' && education.length !== 0 && ( +
    +
    +
    +
    + {loading ? ( + skeleton({ width: 'w-32', height: 'h-8' }) + ) : ( + Education + )} +
    +
    +
    +
      + {loading ? ( + renderSkeleton() + ) : ( + + {education.map((item, index) => ( + + ))} + + )} +
    - )} +
    + )} ); }; Education.propTypes = { - loading: PropTypes.bool, + loading: PropTypes.bool.isRequired, + education: PropTypes.array.isRequired, }; ListItem.propTypes = { diff --git a/src/components/error-page/index.jsx b/src/components/error-page/index.jsx index 458db24..37880b6 100644 --- a/src/components/error-page/index.jsx +++ b/src/components/error-page/index.jsx @@ -10,9 +10,9 @@ const ErrorPage = (props) => { {props.status}

    {props.title}

    -

    +

    {props.subTitle} -

    +
    @@ -25,7 +25,7 @@ const ErrorPage = (props) => { ErrorPage.propTypes = { status: PropTypes.string.isRequired, title: PropTypes.string.isRequired, - subTitle: PropTypes.string.isRequired, + subTitle: PropTypes.node.isRequired, }; export default ErrorPage; diff --git a/src/components/experience/index.jsx b/src/components/experience/index.jsx index 9ab1b19..c3ad474 100644 --- a/src/components/experience/index.jsx +++ b/src/components/experience/index.jsx @@ -1,7 +1,6 @@ import { skeleton } from '../../helpers/utils'; import { Fragment } from 'react'; import PropTypes from 'prop-types'; -import config from '../../../gitprofile.config'; const ListItem = ({ time, position, company }) => (
  • @@ -15,7 +14,7 @@ const ListItem = ({ time, position, company }) => (
  • ); -const Experience = ({ loading }) => { +const Experience = ({ experiences, loading }) => { const renderSkeleton = () => { let array = []; for (let index = 0; index < 2; index++) { @@ -41,40 +40,39 @@ const Experience = ({ loading }) => { return ( <> - {typeof config.experiences !== 'undefined' && - config.experiences.length !== 0 && ( -
    -
    -
    -
    - {loading ? ( - skeleton({ width: 'w-32', height: 'h-8' }) - ) : ( - Experience - )} -
    -
    -
    -
      - {loading ? ( - renderSkeleton() - ) : ( - - {config.experiences.map((experience, index) => ( - - ))} - - )} -
    -
    + {typeof experiences !== 'undefined' && experiences.length !== 0 && ( +
    +
    +
    +
    + {loading ? ( + skeleton({ width: 'w-32', height: 'h-8' }) + ) : ( + Experience + )} +
    +
    +
    +
      + {loading ? ( + renderSkeleton() + ) : ( + + {experiences.map((experience, index) => ( + + ))} + + )} +
    - )} +
    + )} ); }; @@ -86,7 +84,8 @@ ListItem.propTypes = { }; Experience.propTypes = { - loading: PropTypes.bool, + experiences: PropTypes.array.isRequired, + loading: PropTypes.bool.isRequired, }; export default Experience; diff --git a/src/components/head-tag-editor/index.jsx b/src/components/head-tag-editor/index.jsx index fa3320a..bd9f767 100644 --- a/src/components/head-tag-editor/index.jsx +++ b/src/components/head-tag-editor/index.jsx @@ -2,25 +2,24 @@ import { Fragment } from 'react'; import { Helmet } from 'react-helmet-async'; import PropTypes from 'prop-types'; import { isThemeDarkish } from '../../helpers/utils'; -import config from '../../../gitprofile.config'; -const HeadTagEditor = ({ profile, theme }) => { +const HeadTagEditor = ({ profile, theme, googleAnalytics, social }) => { return ( {profile && ( - {config.googleAnalytics?.id && ( + {googleAnalytics?.id && ( )} - {config.googleAnalytics?.id && ( + {googleAnalytics?.id && ( )} Portfolio of {profile.name} @@ -38,9 +37,7 @@ const HeadTagEditor = ({ profile, theme }) => { @@ -61,6 +58,8 @@ const HeadTagEditor = ({ profile, theme }) => { HeadTagEditor.propTypes = { profile: PropTypes.object, theme: PropTypes.string, + googleAnalytics: PropTypes.object.isRequired, + social: PropTypes.object.isRequired, }; export default HeadTagEditor; diff --git a/src/components/project/index.jsx b/src/components/project/index.jsx index 6c67c97..30641d4 100644 --- a/src/components/project/index.jsx +++ b/src/components/project/index.jsx @@ -2,12 +2,11 @@ import { Fragment } from 'react'; import { AiOutlineStar, AiOutlineFork } from 'react-icons/ai'; import PropTypes from 'prop-types'; import { ga, languageColor, skeleton } from '../../helpers/utils'; -import config from '../../../gitprofile.config'; -const Project = ({ repo, loading }) => { +const Project = ({ repo, loading, github, googleAnalytics }) => { const renderSkeleton = () => { let array = []; - for (let index = 0; index < config.github.limit; index++) { + for (let index = 0; index < github.limit; index++) { array.push(
    @@ -61,7 +60,7 @@ const Project = ({ repo, loading }) => { e.preventDefault(); try { - if (config.googleAnalytics?.id) { + if (googleAnalytics?.id) { ga.event({ action: 'Click project', params: { @@ -73,7 +72,7 @@ const Project = ({ repo, loading }) => { console.error(error); } - window.open(item.html_url, '_blank'); + typeof window !== 'undefined' && window.open(item.html_url, '_blank'); }} >
    @@ -145,7 +144,7 @@ const Project = ({ repo, loading }) => { skeleton({ width: 'w-10', height: 'h-5' }) ) : ( { Project.propTypes = { repo: PropTypes.array, - loading: PropTypes.bool, + loading: PropTypes.bool.isRequired, + github: PropTypes.object.isRequired, + googleAnalytics: PropTypes.object.isRequired, }; export default Project; diff --git a/src/components/skill/index.jsx b/src/components/skill/index.jsx index f51f83b..3ed90f9 100644 --- a/src/components/skill/index.jsx +++ b/src/components/skill/index.jsx @@ -1,8 +1,7 @@ import { skeleton } from '../../helpers/utils'; import PropTypes from 'prop-types'; -import config from '../../../gitprofile.config'; -const Skill = ({ loading }) => { +const Skill = ({ loading, skills }) => { const renderSkeleton = () => { let array = []; for (let index = 0; index < 12; index++) { @@ -18,7 +17,7 @@ const Skill = ({ loading }) => { return ( <> - {typeof config.skills !== 'undefined' && config.skills.length !== 0 && ( + {typeof skills !== 'undefined' && skills.length !== 0 && (
    @@ -34,7 +33,7 @@ const Skill = ({ loading }) => {
    {loading ? renderSkeleton() - : config.skills.map((skill, index) => ( + : skills.map((skill, index) => (
    { }; Skill.propTypes = { - loading: PropTypes.bool, + loading: PropTypes.bool.isRequired, + skills: PropTypes.array.isRequired, }; export default Skill; diff --git a/src/components/theme-changer/index.jsx b/src/components/theme-changer/index.jsx index 67d9baa..af92dcd 100644 --- a/src/components/theme-changer/index.jsx +++ b/src/components/theme-changer/index.jsx @@ -1,13 +1,14 @@ import { AiOutlineControl } from 'react-icons/ai'; import { skeleton } from '../../helpers/utils'; import PropTypes from 'prop-types'; -import config from '../../../gitprofile.config'; -const ThemeChanger = ({ theme, setTheme, loading }) => { +const ThemeChanger = ({ theme, setTheme, loading, themeConfig }) => { const changeTheme = (e, selectedTheme) => { e.preventDefault(); document.querySelector('html').setAttribute('data-theme', selectedTheme); - localStorage.setItem('gitprofile-theme', selectedTheme); + + typeof window !== 'undefined' && + localStorage.setItem('gitprofile-theme', selectedTheme); setTheme(selectedTheme); }; @@ -26,7 +27,7 @@ const ThemeChanger = ({ theme, setTheme, loading }) => { {loading ? skeleton({ width: 'w-16', height: 'h-5' }) - : theme === config.themeConfig.default + : theme === themeConfig.defaultTheme ? 'Default' : theme} @@ -60,9 +61,9 @@ const ThemeChanger = ({ theme, setTheme, loading }) => { >
      {[ - config.themeConfig.default, - ...config.themeConfig.themes.filter( - (item) => item !== config.themeConfig.default + themeConfig.defaultTheme, + ...themeConfig.themes.filter( + (item) => item !== themeConfig.defaultTheme ), ].map((item, index) => (
    • @@ -72,9 +73,7 @@ const ThemeChanger = ({ theme, setTheme, loading }) => { className={`${theme === item ? 'active' : ''}`} > - {item === config.themeConfig.default - ? 'Default' - : item} + {item === themeConfig.defaultTheme ? 'Default' : item}
    • @@ -91,8 +90,9 @@ const ThemeChanger = ({ theme, setTheme, loading }) => { ThemeChanger.propTypes = { theme: PropTypes.string, - setTheme: PropTypes.func, - loading: PropTypes.bool, + setTheme: PropTypes.func.isRequired, + loading: PropTypes.bool.isRequired, + themeConfig: PropTypes.object.isRequired, }; export default ThemeChanger; diff --git a/src/helpers/utils.jsx b/src/helpers/utils.jsx index efa1272..79dc21a 100644 --- a/src/helpers/utils.jsx +++ b/src/helpers/utils.jsx @@ -1,31 +1,29 @@ import colors from '../data/colors.json'; import { hotjar } from 'react-hotjar'; -import config from '../../gitprofile.config'; -export const getInitialTheme = () => { - if (config.themeConfig.disableSwitch) { - return config.themeConfig.default; +export const getInitialTheme = (themeConfig) => { + if (themeConfig.disableSwitch) { + return themeConfig.defaultTheme; } if ( + typeof window !== 'undefined' && !(localStorage.getItem('gitprofile-theme') === null) && - config.themeConfig.themes.includes(localStorage.getItem('gitprofile-theme')) + themeConfig.themes.includes(localStorage.getItem('gitprofile-theme')) ) { let theme = localStorage.getItem('gitprofile-theme'); return theme; } - if ( - config.themeConfig.respectPrefersColorScheme && - !config.themeConfig.disableSwitch - ) { - return window.matchMedia('(prefers-color-scheme: dark)').matches + if (themeConfig.respectPrefersColorScheme && !themeConfig.disableSwitch) { + return typeof window !== 'undefined' && + window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' - : config.themeConfig.default; + : themeConfig.defaultTheme; } - return config.themeConfig.default; + return themeConfig.defaultTheme; }; export const skeleton = ({ @@ -60,8 +58,10 @@ export const ga = { // initialize google analytic initialize: (id) => { try { - window.gtag('js', new Date()); - window.gtag('config', id); + if (typeof window !== 'undefined') { + window.gtag('js', new Date()); + window.gtag('config', id); + } } catch (error) { console.error(error); } @@ -69,7 +69,7 @@ export const ga = { // log specific events happening event: ({ action, params }) => { try { - window.gtag('event', action, params); + typeof window !== 'undefined' && window.gtag('event', action, params); } catch (error) { console.error(error); } @@ -91,12 +91,242 @@ export const isThemeDarkish = (theme) => { } }; -export const setupHotjar = () => { - if (config.hotjar?.id) { - let snippetVersion = config.hotjar?.snippetVersion - ? config.hotjar?.snippetVersion +export const setupHotjar = (hotjarConfig) => { + if (hotjarConfig?.id) { + let snippetVersion = hotjarConfig?.snippetVersion + ? hotjarConfig?.snippetVersion : 6; - hotjar.initialize(config.hotjar.id, snippetVersion); + hotjar.initialize(hotjarConfig.id, snippetVersion); } }; + +export const sanitizeConfig = (config) => { + const customTheme = + typeof config.themeConfig !== 'undefined' && + typeof config.themeConfig.customTheme !== 'undefined' + ? config.themeConfig.customTheme + : { + primary: '#fc055b', + secondary: '#219aaf', + accent: '#e8d03a', + neutral: '#2A2730', + 'base-100': '#E3E3ED', + '--rounded-box': '3rem', + '--rounded-btn': '3rem', + }; + + const themes = + typeof config.themeConfig !== 'undefined' && + typeof config.themeConfig.themes !== 'undefined' + ? config.themeConfig.themes + : [ + 'light', + 'dark', + 'cupcake', + 'bumblebee', + 'emerald', + 'corporate', + 'synthwave', + 'retro', + 'cyberpunk', + 'valentine', + 'halloween', + 'garden', + 'forest', + 'aqua', + 'lofi', + 'pastel', + 'fantasy', + 'wireframe', + 'black', + 'luxury', + 'dracula', + 'cmyk', + 'autumn', + 'business', + 'acid', + 'lemonade', + 'night', + 'coffee', + 'winter', + 'procyon', + ]; + + return { + github: { + username: config.github.username, + sortBy: + typeof config.github.sortBy !== 'undefined' + ? config.github.sortBy + : 'stars', + limit: + typeof config.github.limit !== 'undefined' ? config.github.limit : 8, + exclude: { + forks: + typeof config.github.exclude !== 'undefined' && + typeof config.github.exclude.forks !== 'undefined' + ? config.github.exclude.forks + : false, + projects: + typeof config.github.exclude !== 'undefined' && + typeof config.github.exclude.projects !== 'undefined' + ? config.github.exclude.projects + : [], + }, + }, + social: { + linkedin: + typeof config.social !== 'undefined' && + typeof config.social.linkedin !== 'undefined' + ? config.social.linkedin + : '', + twitter: + typeof config.social !== 'undefined' && + typeof config.social.twitter !== 'undefined' + ? config.social.twitter + : '', + facebook: + typeof config.social !== 'undefined' && + typeof config.social.facebook !== 'undefined' + ? config.social.facebook + : '', + dribbble: + typeof config.social !== 'undefined' && + typeof config.social.dribbble !== 'undefined' + ? config.social.dribbble + : '', + behance: + typeof config.social !== 'undefined' && + typeof config.social.behance !== 'undefined' + ? config.social.behance + : '', + medium: + typeof config.social !== 'undefined' && + typeof config.social.medium !== 'undefined' + ? config.social.medium + : '', + devto: + typeof config.social !== 'undefined' && + typeof config.social.devto !== 'undefined' + ? config.social.devto + : '', + website: + typeof config.social !== 'undefined' && + typeof config.social.website !== 'undefined' + ? config.social.website + : '', + phone: + typeof config.social !== 'undefined' && + typeof config.social.phone !== 'undefined' + ? config.social.phone + : '', + email: + typeof config.social !== 'undefined' && + typeof config.social.email !== 'undefined' + ? config.social.email + : '', + }, + skills: typeof config.skills !== 'undefined' ? config.skills : [], + experiences: + typeof config.experiences !== 'undefined' ? config.experiences : [], + education: typeof config.education !== 'undefined' ? config.education : [], + blog: { + source: + typeof config.blog !== 'undefined' && + typeof config.blog.source !== 'undefined' + ? config.blog.source + : '', + username: + typeof config.blog !== 'undefined' && + typeof config.blog.username !== 'undefined' + ? config.blog.username + : '', + limit: + typeof config.blog !== 'undefined' && + typeof config.blog.limit !== 'undefined' + ? config.blog.limit + : 5, + }, + googleAnalytics: { + id: + typeof config.googleAnalytics !== 'undefined' && + typeof config.googleAnalytics.id !== 'undefined' + ? config.googleAnalytics.id + : '', + }, + hotjar: { + id: + typeof config.hotjar !== 'undefined' && + typeof config.hotjar.id !== 'undefined' + ? config.hotjar.id + : '', + snippetVersion: + typeof config.hotjar !== 'undefined' && + typeof config.hotjar.snippetVersion !== 'undefined' + ? config.hotjar.snippetVersion + : 6, + }, + themeConfig: { + defaultTheme: + typeof config.themeConfig !== 'undefined' && + typeof config.themeConfig.defaultTheme !== 'undefined' + ? config.themeConfig.defaultTheme + : themes[0], + disableSwitch: + typeof config.themeConfig !== 'undefined' && + typeof config.themeConfig.disableSwitch !== 'undefined' + ? config.themeConfig.disableSwitch + : false, + respectPrefersColorScheme: + typeof config.themeConfig !== 'undefined' && + typeof config.themeConfig.respectPrefersColorScheme !== 'undefined' + ? config.themeConfig.respectPrefersColorScheme + : false, + themes: themes, + customTheme: customTheme, + }, + }; +}; + +export const noConfigError = { + status: 500, + title: 'No Config is provided.', + subTitle: 'Pass the required config as prop.', +}; + +export const tooManyRequestError = (reset) => { + return { + status: 429, + title: 'Too Many Requests.', + subTitle: ( +

      + Oh no, you hit the{' '} + + rate limit. + + ! Try again later{` ${reset}`}. +

      + ), + }; +}; + +export const notFoundError = { + status: 404, + title: 'The Github Username is Incorrect.', + subTitle: ( +

      + Please provide correct github username in config. +

      + ), +}; + +export const genericError = { + status: 500, + title: 'Ops!!', + subTitle: 'Something went wrong.', +}; diff --git a/src/main.jsx b/src/main.jsx index d88f50c..c1f31c5 100644 --- a/src/main.jsx +++ b/src/main.jsx @@ -1,14 +1,10 @@ import React from 'react'; import ReactDOM from 'react-dom'; -import './index.css'; import App from './App'; -import { HelmetProvider } from 'react-helmet-async'; ReactDOM.render( - - - + , document.getElementById('root') ); diff --git a/tailwind.config.js b/tailwind.config.js index ad4b955..1761a5e 100644 --- a/tailwind.config.js +++ b/tailwind.config.js @@ -8,6 +8,9 @@ export default { plugins: [require('daisyui')], daisyui: { logs: false, - themes: [...config.themeConfig.themes, config.themeConfig.customTheme], + themes: [ + ...config.themeConfig.themes, + { procyon: config.themeConfig.customTheme }, + ], }, }; diff --git a/types/index.d.ts b/types/index.d.ts new file mode 100644 index 0000000..d53024f --- /dev/null +++ b/types/index.d.ts @@ -0,0 +1,265 @@ +// Type definitions for GitProfile +// Project https://github.com/arifszn/gitprofile +// Author: Ariful Alam + +import { Component } from 'react'; + +export interface Github { + /** + * GitHub org/user name + */ + username: string; + + /** + * stars | updated + */ + sortBy?: string; + + /** + * How many projects to display + */ + limit?: number; + + /** + * Exclude projects option + */ + exclude?: { + /** + * Forked projects will not be displayed if set to true + */ + forks?: boolean; + + /** + * These projects will not be displayed + * + * example: ['my-project1', 'my-project2'] + */ + projects?: Array; + }; +} + +export interface Social { + /** + * LinkedIn + */ + linkedin?: string; + + /** + * Twitter + */ + twitter?: string; + + /** + * Facebook + */ + facebook?: string; + + /** + * Dribbble + */ + dribbble?: string; + + /** + * Behance + */ + behance?: string; + + /** + * Medium + */ + medium?: string; + + /** + * dev.to + */ + devto?: string; + + /** + * Website + */ + website?: string; + + /** + * Phone + */ + phone?: string; + + /** + * Email + */ + email?: string; +} + +export interface Blog { + /** + * medium | dev.to + */ + source?: string; + + /** + * Username + */ + username?: string; + + /** + * How many posts to display + * + * Max is 10 + */ + limit?: number; +} + +export interface GoogleAnalytics { + /** + * GA3 tracking id/GA4 tag id UA-XXXXXXXXX-X | G-XXXXXXXXXX + */ + id?: string; +} + +export interface Hotjar { + /** + * Hotjar id + */ + id?: string; + + /** + * Snippet Version + */ + snippetVersion?: number; +} + +export interface CustomTheme { + /** + * Primary color + */ + primary?: string; + + /** + * Secondary color + */ + secondary?: string; + + /** + * Accent color + */ + accent?: string; + + /** + * Neutral color + */ + neutral?: string; + + /** + * Base color of page + */ + 'base-100'?: string; + + /** + * Border radius of rounded-box + */ + '--rounded-box'?: string; + + /** + * Border radius of rounded-btn + */ + '--rounded-btn'?: string; +} + +export interface ThemeConfig { + /** + * Default theme + */ + defaultTheme?: string; + + /** + * Hides the switch in the navbar + */ + disableSwitch?: boolean; + + /** + * Should use the prefers-color-scheme media-query + */ + respectPrefersColorScheme?: boolean; + + /** + * Available themes + */ + themes?: Array; + + /** + * Custom theme + */ + customTheme?: CustomTheme; +} + +export interface Experience { + company?: string; + position?: string; + from?: string; + to?: string; +} + +export interface Education { + institution?: string; + degree?: string; + from?: string; + to?: string; +} + +export interface Config { + /** + * GitHub Config + */ + github: Github; + + /** + * Social links + */ + social?: Social; + + /** + * Skill list + */ + skills?: Array; + + /** + * Experience list + */ + experiences?: Array; + + /** + * Education list + */ + education?: Array; + + /** + * Blog config + */ + blog?: Blog; + + /** + * Google Analytics config + */ + googleAnalytics?: GoogleAnalytics; + + /** + * Hotjar config + */ + hotjar?: Hotjar; + + /** + * Theme config + */ + themeConfig?: ThemeConfig; +} + +export interface GitProfileProps { + /** + * Config values + */ + config: Config; +} + +declare class GitProfile extends Component {} + +export default GitProfile; diff --git a/vite.config.js b/vite.config.js index ff568c7..0447019 100644 --- a/vite.config.js +++ b/vite.config.js @@ -1,6 +1,8 @@ import { defineConfig } from 'vite'; import react from '@vitejs/plugin-react'; -import postcss from './postcss.config.js'; +import tailwind from 'tailwindcss'; +import autoprefixer from 'autoprefixer'; +import tailwindConfig from './tailwind.config.js'; // https://vitejs.dev/config/ export default defineConfig({ @@ -9,6 +11,8 @@ export default defineConfig({ base: '/gitprofile/', plugins: [react()], css: { - postcss, + postcss: { + plugins: [tailwind(tailwindConfig), autoprefixer], + }, }, });