Skip to content

Dev#15

Merged
joshunrau merged 43 commits intomainfrom
dev
Mar 19, 2025
Merged

Dev#15
joshunrau merged 43 commits intomainfrom
dev

Conversation

@joshunrau
Copy link
Collaborator

@joshunrau joshunrau commented Mar 19, 2025

  • add support for source maps in cli
  • internal changes to build system
  • add support for prisma in docker build

Summary by CodeRabbit

  • New Features

    • CLI build and development commands now include source map support for improved debugging.
    • Extended build configurations offer additional bundling options and stronger global variable management.
  • Chores

    • Formatting and linting tools have been updated to ignore build and distribution directories for streamlined performance.
    • New dependency updates enhance platform support and overall build reliability.

@joshunrau joshunrau merged commit 152f3c0 into main Mar 19, 2025
@coderabbitai
Copy link

coderabbitai bot commented Mar 19, 2025

Caution

Review failed

The pull request is closed.

Walkthrough

This pull request introduces a new .prettierignore file to exclude specific directories from Prettier formatting, updates the ESLint configuration to exclude those same directories from linting, and adds new dependencies to the package.json. It also includes modifications to various source files, such as updating function names in test files, changing import paths, and adding new functionality for building and running applications. Additionally, new test suites have been created to validate the functionality of the newly introduced methods and plugins.

Changes

