Skip to content

Commit

Permalink
issue #282: fix formatting, vscode extension suggestions & settings
Browse files Browse the repository at this point in the history
  • Loading branch information
k-allagbe committed Oct 22, 2024
1 parent 11ac540 commit d13bab6
Show file tree
Hide file tree
Showing 25 changed files with 368 additions and 374 deletions.
2 changes: 1 addition & 1 deletion .prettierignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
node_modules
.next
build
build
2 changes: 1 addition & 1 deletion .prettierrc
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@
"trailingComma": "all",
"printWidth": 80,
"endOfLine": "lf"
}
}
5 changes: 0 additions & 5 deletions .vscode/.gitignore

This file was deleted.

7 changes: 7 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"recommendations": [
"esbenp.prettier-vscode",
"davidanson.vscode-markdownlint",
"bierner.markdown-mermaid"
]
}
12 changes: 0 additions & 12 deletions .vscode/fertiscan-frontend.iml

This file was deleted.

6 changes: 0 additions & 6 deletions .vscode/inspectionProfiles/Project_Default.xml

This file was deleted.

12 changes: 0 additions & 12 deletions .vscode/material_theme_project_new.xml

This file was deleted.

8 changes: 0 additions & 8 deletions .vscode/modules.xml

This file was deleted.

13 changes: 13 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"[javascript]": {
"editor.formatOnSave": true,
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[typescript]": {
"editor.formatOnSave": true,
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"prettier.trailingComma": "all",
"javascript.updateImportsOnFileMove.enabled": "always",
"typescript.updateImportsOnFileMove.enabled": "always"
}
6 changes: 0 additions & 6 deletions .vscode/vcs.xml

This file was deleted.

2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
SOFTWARE.
18 changes: 8 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ This project is a **Next.js v14.2.15** application using **TypeScript**, **Mater
- [State Management](#state-management)
- [Contribution Guidelines](#contribution-guidelines)


## Getting Started

### Prerequisites
Expand All @@ -25,7 +24,7 @@ Make sure you have the following installed on your machine:
### Installation

1. Clone the repository:

`git clone https://github.com/your-username/your-repo.git`

2. Navigate to the project directory:
Expand All @@ -46,12 +45,11 @@ Make sure you have the following installed on your machine:

The application should now be running at [http://localhost:3000](http://localhost:3000).


## Folder Structure

This project follows a modular file structure based on Next.js v14's `src/app` directory layout. Here's an overview:

```
```bash
src/
├── app/
│ ├── some-page/
Expand All @@ -71,7 +69,6 @@ src/
└── useStore.ts # Zustand store for state management
```


## Running the Project

To start the development server:
Expand All @@ -88,7 +85,6 @@ To start the production build:

`npm run start`


## Testing

We use **Jest** and **React Testing Library** to test components and application logic.
Expand All @@ -101,7 +97,6 @@ npm run test

Tests are located in the `__tests__` directories adjacent to the components or pages they test.


## Theming

This project uses **Material UI** for theming. The theme is configured in the `src/app/theme.ts` file.
Expand Down Expand Up @@ -166,7 +161,7 @@ Example store setup:

```typescript
// src/store/useStore.ts
import create from 'zustand';
import create from "zustand";

interface StoreState {
counter: number;
Expand All @@ -181,7 +176,6 @@ const useStore = create<StoreState>((set) => ({
export default useStore;
```


## Contribution Guidelines

We encourage all contributors to follow the guidelines outlined in our [CONTRIBUTING.md](https://github.com/ai-cfia/.github/blob/main/profile/CONTRIBUTING.md) document.
Expand All @@ -190,38 +184,42 @@ We encourage all contributors to follow the guidelines outlined in our [CONTRIBU

1. Fork the repository by clicking on the 'Fork' button on the top-right of the repository page.
2. Clone the forked repository to your local machine:

```bash
git clone https://github.com/your-username/your-repo.git
```

### Working on an Issue

1. Always create a new branch for the feature or bugfix you're working on:
```bash
git checkout -b feature/your-feature-name
```
2. Make your changes, ensuring they adhere to the [CONTRIBUTING.md](https://github.com/ai-cfia/.github/blob/main/profile/CONTRIBUTING.md) guidelines.
3. Run the test suite to verify:
```bash
npm run test
```
4. Once your changes are complete, commit and push them to your fork:
```bash
git add .
git commit -m "Description of your feature/bugfix"
git push origin feature/your-feature-name
```
5. Open a Pull Request (PR) from your feature branch, providing a clear description of the changes.
### Code Style
- Follow the ESLint and Prettier configurations provided.
- Write unit tests for your code.
- Ensure the app runs without errors before submitting.
## License
This project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details.
26 changes: 13 additions & 13 deletions jest.config.ts
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
import type { Config } from 'jest'
import nextJest from 'next/jest.js'
import type { Config } from "jest";
import nextJest from "next/jest.js";

const createJestConfig = nextJest({
// Provide the path to your Next.js app to load next.config.js and .env files in your test environment
dir: './',
})
dir: "./",
});

// Add any custom config to be passed to Jest
const config: Config = {
coverageProvider: 'v8',
testEnvironment: 'jsdom',
coverageProvider: "v8",
testEnvironment: "jsdom",
// Add more setup options before each test is run
// setupFilesAfterEnv: ['<rootDir>/jest.setup.ts'],
moduleNameMapper: {
'^@/(.*)$': '<rootDir>/$1',
"^@/(.*)$": "<rootDir>/$1",
},
setupFilesAfterEnv: ['<rootDir>/jest.setup.ts']
}
setupFilesAfterEnv: ["<rootDir>/jest.setup.ts"],
};

// createJestConfig is exported this way to ensure that next/jest can load the Next.js config which is async
export default createJestConfig(config)
export default createJestConfig(config);
2 changes: 1 addition & 1 deletion jest.setup.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
import '@testing-library/jest-dom'
import "@testing-library/jest-dom";
45 changes: 0 additions & 45 deletions src/Components/Header.tsx

This file was deleted.

60 changes: 0 additions & 60 deletions src/Components/Sidenav.tsx

This file was deleted.

20 changes: 0 additions & 20 deletions src/Components/__tests__/Counters.test.tsx

This file was deleted.

Loading

0 comments on commit d13bab6

Please sign in to comment.