Skip to content

a number of changes #13

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

Merged
merged 99 commits into from
Mar 18, 2025
Merged

a number of changes #13

merged 99 commits into from
Mar 18, 2025

Conversation

joshunrau
Copy link
Collaborator

@joshunrau joshunrau commented Mar 18, 2025

  • update cli file structure to support running multiple commands as subprocesses with different shebang
  • add end to end test helper function
  • fix issue with libnest dev hangs indefinitely on --help due to watch mode
  • add libnest build command to bundle application using config

Summary by CodeRabbit

  • New Features

    • Introduced new command-line entry points for building and development, along with new scripts to build and start example applications.
    • Enabled explicit build configuration to specify the production output location.
  • Chores

    • Upgraded the package manager to a newer version and streamlined configuration settings.
    • Refined the testing setup and dependency management to enhance overall stability.

Copy link

coderabbitai bot commented Mar 18, 2025

Warning

Rate limit exceeded

@github-actions[bot] has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 29 minutes and 50 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

Reviewing files that changed from the base of the PR and between 31f4934 and 84408f6.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (56)
  • .gitignore (1 hunks)
  • example/app.test.ts (1 hunks)
  • libnest.config.ts (1 hunks)
  • package.json (3 hunks)
  • src/app/__tests__/app.module.test.ts (1 hunks)
  • src/app/app.container.ts (4 hunks)
  • src/app/app.module.ts (2 hunks)
  • src/app/docs.factory.ts (2 hunks)
  • src/cli/__tests__/bin.test.ts (0 hunks)
  • src/cli/__tests__/libnest-build.test.ts (1 hunks)
  • src/cli/__tests__/libnest-dev.test.ts (1 hunks)
  • src/cli/__tests__/libnest.test.ts (1 hunks)
  • src/cli/bin.js (0 hunks)
  • src/cli/bin/libnest (1 hunks)
  • src/cli/bin/libnest-build (1 hunks)
  • src/cli/bin/libnest-dev (1 hunks)
  • src/cli/libnest-build.ts (1 hunks)
  • src/cli/libnest-dev.ts (1 hunks)
  • src/cli/libnest.ts (1 hunks)
  • src/decorators/route-access.decorator.ts (1 hunks)
  • src/decorators/validation-schema.decorator.ts (1 hunks)
  • src/index.ts (1 hunks)
  • src/middleware/delay.middleware.ts (1 hunks)
  • src/mixins/data-transfer-object.mixin.ts (2 hunks)
  • src/modules/auth/ability.factory.ts (1 hunks)
  • src/modules/auth/auth.config.ts (3 hunks)
  • src/modules/auth/auth.module.ts (2 hunks)
  • src/modules/auth/strategies/jwt.strategy.ts (2 hunks)
  • src/modules/crypto/crypto.config.ts (1 hunks)
  • src/modules/crypto/crypto.module.ts (1 hunks)
  • src/modules/crypto/crypto.service.ts (2 hunks)
  • src/modules/logging/json.logger.ts (5 hunks)
  • src/modules/logging/logging.middleware.ts (1 hunks)
  • src/modules/logging/logging.module.ts (2 hunks)
  • src/modules/prisma/__tests__/prisma.factory.test.ts (1 hunks)
  • src/modules/prisma/prisma.factory.ts (2 hunks)
  • src/modules/prisma/prisma.module.ts (3 hunks)
  • src/modules/prisma/prisma.service.ts (3 hunks)
  • src/modules/prisma/prisma.types.ts (2 hunks)
  • src/modules/prisma/prisma.utils.ts (2 hunks)
  • src/pipes/parse-schema.pipe.ts (1 hunks)
  • src/pipes/validation.pipe.ts (1 hunks)
  • src/schemas/env.schema.ts (0 hunks)
  • src/testing/factories/mock.factory.ts (1 hunks)
  • src/testing/helpers/cli.ts (1 hunks)
  • src/testing/helpers/e2e.ts (1 hunks)
  • src/testing/index.ts (1 hunks)
  • src/testing/setup.ts (1 hunks)
  • src/user-config.ts (2 hunks)
  • src/utils/__tests__/build.utils.test.ts (1 hunks)
  • src/utils/__tests__/meta.utils.test.ts (8 hunks)
  • src/utils/build.utils.ts (1 hunks)
  • src/utils/meta.utils.ts (5 hunks)
  • src/utils/validation.utils.ts (1 hunks)
  • typedoc.config.js (1 hunks)
  • vitest.config.js (1 hunks)

Walkthrough

