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

Migration/4 - Setup Project and updated the packages #5

Merged
merged 35 commits into from
Oct 10, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
b7ab6d5
refactor/4 - Refactored the package.json file and maintained files an…
anisha2lc Aug 29, 2023
afa044c
refactor/4 - Refactored the package.json file and maintained files an…
anisha2lc Aug 29, 2023
2f1cd13
refactor/4 - Refactored the package.json file and maintained files an…
anisha2lc Aug 29, 2023
fc5e891
migration/4 - Updated the packages and configured github and gitlab ci
anisha2lc Aug 31, 2023
1236319
migration/4 - Updated the packages and configured github and gitlab ci
anisha2lc Aug 31, 2023
af6959a
Dockerizing the cra-template
anisha2lc Sep 1, 2023
1f01927
dockerize/26 - added commands to run test files in docker
anisha2lc Sep 14, 2023
248f760
docker/25 - Dockerized the cra template
anisha2lc Sep 19, 2023
bc3a16f
dockerize/26 - Dockerized the react template
anisha2lc Sep 19, 2023
75035cd
dockerize/26 - Dockerized the react template
anisha2lc Sep 19, 2023
17b2331
Resolved PR comments
anisha2lc Sep 19, 2023
69967f9
dockerize/26 - Dokerize the react template
anisha2lc Sep 19, 2023
26b83cb
Removed unrequired codes
anisha2lc Sep 19, 2023
199e3aa
Removed unrequired codes
anisha2lc Sep 19, 2023
21e07f3
Removed unrequired codes
anisha2lc Sep 19, 2023
996b92f
dockerize/26 - Removed the unnecessary code
anisha2lc Sep 20, 2023
8e07f82
dockerize/26 - Removed the unnecessary code
anisha2lc Sep 20, 2023
b60d792
dockerize/26 - Removed the unnecessary code
anisha2lc Sep 20, 2023
1a11cfa
dockerize/26 - Removed the unnecessary code
anisha2lc Sep 20, 2023
a9a39f5
dockerize/26 - Removed the unnecessary code
anisha2lc Sep 20, 2023
913825e
dockerize/26 - Removed the unnecessary code
anisha2lc Sep 20, 2023
daeca22
dockerize/26 - Dockerized the CRA template
anisha2lc Sep 20, 2023
470d696
migration/4 - configured CI/CD, updated packages and initial project …
anisha2lc Sep 20, 2023
8d2146d
migration/4 - Resolved the PR comments
anisha2lc Sep 27, 2023
2f64932
migration/4 - Solved the merge conflicts
anisha2lc Sep 27, 2023
dd503de
migration/4 - Solved the merge conflicts
anisha2lc Sep 27, 2023
318a0e1
migration/4 - Solved the merge conflicts
anisha2lc Sep 27, 2023
b237b98
migration/4 - Solved the merge conflicts
anisha2lc Sep 27, 2023
6a71e16
migration/4 - run the github CI successfully
anisha2lc Sep 29, 2023
55a4d88
migration/4 - Added eslint as job in github CI
anisha2lc Oct 3, 2023
d61c247
migration/4 - Added eslint as job in github CI
anisha2lc Oct 3, 2023
4480af6
migration/4 - Added eslint as job in github CI
anisha2lc Oct 3, 2023
cc332b1
migration/4 - Added eslint as job in github CI
anisha2lc Oct 3, 2023
c962ff4
dockerize/26 - Resolved the Merge conflicts
anisha2lc Oct 9, 2023
d82fc3d
Merge pull request #4 from TruemarkDev/dockerize/26-cra-template
coolprobn Oct 10, 2023
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
File renamed without changes.
File renamed without changes.
File renamed without changes.
34 changes: 34 additions & 0 deletions .github/cra-template-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: E2E Tests

on:
pull_request:
types:
- opened
- synchronize

anisha02lc marked this conversation as resolved.
Show resolved Hide resolved
jobs:
unit_test:
image: node:18.4
stage: test
script:
- mkdir -p ~/bin/ && export PATH="~/bin/:$PATH"
- npm run jest:ci

e2e_tests:
runs-on: ubuntu-latest

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

- name: Setup Node.js
uses: actions/setup-node@v2
with:
node-version: 18.14.0

