-
-
Notifications
You must be signed in to change notification settings - Fork 713
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
Enhance setup.js for Improved Docker Compatibility #2447
Changes from all commits
5821d59
1519682
81bbb3e
7d04c94
f8389f6
f54dcf2
b93aed6
a0ee511
235d163
66f4843
aef2485
0fa9fe5
88626b7
6fd1e01
e572cf4
cfdeff5
e188853
9a2b428
12e5474
17a12f7
a44ecdb
526a2cf
82836f0
a97314c
32eb6a9
ab509f6
fb913e1
d4fca6f
41bb9cf
7966dda
ec8ec5f
96d5e9a
ef08944
8236c9a
b09c696
c8c42a4
d16b95e
aa1cb05
5e38619
435c0bd
97bb5e6
0b47923
31b4bc5
c0884d1
9412b27
eac28f7
f1cd66a
15282bc
5830ec7
0ebafd5
c426e45
97dde86
f9d03de
6243659
4c539cb
39115fb
3192d45
5cd5a48
da0113c
de5cb43
2b4f3a0
3174ea4
7eb38f7
af8cd4a
594765d
cd99eb0
5c41622
f9b02a1
05dcfc8
bab3153
99bd739
c298068
a8ee09e
425b45f
dd635c4
f27ed9e
9316808
ae3dac5
1f9cacc
e863c6b
a859d25
418092e
65e2b3a
55a8e7c
3591428
c860961
5be01a6
ff4ea49
da04be8
557c203
780ae27
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"skipShellCheck": false, | ||
"skipCritical": false, | ||
"disableLineBreaks": false | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,3 @@ | ||
# Contains the PDF file of the Tag as JSON string, thus does not need to be linted | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
src/components/CheckIn/tagTemplate.ts | ||
package.json | ||
package-lock.json | ||
tsconfig.json |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -66,13 +66,7 @@ | |
"@typescript-eslint/array-type": "error", | ||
"@typescript-eslint/consistent-type-assertions": "error", | ||
"@typescript-eslint/consistent-type-imports": "error", | ||
"@typescript-eslint/explicit-function-return-type": [ | ||
2, | ||
{ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
"allowExpressions": true, | ||
"allowTypedFunctionExpressions": true | ||
} | ||
], | ||
"@typescript-eslint/explicit-function-return-type": "off", | ||
"camelcase": "off", | ||
"@typescript-eslint/naming-convention": [ | ||
"error", | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -46,7 +46,7 @@ jobs: | |
- name: Check formatting | ||
if: steps.changed-files.outputs.only_changed != 'true' | ||
run: npm run format:check | ||
|
||
- name: Run formatting if check fails | ||
if: failure() | ||
run: npm run format | ||
|
@@ -57,10 +57,10 @@ jobs: | |
|
||
- name: Check for linting errors in modified files | ||
if: steps.changed-files.outputs.only_changed != 'true' | ||
env: | ||
env: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
CHANGED_FILES: ${{ steps.changed-files.outputs.all_changed_files }} | ||
run: npx eslint ${CHANGED_FILES} && python .github/workflows/eslint_disable_check.py | ||
run: npx eslint "**/*.{js,jsx,ts,tsx}" --ignore-path .eslintignore | ||
|
||
- name: Check for TSDoc comments | ||
run: npm run check-tsdoc # Run the TSDoc check script | ||
|
||
|
@@ -89,7 +89,7 @@ jobs: | |
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
|
||
- name: Get Changed Unauthorized files | ||
id: changed-unauth-files | ||
uses: tj-actions/changed-files@v45 | ||
|
@@ -130,10 +130,10 @@ jobs: | |
*.password | ||
*.secret | ||
*.credentials | ||
|
||
- name: List all changed unauthorized files | ||
if: steps.changed-unauth-files.outputs.any_changed == 'true' || steps.changed-unauth-files.outputs.any_deleted == 'true' | ||
env: | ||
env: | ||
VanshikaSabharwal marked this conversation as resolved.
Show resolved
Hide resolved
|
||
CHANGED_UNAUTH_FILES: ${{ steps.changed-unauth-files.outputs.all_changed_files }} | ||
run: | | ||
for file in ${CHANGED_UNAUTH_FILES}; do | ||
|
@@ -154,14 +154,14 @@ jobs: | |
uses: tj-actions/changed-files@v45 | ||
|
||
- name: Echo number of changed files | ||
env: | ||
env: | ||
CHANGED_FILES_COUNT: ${{ steps.changed-files.outputs.all_changed_files_count }} | ||
run: | | ||
echo "Number of files changed: $CHANGED_FILES_COUNT" | ||
|
||
- name: Check if the number of changed files is less than 100 | ||
if: steps.changed-files.outputs.all_changed_files_count > 100 | ||
env: | ||
env: | ||
CHANGED_FILES_COUNT: ${{ steps.changed-files.outputs.all_changed_files_count }} | ||
run: | | ||
echo "Error: Too many files (greater than 100) changed in the pull request." | ||
|
@@ -201,11 +201,11 @@ jobs: | |
|
||
- name: Install Dependencies | ||
run: npm install | ||
|
||
- name: Get changed TypeScript files | ||
id: changed-files | ||
uses: tj-actions/changed-files@v45 | ||
|
||
- name: Run Jest Tests | ||
if: steps.changed-files.outputs.only_changed != 'true' | ||
env: | ||
|
@@ -227,8 +227,8 @@ jobs: | |
if ! npx lcov-result-merger 'coverage/*/lcov.info' > 'coverage/lcov.info'; then | ||
echo "Failed to merge coverage reports" | ||
exit 1 | ||
fi | ||
fi | ||
|
||
- name: TypeScript compilation for changed files | ||
run: | | ||
for file in ${{ steps.changed-files.outputs.all_files }}; do | ||
|
@@ -249,7 +249,7 @@ jobs: | |
- name: Test acceptable level of code coverage | ||
uses: VeryGoodOpenSource/very_good_coverage@v3 | ||
with: | ||
path: "./coverage/lcov.info" | ||
path: './coverage/lcov.info' | ||
min_coverage: 0.0 | ||
|
||
Graphql-Inspector: | ||
|
@@ -267,15 +267,15 @@ jobs: | |
|
||
- name: resolve dependency | ||
run: npm install -g @graphql-inspector/cli | ||
|
||
VanshikaSabharwal marked this conversation as resolved.
Show resolved
Hide resolved
|
||
- name: Clone API Repository | ||
run: | | ||
# Retrieve the complete branch name directly from the GitHub context | ||
FULL_BRANCH_NAME=${{ github.base_ref }} | ||
echo "FULL_Branch_NAME: $FULL_BRANCH_NAME" | ||
|
||
# Clone the specified repository using the extracted branch name | ||
git clone --branch $FULL_BRANCH_NAME https://github.com/PalisadoesFoundation/talawa-api && ls -a | ||
git clone --branch $FULL_BRANCH_NAME https://github.com/PalisadoesFoundation/talawa-api && ls -a | ||
|
||
- name: Validate Documents | ||
run: graphql-inspector validate './src/GraphQl/**/*.ts' './talawa-api/schema.graphql' | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,7 +25,7 @@ code style should not be changed and must be followed. | |
|
||
- Typescript | ||
|
||
- React.js | ||
- React.js | ||
|
||
- CSS module | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
|
@@ -43,7 +43,6 @@ code style should not be changed and must be followed. | |
|
||
- Should make use of React hooks where appropriate | ||
|
||
|
||
## Code Style and Naming Conventions | ||
|
||
- All React components *must* be written in PascalCase, with their file names, and associated CSS modules being written in PascalCase | ||
|
@@ -55,13 +54,15 @@ code style should not be changed and must be followed. | |
- Use of custom classes directly are refrained, use of modular css is encouraged along with bootstrap classes | ||
|
||
**Wrong way ❌** | ||
|
||
``` | ||
<div className="myCustomClass">...</div> | ||
<div className={`${styles.myCustomClass1} myCustomClass2`}>...</div> // No using personal custom classes directly, here you should not use myCustomClass2 | ||
.container{...} // No changing the property of already existing classes reserved by boostrap directly in css files | ||
``` | ||
|
||
**Correct ways ✅** | ||
**Correct ways ✅** | ||
|
||
``` | ||
<div className={styles.myCustomClass}>...</div> // Use custom class defined in modular css file | ||
<div className={`${styles.myCustomClass} relative bg-danger`}>...</div> // Use classes already defined in Bootstrap | ||
|
@@ -74,7 +75,8 @@ code style should not be changed and must be followed. | |
|
||
**Wrong way ❌** | ||
|
||
Using plain Bootstrap classes and attributes without leveraging the React-Bootstrap library should be refrained. While it may work for basic functionality, it doesn't fully integrate with React and may cause issues when dealing with more complex state management or component interactions. | ||
Using plain Bootstrap classes and attributes without leveraging the React-Bootstrap library should be refrained. While it may work for basic functionality, it doesn't fully integrate with React and may cause issues when dealing with more complex state management or component interactions. | ||
|
||
``` | ||
<div class="dropdown"> | ||
<button class="btn btn-secondary dropdown-toggle" type="button" data-bs-toggle="dropdown" aria-expanded="false"> | ||
|
@@ -87,11 +89,11 @@ Using plain Bootstrap classes and attributes without leveraging the React-Bootst | |
</ul> | ||
</div> | ||
``` | ||
|
||
|
||
**Correct way ✅** | ||
|
||
It's recommended to use the React-Bootstrap library for seamless integration of Bootstrap components in a React application. | ||
|
||
``` | ||
import Dropdown from 'react-bootstrap/Dropdown'; | ||
|
||
|
@@ -114,27 +116,27 @@ function BasicExample() { | |
export default BasicExample; | ||
``` | ||
|
||
## Test and Code Linting | ||
|
||
## Test and Code Linting | ||
|
||
Unit tests must be written for *all* code submissions to the repository, | ||
Unit tests must be written for *all* code submissions to the repository, | ||
the code submitted must also be linted ESLint and formatted with Prettier. | ||
|
||
## Folder/Directory Structure | ||
|
||
### Sub Directories of `src` | ||
|
||
`assets` - This houses all of the static assets used in the project | ||
- `css` - This houses all of the css files used in the project | ||
- `images` - This houses all of the images used in the project | ||
- `scss` - This houses all of the scss files used in the project | ||
- `components -` All Sass files for components | ||
- `content -` All Sass files for content | ||
- `forms -` All Sass files for forms | ||
- `_talawa.scss` - Partial Sass file for Talawa | ||
- `_utilities.scss` - Partial Sass file for utilities | ||
- `_variables.scss` - Partial Sass file for variables | ||
- `app.scss` - Main Sass file for the app, imports all other partial Sass files | ||
|
||
- `css` - This houses all of the css files used in the project | ||
- `images` - This houses all of the images used in the project | ||
- `scss` - This houses all of the scss files used in the project | ||
- `components -` All Sass files for components | ||
- `content -` All Sass files for content | ||
- `forms -` All Sass files for forms | ||
- `_talawa.scss` - Partial Sass file for Talawa | ||
- `_utilities.scss` - Partial Sass file for utilities | ||
- `_variables.scss` - Partial Sass file for variables | ||
- `app.scss` - Main Sass file for the app, imports all other partial Sass files | ||
|
||
`components` - The directory for base components that will be used in the various views/screens | ||
|
||
|
@@ -148,7 +150,6 @@ the code submitted must also be linted ESLint and formatted with Prettier. | |
|
||
`utils` - This holds the utility functions that do not fall into any of the other categories | ||
|
||
|
||
## Imports | ||
|
||
Absolute imports have been set up for the project, so imports may be done directly from `src`. | ||
|
@@ -161,10 +162,9 @@ import Navbar from 'components/Navbar/Navbar'; | |
|
||
Imports should be grouped in the following order: | ||
|
||
- React imports | ||
- Third party imports | ||
- Local imports | ||
|
||
- React imports | ||
- Third party imports | ||
- Local imports | ||
|
||
If there is more than one import from a single library, they should be grouped together | ||
|
||
|
@@ -213,7 +213,6 @@ Follow this [link](https://getbootstrap.com/docs/5.3/customize/sass/) to learn h | |
- **_table.scss** | ||
- **_typography.scss** | ||
|
||
|
||
- `src/assets/scss/forms/{'{partialFile}'}.scss` - where the {'{partialFile}'} are the following files | ||
- **_check-radios.scss** | ||
- **_floating-label.scss** | ||
|
@@ -245,9 +244,11 @@ To watch the Sass file for changes and compile it automatically, run the followi | |
``` | ||
npx sass src/assets/scss/app.scss src/assets/css/app.css --watch | ||
``` | ||
|
||
The `src/assets/css/app.css.map` file associates the generated CSS code with the original SCSS code. It allows you to see your SCSS code in the browser's developer tools for debugging. | ||
|
||
To skip generating the map file, run | ||
|
||
``` | ||
npx sass --no-source-map src/assets/scss/app.scss src/assets/css/app.css | ||
``` |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -125,24 +125,30 @@ The process of proposing a change to Talawa Admin can be summarized as: | |
1. _General Information_ | ||
1. The current code coverage of the repo is: [![codecov](https://codecov.io/gh/PalisadoesFoundation/talawa-admin/branch/develop/graph/badge.svg?token=II0R0RREES)](https://codecov.io/gh/PalisadoesFoundation/talawa-admin) | ||
2. You can determine the percentage test coverage of your code by running these two commands in sequence: | ||
|
||
``` | ||
npm install | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
npm run test --watchAll=false --coverage | ||
genhtml coverage/lcov.info -o coverage | ||
``` | ||
|
||
3. The output of the `npm run test` command will give you a tablular coverage report per file | ||
4. The overall coverage rate will be visible on the penultimate line of the `genhtml` command's output. | ||
5. The `genhtml` command is part of the Linux `lcov` package. Similar packages can be found for Windows and MacOS. | ||
6. The currently acceptable coverage rate can be found in the [GitHub Pull Request file](.github/workflows/pull-requests.yml). Search for the value below the line containing `min_coverage`. | ||
2. _Testing Individual Files_ | ||
1. You can test an individual file by running this command: | ||
|
||
``` | ||
npm run test --watchAll=false /path/to/test/file | ||
``` | ||
|
||
2. You can get the test coverage report for that file by running this command. The report will list all tests in the suite. Those tests that are not run will have zero values. You will need to look for the output line relevant to your test file. | ||
|
||
``` | ||
npm run test --watchAll=false --coverage /path/to/test/file | ||
``` | ||
|
||
3. _Creating your code coverage account_ | ||
|
||
1. You can also see your code coverage online for your fork of the repo. This is provided by `codecov.io` | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
# Documentation | ||
|
||
Welcome to our documentation guide. Here are some useful tips you need to know! | ||
|
||
# Table of Contents | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
|
@@ -15,18 +16,21 @@ Welcome to our documentation guide. Here are some useful tips you need to know! | |
|
||
Our documentation can be found in ONLY TWO PLACES: | ||
|
||
1. ***Inline within the repository's code files***: We have automated processes to extract this information and place it in our Talawa documentation site [docs.talawa.io](https://docs.talawa.io/). | ||
1. ***Inline within the repository's code files***: We have automated processes to extract this information and place it in our Talawa documentation site [docs.talawa.io](https://docs.talawa.io/). | ||
1. ***In our `talawa-docs` repository***: Our [Talawa-Docs](https://github.com/PalisadoesFoundation/talawa-docs) repository contains user edited markdown files that are automatically integrated into our Talawa documentation site [docs.talawa.io](https://docs.talawa.io/) using the [Docusaurus](https://docusaurus.io/) package. | ||
|
||
## How to use Docusaurus | ||
|
||
The process in easy: | ||
|
||
1. Install `talawa-docs` on your system | ||
1. Launch docusaurus on your system according to the `talawa-docs`documentation. | ||
- A local version of `docs.talawa.io` should automatically launched in your browser at http://localhost:3000/ | ||
1. Launch docusaurus on your system according to the `talawa-docs`documentation. | ||
- A local version of `docs.talawa.io` should automatically launched in your browser at <http://localhost:3000/> | ||
VanshikaSabharwal marked this conversation as resolved.
Show resolved
Hide resolved
|
||
1. Add/modify the markdown documents to the `docs/` directory of the `talawa-docs` repository | ||
1. If adding a file, then you will also need to edit the `sidebars.js` which is used to generate the [docs.talawa.io](https://docs.talawa.io/) menus. | ||
1. Always monitor the local website in your brower to make sure the changes are acceptable. | ||
1. Always monitor the local website in your brower to make sure the changes are acceptable. | ||
- You'll be able to see errors that you can use for troubleshooting in the CLI window you used to launch the local website. | ||
|
||
## Other information | ||
|
||
***PLEASE*** do not add markdown files in this repository. Add them to `talawa-docs`! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.