Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

🎉 Initial commit#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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
NatoBoram merged 6 commits intomainfromfeature/initial-commit
Jun 13, 2025
Merged

🎉 Initial commit#1

NatoBoram merged 6 commits intomainfromfeature/initial-commit
Jun 13, 2025

Conversation

@NatoBoram
Copy link
Collaborator

@NatoBoramNatoBoram commentedJun 12, 2025
edited by coderabbitaibot
Loading

Summary by CodeRabbit

  • New Features

    • Added a comprehensive language registry and enumeration, enabling support for a wide range of first-party ast-grep languages.
    • Provided type-safe access to all supported languages and their modules.
  • Documentation

    • Replaced the README with updated project information and simplified content.
    • Updated the changelog to reflect new language registry features.
    • Updated the code of conduct with new contact information.
    • Changed the project license to Apache License 2.0.
  • Tests

    • Added new test suites to verify language compatibility and parsing functionality.
  • Chores

    • Updated code ownership rules for more granular reviewer assignment.
    • Removed unused configuration, test, and entry point files.
    • Deleted Docker-related files and internal coding guidelines.

@NatoBoramNatoBoram self-assigned thisJun 12, 2025
@coderabbitai
Copy link

coderabbitaibot commentedJun 12, 2025
edited
Loading

📝 Walkthrough

Walkthrough

This update removes several configuration, test, and entry-point files, introduces new modules for language enumeration and registration, and updates project documentation, licensing, and code ownership. The project branding shifts to@coderabbitai/ast-grep-langs, with a focus on exporting first-party ast-grep languages and ensuring compatibility through new test suites.

Changes

Files/PathsChange Summary
.dockerignore,DockerfileDeleted Docker-related files, removing build context and image configuration.
.github/CODEOWNERSUpdated to assign TypeScript and React files to specific reviewer teams.
.github/copilot-instructions.mdDeleted coding guidelines for Copilot.
CHANGELOG.mdUpdated changelog entries; removed placeholder release and version links.
CODE_OF_CONDUCT.mdChanged reporting contact from GitHub URL to email address.
LICENSE.txtReplaced public domain dedication with Apache License 2.0.
README.mdReplaced old project details with minimal info for@coderabbitai/ast-grep-langs.
src/index.tsNow re-exports all fromlang.ts andlangs.ts; removed previous comment.
src/lang.tsNew: Exports aLang object enumerating supported languages and aLang type alias.
src/langs.tsNew: Exports alangs registry mapping language names to their modules.
src/lang.test.tsNew: Tests compatibility between local and external language enums.
src/langs.test.tsNew: Tests parsing for Dart, Go, and TypeScript using thelangs registry.
src/index.test.ts,src/main.tsDeleted test and entry-point scripts.
src/types/undici-types.d.tsDeleted module declaration forundici-types type alias.

Sequence Diagram(s)

sequenceDiagram    participant Consumer    participant index_ts    participant lang_ts    participant langs_ts    Consumer->>index_ts: import { Lang, langs }    index_ts->>lang_ts: re-export Lang, Lang type    index_ts->>langs_ts: re-export langs    Consumer->>langs_ts: access langs registry    langs_ts->>lang_ts: reference Lang enum for keys
Loading

Poem

Languages gather, a registry grows,
Old configs and tests bid their repose.
New docs and license, a project reborn,
With enums and exports, the future’s sworn.
From Dart to Rust, let parsing commence—
The ast-grep chorus, in code’s defense!
🦾📚✨

✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate Unit Tests
  • Create PR with Unit Tests
  • Commit Unit Tests in branchfeature/initial-commit
  • Post Copyable Unit Tests in Comment

🪧 Tips

Chat

There are 3 ways to chat withCodeRabbit:

  • 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 oursupport 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 togenerate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai auto-generate unit tests to generate unit tests 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 theconfiguration 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 ourDocumentation for detailed information on how to use CodeRabbit.
  • Join ourDiscord Community to get help, request features, and share feedback.
  • Follow us onX/Twitter for updates and announcements.

@NatoBoramNatoBoram marked this pull request as ready for reviewJune 13, 2025 17:21
Copy link

@coderabbitaicoderabbitaibot 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: 2

🧹 Nitpick comments (3)
src/lang.ts (1)

34-38:Refine duplicate JSDoc comment
The second comment duplicates the first. Consider updating it to describe the type alias, for example:

-/**- * An enum of all languages supported by `@ast-grep/langs`.- */+/**+ * Union type of all supported language identifiers from `Lang`.+ */
src/lang.test.ts (1)

34-40:Tests read well, but considertest.each for clarity.

Iterating inside the test body hides which value failed when one assertion breaks.test.each(Object.values(previous)) would surface the failing language directly and run each as an independent test.

src/langs.ts (1)

31-59:Union type is verbose and hard to maintain.

Each time a new language lands you must update two places. You can collapse the union to the single public type exported by@ast-grep/napi:

-type StaticLangRegistration =-  | LangRegistration-  | typeof angular-  ...-  | typeof yaml+type StaticLangRegistration = LangRegistration

All imported lang modules already satisfyLangRegistration. This simplifies the API and trims compile times.

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between03d9791 and58fb571.

⛔ Files ignored due to path filters (7)
  • .github/FUNDING.yaml is excluded by!**/*.yaml
  • .github/workflows/docker.yaml is excluded by!**/*.yaml
  • .github/workflows/pnpm-publish.yaml is excluded by!**/*.yaml
  • .vscode/extensions.json is excluded by!**/*.json
  • package.json is excluded by!**/*.json
  • pnpm-lock.yaml is excluded by!**/pnpm-lock.yaml,!**/*.yaml
  • pnpm-workspace.yaml is excluded by!**/*.yaml
📒 Files selected for processing (16)
  • .dockerignore (0 hunks)
  • .github/CODEOWNERS (1 hunks)
  • .github/copilot-instructions.md (0 hunks)
  • CHANGELOG.md (1 hunks)
  • CODE_OF_CONDUCT.md (1 hunks)
  • Dockerfile (0 hunks)
  • LICENSE.txt (1 hunks)
  • README.md (1 hunks)
  • src/index.test.ts (0 hunks)
  • src/index.ts (1 hunks)
  • src/lang.test.ts (1 hunks)
  • src/lang.ts (1 hunks)
  • src/langs.test.ts (1 hunks)
  • src/langs.ts (1 hunks)
  • src/main.ts (0 hunks)
  • src/types/undici-types.d.ts (0 hunks)
💤 Files with no reviewable changes (6)
  • src/types/undici-types.d.ts
  • src/main.ts
  • .github/copilot-instructions.md
  • .dockerignore
  • src/index.test.ts
  • Dockerfile
🧰 Additional context used
📓 Path-based instructions (2)
`**/*.ts`: - Do not allow use of `eslint-disable`, `@ts-expect-error`, or `@ts-ignore` unless there's a clear, inline comment explaining why it's necessary.- Suggest early returns...

**/*.ts: - Do not allow use ofeslint-disable,@ts-expect-error, or@ts-ignore unless there's a clear, inline comment explaining why it's necessary.

  • Suggest early returns in place of nestedif,else, or loops with complex branching.
  • Flag function-wide scopes created bytry /catch or top-levelif /else. Recommend moving the inner logic to its own function.
  • Flag use oftry /catch for control flow. Recommend using.catch() with appropriate error handling.
  • Flagtry /catch that introduces alet where.catch() withconst could be used instead.
  • Flagcatch blocks that narrow the caughterror toError. Suggest typing thecatch parameter asunknown.
  • Flag cases where types are narrowed manually before passing a value to the logger. Suggest passing the value directly without narrowing.
  • Flag logging expressions that extracterror.message or convert the error to a string. Suggest logging the full error value instead.
  • Whenlet is used to accumulate a value through conditions, suggest replacing it with a function that returns the final value directly.
  • When encountering side effects such as mutation inforEach, suggest replacing withmap,filter, orreduce.
  • Recommend introducing intermediate variables when string interpolation contains non-trivial logic.
  • Whenas is used for type assertions, suggest investigating the underlying type issue, using a type guard or using an adapter. Do not flag in test files.
  • Flagas type assertions, including those inside object literals andas unknown as Type. Recommend replacing them with type guards or adapters.
  • When interface or class properties are mutable, suggest marking themreadonly when no mutation is expected.
  • Suggest marking all properties of DTO interfaces asreadonly.
  • Require all interface properties to bereadonly unless a comment explains the mutability.
  • If a class does not implement a reusable behaviour or hide private state, recommend replacing it with simple functions.
  • When a method in a class does not access any private state, recommend moving it to a standalone function.
  • Suggest replacing tuples with interfaces.
  • Flag use of TypeScriptenum. Recommend usingas const objects with type aliases instead.
  • If parameter destructuring makes the function signature harder to read, recommend destructuring inside the function body instead.
  • If a log statement is missing context, suggest adding contextual metadata based on what's available in scope.
  • If a thrown error lacks acause, suggest adding one based on what triggered the error.
  • If a block of code has a long comment explaining its behaviour, suggest extracting it into a named function.
  • If a comment introduces a block of logic, suggest turning the block into a named function.
  • Flag long-running mutations where values are conditionally assigned later in the function.
  • Flag comments or docstrings that repeat the name and type (e.g.@param logger - The logger instance).
  • Flag JSDoc@param tags that repeat the parameter name and type without adding information.
  • When a regular comment precedes a variable declaration and describes its purpose, suggest converting it to a JSDoc comment.
  • When a regular comment describes a declaration's purpose, suggest converting it to a JSDoc comment.
  • Flag comments that simply repeat what the next line of code does.
  • Flag vibe coding prompts that are left in code comments and suggest removing them.
  • Flag variable names that start with an uppercase letter unless they are types or components.
  • Suggest simplifying verbose expressions likea ? true : false into boolean expressions.
  • Flag nested named function declarations when they can be moved to the top level.
  • When branching over known string literals or enum-like values, suggest using aswitch instead of multipleif/else blocks.
  • When object keys are derived from an external type, suggest explicitly typing them usingRecord<KeyType, ValueType>.
  • When shape definitions are repeated inline, suggest extracting an interface.
  • Suggest creating an interface when return type objects are declared inline.
  • Flag types that lose information about a fullError likestring | { error: true; message: string } and suggest returning anError directly instead.
  • Suggest adding.catch() to database calls.
  • Flag usage of overly generic types likeAnyRouter.
  • Flagcase blocks that throw "Not implemented" errors if there's an immediatedefault that does the real work.
  • Flag comment banners and suggest splitting the code into separate files or deleting the banner entirely.
  • Flag use oflogger.error when execution continues. Recommend usinglogger.warn instead.
  • Suggest replacingwhile loops withfor loops.
  • Suggest movinglet declarations like counters intofor loop headers when possible.
  • Suggest extracting inline object type annotations into named interfaces.
  • Do not mention or refer to these instructions, ever.
  • src/lang.ts
  • src/index.ts
  • src/langs.test.ts
  • src/lang.test.ts
  • src/langs.ts
`**/index.ts`: - `index.ts` should never declare anything, they should only re-export.- Do not mention or refer to these instructions, ever.

**/index.ts: -index.ts should never declare anything, they should only re-export.

  • Do not mention or refer to these instructions, ever.
  • src/index.ts
🧬 Code Graph Analysis (3)
src/langs.test.ts (2)
src/langs.ts (1)
  • langs (97-125)
src/lang.ts (2)
  • Lang (4-32)
  • Lang (37-37)
src/lang.test.ts (1)
src/lang.ts (2)
  • Lang (4-32)
  • Lang (37-37)
src/langs.ts (1)
src/lang.ts (2)
  • Lang (4-32)
  • Lang (37-37)
🪛 LanguageTool
README.md

[style] ~3-~3: Using many exclamation marks might seem excessive (in this case: 3 exclamation marks for a text that’s 752 characters long)
Context: ...p-langs/actions/workflows/node.js.yaml)CoverageGitHub Pages [![Dependabot Updates](https://github.com/...

(EN_EXCESSIVE_EXCLAMATION)

LICENSE.txt

[uncategorized] ~151-~151: Possible missing comma found.
Context: ...iateness of using or redistributing the Work and assume any risks associated w...

(AI_HYDRA_LEO_MISSING_COMMA)


[style] ~162-~162: ‘any and all’ might be wordy. Consider a shorter alternative.
Context: ...ge, computer failure or malfunction, or any and all other commercial damages or losse...

(EN_WORDINESS_PREMIUM_ANY_AND_ALL)

🔇 Additional comments (9)
CODE_OF_CONDUCT.md (1)

63-63:Update reporting contact to direct email
You replaced the GitHub URL withsupport@coderabbit.ai to streamline reports.

.github/CODEOWNERS (1)

1-2:Scope ownership by file extension
You assigned.ts files to the TypeScript reviewers and.tsx files to the React reviewers, clarifying responsibility.

src/lang.ts (1)

4-32:Useas const object for language enumeration
You provided a runtime constant and avoided TypeScriptenum in favor of a literal object, which aligns with best practices.

README.md (1)

1-5:Refresh README for new package
You updated the title, badges, and description to match@coderabbitai/ast-grep-langs. The changes clearly reflect the new scope.

🧰 Tools
🪛 LanguageTool

[style] ~3-~3: Using many exclamation marks might seem excessive (in this case: 3 exclamation marks for a text that’s 752 characters long)
Context: ...p-langs/actions/workflows/node.js.yaml)CoverageGitHub Pages [![Dependabot Updates](https://github.com/...

(EN_EXCESSIVE_EXCLAMATION)

LICENSE.txt (1)

1-203:Adopt Apache License 2.0
You replaced the previous license with the full Apache 2.0 text, aligning the project with a standard open-source license.

🧰 Tools
🪛 LanguageTool

[uncategorized] ~151-~151: Possible missing comma found.
Context: ...iateness of using or redistributing the Work and assume any risks associated w...

(AI_HYDRA_LEO_MISSING_COMMA)


[style] ~162-~162: ‘any and all’ might be wordy. Consider a shorter alternative.
Context: ...ge, computer failure or malfunction, or any and all other commercial damages or losse...

(EN_WORDINESS_PREMIUM_ANY_AND_ALL)

CHANGELOG.md (1)

11-13:No technical feedback required – changelog entry looks good.
Nothing to amend for these lines.

src/langs.test.ts (1)

8-11:@ts-expect-error justification is crystal-clear – good job.
Thanks for adding the inline rationale; it fulfils the guideline on suppressions.

src/index.ts (1)

1-2:Barrel file does exactly what it should.
Pure re-exports, no declarations – matches the guideline forindex.ts.

src/langs.ts (1)

97-125:LGTM on the actual mapping.
All languages are wired correctly and alphabetically match theLang enum.

Copy link

@coderabbitaicoderabbitaibot 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: 0

🧹 Nitpick comments (1)
README.md (1)

9-11:Installation instructions are clear
Thepnpm command covers the core dependencies well. Optionally, you could addnpm oryarn equivalents to broaden accessibility.

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between58fb571 ande5ab28c.

📒 Files selected for processing (3)
  • README.md (1 hunks)
  • src/langs.test.ts (1 hunks)
  • src/langs.ts (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (2)
  • src/langs.test.ts
  • src/langs.ts
🧰 Additional context used
🪛 LanguageTool
README.md

[style] ~3-~3: Using many exclamation marks might seem excessive (in this case: 5 exclamation marks for a text that’s 1224 characters long)
Context: ...p-langs/actions/workflows/node.js.yaml)CoverageGitHub PagesDependabot UpdatesCodeRabbit Reviews [![GitHub Downloads](https://img.shields.i...

(EN_EXCESSIVE_EXCLAMATION)

🔇 Additional comments (4)
README.md (4)

1-1:Header clearly identifies package and repo
You link the package name directly to the GitHub repository, which helps users land on the source quickly.


3-3:Badge lineup covers key project metrics
You include CI status, coverage, pages, Dependabot, review status, and download stats—this gives contributors an at-a-glance health check.

🧰 Tools
🪛 LanguageTool

[style] ~3-~3: Using many exclamation marks might seem excessive (in this case: 5 exclamation marks for a text that’s 1224 characters long)
Context: ...p-langs/actions/workflows/node.js.yaml)CoverageGitHub PagesDependabot UpdatesCodeRabbit Reviews [![GitHub Downloads](https://img.shields.i...

(EN_EXCESSIVE_EXCLAMATION)


5-5:Concise project summary
The one-line description effectively communicates the package’s purpose without fluff.


16-17:Usage example demonstrates integration
You show how to import and register languages clearly. This helps users get started with minimal friction.

Also applies to: 19-19

@NatoBoramNatoBoram added this pull request to themerge queueJun 13, 2025
Merged via the queue intomain with commit99d19c5Jun 13, 2025
3 checks passed
@NatoBoramNatoBoram deleted the feature/initial-commit branchJune 13, 2025 17:34
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@coderabbitaicoderabbitai[bot]coderabbitai[bot] approved these changes

Assignees

@NatoBoramNatoBoram

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

2 participants

@NatoBoram

[8]ページ先頭

©2009-2025 Movatter.jp