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

Release #848

Merged
merged 65 commits into from
Oct 27, 2024
Merged

Release #848

merged 65 commits into from
Oct 27, 2024

Conversation

philipbrembeck
Copy link
Collaborator

@philipbrembeck philipbrembeck commented Oct 27, 2024

Summary by Sourcery

Introduce new components for product and ingredient checking, enhance existing components for better maintainability, and improve the build and CI systems. Add support for multiple languages and update documentation with a new developer guide.

New Features:

  • Introduce a new IngredientsCheck component for checking the vegan status of ingredients.
  • Add a new ProductSearch component for searching products by barcode and displaying their vegan status.
  • Implement a new ViewportScanner component for scanning barcodes using the device camera.
  • Add support for multiple languages with locale-specific pages and translations.

Enhancements:

  • Refactor the ShareButton component to use a more flexible and maintainable structure for handling share options.
  • Improve the Footer component by introducing a FooterLink sub-component for better code organization.
  • Enhance the Nav component by introducing a NavItem sub-component for better code organization.
  • Refactor the ModalWrapper component to improve its usability and maintainability.
  • Update the ESLint configuration to enforce stricter TypeScript rules and improve code quality.
  • Refactor styles to use SCSS mixins for better maintainability and consistency.

Build:

  • Update the build system to use pnpm instead of npm for package management.

CI:

  • Update the CI workflow to use pnpm for installing dependencies and running scripts.
  • Add a new CI job for running end-to-end tests using Playwright.

Deployment:

  • Add a new deployment step to restart the Kubernetes pod after deployment.

Documentation:

  • Update the README with a new Developer Guide section, including prerequisites, getting started instructions, and development guidelines.

Tests:

  • Add a new Jest configuration for running unit tests with coverage reporting.
  • Add Playwright configuration for running end-to-end tests.

dependabot bot and others added 30 commits October 7, 2024 02:50
Bumps [@types/react](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/react) from 18.3.3 to 18.3.11.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/react)