File(s) Change Summary
.prettierignore New file added to ignore build/ and dist/ directories for Prettier formatting.
eslint.config.js Added exclude: ['build/**/*', 'dist/**/*'] to avoid linting files in build and distribution directories.
package.json Added dependencies: "@prisma/engines": "^6.5.0" and "@prisma/get-platform": "^6.5.0".
src/app/app.container.ts Updated comment to clarify that multiple environment variables can be statically replaced.
src/cli/__tests__/libnest-build.test.ts, src/cli/libnest.test.ts Updated mocks: replaced bundle with buildProd and renamed path resolution function.
src/cli/__tests__/libnest-dev.test.ts Updated mocked module from ../../utils/meta.utils.js to ../../meta/dev.js for runDev.
src/cli/bin/libnest-build, src/cli/bin/libnest-dev Modified shebang lines to include --enable-source-maps (and --watch retained for dev).
src/cli/libnest-build.ts Changed import and invocation from bundle to buildProd from the meta folder.
src/cli/libnest-dev.ts Updated import of runDev to load from ../meta/dev.js.
src/cli/libnest.ts Replaced resolveAbsoluteImportPathFromCwd with resolveAbsoluteImportPath (with an added parameter).
src/meta/__tests__/* Added new test suites for build, dev, import, load, parse, and resolve functions.
src/meta/build.ts New file added with the bundle and buildProd functions for production builds.
src/meta/dev.ts New file added with the runDev function for running the development server.
src/meta/import.ts New file added with the importDefault function for dynamic module imports.
src/meta/load.ts New file added exporting loadUserConfig, loadEntry, and loadAppContainer along with the associated type.
src/meta/parse.ts New file added containing the parseEntryFromFunction to validate dynamic import expressions.
src/meta/plugins/* New files and tests added for prismaPlugin and swcPlugin esbuild plugins.
src/meta/resolve.ts New file added with resolveAbsoluteImportPath and resolveUserConfig functions for path resolution.
src/testing/helpers/cli.ts, src/testing/helpers/e2e.ts Updated test helpers: added a mocked cwd and revised configuration loading logic.
src/user-config.ts Updated UserConfigOptions: added optional esbuildOptions and mode properties; refined globals type to Jsonifiable.
src/utils/__tests__/*, src/utils/build.utils.ts, src/utils/meta.utils.ts Removed: Deleted test files and utility modules that have been replaced by functionality moved under src/meta/.

Sequence Diagram(s)

sequenceDiagram
  participant U as User/CLI
  participant LB as libnest‐build.ts
  participant BP as buildProd (meta/build.ts)
  participant LU as loadUserConfig (meta/load.ts)
  participant PE as parseEntryFromFunction (meta/parse.ts)
  participant B as bundle (meta/build.ts)
  
  U->>LB: Execute build command with configFile
  LB->>BP: Call buildProd({ configFile })
  BP->>LU: Load user configuration
  LU-->>BP: Return configuration data
  BP->>PE: Parse entry from configuration entry function
  PE-->>BP: Return entry specifier
  BP->>B: Call bundle({ config, entrySpecifier, resolveDir })
  B-->>BP: Return build result
  BP-->>LB: Return result (or error)
  LB-->>U: Output build result
Loading
sequenceDiagram
  participant U as User/CLI
  participant D as libnest‐dev.ts
  participant RD as runDev (meta/dev.ts)
  participant RA as resolveAbsoluteImportPath (meta/resolve.ts)
  participant LU as loadUserConfig (meta/load.ts)
  participant LAC as loadAppContainer (meta/load.ts)
  participant AC as AppContainer
  
  U->>D: Execute dev command with configFile
  D->>RD: Call runDev(configFile)
  RD->>RA: Resolve absolute path for config file
  RA-->>RD: Return resolved path
  RD->>LU: Load user configuration
  LU-->>RD: Return configuration and baseDir
  RD->>LAC: Load app container (dynamic mode)
  LAC-->>RD: Return AppContainer
  RD->>AC: Call bootstrap on AppContainer
  AC-->>RD: Bootstrap complete
  RD-->>D: Return success status
  D-->>U: Output dev result
Loading

Poem

I'm a happy rabbit hopping through the code,
Skipping past builds on a merry, bug-free road.
With modules and plugins in a playful array,
Each line a fresh carrot, lighting my way.
In this digital meadow, our work takes flight—
Code and magic, dancing under source-mapped light!
Hooray for change, in every byte delight!


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 32dfde1 and 37378e0.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (35)
  • .prettierignore (1 hunks)
  • eslint.config.js (1 hunks)
  • package.json (1 hunks)
  • src/app/app.container.ts (1 hunks)
  • src/cli/__tests__/libnest-build.test.ts (2 hunks)
  • src/cli/__tests__/libnest-dev.test.ts (1 hunks)
  • src/cli/__tests__/libnest.test.ts (2 hunks)
  • src/cli/bin/libnest-build (1 hunks)
  • src/cli/bin/libnest-dev (1 hunks)
  • src/cli/libnest-build.ts (2 hunks)
  • src/cli/libnest-dev.ts (1 hunks)
  • src/cli/libnest.ts (2 hunks)
  • src/meta/__tests__/build.test.ts (1 hunks)
  • src/meta/__tests__/dev.test.ts (1 hunks)
  • src/meta/__tests__/import.test.ts (1 hunks)
  • src/meta/__tests__/load.test.ts (1 hunks)
  • src/meta/__tests__/parse.test.ts (1 hunks)
  • src/meta/__tests__/resolve.test.ts (1 hunks)
  • src/meta/build.ts (1 hunks)
  • src/meta/dev.ts (1 hunks)
  • src/meta/import.ts (1 hunks)
  • src/meta/load.ts (1 hunks)
  • src/meta/parse.ts (1 hunks)
  • src/meta/plugins/__tests__/prisma.test.ts (1 hunks)
  • src/meta/plugins/__tests__/swc.test.ts (1 hunks)
  • src/meta/plugins/prisma.ts (1 hunks)
  • src/meta/plugins/swc.ts (1 hunks)
  • src/meta/resolve.ts (1 hunks)
  • src/testing/helpers/cli.ts (1 hunks)
  • src/testing/helpers/e2e.ts (1 hunks)
  • src/user-config.ts (3 hunks)
  • src/utils/__tests__/build.utils.test.ts (0 hunks)
  • src/utils/__tests__/meta.utils.test.ts (0 hunks)
  • src/utils/build.utils.ts (0 hunks)
  • src/utils/meta.utils.ts (0 hunks)
✨ Finishing Touches
  • 📝 Generate Docstrings

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.

@github-actions
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