Skip to content
Merged
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
8 changes: 4 additions & 4 deletions .github/workflows/e2e.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ jobs:
- name: Install dependencies
run: pnpm install --frozen-lockfile --prefer-offline
- name: Run database migrations
run: npx prisma migrate reset --force
run: pnpm dlx prisma migrate reset --force
- name: Store Playwright's Version
run: |
PLAYWRIGHT_VERSION=$(pnpm ls @playwright/test | grep @playwright | sed 's/.*@//')
Expand All @@ -66,9 +66,9 @@ jobs:
key: playwright-browsers-${{ env.PLAYWRIGHT_VERSION }}
- name: Setup Playwright
if: steps.cache-playwright-browsers.outputs.cache-hit != 'true'
run: npx playwright install chromium --with-deps
run: pnpm dlx playwright install chromium --with-deps
- name: Run e2e tests
run: npx playwright test --shard=${{ matrix.shardIndex }}/${{ matrix.shardTotal }}
run: pnpm test:e2e --shard=${{ matrix.shardIndex }}/${{ matrix.shardTotal }}
- name: Upload test report
uses: actions/upload-artifact@v4
if: always()
Expand All @@ -92,7 +92,7 @@ jobs:
pattern: blob-report-*
merge-multiple: true
- name: Merge into HTML Report
run: npx playwright merge-reports --reporter html ./all-blob-reports
run: pnpm dlx playwright merge-reports --reporter html ./all-blob-reports
- name: Upload HTML report
uses: actions/upload-artifact@v4
with:
Expand Down
2 changes: 1 addition & 1 deletion .husky/commit-msg
Original file line number Diff line number Diff line change
@@ -1 +1 @@
npx --no -- commitlint --edit ${1}
pnpm dlx commitlint --edit ${1}
2 changes: 1 addition & 1 deletion .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1 +1 @@
npx lint-staged
pnpm dlx lint-staged
13 changes: 10 additions & 3 deletions .storybook/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,24 @@ import path from "path";

