Skip to content

Commit

Permalink
Merge branch 'develop' of github.com:atlp-rwanda/e-commerce-ninjas-fe…
Browse files Browse the repository at this point in the history
… into ch-setup-ci-187584863
  • Loading branch information
AimePazzo committed Jul 1, 2024
2 parents d0ac765 + a0435a3 commit 7d74dbb
Show file tree
Hide file tree
Showing 11 changed files with 11,958 additions and 6,932 deletions.
17 changes: 6 additions & 11 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,43 +3,38 @@ version: 2.1
jobs:
test:
docker:
- image: cimg/base:current
- image: cimg/node:current
steps:
- setup_remote_docker:
version: docker24
- checkout
- run:
name: update-npm
name: Update npm
command: "sudo npm install -g npm@latest"
- run:
name: Install dependencies
command: npm install
- run:
name: Run tests
name: Run tests and generate coverage
command: |
mkdir -p test-results
npm test -- --watchAll=false --coverage --outputFile=test-results/jest.xml --json --useStderr
- run:
name: Run tests
command: npm test -- --watchAll=false --coverage

npm test -- --watchAll=false --coverage --outputFile=test-results/jest.xml --json --useStderr
- run:
name: Upload coverage to Code Climate
command: |
curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
chmod +x ./cc-test-reporter
./cc-test-reporter before-build
./cc-test-reporter format-coverage -t lcov -o coverage/codeclimate.json coverage/lcov.info
./cc-test-reporter upload-coverage
./cc-test-reporter after-build --exit-code $?
- store_test_results:
path: test-results

- store_artifacts:
path: coverage
destination: coverage

workflows:
test_workflow:
jobs:
- test
- test
1 change: 1 addition & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
"plugin:@typescript-eslint/recommended",
"plugin:storybook/recommended"
],
"ignorePatterns":["jest.config.ts"],
"rules": {
"react-hooks/rules-of-hooks": "error",
"react-hooks/exhaustive-deps": "warn",
Expand Down
41 changes: 21 additions & 20 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,23 +17,24 @@ jobs:
node-version: [20.x]

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

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}

- name: Install dependencies
run: npm install

- name: Run tests
run: |
npm test -- --watchAll=false --coverage
cat ./coverage/lcov.info | ./node_modules/.bin/coveralls
- name: Upload coverage to Coveralls
uses: coverallsapp/github-action@v2
env:
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}
- name: Checkout code
uses: actions/checkout@v3

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}

- name: Clear npm cache and reinstall dependencies
run: |
npm cache clean --force
npm install
- name: Run tests explicitly with npm run
run: |
npm run test --if-present -- --passWithNoTests
- name: Upload coverage to Coveralls
uses: coverallsapp/github-action@v2
env:
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}
47 changes: 41 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,22 @@
# e-commerce-ninjas-fe
# E-COMMERCE NINJAS WEB APPLICATION - FRONTEND

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.


## Hosted Application URL

[https://e-commerce-ninja-fn-staging.netlify.app/](https://e-commerce-ninja-fn-staging.netlify.app/)

## Github repository

[https://github.com/atlp-rwanda/e-commerce-ninjas-fe](https://github.com/atlp-rwanda/e-commerce-ninjas-fe/tree/develop)


[![Maintainability](https://api.codeclimate.com/v1/badges/a7dce016f123cdcc9042/maintainability)](https://codeclimate.com/github/atlp-rwanda/e-commerce-ninjas-fe/maintainability)
[![Test Coverage](https://api.codeclimate.com/v1/badges/a7dce016f123cdcc9042/test_coverage)](https://codeclimate.com/github/atlp-rwanda/e-commerce-ninjas-fe/test_coverage)
Front end repository for the teams' project
[![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)
[![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)
[![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)

## Completed features
- Setup empty react
Expand All @@ -21,10 +36,30 @@ Front end repository for the teams' project
```bash
npm run dev
```
## StoryBook

To run storybook for documentation, use this command

## StoryBook
To run storybook for documentation, use the command
```bash
npm run storybook
```sh
npm run storybook
```

## Folder Structure

- `public`: Contains static files like `index.html` and images.
- `src`: The main source folder for the React application.
- `components`: Reusable UI components.
- `pages`: Different pages/screens of the application.
- `store`: Redux store setup and slices.
- `stories`: StoryBook stories for UI components.
- `utils`: Utility functions and helpers.
- `.babelrc`: Babel configuration file.
- `.eslintrc`: ESLint configuration file.
- `.gitignore`: Specifies which files and directories to ignore in Git.
- `package-lock.json`: Automatically generated file that describes the exact tree of dependencies.
- `package.json`: Contains project metadata and dependencies.
- `README.md`: The readme file you are currently reading.
- `tsconfig.json`: TypeScript configuration file.
- `webpack.dev.config.ts`: Webpack configuration file for development.
- `webpack.prod.config.ts`: Webpack configuration file for production.
12 changes: 12 additions & 0 deletions jest.config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"preset": "ts-jest",
"testEnvironment": "jsdom",
"moduleFileExtensions": ["ts", "tsx", "js", "jsx", "json", "node"],
"testRegex": "(/__tests__/.*|(\\.|/)(test|spec))\\.(jsx?|tsx?)$",
"transform": {
"^.+\\.(ts|tsx)$": "ts-jest"
},
"moduleNameMapper": {
"\\.(css|less|scss|sass)$": "identity-obj-proxy"
}
}
Loading

0 comments on commit 7d74dbb

Please sign in to comment.