Skip to content

feat: add store command#66

Merged
luxass merged 5 commits intomainfrom
luxass/06-14-feat-add-store-command
Jun 15, 2025
Merged

feat: add store command#66
luxass merged 5 commits intomainfrom
luxass/06-14-feat-add-store-command

Conversation

@luxass
Copy link
Member

@luxass luxass commented Jun 14, 2025

This PR implements the #65 in favor of the old download subcommand.

Summary by CodeRabbit

  • New Features

    • Introduced a new CLI command, store, with subcommands: init, repair, clean, and status, enabling advanced management of Unicode Character Database (UCD) stores.
    • Added support for configuring local or remote UCD stores, including options for specifying directories, URLs, file patterns, and output formats.
    • Implemented commands to initialize, repair, clean, and check the status of UCD stores, with help and dry-run capabilities.
  • Tests

    • Updated test coverage to verify the new store command and its integration in the CLI.
  • Documentation

    • Added release notes and usage documentation for the new store command and its subcommands.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jun 14, 2025

Caution

Review failed

The pull request is closed.

Walkthrough

This change introduces a new "store" command to the CLI, complete with subcommands for initializing, repairing, cleaning, and checking the status of a Unicode Character Database (UCD) store. It adds corresponding command handlers, updates types and interfaces, and expands the UCD store's API with new methods for file management and analysis.

Changes

File(s) Change Summary
.changeset/some-lights-post.md Added a changeset documenting a minor version update for the CLI with the new "store" command.
packages/cli/src/cli-utils.ts, packages/cli/test/cli-utils.test.ts Integrated the "store" command into CLI utilities and updated tests to cover the new command.
packages/cli/src/cmd/store/root.ts Added the root handler for the "store" command, routing to subcommands and handling help/validation logic.
packages/cli/src/cmd/store/init.ts, repair.ts, clean.ts, status.ts Implemented command handlers for "init", "repair", "clean", and "status" subcommands, including flag parsing.
packages/cli/src/cmd/store/_shared.ts Defined shared flag interfaces and descriptions for store-related CLI commands.
packages/ucd-store/src/store.ts Added CleanResult, AnalyzeResult types and extended UCDStore with getAllFiles, clean, and analyze.
packages/ucd-store/src/local.ts, packages/ucd-store/src/remote.ts Stubbed new methods (getAllFiles, clean, analyze) in local and remote UCD store implementations.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant CLI
    participant StoreRoot
    participant StoreSubcommand
    participant UCDStore

    User->>CLI: ucd store [subcommand] [flags]
    CLI->>StoreRoot: runStoreRoot(subcommand, flags)
    StoreRoot->>StoreSubcommand: run[Subcommand]Store(options)
    StoreSubcommand->>UCDStore: createUCDStore(config)
    StoreSubcommand->>UCDStore: (e.g., clean, analyze, init, repair)
    UCDStore-->>StoreSubcommand: Result (success/error)
    StoreSubcommand-->>CLI: Output result
    CLI-->>User: Display output
Loading

Possibly related PRs

  • feat: add initial ucd-store package #20: Introduced the initial ucd-store package, which the new CLI commands now extend with additional methods and interfaces for store operations.
  • feat: add ucd-store #25: Implemented the foundational UCD store classes and functions that the new "store" CLI command and its subcommands depend on.

Poem

In the warren, code bunnies convene,
To build a store—so shiny, so clean!
With init, repair, and status to show,
And cleaning up files in a single go.
Now Unicode’s safe, both near and remote—
This bunny’s quite proud, so let’s gloat! 🐇✨

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-utils.ts

Oops! Something went wrong! :(

ESLint: 9.28.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/cmd/store/clean.ts

Oops! Something went wrong! :(

ESLint: 9.28.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/cmd/store/_shared.ts

Oops! Something went wrong! :(

ESLint: 9.28.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.

  • 8 others

📜 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 115abdd and 333a90c.

📒 Files selected for processing (12)
  • .changeset/some-lights-post.md (1 hunks)
  • packages/cli/src/cli-utils.ts (3 hunks)
  • packages/cli/src/cmd/store/_shared.ts (1 hunks)
  • packages/cli/src/cmd/store/clean.ts (1 hunks)
  • packages/cli/src/cmd/store/init.ts (1 hunks)
  • packages/cli/src/cmd/store/repair.ts (1 hunks)
  • packages/cli/src/cmd/store/root.ts (1 hunks)
  • packages/cli/src/cmd/store/status.ts (1 hunks)
  • packages/cli/test/cli-utils.test.ts (2 hunks)
  • packages/ucd-store/src/local.ts (2 hunks)
  • packages/ucd-store/src/remote.ts (2 hunks)
  • packages/ucd-store/src/store.ts (2 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.
    • 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.

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 github-actions bot added the pkg: cli Changes related to the CLI package. label Jun 14, 2025
@changeset-bot
Copy link

changeset-bot bot commented Jun 14, 2025

🦋 Changeset detected

Latest commit: 333a90c

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@ucdjs/cli Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link
Member Author

luxass commented Jun 14, 2025

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

@codecov
Copy link

codecov bot commented Jun 14, 2025

@luxass luxass mentioned this pull request Jun 15, 2025
@luxass luxass marked this pull request as ready for review June 15, 2025 11:14
Copy link
Member Author

luxass commented Jun 15, 2025

Merge activity

  • Jun 15, 2:11 PM UTC: A user started a stack merge that includes this pull request via Graphite.
  • Jun 15, 2:12 PM UTC: Graphite rebased this pull request as part of a merge.
  • Jun 15, 2:14 PM UTC: @luxass merged this pull request with Graphite.

@luxass luxass changed the base branch from luxass/06-14-refactor-migrate-ucd-store-to-use-utils to graphite-base/66 June 15, 2025 14:11
@luxass luxass changed the base branch from graphite-base/66 to main June 15, 2025 14:11
@github-actions github-actions bot added the pkg: ucd-store Changes related to the UCD Store package. label Jun 15, 2025
@luxass luxass force-pushed the luxass/06-14-feat-add-store-command branch from 627986e to 333a90c Compare June 15, 2025 14:12
@luxass luxass merged commit 016a09b into main Jun 15, 2025
2 of 4 checks passed
@luxass luxass deleted the luxass/06-14-feat-add-store-command branch June 15, 2025 14:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pkg: cli Changes related to the CLI package. pkg: ucd-store Changes related to the UCD Store package.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant