Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Initial repo setup #2

Merged
merged 30 commits into from
Nov 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
8451904
add: Initial repo setup
MehulKChaudhari Nov 4, 2024
4a0a9ad
add: testing and eslint
MehulKChaudhari Nov 4, 2024
c39607f
add: workflow file
MehulKChaudhari Nov 4, 2024
a5bdfa8
fix: title of site
MehulKChaudhari Nov 4, 2024
839be08
fix: eslint config
MehulKChaudhari Nov 4, 2024
2d50efe
Update README.md
MehulKChaudhari Nov 4, 2024
733ebb8
Update README.md
MehulKChaudhari Nov 4, 2024
b8affa6
Fix: title
MehulKChaudhari Nov 4, 2024
841e091
fix: eslint
MehulKChaudhari Nov 4, 2024
b14340b
fix: CI
MehulKChaudhari Nov 4, 2024
63d001f
chore: remove frozen file flag
MehulKChaudhari Nov 4, 2024
5e6df34
fix: lint errors
MehulKChaudhari Nov 4, 2024
78c9cd0
add: volta
MehulKChaudhari Nov 4, 2024
32e9f3d
update: pnpm-lock.yaml
MehulKChaudhari Nov 4, 2024
caf2b9c
fix: pnpm version in CI
MehulKChaudhari Nov 4, 2024
b703e06
fix: formatting
MehulKChaudhari Nov 4, 2024
62151cc
chore: remove unneccesary step
MehulKChaudhari Nov 4, 2024
1183a6d
fix: format
MehulKChaudhari Nov 4, 2024
8db393a
fix: CI file
MehulKChaudhari Nov 4, 2024
a7b1cc7
Merge branch 'setup/react-ts-vite' into add-test-setup
MehulKChaudhari Nov 5, 2024
8f13fcf
fix: eslint config
MehulKChaudhari Nov 4, 2024
bd6e583
Update README.md
MehulKChaudhari Nov 4, 2024
c8c39c2
fix: title of site
MehulKChaudhari Nov 4, 2024
8e47eec
fix: lint
MehulKChaudhari Nov 5, 2024
1af6f68
Merge branch 'add-test-setup' into add-Workflow-to-run-tests-eslint-c…
MehulKChaudhari Nov 5, 2024
5ef3a12
Merge branch 'add-Workflow-to-run-tests-eslint-check' into add--volta
MehulKChaudhari Nov 5, 2024
5d3083a
Fix: title
MehulKChaudhari Nov 5, 2024
3aaf58d
Merge pull request #5 from Real-Dev-Squad/add--volta
prakashchoudhary07 Nov 6, 2024
f0cd89a
Merge pull request #4 from Real-Dev-Squad/add-Workflow-to-run-tests-e…
prakashchoudhary07 Nov 6, 2024
200948f
Merge pull request #3 from Real-Dev-Squad/add-test-setup
prakashchoudhary07 Nov 6, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 43 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: CI
Copy link
Contributor

Choose a reason for hiding this comment

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

Please add a time out


on:
push:
branches:
- main
- develop
pull_request:
branches:
- main
- develop

jobs:
lint_test:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Install pnpm
uses: pnpm/action-setup@v2
with:
version: 8

- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: 18
Copy link
Contributor

Choose a reason for hiding this comment

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

Please use latest node version

cache: pnpm

- name: Install dependencies
run: pnpm install --frozen-lockfile

- name: Run ESLint
run: pnpm lint

- name: Check code format
run: pnpm format

- name: Run tests
run: pnpm test
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?
9 changes: 9 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"semi": true,
"singleQuote": true,
"tabWidth": 2,
"trailingComma": "all",
"printWidth": 80,
"bracketSpacing": true,
"jsxBracketSameLine": false
}
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
# website-template

A template to create all public facing sites
81 changes: 81 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
import js from '@eslint/js';
import globals from 'globals';
import reactHooks from 'eslint-plugin-react-hooks';
import reactRefresh from 'eslint-plugin-react-refresh';
import tseslint from 'typescript-eslint';
import react from 'eslint-plugin-react';
import prettier from 'eslint-plugin-prettier';
import importPlugin from 'eslint-plugin-import';
import jsxA11y from 'eslint-plugin-jsx-a11y';

