Skip to content

Commit

Permalink
Minor fixes and add Husky
Browse files Browse the repository at this point in the history
  • Loading branch information
fadihanna123 committed Jun 10, 2024
1 parent 770f1d2 commit e2c3f83
Show file tree
Hide file tree
Showing 16 changed files with 1,243 additions and 154 deletions.
18 changes: 9 additions & 9 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,17 @@ module.exports = {
root: true,
env: { browser: true, es2020: true },
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/recommended',
'plugin:react-hooks/recommended',
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
"plugin:react-hooks/recommended",
],
ignorePatterns: ['dist', '.eslintrc.cjs'],
parser: '@typescript-eslint/parser',
plugins: ['react-refresh'],
ignorePatterns: ["dist", ".eslintrc.cjs"],
parser: "@typescript-eslint/parser",
plugins: ["react-refresh"],
rules: {
'react-refresh/only-export-components': [
'warn',
"react-refresh/only-export-components": [
"warn",
{ allowConstantExport: true },
],
},
}
};
72 changes: 36 additions & 36 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@ name: "CodeQL"

on:
push:
branches: [ "master" ]
branches: ["master"]
pull_request:
branches: [ "master" ]
branches: ["master"]
schedule:
- cron: '25 23 * * 0'
- cron: "25 23 * * 0"

jobs:
analyze:
Expand All @@ -44,8 +44,8 @@ jobs:
fail-fast: false
matrix:
include:
- language: javascript-typescript
build-mode: none
- language: javascript-typescript
build-mode: none
# CodeQL supports the following values keywords for 'language': 'c-cpp', 'csharp', 'go', 'java-kotlin', 'javascript-typescript', 'python', 'ruby', 'swift'
# Use `c-cpp` to analyze code written in C, C++ or both
# Use 'java-kotlin' to analyze code written in Java, Kotlin or both
Expand All @@ -55,38 +55,38 @@ jobs:
# If you are analyzing a compiled language, you can modify the 'build-mode' for that language to customize how
# your codebase is analyzed, see https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/codeql-code-scanning-for-compiled-languages
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Checkout repository
uses: actions/checkout@v4

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v3
with:
languages: ${{ matrix.language }}
build-mode: ${{ matrix.build-mode }}
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v3
with:
languages: ${{ matrix.language }}
build-mode: ${{ matrix.build-mode }}
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.

# For more details on CodeQL's query packs, refer to: https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
# queries: security-extended,security-and-quality
# For more details on CodeQL's query packs, refer to: https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
# queries: security-extended,security-and-quality

# If the analyze step fails for one of the languages you are analyzing with
# "We were unable to automatically build your code", modify the matrix above
# to set the build mode to "manual" for that language. Then modify this step
# to build your code.
# ℹ️ Command-line programs to run using the OS shell.
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
- if: matrix.build-mode == 'manual'
run: |
echo 'If you are using a "manual" build mode for one or more of the' \
'languages you are analyzing, replace this with the commands to build' \
'your code, for example:'
echo ' make bootstrap'
echo ' make release'
exit 1
# If the analyze step fails for one of the languages you are analyzing with
# "We were unable to automatically build your code", modify the matrix above
# to set the build mode to "manual" for that language. Then modify this step
# to build your code.
# ℹ️ Command-line programs to run using the OS shell.
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
- if: matrix.build-mode == 'manual'
run: |
echo 'If you are using a "manual" build mode for one or more of the' \
'languages you are analyzing, replace this with the commands to build' \
'your code, for example:'
echo ' make bootstrap'
echo ' make release'
exit 1
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v3
with:
category: "/language:${{matrix.language}}"
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v3
with:
category: "/language:${{matrix.language}}"
5 changes: 5 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
yarn --emoji --ignore-scripts
yarn lint
yarn format
rimraf node_modules
git add -A
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
FROM node:20.14.0-alpine3.20
WORKDIR /app
COPY package.json .
RUN npm i -g serve rimraf
RUN yarn
RUN npm i --ignore-scripts -g serve rimraf
RUN yarn --ignore-scripts
COPY . .
RUN yarn build
EXPOSE 3000
Expand Down
2 changes: 1 addition & 1 deletion index.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!DOCTYPE html>
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
Expand Down
11 changes: 9 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,13 @@
"scripts": {
"dev": "vite",
"prebuild": "rimraf dist",
"format": "prettier . -w",
"setup": "yarn --emoji --ignore-scripts",
"clear": "rimraf node_modules dist",
"build": "tsc && vite build",
"lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0",
"preview": "vite preview"
"preview": "vite preview",
"prepare": "husky"
},
"dependencies": {
"fs": "^0.0.1-security",
Expand All @@ -22,10 +26,13 @@
"@typescript-eslint/eslint-plugin": "^7.11.0",
"@typescript-eslint/parser": "^7.11.0",
"@vitejs/plugin-react": "^4.3.0",
"eslint": "^9.3.0",
"eslint": "8.56.0",
"eslint-plugin-react": "^7.34.2",
"eslint-plugin-react-hooks": "^4.6.2",
"eslint-plugin-react-refresh": "^0.4.7",
"husky": "^9.0.11",
"typescript": "^5.4.5",
"typescript-eslint": "^7.12.0",
"vite": "^5.2.12"
}
}
7 changes: 5 additions & 2 deletions src/App.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
import './styles/App.css';
import { Layout } from './app/';
import React from "react";

