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

Feat update model #79

Merged
merged 9 commits into from
Jul 10, 2024
Merged

Feat update model #79

merged 9 commits into from
Jul 10, 2024

Conversation

Romakita
Copy link
Contributor

@Romakita Romakita commented Jul 10, 2024

Summary by CodeRabbit

  • New Features
    • Added guides and configuration for custom decorators, file uploads, and customizing 404 responses.
    • Introduced support for dynamically importing providers based on DI configuration.
    • Introduced Vike for server-side rendering.
    • Added guides for deploying Ts.ED applications on Serverless with AWS Lambda.
  • Documentation
    • Updated navigation links and added new configuration options for router and jsonMapper.
    • Documented the usage of @Any and @Nullable decorators.
    • Added installation instructions for passport.
  • Style
    • Reorganized CSS styles for the ApiAnchor component.
  • Bug Fixes
    • Updated import paths to ensure compatibility with @tsed/mongoose.

Copy link
Contributor

coderabbitai bot commented Jul 10, 2024

Warning

Rate limit exceeded

@Romakita has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 29 minutes and 42 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

📥 Commits

Files that changed from the base of the PR and between b8bbbb5 and 9fb0eb9.

Walkthrough

The recent updates encompass documentation improvements, configuration additions, and code enhancements. Key changes include new navigation links, refined CSS styles, enhanced router and JSON mapper configurations, and the introduction of custom decorators, middleware, and file upload handling. Additionally, there are comprehensive guides for serverless deployment, dynamic provider imports, and customizing 404 error pages.

Changes

File Path Change Summary
docs/.vitepress/config.mts Added links for "Custom decorators", "Upload files", and "Customize 404" in the navigation menu.
docs/.vitepress/theme/molecules/api-anchor/ApiAnchor.css Reorganized CSS styles, modified selectors, added hover effects, and reordered properties.
docs/docs/configuration/index.md Added router.appendChildrenRoutesFirst and jsonMapper.strictGroups configurations.
docs/docs/configuration/snippets/bootstrap-with-node-config.ts Updated rootDir variable definition to use __dirname.
docs/docs/custom-endpoint-decorators.md Introduced custom endpoint decorators for request handling.
docs/docs/json-mapper.md Updated jsonMapper configuration with strictGroups property.
docs/docs/model.md Introduced usage of @Any and @Nullable decorators for metadata assignment.
docs/docs/not-found-page.md Guide on customizing the 404 error response using Exception filters in Ts.ED.
docs/docs/providers.md Added functionality to import providers dynamically based on DI configuration.
docs/docs/snippets/middlewares/platform-accept-mimes-middleware.ts Introduced PlatformAcceptMimesMiddleware for handling accepted MIME types.
docs/docs/snippets/multer/configuration.ts Defined multer configuration setup within a Server class.
docs/docs/snippets/multer/controller.ts Introduced MyCtrl controller class for file upload handling.
docs/docs/snippets/multer/file-array.ts Introduced MyCtrl controller class for uploading multiple files.
docs/docs/snippets/multer/loading-file.js Introduced function loadFile for asynchronous file loading.
docs/docs/upload-files.md Documented file upload support using Multer in Ts.ED.
docs/tutorials/mongoose.md Updated import path for @tsed/mongoose in the Configuration link.
docs/tutorials/passport.md Added installation instructions for passport.
docs/tutorials/serverless.md Guide on deploying Ts.ED applications on Serverless with AWS Lambda.
docs/tutorials/vike.md Introduced Vike usage with Ts.ED for server-side rendering.

Poem

In the land of code where changes flow,
With new links and guides, our knowledge does grow.
Custom decorators and file uploads appear,
Dynamic imports bring a cheer.
Serverless dreams take flight on high,
With Ts.ED, we reach the sky.
🐇✨


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 7

Outside diff range, codebase verification and nitpick comments (7)
docs/docs/not-found-page.md (1)

13-15: Fix grammatical issue in the warning.

Correct the grammar in the warning message.

- `response.render()` require to configure the template engine before.
+ `response.render()` requires configuring the template engine beforehand.
Tools
LanguageTool

[grammar] ~14-~14: Did you mean “configuring”? Or maybe you should add a pronoun? In active voice, ‘require’ + ‘to’ takes an object, usually a pronoun.
Context: ...::: warning response.render() require to configure the template engine before. See our pag...

(ALLOW_TO)

docs/docs/custom-endpoint-decorators.md (1)

47-52: Consider using a more descriptive adjective.

The phrase "really small" can be improved for clarity.

- If your action is really small,
+ If your action is minimal,
Tools
LanguageTool

[style] ~48-~48: Consider using an extreme adjective for ‘small’.
Context: ...out Ts.ED middleware. If your action is really small, you can register a pure express middle...

(EXTREME_ADJECTIVES)

docs/docs/providers.md (1)

Line range hint 148-249: Fix unordered list indentation.

The unordered list indentation should be corrected to follow Markdownlint rules.

-  - [Service](/docs/services.md),
-  - [Controller](/docs/controllers.md),
-  - [Middleware](/docs/middlewares.md),
-  - [Pipes](/docs/pipes.md).
+  - [Service](/docs/services.md),
+  - [Controller](/docs/controllers.md),
+  - [Middleware](/docs/middlewares.md),
+  - [Pipes](/docs/pipes.md).
Tools
LanguageTool

[style] ~254-~254: Consider shortening this phrase to just ‘whether’, unless you mean ‘regardless of whether’.
Context: ...plication loads, so do all the modules, whether or not they are immediately necessary. While t...

(WHETHER)

docs/tutorials/serverless.md (4)

4-4: Improve readability by rephrasing.

The sentence structure can be improved for better readability.

- content: Guide to deploy your Ts.ED application on Serveless.
+ content: Guide to deploying your Ts.ED application on Serverless.

72-72: Rephrase for better readability.

Consider rephrasing to improve readability.

- By convention, try to not import something from `@tsed/common`.
+ By convention, try not to import anything from `@tsed/common`.
Tools
LanguageTool

[style] ~72-~72: Consider changing the order of words to improve your wording.
Context: ...# Rule ::: warning By convention, try to not import something from @tsed/common. `...

(TO_NOT_VB)


[style] ~72-~72: The phrase ‘a lot of’ might be wordy and overused. Consider using an alternative.
Context: ...om @tsed/common. @tsed/common embed a lot of codes designed for the Full server plat...

(A_LOT_OF)


224-224: Improve sentence flow.

Rephrase to improve sentence flow.

- For that, we need also to build our code before invoke the lambda.
+ For that, we also need to build our code before invoking the lambda.
Tools
LanguageTool

[style] ~224-~224: To make your writing flow more naturally, try moving ‘also’ before the verb.
Context: ...le to invoke our function. For that, we need also to build our code before invoke the lam...

(ALSO_PLACEMENT)


239-239: Specify language in code block.

Add a language identifier to the code block for better syntax highlighting.

- ```
+ ```bash
Tools
Markdownlint

239-239: null
Fenced code blocks should have a language specified

(MD040, fenced-code-language)

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 0d310b0 and b8bbbb5.

Files ignored due to path filters (4)
  • docs/public/serverless.png is excluded by !**/*.png
  • docs/public/serverless.svg is excluded by !**/*.svg
  • docs/public/vike-tsed.png is excluded by !**/*.png
  • docs/public/vike.svg is excluded by !**/*.svg
