Skip to content

Conversation

@eluce2
Copy link
Collaborator

@eluce2 eluce2 commented Jun 25, 2025

Summary by CodeRabbit

  • New Features

    • Introduced a new shared utility package for formatting and saving source files, now used by type generation and CLI tools.
  • Chores

    • Updated package configurations and dependencies to use the new shared utility package.
    • Improved formatting consistency after type generation.
    • Enhanced TypeScript project configuration for better module resolution and aliasing.
    • Added and updated build and development scripts for the shared utilities package.

@vercel
Copy link

vercel bot commented Jun 25, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
proofkit-docs ✅ Ready (Inspect) Visit Preview Jun 25, 2025 2:17pm

@eluce2 eluce2 marked this pull request as ready for review June 25, 2025 14:11
Copy link
Collaborator Author

eluce2 commented Jun 25, 2025

This stack of pull requests is managed by Graphite. Learn more about stacking.

This was referenced Jun 25, 2025
Copy link
Collaborator Author

eluce2 commented Jun 25, 2025

Merge activity

  • Jun 25, 2:11 PM UTC: A user started a stack merge that includes this pull request via Graphite.
  • Jun 25, 2:11 PM UTC: @eluce2 merged this pull request with Graphite.

@eluce2 eluce2 merged commit 4fdb916 into main Jun 25, 2025
1 of 3 checks passed
@coderabbitai
Copy link

coderabbitai bot commented Jun 25, 2025

Caution

Review failed

The pull request is closed.

Walkthrough

This update introduces a new @proofkit/shared-utils package containing a utility function for formatting and saving TypeScript source files using Prettier and ts-morph. Both the @proofkit/typegen and @proofkit/cli packages now depend on this shared utility, replacing their local formatting implementations. Several configuration files were updated or added to support the new package and streamline TypeScript module resolution.

Changes

File(s) Change Summary
.changeset/fruity-otters-sip.md Documents patch updates and formatting improvements for @proofkit/typegen and @proofkit/cli.
packages/cli/package.json
packages/typegen/package.json
Added "@proofkit/shared-utils": "workspace:*" as a dependency.
packages/cli/src/cli/add/data-source/filemaker.ts Clarified prompt logic with parentheses, added semicolon, and removed project argument from a function call.
packages/cli/src/utils/ts-morph.ts Removed local formatAndSaveSourceFiles and re-exported it from @proofkit/shared-utils.
packages/typegen/src/typegen.ts Replaced manual formatting logic with a call to formatAndSaveSourceFiles from shared utils.
packages/typegen/tsconfig.json Simplified config by extending base config and removing redundant options.
packages/shared-utils/package.json Replaced minimal private config with a full public npm package manifest and build scripts.
packages/shared-utils/src/formatting.ts Added new exported async function formatAndSaveSourceFiles for formatting ts-morph projects.
packages/shared-utils/src/index.ts Re-exported all exports from the formatting module.
packages/shared-utils/tsconfig.json Added TypeScript config extending the base, with output, source, and exclusion settings.
packages/shared-utils/vite.config.ts Added Vite config merging base and specialized settings for building the package.
tsconfig.json Added baseUrl and paths for @proofkit/* alias resolution to packages/*/src.

Sequence Diagram(s)

sequenceDiagram
    participant TypeGen as @proofkit/typegen
    participant CLI as @proofkit/cli
    participant SharedUtils as @proofkit/shared-utils
    participant Prettier as Prettier
    participant TSMorph as ts-morph

    TypeGen->>SharedUtils: import { formatAndSaveSourceFiles }
    CLI->>SharedUtils: import { formatAndSaveSourceFiles }
    TypeGen->>SharedUtils: formatAndSaveSourceFiles(project)
    CLI->>SharedUtils: formatAndSaveSourceFiles(project)
    SharedUtils->>TSMorph: get all source files from project
    loop for each source file
        SharedUtils->>Prettier: getFileInfo(filePath)
        alt not ignored by Prettier
            SharedUtils->>Prettier: format(fileText, options)
            SharedUtils->>TSMorph: update file text
        end
    end
    SharedUtils->>TSMorph: project.save()
Loading

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

packages/cli/src/cli/add/data-source/filemaker.ts

Oops! Something went wrong! :(

ESLint: 9.27.0

ESLint couldn't find an eslint.config.(js|mjs|cjs) file.

From ESLint v9.0.0, the default configuration file is now eslint.config.js.
If you are using a .eslintrc.* file, please follow the migration guide
to update your configuration file to the new format:

https://eslint.org/docs/latest/use/configure/migration-guide

If you still have problems after following the migration guide, please stop by
https://eslint.org/chat/help to chat with the team.

packages/cli/src/utils/ts-morph.ts

Oops! Something went wrong! :(

ESLint: 9.27.0

ESLint couldn't find an eslint.config.(js|mjs|cjs) file.

From ESLint v9.0.0, the default configuration file is now eslint.config.js.
If you are using a .eslintrc.* file, please follow the migration guide
to update your configuration file to the new format:

https://eslint.org/docs/latest/use/configure/migration-guide

If you still have problems after following the migration guide, please stop by
https://eslint.org/chat/help to chat with the team.

packages/shared-utils/src/formatting.ts

Oops! Something went wrong! :(

ESLint: 9.27.0

ESLint couldn't find an eslint.config.(js|mjs|cjs) file.

From ESLint v9.0.0, the default configuration file is now eslint.config.js.
If you are using a .eslintrc.* file, please follow the migration guide
to update your configuration file to the new format:

https://eslint.org/docs/latest/use/configure/migration-guide

If you still have problems after following the migration guide, please stop by
https://eslint.org/chat/help to chat with the team.

  • 3 others

📜 Recent review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between a48b557 and b483d67.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (13)
  • .changeset/fruity-otters-sip.md (1 hunks)
  • packages/cli/package.json (1 hunks)
  • packages/cli/src/cli/add/data-source/filemaker.ts (2 hunks)
  • packages/cli/src/utils/ts-morph.ts (1 hunks)
  • packages/shared-utils/package.json (1 hunks)
  • packages/shared-utils/src/formatting.ts (1 hunks)
  • packages/shared-utils/src/index.ts (1 hunks)
  • packages/shared-utils/tsconfig.json (1 hunks)
  • packages/shared-utils/vite.config.ts (1 hunks)
  • packages/typegen/package.json (1 hunks)
  • packages/typegen/src/typegen.ts (2 hunks)
  • packages/typegen/tsconfig.json (2 hunks)
  • tsconfig.json (1 hunks)
✨ Finishing Touches
  • 📝 Generate Docstrings

🪧 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.
    • Explain this complex logic.
    • 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 explain this code block.
    • @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 explain its main purpose.
    • @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.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

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 generate sequence diagram to generate a sequence diagram of the changes in 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.

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.

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.

2 participants