// Components
import "./styles/App.css";
import { Layout } from "./app/";

const App: React.FC = () => <Layout />;

Expand Down
20 changes: 11 additions & 9 deletions src/app/Layout.tsx
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
import { ExperienceSection } from '../components';
import EducationSection from '../components/EducationSection';
import PersonCardSection from '../components/PersonCardSection';
import {
ExperienceSection,
EducationSection,
PersonCardSection,
} from "../components";

const Layout: React.FC = () => (
<div className='container'>
<div className='containerRow'>
<div className='containerCol'>
<div className="container">
<div className="containerRow">
<div className="containerCol">
<PersonCardSection />
</div>
<div className='containerCol'>
<div className='secondContainerCol'>
<div className='expeeduRow'>
<div className="containerCol">
<div className="secondContainerCol">
<div className="expeeduRow">
<ExperienceSection />
<EducationSection />
</div>
Expand Down
8 changes: 4 additions & 4 deletions src/components/EducationSection.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { eduData } from '../consts';
import TxtSection from './TxtSection';
import { eduData } from "../consts";
import TxtSection from "./TxtSection";

const EducationSection: React.FC = () => {
return (
<div className='eduCol'>
<h1 className='heading'>Education</h1>
<div className="eduCol">
<h1 className="heading">Education</h1>

{eduData.map((expe) => {
return (
Expand Down
8 changes: 4 additions & 4 deletions src/components/ExperienceSection.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { expeData } from '../consts';
import TxtSection from './TxtSection';
import { expeData } from "../consts";
import TxtSection from "./TxtSection";

const ExperienceSection: React.FC = () => {
return (
<div className='expeCol'>
<h1 className='heading'>Experience</h1>
<div className="expeCol">
<h1 className="heading">Experience</h1>

{expeData.map((expe) => {
return (
Expand Down
14 changes: 7 additions & 7 deletions src/components/PersonCardSection.tsx
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
const PersonCardSection: React.FC = () => {
const IMAGES = {
myProfilePic: new URL('../assets/myProfilePic.JPG', import.meta.url).href,
myProfilePic: new URL("../assets/myProfilePic.JPG", import.meta.url).href,
};

return (
<div className='firstContainerCol'>
<div className="firstContainerCol">
<img
className='myProfilePic'
className="myProfilePic"
src={IMAGES.myProfilePic}
alt='myProfilePic'
alt="myProfilePic"
/>
<br />
<div className='firstColTxt'>
<h1 className='myName heading'>Fadi Hanna</h1>
<div className="firstColTxt">
<h1 className="myName heading">Fadi Hanna</h1>
<h4> Frontend developer </h4>
<br />
Skills:
<section className='skillSec'> HTML CSS JAVASCRIPT </section>
<section className="skillSec"> HTML CSS JAVASCRIPT </section>
</div>
</div>
);
Expand Down
8 changes: 4 additions & 4 deletions src/components/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export { default as TxtSection } from './TxtSection';
export { default as ExperienceSection } from './ExperienceSection';
export { default as PersonCardSection } from './PersonCardSection';
export { default as EducationSection } from './EducationSection';
export { default as TxtSection } from "./TxtSection";
export { default as ExperienceSection } from "./ExperienceSection";
export { default as PersonCardSection } from "./PersonCardSection";
export { default as EducationSection } from "./EducationSection";
4 changes: 3 additions & 1 deletion src/main.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
import React from "react";
import ReactDOM from "react-dom/client";

// Components
import App from "./App.tsx";
import "./styles/index.css";

ReactDOM.createRoot(document.getElementById("root")!).render(
<React.StrictMode>
<App />
</React.StrictMode>
</React.StrictMode>,
);
10 changes: 8 additions & 2 deletions src/styles/App.css
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,14 @@

to {
color: gray;
text-shadow: 0 0 20px #00fff2, 0 0 30px #00fff2, 0 0 40px #00fff2,
0 0 50px #00fff2, 0 0 60px #00fff2, 0 0 70px #00fff2, 0 0 80px #00fff2,
text-shadow:
0 0 20px #00fff2,
0 0 30px #00fff2,
0 0 40px #00fff2,
0 0 50px #00fff2,
0 0 60px #00fff2,
0 0 70px #00fff2,
0 0 80px #00fff2,
0 1 90px #00fff2;
}
}
Expand Down
5 changes: 2 additions & 3 deletions vite.config.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { defineConfig } from 'vite';
import react from '@vitejs/plugin-react';
import fs from 'fs';
import { defineConfig } from "vite";
import react from "@vitejs/plugin-react";

/** @type {import('vite').UserConfig} */
export default defineConfig({
Expand Down
Loading

0 comments on commit e2c3f83

Please sign in to comment.