Skip to content

Commit

Permalink
Merge pull request #596 from dzcode-io/cleanup-repo-sec-issues
Browse files Browse the repository at this point in the history
fix: cleanup repo security issues and codecov and readme tweaks
  • Loading branch information
ZibanPirate authored Sep 14, 2024
2 parents d7eb411 + acc98d6 commit 6248d5f
Show file tree
Hide file tree
Showing 20 changed files with 7,816 additions and 12,156 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/cd.deploy.stg.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ jobs:
CI: true
STAGE: staging
SSH_ADDRESS_STG: ${{ secrets.SSH_ADDRESS_STG }}
FIREBASE_TOKEN: ${{ secrets.FIREBASE_TOKEN }}
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
DEPLOY_VERSION: ${{ github.ref_type == 'tag' && github.ref_name || format('stg-0.0.0-{0}-{1}-{2}', github.ref_name, github.run_number, github.run_attempt) }}

steps:
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/cd.deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ jobs:
CI: true
STAGE: production
SSH_ADDRESS_PRD: ${{ secrets.SSH_ADDRESS_PRD }}
FIREBASE_TOKEN: ${{ secrets.FIREBASE_TOKEN }}
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
DEPLOY_VERSION: ${{ github.ref_type == 'tag' && github.ref_name || format('0.0.0-{0}-{1}-{2}', github.ref_name, github.run_number, github.run_attempt) }}

steps:
Expand Down
14 changes: 9 additions & 5 deletions .github/workflows/ci.main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,41 +46,45 @@ jobs:
run: |
npm run test:alone -- -- --coverage
- uses: codecov/codecov-action@v3
- uses: codecov/codecov-action@v4
if: ${{ matrix.os == 'ubuntu-latest' }}
with:
flags: api
name: codecov-api
directory: ./api
fail_ci_if_error: true
- uses: codecov/codecov-action@v3
token: ${{ secrets.CODECOV_TOKEN }}
- uses: codecov/codecov-action@v4
if: ${{ matrix.os == 'ubuntu-latest' }}
with:
flags: web
name: codecov-web
directory: ./web
fail_ci_if_error: true
- uses: codecov/codecov-action@v3
token: ${{ secrets.CODECOV_TOKEN }}
- uses: codecov/codecov-action@v4
if: ${{ matrix.os == 'ubuntu-latest' }}
with:
flags: data
name: codecov-data
directory: ./data
fail_ci_if_error: false # put it back to true once we have tests in ./data
- uses: codecov/codecov-action@v3
- uses: codecov/codecov-action@v4
if: ${{ matrix.os == 'ubuntu-latest' }}
with:
flags: models
name: codecov-models
directory: ./packages/models
fail_ci_if_error: true
- uses: codecov/codecov-action@v3
token: ${{ secrets.CODECOV_TOKEN }}
- uses: codecov/codecov-action@v4
if: ${{ matrix.os == 'ubuntu-latest' }}
with:
flags: utils
name: codecov-utils
directory: ./packages/utils
fail_ci_if_error: true
token: ${{ secrets.CODECOV_TOKEN }}

- name: "Misc"
shell: bash
Expand Down
3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,7 @@ src/_e2e-test/videos
src/_e2e-test/screenshots

# Project
firebase/public
firebase/data
*/cloudflare/public

# mobile
mobile/.expo
Expand Down
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ You can find more about each folder by clicking on the folder name
Make sure you have:

- [Git](https://git-scm.com/)
- [Nodejs](https://nodejs.org/) version 18 or higher (we recommend using [nvm](https://github.com/nvm-sh/nvm))
- [Nodejs](https://nodejs.org/) version 20 or higher (we recommend using [volta](https://docs.volta.sh/guide/getting-started) over plain install or [nvm](https://github.com/nvm-sh/nvm))

### Run it locally

Expand Down Expand Up @@ -94,7 +94,8 @@ If you use VSCode, please make sure to have a `.vscode/settings.json` file with
"*.css": "tailwindcss"
},
"prettier.configPath": "packages/tooling/.prettierrc",
"eslint.options": { "overrideConfigFile": "packages/tooling/.eslintrc.json" },
"prettier.prettierPath": "./node_modules/prettier/index.cjs",
"eslint.options": { "overrideConfigFile": "packages/tooling/eslint.config.mjs" },
"editor.codeActionsOnSave": {
"source.fixAll.eslint": "always",
"source.fixAll.ts": "always"
Expand All @@ -107,10 +108,9 @@ If you use VSCode, please make sure to have a `.vscode/settings.json` file with
- If you already forked the repository, please make sure your fork is up-to-date, following [this simple steps](https://www.dzcode.io/Learn/Git_Basics/Syncing_An_Old_Forked_Repository_With_Upstream).
- Please make sure your code follows the style guideline defined in this repo, for that simply run `npm run lint:fix` to ensure the conformity. This process should happen automatically whenever you commit your changes, but you can always do it manually when your Pull Request checks are failing due to linting errors.

### List Your Project or Add/Edit Article
### List Your Project

- To list your project on dzcode.io, see [this tutorial](https://dzcode.io/Learn/About_dzcode_io/Add_Your_Project_To_dzcode_io)
- To add an article, see [this tutorial](https://dzcode.io/Learn/About_dzcode_io/Add_Your_Article_To_dzcode_io)
Follow [these steps](https://github.com/dzcode-io/dzcode.io/blob/main/data/models/documentation/About_dzcode_io/Add_Your_Project_To_dzcode_io/content.md).

## License

Expand Down
11 changes: 4 additions & 7 deletions data/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,7 @@
"@dzcode.io/tooling": "*",
"@dzcode.io/utils": "*",
"@types/fs-extra": "^11.0.4",
"@types/glob": "^8.1.0",
"cpx": "^1.5.0",
"firebase-tools": "^13.16.0"
"@types/glob": "^8.1.0"
},
"license": "MIT",
"lint-staged": {
Expand Down Expand Up @@ -46,9 +44,8 @@
"lint:prettier": "prettier --config ../packages/tooling/.prettierrc --ignore-path ../packages/tooling/.prettierignore --log-level warn",
"lint:ts-prune": "ts-node ../packages/tooling/setup-ts-prune.ts && ts-prune --error",
"lint:tsc": "tsc --noEmit",
"test": "jest src",
"test:cov": "jest src --coverage",
"test:cov:watch": "jest src --coverage --watchAll",
"test:watch": "jest src --watchAll"
"test": "npm run build && npm run test:alone",
"test:alone": "jest --config ../packages/tooling/jest.config.ts --rootDir .",
"test:watch": "npm-run-all build --parallel build:watch \"test:alone --watch {@}\" --"
}
}
Empty file added data/src/_test/pre-test.ts
Empty file.
Empty file added data/src/_test/setup.ts
Empty file.
Loading

0 comments on commit 6248d5f

Please sign in to comment.