const config: StorybookConfig = {
stories: ["../stories/**/*.mdx", "../stories/**/*.stories.@(js|jsx|mjs|ts|tsx)"],

addons: [
"@storybook/addon-onboarding",
"@storybook/addon-links",
"@storybook/addon-essentials",
"@storybook/addon-interactions",
"@storybook/addon-themes",
],

framework: {
name: "@storybook/nextjs",
options: {},
},
docs: {
autodocs: "tag",
},

docs: {},

staticDirs: ["../public"],

webpackFinal: async (config) => {
if (config.resolve) {
config.resolve.alias = {
Expand All @@ -27,5 +30,9 @@ const config: StorybookConfig = {
}
return config;
},

typescript: {
reactDocgen: "react-docgen-typescript"
}
};
export default config;
7 changes: 4 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
FROM node:20-alpine AS base
RUN corepack enable

# Install dependencies only when needed
FROM base AS deps
Expand All @@ -11,7 +12,7 @@ FROM base AS deps
RUN \
if [ -f yarn.lock ]; then yarn --frozen-lockfile; \
elif [ -f package-lock.json ]; then npm ci; \
elif [ -f pnpm-lock.yaml ]; then yarn global add pnpm && pnpm i --frozen-lockfile; \
elif [ -f pnpm-lock.yaml ]; then pnpm i --frozen-lockfile; \
else echo "Lockfile not found." && exit 1; \
fi

Expand All @@ -27,7 +28,7 @@ FROM base AS builder
# Uncomment the following line in case you want to disable telemetry during the build.
ENV NEXT_TELEMETRY_DISABLED 1

RUN yarn build
RUN pnpm run build

# If using npm comment out above and use below instead
# RUN npm run build
Expand Down Expand Up @@ -64,4 +65,4 @@ FROM base AS runner
# set hostname to localhost
ENV HOSTNAME "0.0.0.0"

CMD npx prisma migrate deploy && node server.js
CMD pnpm dlx prisma migrate deploy && node server.js
12 changes: 9 additions & 3 deletions e2e/books/book-validation.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@ test.describe('Book validation', () => {
// Assert
await expect(page).toHaveURL('/books/new')
await expect(
page.locator('[placeholder=Título][required]:invalid'),
page.locator(
'[placeholder=Título][aria-required=true][aria-invalid=true]',
),
).toBeVisible()
})

Expand Down Expand Up @@ -59,7 +61,9 @@ test.describe('Book validation', () => {
// Assert
await expect(page).toHaveURL('/books/new')
await expect(
page.locator('[placeholder=Autores][required]:invalid'),
page.locator(
'[placeholder=Autores][aria-required=true][aria-invalid=true]',
),
).toBeVisible()
})

Expand Down Expand Up @@ -97,7 +101,9 @@ test.describe('Book validation', () => {
// Assert
await expect(page).toHaveURL('/books/new')
await expect(
page.locator('[placeholder=Imagen][required]:invalid'),
page.locator(
'[placeholder=Imagen][aria-required=true][aria-invalid=true]',
),
).toBeVisible()
})

Expand Down
165 changes: 83 additions & 82 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"start": "next start",
"lint": "next lint",
"prepare": "husky",
"postinstall": "npx prisma generate",
"postinstall": "pnpm dlx prisma generate",
"test": "vitest",
"coverage": "vitest run --coverage",
"test:ci": "NODE_ENV=test vitest --watch=false",
Expand All @@ -24,113 +24,114 @@
"build-storybook": "storybook build",
"prisma:migrate": "prisma migrate dev",
"prisma:generate": "prisma generate",
"cli:user:admin": "npx tsx src/core/user/infrastructure/cli/add-user.cli.ts admin",
"cli:user:member": "npx tsx src/core/user/infrastructure/cli/add-user.cli.ts member"
"cli:user:admin": "pnpm dlx tsx src/core/user/infrastructure/cli/add-user.cli.ts admin",
"cli:user:member": "pnpm dlx tsx src/core/user/infrastructure/cli/add-user.cli.ts member"
},
"dependencies": {
"@aulasoftwarelibre/next-auth-firewall": "1.2.0",
"@auth/core": "^0.30.0",
"@auth/prisma-adapter": "^2.0.0",
"@heroicons/react": "^2.1.3",
"@nextui-org/avatar": "^2.0.27",
"@nextui-org/breadcrumbs": "^2.0.7",
"@nextui-org/button": "^2.0.31",
"@nextui-org/card": "^2.0.28",
"@nextui-org/divider": "^2.0.27",
"@nextui-org/dropdown": "^2.1.23",
"@nextui-org/input": "^2.1.21",
"@nextui-org/kbd": "^2.0.28",
"@nextui-org/link": "^2.0.29",
"@nextui-org/listbox": "^2.1.19",
"@nextui-org/modal": "^2.0.33",
"@nextui-org/navbar": "^2.0.30",
"@nextui-org/progress": "^2.0.28",
"@nextui-org/radio": "^2.0.28",
"@nextui-org/switch": "^2.0.28",
"@nextui-org/system": "^2.1.2",
"@nextui-org/table": "^2.0.33",
"@nextui-org/tabs": "^2.0.29",
"@nextui-org/theme": "^2.2.3",
"@nextui-org/user": "^2.0.28",
"@prisma/client": "^5.13.0",
"@react-aria/visually-hidden": "^3.8.11",
"@auth/core": "^0.34.2",
"@auth/prisma-adapter": "^2.4.2",
"@heroicons/react": "^2.1.5",
"@nextui-org/avatar": "2.0.32",
"@nextui-org/breadcrumbs": "2.0.12",
"@nextui-org/button": "2.0.37",
"@nextui-org/card": "2.0.33",
"@nextui-org/divider": "2.0.31",
"@nextui-org/dropdown": "2.1.29",
"@nextui-org/input": "2.2.4",
"@nextui-org/kbd": "2.0.33",
"@nextui-org/link": "2.0.34",
"@nextui-org/listbox": "2.1.25",
"@nextui-org/modal": "2.0.39",
"@nextui-org/navbar": "2.0.36",
"@nextui-org/progress": "2.0.33",
"@nextui-org/radio": "2.1.4",
"@nextui-org/switch": "2.0.33",
"@nextui-org/system": "^2.2.5",
"@nextui-org/table": "2.0.39",
"@nextui-org/tabs": "2.0.35",
"@nextui-org/theme": "^2.2.9",
"@nextui-org/user": "2.0.33",
"@prisma/client": "^5.19.1",
"@react-aria/visually-hidden": "^3.8.15",
"amazon-buddy": "^2.2.45",
"date-fns": "^3.6.0",
"framer-motion": "^11.1.9",
"next": "14.2.3",
"framer-motion": "^11.5.4",
"next": "14.2.8",
"next-auth": "5.0.0-beta.9",
"next-themes": "^0.3.0",
"nodemailer": "^6.9.13",
"nodemailer": "^6.9.15",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"react-hot-toast": "^2.4.1",
"server-only": "^0.0.1",
"sharp": "^0.33.3",
"ts-essentials": "^10.0.0",
"sharp": "^0.33.5",
"ts-essentials": "^10.0.2",
"ulid": "^2.3.0",
"use-debounce": "^10.0.0",
"uuid": "^9.0.1",
"use-debounce": "^10.0.3",
"uuid": "^10.0.0",
"zod": "^3.23.8"
},
"devDependencies": {
"@commitlint/cli": "^19.3.0",
"@commitlint/config-conventional": "19.2.2",
"@playwright/test": "^1.44.0",
"@storybook/addon-essentials": "^8.0.10",
"@storybook/addon-interactions": "^8.0.10",
"@storybook/addon-links": "^8.0.10",
"@storybook/addon-onboarding": "^8.0.10",
"@storybook/addon-themes": "^8.0.10",
"@storybook/blocks": "^8.0.10",
"@storybook/nextjs": "^8.0.10",
"@storybook/react": "^8.0.10",
"@storybook/testing-library": "^0.2.2",
"@testcontainers/postgresql": "^10.9.0",
"@testing-library/jest-dom": "^6.4.5",
"@testing-library/react": "^15.0.7",
"@commitlint/cli": "^19.4.1",
"@commitlint/config-conventional": "19.4.1",
"@playwright/test": "^1.47.0",
"@storybook/addon-essentials": "^8.2.9",
"@storybook/addon-interactions": "^8.2.9",
"@storybook/addon-links": "^8.2.9",
"@storybook/addon-onboarding": "^8.2.9",
"@storybook/addon-themes": "^8.2.9",
"@storybook/blocks": "^8.2.9",
"@storybook/nextjs": "^8.2.9",
"@storybook/react": "^8.2.9",
"@storybook/test": "^8.2.9",
"@testcontainers/postgresql": "^10.13.0",
"@testing-library/jest-dom": "^6.5.0",
"@testing-library/react": "^16.0.1",
"@types/lodash.clonedeep": "^4.5.9",
"@types/node": "^20.12.11",
"@types/node": "^22.5.4",
"@types/nodemailer": "^6.4.15",
"@types/react": "^18.3.1",
"@types/react": "^18.3.5",
"@types/react-dom": "^18.3.0",
"@types/uuid": "^9.0.8",
"@typescript-eslint/eslint-plugin": "^7.8.0",
"@typescript-eslint/parser": "^7.8.0",
"@vitejs/plugin-react": "^4.2.1",
"@vitest/coverage-v8": "1.6.0",
"@vitest/ui": "1.6.0",
"autoprefixer": "^10.4.19",
"@types/uuid": "^10.0.0",
"@typescript-eslint/eslint-plugin": "^8.4.0",
"@typescript-eslint/parser": "^8.4.0",
"@vitejs/plugin-react": "^4.3.1",
"@vitest/coverage-v8": "2.0.5",
"@vitest/ui": "2.0.5",
"autoprefixer": "^10.4.20",
"dotenv": "^16.4.5",
"eslint": "^8.57.0",
"eslint-config-next": "14.2.3",
"eslint-config-next": "14.2.8",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-import": "^2.29.1",
"eslint-plugin-prettier": "^5.1.3",
"eslint-plugin-react": "^7.34.1",
"eslint-plugin-simple-import-sort": "^12.1.0",
"eslint-plugin-import": "^2.30.0",
"eslint-plugin-prettier": "^5.2.1",
"eslint-plugin-react": "^7.35.2",
"eslint-plugin-simple-import-sort": "^12.1.1",
"eslint-plugin-sort": "^3.0.2",
"eslint-plugin-storybook": "^0.8.0",
"eslint-plugin-unicorn": "^52.0.0",
"eslint-plugin-unused-imports": "^3.2.0",
"husky": "^9.0.11",
"jsdom": "^24.0.0",
"eslint-plugin-unicorn": "^55.0.0",
"eslint-plugin-unused-imports": "^4.1.3",
"husky": "^9.1.5",
"jsdom": "^25.0.0",
"just-pnpm": "^1.0.2",
"lint-staged": "^15.2.2",
"lint-staged": "^15.2.10",
"lodash.clonedeep": "^4.5.0",
"nextui-cli": "^0.2.1",
"postcss": "^8.4.38",
"prettier": "^3.2.5",
"prettier-plugin-tailwindcss": "^0.5.14",
"prisma": "^5.13.0",
"rimraf": "^5.0.5",
"storybook": "^8.0.10",
"tailwindcss": "^3.4.3",
"testcontainers": "^10.9.0",
"tsx": "^4.9.3",
"typescript": "^5.4.5",
"vite-tsconfig-paths": "^4.3.2",
"vitest": "1.6.0"
"nextui-cli": "^0.3.4",
"postcss": "^8.4.45",
"prettier": "^3.3.3",
"prettier-plugin-tailwindcss": "^0.6.6",
"prisma": "^5.19.1",
"rimraf": "^6.0.1",
"storybook": "^8.2.9",
"tailwindcss": "^3.4.10",
"testcontainers": "^10.13.0",
"tsx": "^4.19.0",
"typescript": "^5.5.4",
"vite-tsconfig-paths": "^5.0.1",
"vitest": "2.0.5"
},
"packageManager": "[email protected]",
"commitlint": {
"extends": [
"@commitlint/config-conventional"
Expand Down
2 changes: 1 addition & 1 deletion playwright.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export default defineConfig({
trace: 'retry-with-trace',
},
webServer: {
command: `yarn dev -p ${PORT}`,
command: `pnpm run dev -p ${PORT}`,
reuseExistingServer: !process.env.CI,
url: baseURL,
},
Expand Down
Loading