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

156 build performance improvement pnpm or bun #162

Open
wants to merge 16 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
16 changes: 8 additions & 8 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,28 +45,28 @@ jobs:
run: |
echo "::notice::Running react-scripts tests."
export CI=true
npm install cross-env npm-run-all -g
npm install
npm install cross-env bun -g
bun install
- name: "5. Verifying backend code is pretty"
run: |
npm run prettier:backend
bun run prettier:backend
- name: "6. Verifying frontend code is pretty"
run: |
npm run prettier:frontend
bun run prettier:frontend
- name: "7. Linting frontend"
run: npm run lint:frontend
run: bun run lint:frontend
- name: "8. Run Frontend tests"
run: npm run test:frontend
run: bun run test:frontend
- name: "9. Run Backend linting"
run: |
npm run lint:backend
bun run lint:backend

################################################################################################
# C. Ensure no vulnerabilities.
- name: "10. Test: there should be no Python vulnerabilities."
run: |
echo "::notice::Checking for vulnerabilities in backend Python app dependencies."
npm run test:backend
bun run test:backend
- name: "11. Test: there should be no HIGH Node.js vulnerabilities."
run: |
echo "::notice::Checking for high vulnerabilities in frontend Node.js app dependencies."
Expand Down
22 changes: 14 additions & 8 deletions .upsun/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,11 @@ applications:
source:
root: "frontend"

type: "nodejs:18"
type: "nodejs:20"

dependencies:
nodejs:
bun: "*"

build:
flavor: none
Expand All @@ -22,10 +26,12 @@ applications:

hooks:
build: |
set -eux
npm install
set -eu
echo "Installing frontend app Node.js dependencies..."
bun install > /dev/null
export REACT_APP_PROJECT_ID=$PLATFORM_PROJECT
npm run build
echo "Building frontend..."
bun run build > /dev/null

relationships:
api: "backend:http"
Expand All @@ -49,15 +55,15 @@ applications:
source:
root: "backend"

type: "python:3.11"
type: "python:3.12"

build:
flavor: none
hooks:
build: |
set -eux
pip install --upgrade pip
pip install -r requirements.txt
set -eu
echo "Installing backend app dependencies"
pip install -r requirements.txt --disable-pip-version-check > /dev/null

web:
commands:
Expand Down
22 changes: 11 additions & 11 deletions backend/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
async-timeout==4.0.3
blinker==1.6.3
blinker==1.7.0
boolean.py==4.0
CacheControl==0.13.1
cachelib==0.10.2
certifi==2023.7.22
charset-normalizer==3.3.1
certifi==2023.11.17
charset-normalizer==3.3.2
click==8.1.7
cyclonedx-python-lib==4.2.3
defusedxml==0.7.1
Expand All @@ -14,31 +14,31 @@ Flask-Cors==3.0.10
Flask-Session==0.5.0
gunicorn==21.2.0
html5lib==1.1
idna==3.4
idna==3.6
itsdangerous==2.1.2
Jinja2==3.1.2
Jinja2==3.1.3
license-expression==30.1.1
markdown-it-py==3.0.0
MarkupSafe==2.1.3
mdurl==0.1.2
msgpack==1.0.7
packageurl-python==0.11.2
packageurl-python==0.13.4
packaging==23.2
pip-api==0.0.30
pip-requirements-parser==32.0.1
pip_audit==2.6.1
py-serializable==0.11.1
Pygments==2.16.1
Pygments==2.17.2
pyparsing==3.1.1
python-dotenv==0.19.1
redis==4.5.4
requests==2.31.0
rich==13.6.0
rich==13.7.0
six==1.16.0
sortedcontainers==2.4.0
toml==0.10.2
urllib3==2.0.7
urllib3==2.1.0
webencodings==0.5.1
Werkzeug==3.0.1
pylint==3.0.2
black==23.3.0
pylint==3.0.3
black==23.12.1
Binary file added bun.lockb
Binary file not shown.
4 changes: 2 additions & 2 deletions frontend/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ You will also see any lint errors in the console.
Launches the test runner in the interactive watch mode.\
See the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.

### `npm run build`
### `bun run build`

Builds the app for production to the `build` folder.\
It correctly bundles React in production mode and optimizes the build for the best performance.
Expand All @@ -29,7 +29,7 @@ Your app is ready to be deployed!

See the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.

### `npm run eject`
### `bun run eject`

**Note: this is a one-way operation. Once you `eject`, you can’t go back!**

Expand Down
Binary file added frontend/bun.lockb
Binary file not shown.
Loading
Loading