Skip to content

Commit 7d74dbb

Browse files
author
AimePazzo
committed
Merge branch 'develop' of github.com:atlp-rwanda/e-commerce-ninjas-fe into ch-setup-ci-187584863
2 parents d0ac765 + a0435a3 commit 7d74dbb

11 files changed

+11958
-6932
lines changed

.circleci/config.yml

+6-11
Original file line numberDiff line numberDiff line change
@@ -3,43 +3,38 @@ version: 2.1
33
jobs:
44
test:
55
docker:
6-
- image: cimg/base:current
6+
- image: cimg/node:current
77
steps:
88
- setup_remote_docker:
99
version: docker24
1010
- checkout
1111
- run:
12-
name: update-npm
12+
name: Update npm
1313
command: "sudo npm install -g npm@latest"
1414
- run:
1515
name: Install dependencies
1616
command: npm install
1717
- run:
18-
name: Run tests
18+
name: Run tests and generate coverage
1919
command: |
2020
mkdir -p test-results
21-
npm test -- --watchAll=false --coverage --outputFile=test-results/jest.xml --json --useStderr
22-
23-
- run:
24-
name: Run tests
25-
command: npm test -- --watchAll=false --coverage
26-
21+
npm test -- --watchAll=false --coverage --outputFile=test-results/jest.xml --json --useStderr
2722
- run:
2823
name: Upload coverage to Code Climate
2924
command: |
3025
curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
3126
chmod +x ./cc-test-reporter
3227
./cc-test-reporter before-build
3328
./cc-test-reporter format-coverage -t lcov -o coverage/codeclimate.json coverage/lcov.info
29+
./cc-test-reporter upload-coverage
3430
./cc-test-reporter after-build --exit-code $?
3531
- store_test_results:
3632
path: test-results
37-
3833
- store_artifacts:
3934
path: coverage
4035
destination: coverage
4136

4237
workflows:
4338
test_workflow:
4439
jobs:
45-
- test
40+
- test

.eslintrc.json

+1
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
"plugin:@typescript-eslint/recommended",
1919
"plugin:storybook/recommended"
2020
],
21+
"ignorePatterns":["jest.config.ts"],
2122
"rules": {
2223
"react-hooks/rules-of-hooks": "error",
2324
"react-hooks/exhaustive-deps": "warn",

.github/workflows/ci.yml

+21-20
Original file line numberDiff line numberDiff line change
@@ -17,23 +17,24 @@ jobs:
1717
node-version: [20.x]
1818

1919
steps:
20-
- name: Checkout code
21-
uses: actions/checkout@v3
22-
23-
- name: Use Node.js ${{ matrix.node-version }}
24-
uses: actions/setup-node@v3
25-
with:
26-
node-version: ${{ matrix.node-version }}
27-
28-
- name: Install dependencies
29-
run: npm install
30-
31-
- name: Run tests
32-
run: |
33-
npm test -- --watchAll=false --coverage
34-
cat ./coverage/lcov.info | ./node_modules/.bin/coveralls
35-
36-
- name: Upload coverage to Coveralls
37-
uses: coverallsapp/github-action@v2
38-
env:
39-
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}
20+
- name: Checkout code
21+
uses: actions/checkout@v3
22+
23+
- name: Use Node.js ${{ matrix.node-version }}
24+
uses: actions/setup-node@v3
25+
with:
26+
node-version: ${{ matrix.node-version }}
27+
28+
- name: Clear npm cache and reinstall dependencies
29+
run: |
30+
npm cache clean --force
31+
npm install
32+
33+
- name: Run tests explicitly with npm run
34+
run: |
35+
npm run test --if-present -- --passWithNoTests
36+
37+
- name: Upload coverage to Coveralls
38+
uses: coverallsapp/github-action@v2
39+
env:
40+
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}

README.md

