ci(frontend): Enforce consistent yarn.lock + minor DX improvements (#8316)

- ci(frontend): Ensure CI fails if `yarn.lock` is inconsistent with `package.json`
- dx(frontend): Add Prettier check to `lint` script in `package.json`
- dx(frontend): Add `packageManager` to `package.json` for Corepack support
- build(frontend): Use `yarn` consistently in the Dockerfile
This commit is contained in:
Reinier van der Leer
2024-10-11 16:51:15 +02:00
committed by GitHub
parent 992989ee71
commit 74e677baec
5 changed files with 6620 additions and 263 deletions

View File

@@ -29,15 +29,11 @@ jobs:
- name: Install dependencies
run: |
npm install
- name: Check formatting with Prettier
run: |
npx prettier --check .
yarn install --frozen-lockfile
- name: Run lint
run: |
npm run lint
yarn lint
test:
runs-on: ubuntu-latest
@@ -62,18 +58,18 @@ jobs:
- name: Install dependencies
run: |
npm install
yarn install --frozen-lockfile
- name: Setup Builder .env
run: |
cp .env.example .env
- name: Install Playwright Browsers
run: npx playwright install --with-deps
run: yarn playwright install --with-deps
- name: Run tests
run: |
npm run test
yarn test
- uses: actions/upload-artifact@v4
if: ${{ !cancelled() }}

View File

@@ -149,6 +149,3 @@ To persist data for PostgreSQL and Redis, you can modify the `docker-compose.yml
3. Save the file and run `docker compose up -d` to apply the changes.
This configuration will create named volumes for PostgreSQL and Redis, ensuring that your data persists across container restarts.

View File

@@ -14,7 +14,7 @@ CMD ["yarn", "run", "dev"]
# Build stage for prod
FROM base AS build
COPY autogpt_platform/frontend/ .
RUN npm run build
RUN yarn build
# Prod stage
FROM node:21-alpine AS prod
@@ -29,4 +29,4 @@ COPY --from=build /app/public ./public
COPY --from=build /app/next.config.mjs ./next.config.mjs
EXPOSE 3000
CMD ["npm", "start"]
CMD ["yarn", "start"]

View File

@@ -8,7 +8,7 @@
"dev:test": "export NODE_ENV=test && next dev",
"build": "next build",
"start": "next start",
"lint": "next lint",
"lint": "next lint && prettier --check .",
"format": "prettier --write .",
"test": "playwright test",
"test-ui": "playwright test --ui",
@@ -94,5 +94,6 @@
"storybook": "^8.3.5",
"tailwindcss": "^3.4.1",
"typescript": "^5"
}
},
"packageManager": "yarn@1.22.22+sha512.a6b2f7906b721bba3d67d4aff083df04dad64c399707841b7acf00f6b133b7ac24255f2652fa22ae3534329dc6180534e98d17432037ff6fd140556e2bb3137e"
}

File diff suppressed because it is too large Load Diff