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

Talawa api typescript migration #780

Merged
merged 30 commits into from
Nov 9, 2022
Merged
Show file tree
Hide file tree
Changes from 28 commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
61818a1
Removed package easygraphql-tester (#747)
xoldd Aug 28, 2022
e50c869
Revert "Removed package easygraphql-tester (#747)" (#753)
palisadoes Aug 28, 2022
c77c90c
Bump moment-timezone from 0.5.34 to 0.5.37 (#757)
dependabot[bot] Sep 3, 2022
2353faa
Doubled the number of retries
palisadoes Sep 3, 2022
6140c4e
add mongodb credentials in github actions yml file
JamaicanFriedChicken Sep 7, 2022
0ba56b1
update github actions mongodb parameters
JamaicanFriedChicken Sep 7, 2022
886d6f5
update variable names in github actions
JamaicanFriedChicken Sep 7, 2022
120e739
update github actions push file
JamaicanFriedChicken Sep 7, 2022
04018df
revert github actions push file
JamaicanFriedChicken Sep 7, 2022
7e6b0a9
add start period for health check in github actions
JamaicanFriedChicken Sep 7, 2022
8537910
add extra health check parameters for mongo
JamaicanFriedChicken Sep 7, 2022
37619c6
adjust mongo image version
JamaicanFriedChicken Sep 7, 2022
254522f
explicitly add mongo version to image for github actions
JamaicanFriedChicken Sep 7, 2022
0ad7d01
Removed package easygraphql-tester (#754)
xoldd Sep 11, 2022
7d5babc
Code Coverage : Tests for groups.js Fix #585 (#769)
SiddheshKukade Sep 19, 2022
75083f1
Update CONTRIBUTING.md
palisadoes Sep 20, 2022
fe8aeed
Update CONTRIBUTING.md
palisadoes Sep 20, 2022
dc7c4f4
Bump jose from 2.0.5 to 2.0.6 (#770)
dependabot[bot] Sep 20, 2022
a407aa8
Bump file-type and image-hash (#752)
dependabot[bot] Sep 20, 2022
a392f82
Bump got and nodemon (#771)
dependabot[bot] Sep 20, 2022
5d004a8
Bump vm2 from 3.9.9 to 3.9.11 (#772)
dependabot[bot] Sep 28, 2022
01b2c8e
Feature Request : Performing Donations ( Ability to store donation t…
SiddheshKukade Oct 18, 2022
3b958de
Test for send_membership_request.js (#763)
nishant3721 Oct 23, 2022
7f12160
Talawa api multitenancy (#776)
ebrahim354 Nov 1, 2022
cecf46f
interchanged .env and .env.sample from the installation guide (#774)
kb-0311 Nov 1, 2022
1227bd4
Migrated develop branch to typescript including the changes till octo…
xoldd Nov 3, 2022
5c01bf9
Added some comments and reinstalled some packages to match the main r…
xoldd Nov 6, 2022
e4da374
Github actions update
xoldd Nov 6, 2022
778a399
getLanguage.spec.ts import fix
xoldd Nov 6, 2022
b16e4c7
forgotPassword.spec.ts fix
xoldd Nov 6, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 2 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
dist
node_modules
21 changes: 14 additions & 7 deletions .env.sample
Original file line number Diff line number Diff line change
@@ -1,22 +1,29 @@
# 👋 Welcome, we're glad you're setting up an installation of Talawa-api. Copy this
# 👋 Welcome, we're glad you're setting up an installation of Talawa-api. Copy this
# file to .env or set the variables in your local environment manually.


# Generate a unique random key, you can use `openssl rand -hex 32` in terminal

ACCESS_TOKEN_SECRET=


# Generate a unique random key, you can use `openssl rand -hex 32` in terminal

REFRESH_TOKEN_SECRET=

# if you are using DOCKER use this mongodb url
# mongodb://mongo:27017/talawa-api
# if you are using hosted mongodb, mongodb connection string will look like this
# mongodb+srv://<username>:<password>@<server_url>/<db_name>?retryWrites=true&w=majority
# for local instance use this connection string
# mongodb://localhost:27017/<db_name>?retryWrites=true&w=majority

# Please read about mongodb connection string here :- https://www.mongodb.com/docs/v5.2/reference/connection-string/

# This is the default mongodb connection string for the mongodb docker container that's created along with talawa-api docker container.
# Use this as the value for `MONGO_DB_URL` environment variables when you're using the docker approach.

# mongodb://talawa_mongodb:27017/talawa-api?retryWrites=true&w=majority


# This environment variable is used to provide the mongodb connection string to talawa-api.
MONGO_DB_URL=


# Get the google recaptcha secret key from google recaptcha admin or https://www.google.com/recaptcha/admin/create
# from here for reCAPTCHA v2 and "I'm not a robot" Checkbox, and paste the key here.
# Note: In domains, fill localhost
Expand Down
7 changes: 4 additions & 3 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
node_modules
.github
.vscode

old-api
build
coverage
node_modules
src/generated
32 changes: 0 additions & 32 deletions .eslintrc.js

This file was deleted.

64 changes: 64 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
{
"env": {
"es2022": true,
"node": true
},
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/eslint-recommended",
"plugin:prettier/recommended"
],
"overrides": [
{
"files": [
"*.ts"
],
"processor": "@graphql-eslint/graphql"
},
{
"files": [
"*.graphql"
],
"parser": "@graphql-eslint/eslint-plugin",
"plugins": [
"@graphql-eslint"
]
}
],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaVersion": "latest",
"sourceType": "module"
},
"plugins": [
"@typescript-eslint"
],
"root": true,
"rules": {
"eqeqeq": [
"error",
"always"
],
"linebreak-style": [
"error",
"unix"
],
"no-unused-vars": [
"error",
{
"argsIgnorePattern": "^_",
"caughtErrorsIgnorePattern": "^_",
"destructuredArrayIgnorePattern": "^_",
"varsIgnorePattern": "^_"
}
],
"quotes": [
"error",
"double",
{
"allowTemplateLiterals": true,
"avoidEscape": true
}
]
}
}
2 changes: 1 addition & 1 deletion .github/workflows/codeql-codescan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
strategy:
fail-fast: false
matrix:
language: [ 'javascript']
language: [ 'typescript']

steps:
- name: Checkout repository
Expand Down
94 changes: 44 additions & 50 deletions .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ jobs:
steps:
- uses: actions/checkout@v2
- name: Install Dependencies
run: yarn
run: npm ci
- name: Run ESLint and Prettier
run: yarn lint
run: npm run lint

Count-lines-of-code:
name: Total number of lines in every file should not be more than 400
Expand All @@ -33,37 +33,37 @@ jobs:
- uses: actions/checkout@v2
- run: chmod +x ./.github/workflows/countline.py
- run: |
./.github/workflows/countline.py --exclude_directories tests
./.github/workflows/countline.py --exclude_directories __tests__

Code-Formatter:
name: Formats the code
runs-on: ubuntu-latest
needs: Linter
steps:
- name: Checkout
uses: actions/checkout@v2
with:
# This is important to fetch the changes to the previous commit
fetch-depth: 0
- name: Prettify code
uses: creyD/prettier_action@v3.3
with:
same_commit: True
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Checkout
uses: actions/checkout@v2
with:
# This is important to fetch the changes to the previous commit
fetch-depth: 0
- name: Prettify code
uses: creyD/prettier_action@v3.3
with:
same_commit: True
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

JSDocs:
name : "JSDocs comments and pipeline"
runs-on : ubuntu-latest
name: 'JSDocs comments and pipeline'
runs-on: ubuntu-latest
needs: Code-Formatter
steps:
- uses: actions/checkout@v2
- name : "Check whether comments exists for JSDocs"
- name: 'Check whether comments exists for JSDocs'
run: |
chmod +x ./.github/workflows/check-jsdocs-comment.py
./.github/workflows/check-jsdocs-comment.py

- name : "Run JSDocs"
- name: 'Run JSDocs'
if: env.RUN_JSDOCS == 'True'
run: echo "Run JSdocs :${{ env.RUN_JSDOCS }}"

Expand All @@ -74,15 +74,14 @@ jobs:
strategy:
matrix:
node-version: [14.x]
mongodb-version: ['4.4']
services:
mongo:
image: mongo
image: mongo:4.4
options: >-
--health-cmd mongo
--health-interval 10s
--health-timeout 5s
--health-retries 5
--health-cmd mongo
--health-interval 10s
--health-timeout 5s
--health-retries 10
ports:
- 27017:27017
env:
Expand All @@ -91,35 +90,30 @@ jobs:
REFRESH_TOKEN_SECRET: 96d41e144e63475f7f753735b50305cd2857cc41c2f2570babdb948c10b77bc5

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

- name: Set up Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v2
- name: Checkout repository
uses: actions/checkout@v2

- name: Install dependencies
run: npm install
- name: Set up Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v2

- name: Start the Application
run: npm run start-test-server-in-action
- name: Install dependencies
run: npm ci

- name: Sleep for 10s
uses: juliangruber/sleep-action@v1
with:
time: 10s
- name: Sleep for 10s
uses: juliangruber/sleep-action@v1
with:
time: 10s

- name: Run the tests
run: npm run test
- name: Run the tests
run: npm run test

- name: Present current coverage in PR
uses: codecov/codecov-action@v2.1.0
with:
verbose: true
- name: Stop the Application
run: npm run stop-test-server-in-action
- name: Present current coverage in PR
uses: codecov/codecov-action@v2.1.0
with:
verbose: true

- name: Test acceptable level of code coverage
uses: VeryGoodOpenSource/very_good_coverage@v1.1.1
with:
path: "./coverage/lcov.info"
min_coverage: 46.5
- name: Test acceptable level of code coverage
uses: VeryGoodOpenSource/very_good_coverage@v1.1.1
with:
path: './coverage/lcov.info'
min_coverage: 46.5
Loading