This pull request introduces updates across configuration files, tests, CLI tools, modules, and type declarations. Notable modifications include the addition of a build configuration in both the .gitignore and user configuration files, refactoring of test structures to adopt an e2e paradigm, updates to CLI entry points and their associated tests, and extensive updates to type signatures and exports across the codebase.

Changes

File(s) Change Summary
.gitignore Added a new entry to ignore the build/ directory.
example/app.test.ts Refactored tests: switched from supertest/NestExpressApplication to an e2e testing utility; updated hooks and function signatures.
libnest.config.ts Introduced a new build configuration with an outfile property using path.resolve.
package.json Updated package manager version, modified bin entry, revised scripts (including new example commands), updated dependency versions, and added new knip/ pnpm configuration sections.
src/app/__tests__/app.module.test.ts Updated type import for CryptoOptions from crypto.config.js instead of the service file.
src/app/app.container.ts Renamed EnvSchema to BaseEnvSchema; updated type definitions, method signatures, and exports accordingly.
src/app/app.module.ts Reorganized type definitions: added DynamicAppModule, exported ConditionalImport, and updated the return type of configure to void.
src/app/docs.factory.ts Added import for OpenAPIObject and updated the createDocs method to explicitly return an OpenAPIObject.
src/cli/__tests__/* Removed obsolete CLI tests and added new test suites for libnest-build, libnest-dev, and libnest.
src/cli/bin/* Deleted bin.js and introduced new entry point scripts for libnest, libnest-build, and libnest-dev, each with ES module support.
src/cli/libnest*.ts Added new CLI implementations for build and development commands; updated action signatures and configuration validations.
src/decorators/route-access.decorator.ts Changed PublicRouteAccess from a private to an exported type.
src/decorators/validation-schema.decorator.ts Updated the inner function’s signature to explicitly return void.
src/index.ts Expanded and updated type exports with additional types and revised definitions.
src/middleware/delay.middleware.ts Removed the DelayOptions type; updated delay function signature to accept an inline typed parameter with an explicit void return.
src/mixins/data-transfer-object.mixin.ts Updated JSDoc parameter name (from shapeOrSchema to shape) and set an explicit return type of unknown.
src/modules/auth/* In ability factory, auth.config, auth.module, and jwt.strategy: updated method signatures (including explicit string and object return types) and added a new UserQueryResult type.
src/modules/crypto/* Refactored CryptoService to import CryptoOptions from the config; updated methods to include explicit return types.
src/modules/logging/* Updated JSONLogger logging methods, LoggingMiddleware’s use method, and LoggingModule’s factory setup to include explicit return types and improved imports.
src/modules/prisma/* Made comprehensive type and signature updates in prisma.factory, prisma.module, prisma.service, prisma.types, and prisma.utils: removed obsolete type arguments, added explicit Promise/string return types, and refactored token generation.
src/pipes/parse-schema.pipe.ts and src/pipes/validation.pipe.ts Updated the transform methods to explicitly return `Promise<T
src/schemas/env.schema.ts Removed documentation comments referencing RuntimeEnv from constants and type definitions.
src/testing/* Added new CLI and E2E helper files, updated the mock factory’s return type, and revised the testing setup for asynchronous module mocking.
src/user-config.ts Added a new build property with an outfile string and updated the return type of the defineUserConfig function.
src/utils/* Introduced new build.utils.ts with functions for esbuild and SWC transformations; updated meta.utils.ts to rename functions and add findConfig; set explicit return types in validation.utils.ts.
typedoc.config.js Added an intentionallyNotExported array to specify entities excluded from documentation.
vitest.config.js Expanded the coverage exclusion list to include files in src/testing/helpers/*.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant CLI
    participant ConfigResolver
    participant Executor

    User->>CLI: Run command (e.g., libnest --config-file <path>)
    CLI->>ConfigResolver: Resolve configuration file path
    ConfigResolver-->>CLI: Return resolved config path
    CLI->>Executor: Dispatch subcommand (build or dev)
    Executor-->>CLI: Execute bundling or development action
    CLI->>User: Output result or error
Loading

Poem

Hi there, I’m a hopping coder bunny,
Delighted to see these changes sunny.
Files and types now dance in line,
CLI commands robustly shine.
With carrots 🥕 and code so fine,
I hop in joy—oh, what a design!
Happy coding from your rabbit friend!


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ 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 generate docstrings to generate docstrings for this 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.

@joshunrau joshunrau merged commit f5de846 into main Mar 18, 2025
0 of 2 checks passed
Copy link

🎉 This PR is included in version 2.2.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