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

Updating deployment script + refactoring #327

Merged
merged 24 commits into from
Oct 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
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
185 changes: 51 additions & 134 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,137 +1,54 @@
{
"plugins": [
"import",
"react",
"@typescript-eslint",
"prettier",
"sonarjs",
"jsx-a11y"
],
"extends": ["plugin:@typescript-eslint/recommended", "prettier"],
"rules": {
"react/display-name": "error",
"react/no-unescaped-entities": "off",
"import/no-anonymous-default-export": "error",
"@typescript-eslint/no-unused-vars": "error",
"@typescript-eslint/ban-ts-comment": "off",
"@typescript-eslint/no-explicit-any": "error",
"@typescript-eslint/no-non-null-assertion": "off",
// add new line above comment
"no-duplicate-case": "error",
"jsx-a11y/interactive-supports-focus": [
"error",
{
"tabbable": [
"button",
"checkbox",
"link",
"searchbox",
"spinbutton",
"switch",
"textbox"
]
}
],
"jsx-a11y/role-has-required-aria-props": "warn",
"jsx-a11y/alt-text": [
2,
{
"elements": ["img"],
"img": ["Image"]
}
],
"jsx-a11y/no-static-element-interactions": [
"error",
{
"handlers": [
"onClick",
"onMouseDown",
"onMouseUp",
"onKeyPress",
"onKeyDown",
"onKeyUp"
],
"allowExpressionValues": true
}
],
"jsx-a11y/control-has-associated-label": [ 1, {
"labelAttributes": ["label"],
"controlComponents": ["CustomButton"],
"ignoreElements": [
"audio",
"canvas",
"embed",
"input",
"textarea",
"tr",
"video"
],
"ignoreRoles": [
"grid",
"listbox",
"menu",
"menubar",
"radiogroup",
"row",
"tablist",
"toolbar",
"tree",
"treegrid"
],
"depth": 3
}],
"lines-around-comment": [
"error",
{
"beforeLineComment": true,
"beforeBlockComment": true,
"allowBlockStart": true,
"allowClassStart": true,
"allowObjectStart": true,
"allowArrayStart": true
}
],
// add new line above return
"newline-before-return": "error",
// add new line below import
"import/newline-after-import": [
"error",
{
"count": 1
}
],
"@typescript-eslint/ban-types": [
"error",
{
"extendDefaults": true,
"types": {
"{}": false
}
}
],
"no-console": ["error", { "allow": ["warn", "error", "info"] }],
"indent": ["error", "tab"],
// SonarJS rules
"sonarjs/no-identical-expressions": "error",
"no-useless-catch": "error"
},
"settings": {
"import/parsers": {
"@typescript-eslint/parser": [".ts", ".tsx"]
"plugins": ["import", "react", "@typescript-eslint", "prettier", "jsx-a11y"],
"extends": ["plugin:@typescript-eslint/recommended", "prettier", "plugin:jsx-a11y/recommended"],
"rules": {
"react/display-name": "error",
"react/no-unescaped-entities": "off",
"import/no-anonymous-default-export": "error",
"@typescript-eslint/no-unused-vars": "error",
"@typescript-eslint/ban-ts-comment": "off",
"@typescript-eslint/no-explicit-any": "error",
"@typescript-eslint/no-non-null-assertion": "off",
"no-duplicate-case": "error",
"newline-before-return": "error",
"import/newline-after-import": [
"error",
{
"count": 1
}
],
"@typescript-eslint/ban-types": [
"error",
{
"extendDefaults": true,
"types": {
"{}": false
}
}
],
"no-console": ["error", { "allow": ["warn", "error", "info"] }],
"indent": ["error", "tab"]
},
"settings": {
"react": {
"version": "18.x"
},
"import/resolver": {
"typescript": {
"alwaysTryTypes": true,
"project": ["./tsconfig.json"]
}
}
},
"overrides": [
{
"files": ["src/iconify-bundle/*"],
"rules": {
"@typescript-eslint/no-var-requires": "off"
}
}
]
"import/parsers": {
"@typescript-eslint/parser": [".ts", ".tsx"]
},
"import/resolver": {
"typescript": {
"alwaysTryTypes": true,
"project": ["./tsconfig.json"]
}
}
},
"overrides": [
{
"files": ["src/iconify-bundle/*"],
"rules": {
"@typescript-eslint/no-var-requires": "off"
}
}
]
}
7 changes: 1 addition & 6 deletions .github/workflows/PR_Validation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ on:
branches:
- dev
- main
- dev5.4

jobs:
basic-checks:
Expand All @@ -24,12 +25,6 @@ jobs:
- name: Install dependencies
run: npm install

# - name: Execute Unit tests
# run: |
# npm ci
# npm install @rollup/rollup-linux-x64-gnu
# npm run test:unit

- name: Run ESLint
run: npm run lint

Expand Down
30 changes: 15 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,26 +64,26 @@ Delib-5 uses a technological stack consisting of React-Redux-PWA (built with Vit
4. **Set up Firebase configuration**

- In the Firebase console, create a new project named "delib-5" and copy the project ID.
- In the `.firebaserc` file, replace the project ID with the one you just created.
- Set up the `.firebaserc` file according to template in "firebase-config-files.txt", replace the project ID with the one you just created.
- Run `firebase use <project-id>` to select the new project.

5. **Create `configKey.ts` file**
- Set up your `firebase.json` file by copying the template from "firebase-config-files.txt". You do not have to adjust any attributes.

Under `src/functions/db/`, create a new file named `configKey.ts` and add the following code, replacing the placeholders with your actual Firebase project configuration:
5. **Create `.env` files**

```typescript
export const keys = {
apiKey: "your-api-key",
authDomain: "your-auth-domain",
databaseURL: "your-database-url",
projectId: "your-project-id",
storageBucket: "your-storage-bucket",
messagingSenderId: "your-messaging-sender-id",
appId: "your-app-id",
measurementId: "your-measurement-id"
}
In the project root create two files, `.env.development` & `.env.production` (Only if specified by project leader). replacing the placeholders with your actual Firebase project configuration:

export const vapidKey = 'your-vapid-key';
```env
VITE_FIREBASE_API_KEY=__YOUR_CONFIG__
VITE_FIREBASE_AUTH_DOMAIN=__YOUR_CONFIG__
VITE_FIREBASE_DATABASE_URL=__YOUR_CONFIG__
VITE_FIREBASE_PROJECT_ID=__YOUR_CONFIG__
VITE_FIREBASE_STORAGE_BUCKET=__YOUR_CONFIG__
VITE_FIREBASE_MESSAGING_SENDER_ID=__YOUR_CONFIG__
VITE_FIREBASE_APP_ID=__YOUR_CONFIG__
VITE_FIREBASE_MEASUREMENT_ID=__YOUR_CONFIG__

VITE_FIREBASE_VAPID_KEY=__YOUR_CONFIG__
```

Note: This file is not uploaded to GitHub, and you'll need to create it yourself.
Expand Down
32 changes: 0 additions & 32 deletions cypress.config.ts

This file was deleted.

Loading
Loading