-
Notifications
You must be signed in to change notification settings - Fork 1
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 #598
Release #598
Conversation
feat: Init v1 ingredients
* chore: Improve lists * chore(ESLint): Use flatConfig
Bumps [@typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/eslint-plugin) from 8.11.0 to 8.12.1. - [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases) - [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/CHANGELOG.md) - [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v8.12.1/packages/eslint-plugin) --- updated-dependencies: - dependency-name: "@typescript-eslint/eslint-plugin" dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com>
…typescript-eslint/eslint-plugin-8.12.1 build(deps-dev): Bump @typescript-eslint/eslint-plugin from 8.11.0 to 8.12.1
Bumps [@nestjs/schematics](https://github.com/nestjs/schematics) from 10.2.2 to 10.2.3. - [Release notes](https://github.com/nestjs/schematics/releases) - [Changelog](https://github.com/nestjs/schematics/blob/master/.release-it.json) - [Commits](nestjs/schematics@10.2.2...10.2.3) --- updated-dependencies: - dependency-name: "@nestjs/schematics" dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com>
…nestjs/schematics-10.2.3 build(deps-dev): Bump @nestjs/schematics from 10.2.2 to 10.2.3
Bumps [@typescript-eslint/parser](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/parser) from 8.11.0 to 8.12.1. - [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases) - [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/parser/CHANGELOG.md) - [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v8.12.1/packages/parser) --- updated-dependencies: - dependency-name: "@typescript-eslint/parser" dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com>
…typescript-eslint/parser-8.12.1 build(deps-dev): Bump @typescript-eslint/parser from 8.11.0 to 8.12.1
Bumps [@typescript-eslint/parser](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/parser) from 8.12.1 to 8.12.2. - [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases) - [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/parser/CHANGELOG.md) - [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v8.12.2/packages/parser) --- updated-dependencies: - dependency-name: "@typescript-eslint/parser" dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com>
…typescript-eslint/parser-8.12.2 build(deps-dev): Bump @typescript-eslint/parser from 8.12.1 to 8.12.2
Bumps [@nestjs/axios](https://github.com/nestjs/axios) from 3.1.0 to 3.1.1. - [Release notes](https://github.com/nestjs/axios/releases) - [Changelog](https://github.com/nestjs/axios/blob/master/.release-it.json) - [Commits](nestjs/axios@3.1.0...3.1.1) --- updated-dependencies: - dependency-name: "@nestjs/axios" dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com>
…nestjs/axios-3.1.1 build(deps): Bump @nestjs/axios from 3.1.0 to 3.1.1
Bumps [@types/lodash](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/lodash) from 4.17.12 to 4.17.13. - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases) - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/lodash) --- updated-dependencies: - dependency-name: "@types/lodash" dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com>
…types/lodash-4.17.13 build(deps-dev): Bump @types/lodash from 4.17.12 to 4.17.13
Bumps [@typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/eslint-plugin) from 8.12.1 to 8.12.2. - [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases) - [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/CHANGELOG.md) - [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v8.12.2/packages/eslint-plugin) --- updated-dependencies: - dependency-name: "@typescript-eslint/eslint-plugin" dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com>
…typescript-eslint/eslint-plugin-8.12.2 build(deps-dev): Bump @typescript-eslint/eslint-plugin from 8.12.1 to 8.12.2
Bumps [eslint-plugin-n](https://github.com/eslint-community/eslint-plugin-n) from 17.11.1 to 17.12.0. - [Release notes](https://github.com/eslint-community/eslint-plugin-n/releases) - [Changelog](https://github.com/eslint-community/eslint-plugin-n/blob/master/CHANGELOG.md) - [Commits](eslint-community/eslint-plugin-n@v17.11.1...v17.12.0) --- updated-dependencies: - dependency-name: eslint-plugin-n dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com>
…eslint-plugin-n-17.12.0 build(deps-dev): Bump eslint-plugin-n from 17.11.1 to 17.12.0
Bumps [eslint](https://github.com/eslint/eslint) from 9.13.0 to 9.14.0. - [Release notes](https://github.com/eslint/eslint/releases) - [Changelog](https://github.com/eslint/eslint/blob/main/CHANGELOG.md) - [Commits](eslint/eslint@v9.13.0...v9.14.0) --- updated-dependencies: - dependency-name: eslint dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com>
…eslint-9.14.0 build(deps-dev): Bump eslint from 9.13.0 to 9.14.0
Bumps [@nestjs/cli](https://github.com/nestjs/nest-cli) from 10.4.5 to 10.4.7. - [Release notes](https://github.com/nestjs/nest-cli/releases) - [Changelog](https://github.com/nestjs/nest-cli/blob/master/.release-it.json) - [Commits](nestjs/nest-cli@10.4.5...10.4.7) --- updated-dependencies: - dependency-name: "@nestjs/cli" dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com>
…nestjs/cli-10.4.7 build(deps-dev): Bump @nestjs/cli from 10.4.5 to 10.4.7
Bumps [@typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/eslint-plugin) from 8.12.2 to 8.13.0. - [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases) - [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/CHANGELOG.md) - [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v8.13.0/packages/eslint-plugin) --- updated-dependencies: - dependency-name: "@typescript-eslint/eslint-plugin" dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com>
…typescript-eslint/eslint-plugin-8.13.0 build(deps-dev): Bump @typescript-eslint/eslint-plugin from 8.12.2 to 8.13.0
Bumps [@nestjs/common](https://github.com/nestjs/nest/tree/HEAD/packages/common) from 10.4.6 to 10.4.7. - [Release notes](https://github.com/nestjs/nest/releases) - [Commits](https://github.com/nestjs/nest/commits/v10.4.7/packages/common) --- updated-dependencies: - dependency-name: "@nestjs/common" dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com>
…nestjs/common-10.4.7 build(deps): Bump @nestjs/common from 10.4.6 to 10.4.7
Bumps [@typescript-eslint/parser](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/parser) from 8.12.2 to 8.13.0. - [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases) - [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/parser/CHANGELOG.md) - [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v8.13.0/packages/parser) --- updated-dependencies: - dependency-name: "@typescript-eslint/parser" dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com>
…typescript-eslint/parser-8.13.0 build(deps-dev): Bump @typescript-eslint/parser from 8.12.2 to 8.13.0
Bumps [@nestjs/testing](https://github.com/nestjs/nest/tree/HEAD/packages/testing) from 10.4.6 to 10.4.7. - [Release notes](https://github.com/nestjs/nest/releases) - [Commits](https://github.com/nestjs/nest/commits/v10.4.7/packages/testing) --- updated-dependencies: - dependency-name: "@nestjs/testing" dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com>
…nestjs/testing-10.4.7 build(deps-dev): Bump @nestjs/testing from 10.4.6 to 10.4.7
Bumps [@nestjs/platform-express](https://github.com/nestjs/nest/tree/HEAD/packages/platform-express) from 10.4.6 to 10.4.7. - [Release notes](https://github.com/nestjs/nest/releases) - [Commits](https://github.com/nestjs/nest/commits/v10.4.7/packages/platform-express) --- updated-dependencies: - dependency-name: "@nestjs/platform-express" dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com>
…nestjs/platform-express-10.4.7 build(deps): Bump @nestjs/platform-express from 10.4.6 to 10.4.7
Bumps [@nestjs/core](https://github.com/nestjs/nest/tree/HEAD/packages/core) from 10.4.6 to 10.4.7. - [Release notes](https://github.com/nestjs/nest/releases) - [Commits](https://github.com/nestjs/nest/commits/v10.4.7/packages/core) --- updated-dependencies: - dependency-name: "@nestjs/core" dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com>
…nestjs/core-10.4.7 build(deps): Bump @nestjs/core from 10.4.6 to 10.4.7
Bumps [eslint-plugin-n](https://github.com/eslint-community/eslint-plugin-n) from 17.12.0 to 17.13.0. - [Release notes](https://github.com/eslint-community/eslint-plugin-n/releases) - [Changelog](https://github.com/eslint-community/eslint-plugin-n/blob/master/CHANGELOG.md) - [Commits](eslint-community/eslint-plugin-n@v17.12.0...v17.13.0) --- updated-dependencies: - dependency-name: eslint-plugin-n dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com>
…eslint-plugin-n-17.13.0 build(deps-dev): Bump eslint-plugin-n from 17.12.0 to 17.13.0
Bumps [@nestjs/axios](https://github.com/nestjs/axios) from 3.1.1 to 3.1.2. - [Release notes](https://github.com/nestjs/axios/releases) - [Changelog](https://github.com/nestjs/axios/blob/master/.release-it.json) - [Commits](nestjs/axios@3.1.1...3.1.2) --- updated-dependencies: - dependency-name: "@nestjs/axios" dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com>
…nestjs/axios-3.1.2 build(deps): Bump @nestjs/axios from 3.1.1 to 3.1.2
Bumps [eslint-plugin-n](https://github.com/eslint-community/eslint-plugin-n) from 17.13.0 to 17.13.1. - [Release notes](https://github.com/eslint-community/eslint-plugin-n/releases) - [Changelog](https://github.com/eslint-community/eslint-plugin-n/blob/master/CHANGELOG.md) - [Commits](eslint-community/eslint-plugin-n@v17.13.0...v17.13.1) --- updated-dependencies: - dependency-name: eslint-plugin-n dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com>
…eslint-plugin-n-17.13.1 build(deps-dev): Bump eslint-plugin-n from 17.13.0 to 17.13.1
Bumps [@nestjs/swagger](https://github.com/nestjs/swagger) from 7.4.2 to 8.0.3. - [Release notes](https://github.com/nestjs/swagger/releases) - [Changelog](https://github.com/nestjs/swagger/blob/master/.release-it.json) - [Commits](nestjs/swagger@7.4.2...8.0.3) --- updated-dependencies: - dependency-name: "@nestjs/swagger" dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Run & review this pull request in StackBlitz Codeflow. |
Reviewer's Guide by SourceryThis pull request primarily focuses on dependency updates, code reorganization, and feature enhancements for the ingredients API. The changes include updating NestJS and other package versions, restructuring the ingredients module with a new v1 endpoint, and improving the ingredient classification logic. ER diagram for ingredient classificationerDiagram
INGREDIENT {
string name
}
INGREDIENT ||--o{ IS_VEGAN : classified_as
INGREDIENT ||--o{ IS_NOT_VEGAN : classified_as
INGREDIENT ||--o{ IS_MAYBE_NOT_VEGAN : classified_as
IS_VEGAN {
string name
}
IS_NOT_VEGAN {
string name
}
IS_MAYBE_NOT_VEGAN {
string name
}
Class diagram for Ingredients ModuleclassDiagram
class IngredientsController {
+onModuleInit()
+getIngredients(ingredientsParam: string, res: Response, translateFlag: boolean)
-parseIngredients(ingredientsString: string): string[]
-sendResponse(res: Response, notVeganItems: string[], maybeNotVeganItems: string[], veganItems: string[], unknownItems: string[])
}
class IngredientsV1Controller {
+onModuleInit()
+getIngredients(ingredientsParam: string, res: Response, translateFlag: boolean)
-parseIngredients(ingredientsString: string): string[]
-sendResponse(res: Response, notVeganItems: string[], maybeNotVeganItems: string[], veganItems: string[], unknownItems: string[])
}
class TranslationService
class ParseBooleanPipe
class V0ResponseData {
+vegan: boolean
+surely_vegan: string[]
+not_vegan: string[]
+maybe_vegan: string[]
}
class V1ResponseData {
+vegan: boolean
+surely_vegan: string[]
+not_vegan: string[]
+maybe_not_vegan: string[]
+unknown: string[]
}
IngredientsController --> TranslationService
IngredientsV1Controller --> TranslationService
IngredientsController --> ParseBooleanPipe
IngredientsV1Controller --> ParseBooleanPipe
IngredientsController --> V0ResponseData
IngredientsV1Controller --> V1ResponseData
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this 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 - here's some feedback:
Overall Comments:
- Please add documentation describing the breaking changes between v0 and v1 API versions, particularly the response schema differences with the new maybe_not_vegan field
Here's what I looked at during the review
- 🟡 General issues: 1 issue found
- 🟢 Security: all looks good
- 🟢 Testing: all looks good
- 🟢 Complexity: all looks good
- 🟢 Documentation: all looks good
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
return list.map((item) => item.toLowerCase()); | ||
} | ||
|
||
private sophisticatedMatch(ingredient: string, list: string[]): boolean { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
suggestion (performance): Performance optimization needed for RegExp creation
Creating new RegExp objects in a frequently called method can impact performance. Consider refactoring to minimize RegExp object creation or explore alternative matching strategies.
private sophisticatedMatch(ingredient: string, list: string[]): boolean { | |
private readonly whitespaceRegex = /\s+/g; | |
private sophisticatedMatch(ingredient: string, list: string[]): boolean { |
private sophisticatedMatch(ingredient: string, list: string[]): boolean { | ||
const normalizedIngredient = ingredient.toLowerCase().replace(/\s+/g, ""); | ||
|
||
if (list.includes(normalizedIngredient)) return true; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
suggestion (code-quality): Use block braces for ifs, whiles, etc. (use-braces
)
if (list.includes(normalizedIngredient)) return true; | |
if (list.includes(normalizedIngredient)) { |
Explanation
It is recommended to always use braces and create explicit statement blocks.Using the allowed syntax to just write a single statement can lead to very confusing
situations, especially where subsequently a developer might add another statement
while forgetting to add the braces (meaning that this wouldn't be included in the condition).
if (list.some((item) => wordBoundaryRegex.test(item.replace(/\s+/g, "")))) | ||
return true; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
suggestion (code-quality): Use block braces for ifs, whiles, etc. (use-braces
)
if (list.some((item) => wordBoundaryRegex.test(item.replace(/\s+/g, "")))) | |
return true; | |
if (list.some((item) => wordBoundaryRegex.test(item.replace(/\s+/g, "")))) { | |
return true; | |
} | |
Explanation
It is recommended to always use braces and create explicit statement blocks.Using the allowed syntax to just write a single statement can lead to very confusing
situations, especially where subsequently a developer might add another statement
while forgetting to add the braces (meaning that this wouldn't be included in the condition).
# Conflicts: # ismaybenotvegan.json # src/app.module.ts # src/ingredients/ingredients.module.ts # src/ingredients/tests/ingredients.controller.spec.ts # src/ingredients/tests/ingredientsv1.controller.spec.ts # src/ingredients/v0/ingredients.controller.ts # src/ingredients/v1/ingredients.controller.ts
Summary by Sourcery
Update dependencies and introduce new features including a new API endpoint for product details and an enhanced ingredients processing controller. Refactor existing code to improve modularity and maintainability, and update documentation and tests accordingly.
New Features:
Enhancements:
Build:
Documentation:
Tests: