Skip to content

Commit a676e5a

Browse files
committed
Initialize Project
0 parents  commit a676e5a

22 files changed

+10804
-0
lines changed

.eslintrc.cjs

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
module.exports = {
2+
root: true,
3+
env: { browser: true, es2020: true },
4+
extends: [
5+
'eslint:recommended',
6+
'plugin:@typescript-eslint/recommended',
7+
'plugin:react-hooks/recommended',
8+
],
9+
ignorePatterns: ['dist', '.eslintrc.cjs'],
10+
parser: '@typescript-eslint/parser',
11+
plugins: ['react-refresh'],
12+
rules: {
13+
'react-refresh/only-export-components': [
14+
'warn',
15+
{ allowConstantExport: true },
16+
],
17+
},
18+
}

.github/workflows/main.yml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
# This is a basic workflow to help you get started with Actions
2+
name: CI-CD
3+
4+
# Controls when the action will run.
5+
on:
6+
# Triggers the workflow on push or pull request events but only for the main branch
7+
push:
8+
branches: [main]
9+
pull_request:
10+
branches: [main]
11+
# # Allows you to run this workflow manually from the Actions tab
12+
# workflow_dispatch:
13+
14+
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
15+
jobs:
16+
# This workflow contains multiple jobs
17+
build_test:
18+
# The type of runner that the job will run on
19+
runs-on: ubuntu-latest
20+
strategy:
21+
matrix:
22+
node-version: [14.x]
23+
24+
# Steps represent a sequence of tasks that will be executed as part of the job
25+
steps:
26+
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
27+
- uses: actions/checkout@v2
28+
29+
- name: setup node
30+
uses: actions/setup-node@master
31+
with:
32+
node-version: ${{ matrix.node-version }}
33+
34+
# install applicaion dependencies
35+
- name: Install dependencies
36+
run: |
37+
npm install
38+
# build and test the apps
39+
- name: build
40+
run: |
41+
npm run build
42+
npm test

.gitignore

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Logs
2+
logs
3+
*.log
4+
npm-debug.log*
5+
yarn-debug.log*
6+
yarn-error.log*
7+
pnpm-debug.log*
8+
lerna-debug.log*
9+
10+
node_modules
11+
dist
12+
dist-ssr
13+
*.local
14+
15+
# Editor directories and files
16+
.vscode/*
17+
!.vscode/extensions.json
18+
.idea
19+
.DS_Store
20+
*.suo
21+
*.ntvs*
22+
*.njsproj
23+
*.sln
24+
*.sw?

README.md

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
2+
# React-TypeScript Testing Library and Tailwind CSS Template
3+
4+
Unlike Create-React-App, Vite doesnt come by default with Testing Library, Jest setup with it . So, this repository can help you out in quickly getting started.
5+
6+
7+
## Features
8+
9+
- **[React](https://react.dev)**: A popular JavaScript library for building user interfaces.
10+
- **[Typescript](https://www.typescriptlang.org/)**: A typed superset of JavaScript that helps catch errors early and improve code quality.
11+
- **[Jest](https://jestjs.io/)**: A testing utility for writing unit and integration tests with a user-centric approach.
12+
- **[React-Testing-Library](https://testing-library.com/)**: A testing library for React for writing unit and integration tests with a user-centric approach.
13+
- **[Tailwind](https://tailwindcss.com/)**: A utility-first CSS framework for rapidly building custom designs.
14+
15+
## Getting Started
16+
Follow these steps to set up a new project based on this template:
17+
18+
1. Click the "Use this template" button on this repository to create a new repository using this template.
19+
20+
2. Clone your newly created repository to your local machine:
21+
22+
```bash
23+
git clone https://github.com/amitjimiwal/React-ts-jest-template.git
24+
```
25+
26+
3. Navigate to the project directory:
27+
28+
```bash
29+
cd your-project-name
30+
```
31+
32+
4. Install dependencies:
33+
34+
```bash
35+
npm install
36+
```
37+
38+
5. Start the development server:
39+
40+
```bash
41+
npm run dev
42+
```
43+
44+
6. Open your browser and visit `http://localhost:5173` to see your app in action.
45+
46+
## Contributing
47+
48+
Contributions to improve this template are welcome! If you find any issues or have suggestions for enhancements, feel free to open an issue or submit a pull request.
49+
50+
1. Fork the repository.
51+
52+
2. Create a new branch:
53+
54+
```bash
55+
git checkout -b feature/your-feature-name
56+
```
57+
58+
3. Make your changes and commit them:
59+
60+
```bash
61+
git commit -m "Add your changes"
62+
```
63+
64+
4. Push your changes to your forked repository:
65+
66+
```bash
67+
git push origin feature/your-feature-name
68+
```
69+
70+
5. Open a pull request against the `main` branch of this repository.
71+
72+
## License
73+
74+
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.

__tests__/Sampletest.test.tsx

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import {render} from '@testing-library/react';
2+
import React from 'react';
3+
import App from '../src/App';
4+
5+
test('jest running', () => {
6+
render(<App />);
7+
expect(true).toBe(true)
8+
});

babel.config.cjs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
// eslint-disable-next-line no-undef
2+
module.exports = {
3+
presets: [
4+
[
5+
"@babel/preset-env",
6+
{
7+
targets: {
8+
node: "current",
9+
},
10+
},
11+
],
12+
"@babel/preset-react",
13+
"@babel/preset-typescript",
14+
],
15+
};

index.html

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<!doctype html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8" />
5+
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
6+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
7+
<title>Vite + React + TS</title>
8+
</head>
9+
<body>
10+
<div id="root"></div>
11+
<script type="module" src="/src/main.tsx"></script>
12+
</body>
13+
</html>

jest-setup.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
import '@testing-library/jest-dom';

0 commit comments

Comments
 (0)