- name: Install Dependencies
run: npm install

- name: Run E2E Tests
run: npm run start:ci

62 changes: 62 additions & 0 deletions .github/workflows/cra-template-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
name: Tests

on:
pull_request:
types:
- opened
- synchronize

jobs:
eslint:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Set up Node.js
uses: actions/setup-node@v2
with:
node-version: 18.14

- name: Install dependencies
run: npm install

- name: Code Linting
run: npm run lint

unit_test:
runs-on: ubuntu-latest

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

- name: Set up Node.js
uses: actions/setup-node@v2
with:
node-version: 18.14

- name: Install dependencies
run: npm install

- name: Run unit tests
run: npm run jest:ci

e2e_tests:
runs-on: ubuntu-latest

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

- name: Set up Node.js
uses: actions/setup-node@v2
with:
node-version: 18.14

- name: Install Dependencies
run: npm install

- name: Run E2E Tests
run: npm run start:ci

2 changes: 1 addition & 1 deletion template/gitignore → .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,4 @@
npm-debug.log*
yarn-debug.log*
yarn-error.log*
.eslintcache
.eslintcache
30 changes: 30 additions & 0 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
stages:
- unit_test
- e2e_tests

variables:
NODE_VERSION: "18.14"

eslint:
stage: eslint
image: node:$NODE_VERSION
script:
- npm install
- npm run lint

unit_test:
stage: unit_test
image: node:$NODE_VERSION
script:
- npm install
- npm run jest:ci

e2e_tests:
stage: e2e_tests
image: node:$NODE_VERSION
script:
- npm install
- npm run start:ci

only:
- merge_requests
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
79 changes: 79 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
# Contributing to CRA Template Truemark

Thank you for your interest in contributing to our project! We appreciate your interest in contributing.

## How to Contribute
anisha02lc marked this conversation as resolved.
Show resolved Hide resolved

### Ways of contribution for External Contributors {#forExternalContributors}

- **Step 1**:
Fork the Template: On GitHub, click "Fork" to create your own copy.

- **Step 2**:
Create a issue first if you are adding fixes for the template.

- **Step 3**:
Clone the forked repository to your local machine.

```md
git clone https://github.com/TruemarkDev/cra-template-truemark.git for https.

git clone [email protected]:TruemarkDev/cra-template-truemark.git for ssh.
```

- **Step 4**:
Install dependencies using `npm install`.

- **Step 5**:
Start the project using `npm start`.

- **Step 6**:
Check out to a new branch.

- **Step 7**:
Make your changes and commit them.

- **Step 8**:
Push your changes to repository.

- **Step 9**:
Create a pull request with a clear title and description.

### Ways of Contribution for Truemark's Members

If you're a member of Truemark Technology, you can skip forking the project and proceed directly to step 3 of [Ways of contribution for External Contributors](#forExternalContributors)

## Working with git