---
updated-dependencies:
- dependency-name: "@types/react"
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>
Bumps [eslint-config-next](https://github.com/vercel/next.js/tree/HEAD/packages/eslint-config-next) from 14.2.5 to 14.2.14.
- [Release notes](https://github.com/vercel/next.js/releases)
- [Changelog](https://github.com/vercel/next.js/blob/canary/release.js)
- [Commits](https://github.com/vercel/next.js/commits/v14.2.14/packages/eslint-config-next)

---
updated-dependencies:
- dependency-name: eslint-config-next
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>
Bumps [next-intl](https://github.com/amannn/next-intl) from 3.17.2 to 3.20.0.
- [Release notes](https://github.com/amannn/next-intl/releases)
- [Changelog](https://github.com/amannn/next-intl/blob/main/CHANGELOG.md)
- [Commits](amannn/next-intl@v3.17.2...v3.20.0)

---
updated-dependencies:
- dependency-name: next-intl
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>
…next-intl-3.20.0

build(deps): bump next-intl from 3.17.2 to 3.20.0
…eslint-config-next-14.2.14

build(deps-dev): bump eslint-config-next from 14.2.5 to 14.2.14
…types/react-18.3.11

build(deps-dev): bump @types/react from 18.3.3 to 18.3.11
Bumps [@playwright/test](https://github.com/microsoft/playwright) from 1.46.1 to 1.47.2.
- [Release notes](https://github.com/microsoft/playwright/releases)
- [Commits](microsoft/playwright@v1.46.1...v1.47.2)

---
updated-dependencies:
- dependency-name: "@playwright/test"
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>
…playwright/test-1.47.2

build(deps-dev): bump @playwright/test from 1.46.1 to 1.47.2
Bumps [eslint-config-next](https://github.com/vercel/next.js/tree/HEAD/packages/eslint-config-next) from 14.2.14 to 14.2.15.
- [Release notes](https://github.com/vercel/next.js/releases)
- [Changelog](https://github.com/vercel/next.js/blob/canary/release.js)
- [Commits](https://github.com/vercel/next.js/commits/v14.2.15/packages/eslint-config-next)

---
updated-dependencies:
- dependency-name: eslint-config-next
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>
Bumps [typescript](https://github.com/microsoft/TypeScript) from 5.5.4 to 5.6.3.
- [Release notes](https://github.com/microsoft/TypeScript/releases)
- [Changelog](https://github.com/microsoft/TypeScript/blob/main/azure-pipelines.release.yml)
- [Commits](microsoft/TypeScript@v5.5.4...v5.6.3)

---
updated-dependencies:
- dependency-name: typescript
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>
Bumps [next](https://github.com/vercel/next.js) from 14.2.14 to 14.2.15.
- [Release notes](https://github.com/vercel/next.js/releases)
- [Changelog](https://github.com/vercel/next.js/blob/canary/release.js)
- [Commits](vercel/next.js@v14.2.14...v14.2.15)

---
updated-dependencies:
- dependency-name: next
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>
…next-14.2.15

build(deps): bump next from 14.2.14 to 14.2.15
…typescript-5.6.3

build(deps): bump typescript from 5.5.4 to 5.6.3
Bumps [@playwright/test](https://github.com/microsoft/playwright) from 1.47.2 to 1.48.0.
- [Release notes](https://github.com/microsoft/playwright/releases)
- [Commits](microsoft/playwright@v1.47.2...v1.48.0)

---
updated-dependencies:
- dependency-name: "@playwright/test"
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>
…playwright/test-1.48.0

build(deps-dev): bump @playwright/test from 1.47.2 to 1.48.0
…eslint-config-next-14.2.15

build(deps-dev): bump eslint-config-next from 14.2.14 to 14.2.15
feat: Change Package manager to pnpm
Bumps [next-intl](https://github.com/amannn/next-intl) from 3.20.0 to 3.21.1.
- [Release notes](https://github.com/amannn/next-intl/releases)
- [Changelog](https://github.com/amannn/next-intl/blob/main/CHANGELOG.md)
- [Commits](amannn/next-intl@v3.20.0...v3.21.1)

---
updated-dependencies:
- dependency-name: next-intl
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>
Bumps [pnpm/action-setup](https://github.com/pnpm/action-setup) from 2 to 4.
- [Release notes](https://github.com/pnpm/action-setup/releases)
- [Commits](pnpm/action-setup@v2...v4)

---
updated-dependencies:
- dependency-name: pnpm/action-setup
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <[email protected]>
…s/pnpm/action-setup-4

build(deps): bump pnpm/action-setup from 2 to 4
…next-intl-3.21.1

build(deps): bump next-intl from 3.20.0 to 3.21.1
philipbrembeck and others added 23 commits October 26, 2024 18:21
feat: Code Refactor & Upgrade to Next.js 15 / React 19-RC
Bumps [sass](https://github.com/sass/dart-sass) from 1.79.4 to 1.80.4.
- [Release notes](https://github.com/sass/dart-sass/releases)
- [Changelog](https://github.com/sass/dart-sass/blob/main/CHANGELOG.md)
- [Commits](sass/dart-sass@1.79.4...1.80.4)

---
updated-dependencies:
- dependency-name: sass
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>
Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 22.5.4 to 22.8.1.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node)

---
updated-dependencies:
- dependency-name: "@types/node"
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>
…types/node-22.8.1

build(deps): bump @types/node from 22.5.4 to 22.8.1
Bumps [@frontendnetwork/veganify](https://github.com/JokeNetwork/veganify-api-wrapper) from 1.2.5 to 1.2.9.
- [Commits](https://github.com/JokeNetwork/veganify-api-wrapper/commits)

---
updated-dependencies:
- dependency-name: "@frontendnetwork/veganify"
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>
…frontendnetwork/veganify-1.2.9

build(deps): bump @frontendnetwork/veganify from 1.2.5 to 1.2.9
…sass-1.80.4

build(deps): bump sass from 1.79.4 to 1.80.4
* feat: Initialize API v1 for Ingredients

* feat(i18n): Added translations for tooltip

* feat(SCSS): Upgraded to newer SCSS version
Copy link

stackblitz bot commented Oct 27, 2024

Review PR in StackBlitz Codeflow Run & review this pull request in StackBlitz Codeflow.

Copy link

sourcery-ai bot commented Oct 27, 2024

Reviewer's Guide by Sourcery

This pull request implements a major refactoring and modernization of the codebase, migrating to Next.js App Router, improving type safety, and enhancing code organization. The changes include restructuring components, implementing server-side rendering, improving state management, and adding comprehensive testing setup.

Architecture diagram for CI/CD pipeline changes

graph TD;
    A[Pull Request] -->|Trigger| B[Build and Lint PRs]
    B -->|Run| C[Regular Build]
    C -->|On Failure| D[Legacy Peer Deps Build]
    C -->|On Success| E[Deploy to Staging]
    E -->|On Staging Branch| F[E2E Tests]
    F -->|Run| G[Playwright Tests]
Loading

Class diagram for ShareButton component refactoring

classDiagram
    class ShareButtonProps {
        productName?: string
        barcode: string
    }

    class ShareButton {
        - productName: string = "Product"
        - barcode: string
        - showButton: boolean
        - shareOptions: ShareOption[]
        + checkShareAvailability(): void
        + handleShareClick(shareUrl: string): void
    }

    class ShareOption {
        id: string
        text: string
        icon: string
        url: string
        handler?: () => Promise<void>
    }

    ShareButton --> ShareButtonProps
    ShareButton --> ShareOption
Loading

Class diagram for ModalWrapper component refactoring

classDiagram
    class ModalProps {
        id: string
        buttonType: "sup" | "span" | "div"
        buttonClass: string
        buttonText: string
        children: ReactNode
    }

    class ModalWrapper {
        - isOpen: boolean
        - mounted: boolean
        - modalRootRef: HTMLElement | null
        + closeModal(): void
        + handleEscapeKeyPress(event: KeyboardEvent): void
        + handleTouchStart(event: TouchEvent): void
    }

    ModalWrapper --> ModalProps
Loading

File-Level Changes

Change Details Files
Migration to Next.js App Router and improved internationalization
  • Implemented new App Router directory structure with [locale] dynamic routes
  • Added middleware for locale handling
  • Migrated from getStaticProps to server components
  • Enhanced internationalization setup with next-intl
src/app/[locale]/layout.tsx
src/middleware.ts
src/i18n/routing.ts
src/i18n/request.ts
Component architecture refactoring and modernization
  • Split large components into smaller, focused components
  • Implemented proper TypeScript interfaces and types
  • Added client-side components with 'use client' directive
  • Improved state management with React hooks
src/components/Check/index.tsx
src/components/IngredientsCheck/IngredientsForm.tsx
src/components/Scanner/ViewportScanner.tsx
src/components/elements/share.tsx
Enhanced testing and build configuration
  • Added Jest configuration for unit testing
  • Configured Playwright for end-to-end testing
  • Updated ESLint configuration for stricter type checking
  • Implemented Million.js for performance optimization
jest.config.ts
playwright.config.ts
.eslintrc.json
next.config.ts
Styling system improvements
  • Reorganized SCSS modules structure
  • Added new mixins for responsive design
  • Implemented tooltip component with styles
  • Updated theme handling and color schemes
src/styles/_modules/_tooltip.scss
src/styles/_globals/_mixins.scss
src/styles/_globals/_roots.scss

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time. You can also use
    this command to specify where the summary should be inserted.

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

Copy link

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @philipbrembeck - I've reviewed your changes and found some issues that need to be addressed.

Blocking issues:

  • Potential hard-coded PayPal donation link found. (link)
Here's what I looked at during the review
  • 🟡 General issues: 3 issues found
  • 🔴 Security: 1 blocking issue
  • 🟢 Testing: all looks good
  • 🟢 Complexity: all looks good
  • 🟢 Documentation: all looks good

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

src/components/elements/share.tsx Outdated Show resolved Hide resolved
src/components/Check/index.tsx Outdated Show resolved Hide resolved
pnpm-lock.yaml Outdated Show resolved Hide resolved
src/components/elements/contents/donate.tsx Outdated Show resolved Hide resolved
src/components/Check/utils/product-helpers.ts Outdated Show resolved Hide resolved
src/components/Check/utils/product-helpers.ts Outdated Show resolved Hide resolved
src/components/Scanner/ViewportScanner.tsx Outdated Show resolved Hide resolved
src/components/elements/modalwrapper.tsx Outdated Show resolved Hide resolved
src/components/elements/modalwrapper.tsx Outdated Show resolved Hide resolved
# Conflicts:
#	.github/workflows/build.yml
#	.gitignore
#	package.json
#	playwright.config.ts
#	pnpm-lock.yaml
#	src/components/IngredientsCheck/IngredientsForm.tsx
#	src/components/IngredientsCheck/IngredientsList.tsx
#	src/components/IngredientsCheck/ResultsDisplay.tsx
#	src/components/IngredientsCheck/models/IngredientResult.ts
#	src/components/IngredientsCheck/utils/actions.test.ts
#	src/components/IngredientsCheck/utils/actions.ts
#	src/styles/_globals/_mixins.scss
#	src/styles/_modules/_modals.scss
#	src/tests/usability.spec.ts
Copy link

@philipbrembeck philipbrembeck merged commit 2354969 into main Oct 27, 2024
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant