Skip to content

Commit

Permalink
Initialize develop
Browse files Browse the repository at this point in the history
  • Loading branch information
YDrogen authored Jan 14, 2025
0 parents commit e4909b4
Show file tree
Hide file tree
Showing 20 changed files with 4,338 additions and 0 deletions.
45 changes: 45 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
{
"env": {
"browser": true,
"es2021": true
},
"extends": ["eslint:recommended", "plugin:react/recommended", "plugin:react-hooks/recommended"],
"overrides": [
{
"env": {
"node": true
},
"files": [".eslintrc.{js,cjs}"],
"parserOptions": {
"sourceType": "script"
}
},
{
"files": ["**/*.js?(x)"],
"parserOptions": {
"ecmaFeatures": {
"jsx": true
}
},
"rules": {
"no-unused-vars": "warn",
"no-console": "warn",
"react/prop-types": "off",
"react/jsx-uses-react": "off",
"react/react-in-jsx-scope": "off"
}
}
],
"parserOptions": {
"ecmaVersion": "latest",
"sourceType": "module"
},
"ignorePatterns": ["node_modules/", "dist/"],
"plugins": ["react"],
"rules": {},
"settings": {
"react": {
"version": "detect"
}
}
}
59 changes: 59 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
# Simple workflow for deploying static content to GitHub Pages
name: Deploy static content to Pages

on:
# Runs on pushes targeting the default branch
push:
branches: ['main']

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

# Sets the GITHUB_TOKEN permissions to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write

# Allow one concurrent deployment
concurrency:
group: 'pages'
cancel-in-progress: true

jobs:
# Single deploy job since we're just deploying
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}

runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v3

- name: Set up Node
uses: actions/setup-node@v3
with:
node-version: 18
cache: 'npm'

- name: Install dependencies
run: npm ci

- name: Build
run: npm run build

- name: Setup Pages
uses: actions/configure-pages@v3

- name: Upload artifact
uses: actions/upload-pages-artifact@v1
with:
# Upload dist repository
path: './dist'

- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v1
41 changes: 41 additions & 0 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# Simple workflow for deploying static content to GitHub Pages
name: Check formatting

on:
# Runs on pushes targeting the default branch
pull_request:
branches: ['develop']

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

# Sets the GITHUB_TOKEN permissions to allow deployment to GitHub Pages
permissions:
contents: read

jobs:
# Single deploy job since we're just deploying
check-pr:
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v3

- name: Set up Node
uses: actions/setup-node@v3
with:
node-version: 18
cache: 'npm'

- name: Install dependencies
run: npm ci

- name: Check linting
run: npm run lint:check

- name: Check formating
run: npm run format:check

- name: Build
run: npm run build
24 changes: 24 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*

node_modules
dist
dist-ssr
*.local

# Editor directories and files
.vscode/*
!.vscode/extensions.json
.idea
.DS_Store
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?
5 changes: 5 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

npm run lint:check
npm run format:check
5 changes: 5 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Ignore artifacts:
build
coverage
dist
node_modules
8 changes: 8 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"recommendations": [
"esbenp.prettier-vscode",
"naumovs.color-highlight",
"usernamehw.errorlens",
"dbaeumer.vscode-eslint"
]
}
23 changes: 23 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Have fun!

## get started!

1. In the file `vite.config.prod.js`, change the `base` parameter to be the name of your repository, **ending with a `/`**
2. You will have to run `prettier` before being able to commit. Use `npm run format`!

## to create a new feature

1. from `dev` | create a new branch `feature/name-of-the-feature` eg. `feature/main-navbar`
2. open a PR `feature/name-of-the-feature` -> `dev`

## to deploy in production

1. from `dev` | create a new branch `release/version-number` eg. `release/v0.1.0`
2. open a PR `release/version-number` -> `main`
3. open a PR `release/version-number` -> `dev`

## to fix a bug in production

1. from `main` | create a new branch `hotfix/name-of-the-bug` eg. `hotfix/broken-navigation`
2. open a PR `hotfix/name-of-the-bug` -> `main`
3. open a PR `hotfix/name-of-the-bug` -> `dev`
13 changes: 13 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Projet Frontend 2023 Orléans CDA</title>
</head>
<body>
<div id="root"></div>
<script type="module" src="/src/main.jsx"></script>
</body>
</html>
Loading

0 comments on commit e4909b4

Please sign in to comment.