- See the details on [guidelines to follow while working with git.](https://handbook.truemark.dev/docs/guidelines/git)

## Update documentation for the changes made if needed

If your changes affect the functionality of the library or introduce new features, please update the documentation to reflect these changes. This includes:

- Adding new library or updating the packages.
- Adding any new configuration options or usage instructions.

## Creating a Pull Merge

You need to create a PR properly. While creating a PR, you need to add the description of the tasks or features done. The PR must be marked as draft if all the task has not been completed and the remaining tasks needs to be mentioned in Remaining Tasks section as follows. Also, you can add the UI of the part of work done.

```md

Tasks Completed

// Completed tasks

Remaining Tasks

// Remaining tasks if any

Steps To Test Features

// Steps that needs to be followed to test the feature

Screenshots/Video

// Media to show the UI of the task you performed

```
25 changes: 25 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
ARG NODE_VERSION=18.14.0

FROM node:${NODE_VERSION}-alpine

# Set the working directory to /cra-template-truemark inside the container
WORKDIR /cra-template-truemark

# copy package.json file content
COPY package*.json ./

# Copy app files
COPY . .

# Install project dependencies
RUN npm install

# Create a batch script to run both npm start,cypress and unit tests
RUN echo "@echo off" > C:\start-and-test.bat \
&& echo "npm start" >> C:\start-and-test.bat \
&& echo "npx cypress run" >> C:\start-and-test.bat \
&& echo "npm test" >> C:\start-and-test.bat

# Run the shell script
CMD ["start-and-test"]

73 changes: 73 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
# Using cra-template-truemark

## How can we install cra-template-truemark? - Step by Step Guide

1. Clone using the following repo link

```md
git clone https://github.com/TruemarkDev/cra-template-truemark.git for https.

git clone [email protected]:TruemarkDev/cra-template-truemark.git for ssh.

```

2. Go to the project folder

```md
cd cra-template-truemark
```

## How can we run the project?

In the project directory, you can run:

```md
npm start
```

Runs the app in the development mode.
Open [http://localhost:3000](http://localhost:3000) to view it in your browser.

The page will reload when you make changes.
You may also see any lint errors in the console.

## Updating Remote Origin URL to that of the Project

When setting up your local development environment for your project, you need to follow these steps:

1. Navigate to your local project directory using the terminal.
2. Check the current remote URLs associated with your repository by running:

```
git remote -v

```
3. To update the remote origin URL, use the following command, replacing `<new_repo_url>` with the URL of the new project repository by using following command:

```
git remote set-url origin <new_repo_url>

```
4. Verify that the remote origin URL has been updated by running `git remote -v` again. It should now point to the new project repository.

## Dependencies

- **React:** ^18.2.0
- **Node.js:** 18.14.0
- **npm:** 9.8.1

## What are libraries and stack used within template?

- **React:** For building dynamic user interfaces.
- **Routing:** Utilize react-router-dom for navigation.
- **Localization:** i18next simplifies translations.
- **HTTP Requests:** axios for API interactions.
- **Styling:** Bootstrap ensures responsive designs.
- **Icons:** Integrate Font Awesome for customizable icons.
- **Testing:** @testing-library for unit testing and cypress for end-to-end testing.
- **Linting & Formatting:** eslint, Prettier, stylelint.
- **CSS Enhancement:** Leverage Sass for powerful styling.

## How can I contribute?

To find information on how to contribute to the project, you can usually refer to the CONTRIBUTING.md file in project's repository. This file provides guidelines and instructions for contributing to our project.
9 changes: 9 additions & 0 deletions cypress.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
const { defineConfig } = require("cypress");

module.exports = defineConfig({
e2e: {
setupNodeEvents() {
// implement node event listeners here
},
},
});
5 changes: 5 additions & 0 deletions cypress/e2e/spec.cy.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
describe('template spec', () => {
it("shows true as true", () => {
expect(true).to.equal(true);
});
})
5 changes: 5 additions & 0 deletions cypress/fixtures/example.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"name": "Using fixtures to represent data",
"email": "[email protected]",
"body": "Fixtures are a great way to mock data for responses to routes"
}
25 changes: 25 additions & 0 deletions cypress/support/commands.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
// ***********************************************
// This example commands.js shows you how to
// create various custom commands and overwrite
// existing commands.
//
// For more comprehensive examples of custom
// commands please read more here:
// https://on.cypress.io/custom-commands
// ***********************************************
//
//
// -- This is a parent command --
// Cypress.Commands.add('login', (email, password) => { ... })
//
//
// -- This is a child command --
// Cypress.Commands.add('drag', { prevSubject: 'element'}, (subject, options) => { ... })
//
//
// -- This is a dual command --
// Cypress.Commands.add('dismiss', { prevSubject: 'optional'}, (subject, options) => { ... })
//
//
// -- This will overwrite an existing command --
// Cypress.Commands.overwrite('visit', (originalFn, url, options) => { ... })
20 changes: 20 additions & 0 deletions cypress/support/e2e.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
// ***********************************************************
// This example support/e2e.js is processed and
// loaded automatically before your test files.
//
// This is a great place to put global configuration and
// behavior that modifies Cypress.
//
// You can change the location of this file or turn off
// automatically serving support files with the
// 'supportFile' configuration option.
//
// You can read more here:
// https://on.cypress.io/configuration
// ***********************************************************

// Import commands.js using ES2015 syntax:
import './commands'

// Alternatively you can use CommonJS syntax:
// require('./commands')
Loading