Files selected for processing (19)
  • docs/.vitepress/config.mts (3 hunks)
  • docs/.vitepress/theme/molecules/api-anchor/ApiAnchor.css (2 hunks)
  • docs/docs/configuration/index.md (2 hunks)
  • docs/docs/configuration/snippets/bootstrap-with-node-config.ts (1 hunks)
  • docs/docs/custom-endpoint-decorators.md (1 hunks)
  • docs/docs/json-mapper.md (2 hunks)
  • docs/docs/model.md (3 hunks)
  • docs/docs/not-found-page.md (1 hunks)
  • docs/docs/providers.md (1 hunks)
  • docs/docs/snippets/middlewares/platform-accept-mimes-middleware.ts (1 hunks)
  • docs/docs/snippets/multer/configuration.ts (1 hunks)
  • docs/docs/snippets/multer/controller.ts (1 hunks)
  • docs/docs/snippets/multer/file-array.ts (1 hunks)
  • docs/docs/snippets/multer/loading-file.js (1 hunks)
  • docs/docs/upload-files.md (1 hunks)
  • docs/tutorials/mongoose.md (1 hunks)
  • docs/tutorials/passport.md (1 hunks)
  • docs/tutorials/serverless.md (1 hunks)
  • docs/tutorials/vike.md (1 hunks)
Files skipped from review due to trivial changes (4)
  • docs/.vitepress/config.mts
  • docs/docs/configuration/snippets/bootstrap-with-node-config.ts
  • docs/docs/json-mapper.md
  • docs/tutorials/mongoose.md
Additional context used
LanguageTool
docs/docs/not-found-page.md

[grammar] ~14-~14: Did you mean “configuring”? Or maybe you should add a pronoun? In active voice, ‘require’ + ‘to’ takes an object, usually a pronoun.
Context: ...::: warning response.render() require to configure the template engine before. See our pag...

(ALLOW_TO)

docs/docs/custom-endpoint-decorators.md

[style] ~48-~48: Consider using an extreme adjective for ‘small’.
Context: ...out Ts.ED middleware. If your action is really small, you can register a pure express middle...

(EXTREME_ADJECTIVES)

docs/tutorials/vike.md

[uncategorized] ~81-~81: Loose punctuation mark.
Context: ...x) with 2 projects: - packages/server: the backend project - `packages/ser...

(UNLIKELY_OPENING_PUNCTUATION)

docs/tutorials/serverless.md

[style] ~15-~15: Three successive sentences begin with the same word. Consider rewording the sentence or use a thesaurus to find a synonym.
Context: ...ce web framework written using Node.js. Serverless is the first framework developed for bu...

(ENGLISH_WORD_REPEAT_BEGINNING_RULE)


[style] ~72-~72: Consider changing the order of words to improve your wording.
Context: ...# Rule ::: warning By convention, try to not import something from @tsed/common. `...

(TO_NOT_VB)


[style] ~72-~72: The phrase ‘a lot of’ might be wordy and overused. Consider using an alternative.
Context: ...om @tsed/common. @tsed/common embed a lot of codes designed for the Full server plat...

(A_LOT_OF)


[style] ~224-~224: To make your writing flow more naturally, try moving ‘also’ before the verb.
Context: ...le to invoke our function. For that, we need also to build our code before invoke the lam...

(ALSO_PLACEMENT)


[uncategorized] ~341-~341: “you” seems less likely than “your” (belonging to you).
Context: ...## Testing Ts.ED provide a way to test you lambda with mocked Aws event and contex...

(AI_HYDRA_LEO_CP_YOU_YOUR)


[grammar] ~342-~342: A verb may be missing.
Context: ...g the @@PlatformServerlessTest@@ util. Here an example to test a Lambda controller:...

(THERE_MISSING_VERB)

Markdownlint
docs/docs/upload-files.md

40-40: Expected: 2; Actual: 4
Unordered list indentation

(MD007, ul-indent)


41-41: Expected: 2; Actual: 4
Unordered list indentation

(MD007, ul-indent)


42-42: Expected: 2; Actual: 4
Unordered list indentation

(MD007, ul-indent)


43-43: Expected: 2; Actual: 4
Unordered list indentation

(MD007, ul-indent)


44-44: Expected: 2; Actual: 4
Unordered list indentation

(MD007, ul-indent)