+41-6
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,22 @@
1-
# e-commerce-ninjas-fe
1+
# E-COMMERCE NINJAS WEB APPLICATION - FRONTEND
2+
3+
Our e-commerce web application server, developed by Team Ninjas, facilitates smooth online shopping with features like user authentication, product cataloging, and secure payments. It's built to enhance the user experience with high performance and reliability. Suitable for any online marketplace looking to grow.
4+
5+
6+
## Hosted Application URL
7+
8+
[https://e-commerce-ninja-fn-staging.netlify.app/](https://e-commerce-ninja-fn-staging.netlify.app/)
9+
10+
## Github repository
11+
12+
[https://github.com/atlp-rwanda/e-commerce-ninjas-fe](https://github.com/atlp-rwanda/e-commerce-ninjas-fe/tree/develop)
13+
14+
215
[![Maintainability](https://api.codeclimate.com/v1/badges/a7dce016f123cdcc9042/maintainability)](https://codeclimate.com/github/atlp-rwanda/e-commerce-ninjas-fe/maintainability)
316
[![Test Coverage](https://api.codeclimate.com/v1/badges/a7dce016f123cdcc9042/test_coverage)](https://codeclimate.com/github/atlp-rwanda/e-commerce-ninjas-fe/test_coverage)
4-
Front end repository for the teams' project
17+
[![Netlify Status](https://api.netlify.com/api/v1/badges/a3ed5a75-a862-4f3b-ba21-8369180cf3e6/deploy-status)](https://app.netlify.com/sites/e-commerce-ninja-fn-staging/deploys)
18+
[![Coverage Status](https://coveralls.io/repos/github/atlp-rwanda/e-commerce-ninjas-fe/badge.svg)](https://coveralls.io/github/atlp-rwanda/e-commerce-ninjas-fe)
19+
[![CircleCI](https://dl.circleci.com/status-badge/img/gh/atlp-rwanda/e-commerce-ninjas-fe/tree/develop.svg?style=svg)](https://dl.circleci.com/status-badge/redirect/gh/atlp-rwanda/e-commerce-ninjas-fe/tree/develop)
520

621
## Completed features
722
- Setup empty react
@@ -21,10 +36,30 @@ Front end repository for the teams' project
2136
```bash
2237
npm run dev
2338
```
39+
40+
## StoryBook
2441

42+
To run storybook for documentation, use this command
2543

26-
## StoryBook
27-
To run storybook for documentation, use the command
28-
```bash
29-
npm run storybook
44+
```sh
45+
npm run storybook
3046
```
47+
48+
## Folder Structure
49+
50+
- `public`: Contains static files like `index.html` and images.
51+
- `src`: The main source folder for the React application.
52+
- `components`: Reusable UI components.
53+
- `pages`: Different pages/screens of the application.
54+
- `store`: Redux store setup and slices.
55+
- `stories`: StoryBook stories for UI components.
56+
- `utils`: Utility functions and helpers.
57+
- `.babelrc`: Babel configuration file.
58+
- `.eslintrc`: ESLint configuration file.
59+
- `.gitignore`: Specifies which files and directories to ignore in Git.
60+
- `package-lock.json`: Automatically generated file that describes the exact tree of dependencies.
61+
- `package.json`: Contains project metadata and dependencies.
62+
- `README.md`: The readme file you are currently reading.
63+
- `tsconfig.json`: TypeScript configuration file.
64+
- `webpack.dev.config.ts`: Webpack configuration file for development.
65+
- `webpack.prod.config.ts`: Webpack configuration file for production.

jest.config.json

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"preset": "ts-jest",
3+
"testEnvironment": "jsdom",
4+
"moduleFileExtensions": ["ts", "tsx", "js", "jsx", "json", "node"],
5+
"testRegex": "(/__tests__/.*|(\\.|/)(test|spec))\\.(jsx?|tsx?)$",
6+
"transform": {
7+
"^.+\\.(ts|tsx)$": "ts-jest"
8+
},
9+
"moduleNameMapper": {
10+
"\\.(css|less|scss|sass)$": "identity-obj-proxy"
11+
}
12+
}

0 commit comments

Comments
 (0)