export default tseslint.config(
{
ignores: ['dist/**'],
},
js.configs.recommended,
{
files: ['**/*.{ts,tsx}'],
languageOptions: {
ecmaVersion: 2020,
sourceType: 'module',
globals: {
...globals.browser,
...globals.jest,
},
parserOptions: {
ecmaFeatures: {
jsx: true,
},
},
parser: tseslint.parser,
},
plugins: {
react: react,
'react-hooks': reactHooks,
'react-refresh': reactRefresh,
prettier: prettier,
'@typescript-eslint': tseslint.plugin,
import: importPlugin,
'jsx-a11y': jsxA11y,
},
rules: {
'no-use-before-define': 'off',
'no-shadow': 'off',
'no-unused-vars': 'off',
'no-underscore-dangle': 'off',
'import/extensions': 'off',
'import/no-extraneous-dependencies': ['error', { devDependencies: true }],
'import/prefer-default-export': 'off',
'import/no-unresolved': 'off',
'react/jsx-filename-extension': ['warn', { extensions: ['.tsx'] }],
'react/function-component-definition': [
'error',
{ namedComponents: 'arrow-function' },
],
'react/require-default-props': 'off',
'react/jsx-props-no-spreading': 'off',
'react/react-in-jsx-scope': 'off',
'@typescript-eslint/no-use-before-define': ['error'],
'@typescript-eslint/no-shadow': ['error'],
'@typescript-eslint/no-unused-vars': ['error'],
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/explicit-function-return-type': 'off',
...reactHooks.configs.recommended.rules,
'react-refresh/only-export-components': [
'warn',
{ allowConstantExport: true },
],
'prettier/prettier': ['error'],
},
settings: {
react: {
version: 'detect',
},
'import/resolver': {
node: {
extensions: ['.ts', '.tsx'],
},
},
},
},
);
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="/rds-logo.ico" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Feature Flag | Real Dev Squad</title>
</head>
<body>
<div id="root"></div>
<script type="module" src="/src/main.tsx"></script>
</body>
</html>
52 changes: 52 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
{
"name": "feature-flag-frontend",
"private": true,
"version": "0.0.0",
"type": "module",
"scripts": {
"dev": "vite",
"build": "tsc -b && vite build",
"lint": "eslint .",
"lint:fix": "eslint . --fix",
"format": "prettier --check .",
"format:fix": "prettier --write .",
"preview": "vite preview",
"test": "vitest",
"test:watch": "vitest --watch"
Comment on lines +7 to +15
Copy link
Contributor

Choose a reason for hiding this comment

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

Please add coverage report command

},
"dependencies": {
"react": "^18.3.1",
"react-dom": "^18.3.1"
},
"devDependencies": {
"@eslint/js": "^9.14.0",
"@testing-library/jest-dom": "^6.6.3",
"@testing-library/react": "^16.0.1",
"@types/react": "^18.3.12",
"@types/react-dom": "^18.3.1",
"@typescript-eslint/eslint-plugin": "^8.13.0",
"@typescript-eslint/parser": "^8.13.0",
"@vitejs/plugin-react": "^4.3.3",
"eslint": "^8.57.1",
"eslint-config-airbnb": "^19.0.4",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-import": "^2.31.0",
"eslint-plugin-jest": "^28.8.3",
"eslint-plugin-jsx-a11y": "^6.10.2",
"eslint-plugin-prettier": "^5.2.1",
"eslint-plugin-react": "^7.37.2",
"eslint-plugin-react-hooks": "^4.6.2",
"eslint-plugin-react-refresh": "^0.4.14",
"globals": "^15.11.0",
"jsdom": "^25.0.1",
"prettier": "^3.3.3",
"typescript": "~5.6.2",
"typescript-eslint": "^8.11.0",
"vite": "^5.4.10",
"vitest": "^2.1.4"
},
"volta": {
"node": "20.0.0",
"pnpm": "8.0.0"
}
}
Loading
Loading