45-45: Expected: 2; Actual: 4
Unordered list indentation

(MD007, ul-indent)


46-46: Expected: 2; Actual: 4
Unordered list indentation

(MD007, ul-indent)

docs/tutorials/vike.md

82-82: Expected: 2; Actual: 4
Unordered list indentation

(MD007, ul-indent)


83-83: Expected: 2; Actual: 4
Unordered list indentation

(MD007, ul-indent)


85-85: Expected: 2; Actual: 4
Unordered list indentation

(MD007, ul-indent)


86-86: Expected: 2; Actual: 4
Unordered list indentation

(MD007, ul-indent)


166-166: null
Fenced code blocks should have a language specified

(MD040, fenced-code-language)


160-160: null
Images should have alternate text (alt text)

(MD045, no-alt-text)

docs/tutorials/serverless.md

56-56: Punctuation: '...'
Trailing punctuation in heading

(MD026, no-trailing-punctuation)


239-239: null
Fenced code blocks should have a language specified

(MD040, fenced-code-language)

Additional comments not posted (35)
docs/docs/snippets/multer/configuration.ts (1)

1-9: Ensure proper configuration of Multer options.

The configuration for multer specifies the destination directory for uploads. It is important to ensure that this directory is secure and has appropriate permissions to avoid potential security issues.

Ensure that the specified directory ./../uploads is secure and has the correct permissions set.

docs/docs/snippets/middlewares/platform-accept-mimes-middleware.ts (3)

1-6: Imports and decorators are correct.

The imports and decorators are appropriate for the functionality provided.


7-16: Class definition and properties are correct.

The class definition and properties are appropriately set up.


18-25: Logic in the use method is correct.

The use method correctly handles accepted MIME types and throws an appropriate exception.

docs/.vitepress/theme/molecules/api-anchor/ApiAnchor.css (2)

1-8: CSS rules for a[data-name="ApiAnchor"] are correct.

The CSS rules are appropriately applied and follow best practices.


Line range hint 10-32:
CSS rules for [data-name="ApiAnchor"] are correct.

The CSS rules are appropriately applied and follow best practices.

docs/docs/not-found-page.md (2)

1-7: Introduction and customization instructions are clear and correct.

The introduction and customization instructions are well-written and informative.


17-27: Import instructions are clear and correct.

The import instructions are well-written and informative.

docs/docs/custom-endpoint-decorators.md (2)

1-17: Introduction and built-in decorators section are clear and correct.

The introduction and built-in decorators section are well-written and informative.


19-33: Custom decorator example is clear and correct.

The custom decorator example is well-written and informative.

docs/docs/upload-files.md (4)

1-11: LGTM!

The metadata section is well-defined and appears to be correct.


13-22: LGTM!

The introduction and tip sections are clear and informative.


24-34: LGTM!

The configuration and example sections are clear and provide useful information.


50-69: LGTM!

The usage sections for single and multiple file uploads are clear and provide useful code snippets.

docs/tutorials/passport.md (5)

26-32: LGTM!

The installation section is clear and provides useful information for different package managers.


Line range hint 30-74: LGTM!

The configure your server section is clear and provides useful code snippets for configuration.


Line range hint 76-94: LGTM!

The create a new protocol section is clear and provides useful code snippets for creating a new protocol.


Line range hint 96-102: LGTM!

The protect a route section is clear and provides useful code snippets for protecting routes.


Line range hint 104-118: LGTM!

The basic auth and advanced auth sections are clear and provide useful code snippets for configuring the strategies.

docs/tutorials/vike.md (3)

1-14: LGTM!

The metadata section is well-defined and appears to be correct.


16-32: LGTM!

The introduction and tip sections are clear and informative.


39-87: LGTM!

The features and quick start sections are clear and provide useful information.

Tools
LanguageTool

[uncategorized] ~81-~81: Loose punctuation mark.
Context: ...x) with 2 projects: - packages/server: the backend project - `packages/ser...

(UNLIKELY_OPENING_PUNCTUATION)

Markdownlint

82-82: Expected: 2; Actual: 4
Unordered list indentation

(MD007, ul-indent)


83-83: Expected: 2; Actual: 4
Unordered list indentation

(MD007, ul-indent)


85-85: Expected: 2; Actual: 4
Unordered list indentation

(MD007, ul-indent)


86-86: Expected: 2; Actual: 4
Unordered list indentation

(MD007, ul-indent)

docs/docs/providers.md (4)

Line range hint 1-11: LGTM!

The metadata section is well-defined and appears to be correct.

Tools
LanguageTool

[style] ~254-~254: Consider shortening this phrase to just ‘whether’, unless you mean ‘regardless of whether’.
Context: ...plication loads, so do all the modules, whether or not they are immediately necessary. While t...

(WHETHER)


Line range hint 13-72: LGTM!

The introduction and services sections are clear and provide useful examples.

Tools
LanguageTool

[style] ~254-~254: Consider shortening this phrase to just ‘whether’, unless you mean ‘regardless of whether’.
Context: ...plication loads, so do all the modules, whether or not they are immediately necessary. While t...

(WHETHER)


Line range hint 74-94: LGTM!

The dependency injection and scopes sections are clear and provide useful information.

Tools
LanguageTool

[style] ~254-~254: Consider shortening this phrase to just ‘whether’, unless you mean ‘regardless of whether’.
Context: ...plication loads, so do all the modules, whether or not they are immediately necessary. While t...

(WHETHER)


Line range hint 96-146: LGTM!

The binding configuration and custom providers sections are clear and provide useful examples.

Tools
LanguageTool

[style] ~254-~254: Consider shortening this phrase to just ‘whether’, unless you mean ‘regardless of whether’.
Context: ...plication loads, so do all the modules, whether or not they are immediately necessary. While t...

(WHETHER)

docs/docs/configuration/index.md (4)

325-333: Well-documented new configuration for router.

The documentation for router.appendChildrenRoutesFirst is clear and provides the necessary details.


335-339: Clear explanation of router.appendChildrenRoutesFirst.

The description is concise and informative, making it easy to understand the purpose and default value of the configuration.


347-348: New configuration for jsonMapper looks good.

The addition of strictGroups: false is well-documented and fits seamlessly into the existing configuration documentation.


372-377: Informative warning about jsonMapper.strictGroups.

The warning about the default value change in the next major version is helpful for the users.

docs/docs/model.md (5)

99-111: Clear documentation for @Any decorator.

The example and explanation for using @Any decorator to allow all types is clear and informative.


188-200: Well-explained new functionality for @Any decorator.

The explanation of combining @Any with other decorators is clear and provides a useful example.


296-305: Clarity in @Nullable decorator usage.

The example and explanation for using @Nullable decorator with mixed types is clear and informative.


309-319: Well-documented new functionality for @Nullable decorator.

The explanation of combining @Nullable with other decorators is clear and provides a useful example.


329-339: Correct JSON Schema example.

The JSON Schema example for @Nullable decorator usage is correct and informative.

docs/docs/snippets/multer/file-array.ts Show resolved Hide resolved
docs/tutorials/serverless.md Outdated Show resolved Hide resolved
docs/docs/snippets/multer/loading-file.js Show resolved Hide resolved
docs/docs/snippets/multer/controller.ts Show resolved Hide resolved
docs/docs/upload-files.md Outdated Show resolved Hide resolved
docs/tutorials/vike.md Outdated Show resolved Hide resolved
docs/tutorials/vike.md Outdated Show resolved Hide resolved
Romakita and others added 4 commits July 10, 2024 13:59
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
@Romakita Romakita merged commit 60b9fbf into main Jul 10, 2024
7 checks passed
@Romakita Romakita deleted the feat-update-model branch July 15, 2024 21:24
@Romakita
Copy link
Contributor Author

🎉 This PR is included in version 1.0.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant