Skip to content

Conversation

@yujonglee
Copy link
Contributor

@yujonglee yujonglee commented Jun 2, 2025

Summary by CodeRabbit

  • New Features

    • Introduced a membership plugin with support for managing and retrieving subscription information.
    • Added commands to refresh and fetch current subscription status.
    • Provided TypeScript bindings for seamless integration with frontend applications.
  • Permissions

    • Added new permissions for membership-related commands and updated default permission sets.
  • Documentation

    • Added documentation and schema files for membership plugin permissions and configuration.
  • Chores

    • Added configuration files and improved project structure for the new membership plugin.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jun 2, 2025

📝 Walkthrough

Walkthrough

The changes introduce a new Tauri membership plugin, including its Rust implementation, TypeScript bindings, permissions schema, and configuration files. The plugin provides commands for refreshing and retrieving subscription data, integrates with the app's permission system, and supports serialization and error handling. Supporting files for code generation, documentation, and workspace configuration are also added.

Changes

File(s) Change Summary
Cargo.toml, apps/desktop/src-tauri/Cargo.toml Added workspace and app dependencies for hypr-membership-interface and tauri-plugin-membership.
apps/desktop/src-tauri/capabilities/default.json Added "membership:default" permission to default capabilities.
plugins/membership-interface/Cargo.toml, plugins/membership-interface/src/lib.rs Added new Rust package for membership-interface with types and derives for subscription data.
plugins/membership/.gitignore, plugins/membership/package.json, plugins/membership/tsconfig.json Added gitignore, npm package, and TypeScript config for the membership plugin.
plugins/membership/Cargo.toml New Rust crate manifest for tauri-plugin-membership with dependencies and metadata.
plugins/membership/build.rs Added build script to register plugin commands.
plugins/membership/js/bindings.gen.ts, plugins/membership/js/index.ts Added auto-generated TypeScript bindings and re-export module for plugin commands and types.
plugins/membership/permissions/autogenerated/commands/get_subscription.toml
plugins/membership/permissions/autogenerated/commands/refresh.toml
plugins/membership/permissions/autogenerated/reference.md
plugins/membership/permissions/default.toml
plugins/membership/permissions/schemas/schema.json
Added permission configuration, schema, and documentation for membership plugin commands.
plugins/membership/src/commands.rs Added Tauri command implementations: refresh and get_subscription.
plugins/membership/src/error.rs Added error enum handling HTTP and store errors with serialization support.
plugins/membership/src/ext.rs Added trait for membership-related store access, subscription retrieval, and refresh logic.
plugins/membership/src/lib.rs Added plugin initialization, command registration, and test module for the membership plugin.
plugins/membership/src/store.rs Added store key enum and trait implementation for scoped storage of subscription data.

Sequence Diagram(s)

sequenceDiagram
    participant Frontend (TS)
    participant Tauri Plugin (Rust)
    participant Remote API
    participant Store

    Frontend (TS)->>Tauri Plugin (Rust): invoke("refresh")
    Tauri Plugin (Rust)->>Remote API: HTTP GET /subscription
    Remote API-->>Tauri Plugin (Rust): Subscription data
    Tauri Plugin (Rust)->>Store: Update subscription
    Tauri Plugin (Rust)-->>Frontend (TS): Subscription

    Frontend (TS)->>Tauri Plugin (Rust): invoke("get_subscription")
    Tauri Plugin (Rust)->>Store: Retrieve subscription
    Store-->>Tauri Plugin (Rust): Subscription or null
    Tauri Plugin (Rust)-->>Frontend (TS): Subscription or null
Loading

Poem

In the warren of code, a new plugin appears,
With memberships and stores, it now perseveres.
Commands for refresh, and subscriptions to see,
Permissions in place, as safe as can be.
Rust and TypeScript, now hop side by side—
This bunny’s delighted, with features supplied!
🐇✨

✨ Finishing Touches
  • 📝 Generate Docstrings

🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

‼️ IMPORTANT
Auto-reply has been disabled for this repository in the CodeRabbit settings. The CodeRabbit bot will not respond to your replies unless it is explicitly tagged.

  • 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.

Copy link
Contributor

@coderabbitai coderabbitai bot 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: 1

🧹 Nitpick comments (9)
plugins/membership/.gitignore (1)

1-18: .gitignore covers common IDE, OS, and build artifacts
The patterns correctly ignore editor configs (.vs, .idea/, .vscode/settings.json, *.sublime*), system files, lockfiles (package-lock.json, yarn.lock, Cargo.lock), build outputs (/target, dist-js, dist) and node_modules/.

Optionally add pnpm-lock.yaml if this plugin ever uses pnpm for its JS dependencies.

plugins/membership/package.json (1)

8-10: Add types field for TS resolution
To ensure IDEs and bundlers pick up your generated TypeScript definitions, consider adding a "types": "./js/bindings.gen.ts" entry alongside "main".

plugins/membership/build.rs (1)

1-5: Build script registering commands is straightforward.
Defining COMMANDS and invoking tauri_plugin::Builder::new(COMMANDS).build() integrates your Rust handlers into the plugin. Optionally, you could add println!("cargo:rerun-if-changed=src/commands.rs"); to ensure rebuilds when command code changes, but the current implementation is valid.

plugins/membership/permissions/autogenerated/reference.md (1)

5-5: Fix markdown formatting issues in auto-generated documentation.

The static analysis tools have identified markdown formatting issues:

  1. Heading level should be h3 instead of h4 after an h2
  2. Remove trailing colon from the heading

Since this is auto-generated documentation, consider updating the generation template to fix these formatting issues:

-#### This default permission set includes the following:
+### This default permission set includes the following
🧰 Tools
🪛 markdownlint-cli2 (0.17.2)

5-5: Heading levels should only increment by one level at a time
Expected: h3; Actual: h4

(MD001, heading-increment)


5-5: Trailing punctuation in heading
Punctuation: ':'

(MD026, no-trailing-punctuation)

plugins/membership/src/commands.rs (2)

1-10: Consider improving error handling for better debugging.

The command structure is correct and follows Tauri patterns well. However, converting all errors to String using map_err(|e| e.to_string()) loses type information that could be valuable for debugging and error handling on the frontend.

Consider defining a serializable error type that preserves more error context:

-) -> Result<Subscription, String> {
-    app.refresh().await.map_err(|e| e.to_string())
+) -> Result<Subscription, crate::Error> {
+    app.refresh().await

This assumes your crate::Error type implements serde::Serialize, which would provide better error information to the frontend.


12-18: Apply the same error handling improvement here.

Same suggestion as above - consider using the typed error instead of converting to String.

-) -> Result<Option<Subscription>, String> {
-    app.get_subscription().await.map_err(|e| e.to_string())
+) -> Result<Option<Subscription>, crate::Error> {
+    app.get_subscription().await
plugins/membership/src/lib.rs (1)

12-20: Consider making runtime type more flexible.

The hardcoded tauri::Wry runtime type in the command collection limits flexibility. While this works for most use cases, it could cause issues if the plugin needs to support other runtimes.

Consider making the commands generic over the runtime parameter:

-        .commands(tauri_specta::collect_commands![
-            commands::refresh::<tauri::Wry>,
-            commands::get_subscription::<tauri::Wry>,
-        ])
+        .commands(tauri_specta::collect_commands![
+            commands::refresh::<R>,
+            commands::get_subscription::<R>,
+        ])

This would make the plugin more flexible for different runtime environments.

plugins/membership/Cargo.toml (1)

4-4: Update placeholder author information.

The authors field contains a placeholder value "You" which should be updated with actual author information before releasing the plugin.

-authors = ["You"]
+authors = ["Your Name <your.email@example.com>"]
plugins/membership/src/ext.rs (1)

26-30: Consider making API URLs configurable.

The hardcoded URLs based on debug assertions work for development but could be made more flexible for different environments or deployments.

Consider using environment variables or configuration:

-        let url = if cfg!(debug_assertions) {
-            "http://localhost:1234/api/desktop/subscription"
-        } else {
-            "https://app.hypr.com/api/desktop/subscription"
-        };
+        let url = std::env::var("MEMBERSHIP_API_URL")
+            .unwrap_or_else(|_| {
+                if cfg!(debug_assertions) {
+                    "http://localhost:1234/api/desktop/subscription".to_string()
+                } else {
+                    "https://app.hypr.com/api/desktop/subscription".to_string()
+                }
+            });
📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 9e32600 and 241161b.

⛔ Files ignored due to path filters (1)
  • Cargo.lock is excluded by !**/*.lock
📒 Files selected for processing (22)
  • Cargo.toml (2 hunks)
  • apps/desktop/src-tauri/Cargo.toml (1 hunks)
  • apps/desktop/src-tauri/capabilities/default.json (1 hunks)
  • plugins/membership-interface/Cargo.toml (1 hunks)
  • plugins/membership-interface/src/lib.rs (1 hunks)
  • plugins/membership/.gitignore (1 hunks)
  • plugins/membership/Cargo.toml (1 hunks)
  • plugins/membership/build.rs (1 hunks)
  • plugins/membership/js/bindings.gen.ts (1 hunks)
  • plugins/membership/js/index.ts (1 hunks)
  • plugins/membership/package.json (1 hunks)
  • plugins/membership/permissions/autogenerated/commands/get_subscription.toml (1 hunks)
  • plugins/membership/permissions/autogenerated/commands/refresh.toml (1 hunks)
  • plugins/membership/permissions/autogenerated/reference.md (1 hunks)
  • plugins/membership/permissions/default.toml (1 hunks)
  • plugins/membership/permissions/schemas/schema.json (1 hunks)
  • plugins/membership/src/commands.rs (1 hunks)
  • plugins/membership/src/error.rs (1 hunks)
  • plugins/membership/src/ext.rs (1 hunks)
  • plugins/membership/src/lib.rs (1 hunks)
  • plugins/membership/src/store.rs (1 hunks)
  • plugins/membership/tsconfig.json (1 hunks)
🧰 Additional context used
🧬 Code Graph Analysis (3)
plugins/membership/src/commands.rs (2)
plugins/membership/js/bindings.gen.ts (2)
  • Subscription (28-28)
  • refresh (10-12)
plugins/membership/src/ext.rs (4)
  • refresh (9-9)
  • refresh (25-38)
  • get_subscription (8-8)
  • get_subscription (17-23)
plugins/membership-interface/src/lib.rs (1)
plugins/membership/js/bindings.gen.ts (2)
  • Subscription (28-28)
  • SubscriptionStatus (29-29)
plugins/membership/src/ext.rs (2)
plugins/membership/js/bindings.gen.ts (2)
  • Subscription (28-28)
  • refresh (10-12)
plugins/membership/src/commands.rs (2)
  • get_subscription (14-18)
  • refresh (6-10)
🪛 GitHub Actions: .github/workflows/desktop_ci.yaml
plugins/membership/package.json

[error] 1-1: pnpm install failed due to outdated lockfile. The pnpm-lock.yaml is not up to date with package.json. Use 'pnpm install --no-frozen-lockfile' to bypass this in CI.

🪛 markdownlint-cli2 (0.17.2)
plugins/membership/permissions/autogenerated/reference.md

5-5: Heading levels should only increment by one level at a time
Expected: h3; Actual: h4

(MD001, heading-increment)


5-5: Trailing punctuation in heading
Punctuation: ':'

(MD026, no-trailing-punctuation)

🔇 Additional comments (22)
plugins/membership/permissions/default.toml (1)

1-4:

✅ Verification successful

Validate permission identifiers against schema
Please confirm that "allow-refresh" and "allow-get-subscription" exactly match the permission names defined in plugins/membership/permissions/schemas/schema.json, or runtime permission checks will fail.


🏁 Script executed:

#!/usr/bin/env bash
# Verify identifiers exist in the schema
rg '"allow-refresh"' -n plugins/membership/permissions/schemas/schema.json
rg '"allow-get-subscription"' -n plugins/membership/permissions/schemas/schema.json

Length of output: 251


Permissions validated against schema
Both "allow-refresh" and "allow-get-subscription" have matching entries in plugins/membership/permissions/schemas/schema.json (lines 312 and 300). No further changes required.

apps/desktop/src-tauri/Cargo.toml (1)

39-39:

✅ Verification successful

New plugin dependency looks correct
Adding tauri-plugin-membership = { workspace = true } aligns with the other Tauri plugins. Make sure you run cargo check to verify the workspace builds cleanly.

Verify that the desktop app’s capabilities include the new membership permission:


🏁 Script executed:

rg '"membership:default"' -n apps/desktop/src-tauri/capabilities/default.json

Length of output: 108


New plugin dependency and capability verified
The tauri-plugin-membership = { workspace = true } addition aligns with the other Tauri plugins, and the membership permission is present in apps/desktop/src-tauri/capabilities/default.json (line 51). The workspace builds cleanly with cargo check.

plugins/membership-interface/Cargo.toml (2)

6-9: Interface dependencies are appropriate
Using schemars, serde (derive), and specta (derive) will enable serialization, schema validation, and TypeScript bindings for your shared types.


1-4:

✅ Verification successful

Verify crate name consistency in workspace
The package is declared as membership-interface. Ensure any workspace dependency key (e.g., hypr-membership-interface) in the root Cargo.toml uses package = "membership-interface" if the key name differs from the crate name.


🏁 Script executed:

#!/usr/bin/env bash
# Check for matching dependency entry in root manifest
rg 'hypr-membership-interface' -n Cargo.toml

Length of output: 151


Workspace dependency crate name is consistent

The root Cargo.toml (line 65) already specifies:

hypr-membership-interface = { path = "plugins/membership-interface", package = "membership-interface" }

No changes required.

plugins/membership/package.json (1)

1-7:

❓ Verification inconclusive

Verify codegen script behavior
The "codegen": "cargo test -p tauri-plugin-membership" step may be leveraged to emit TypeScript bindings via your test harness—but the name is misleading. Confirm that running npm run codegen actually updates js/bindings.gen.ts, and consider renaming to generate-bindings if it’s not solely for testing.


🏁 Script executed:

#!/usr/bin/env bash
npm run codegen
# then inspect js/bindings.gen.ts for updates

Length of output: 241


Verify and clarify codegen script name and behavior
The codegen npm script in plugins/membership/package.json currently runs cargo test -p tauri-plugin-membership, which may not clearly reflect its intent of emitting TypeScript bindings. Please:

  • Confirm that executing the script from the plugin root (e.g. cd plugins/membership && npm run codegen or npm --prefix plugins/membership run codegen) actually updates js/bindings.gen.ts.
  • If its main purpose is to generate bindings rather than run tests, consider renaming it to generate-bindings for clarity.
cd plugins/membership
npm run codegen
# then inspect js/bindings.gen.ts for updates
🧰 Tools
🪛 GitHub Actions: .github/workflows/desktop_ci.yaml

[error] 1-1: pnpm install failed due to outdated lockfile. The pnpm-lock.yaml is not up to date with package.json. Use 'pnpm install --no-frozen-lockfile' to bypass this in CI.

plugins/membership/tsconfig.json (1)

1-5: TSConfig looks correct.
Extending the base config and targeting only the js/*.ts sources while excluding node_modules aligns with the plugin layout. Review whether you need to capture nested folders (e.g. use **/*.ts) or emit declaration files via "declaration": true, but otherwise this setup is solid.

plugins/membership/js/index.ts (1)

1-1: Re-export aggregator is concise and effective.
Using export * cleanly surfaces all bindings from bindings.gen.ts as the plugin’s main entry point.

plugins/membership/permissions/autogenerated/commands/refresh.toml (1)

1-13: Permissions schema for refresh is well-formed.
The schema reference path ("$schema" = "../../schemas/schema.json") correctly points to the shared definition, and the allow-refresh/deny-refresh entries map directly to the refresh command. Double-check that downstream tooling respects these autogenerated files and that the identifiers align with your registry conventions.

plugins/membership/permissions/autogenerated/commands/get_subscription.toml (1)

1-13: Permissions schema for get_subscription is consistent.
The structure mirrors the refresh config, using allow-get-subscription/deny-get-subscription and the same schema reference. Ensure your permission loader picks up both autogenerated command files.

apps/desktop/src-tauri/capabilities/default.json (1)

51-51: LGTM! Permission integration looks correct.

The addition of "membership:default" follows the established pattern and correctly integrates the new membership plugin's default permission set into the desktop app's capabilities.

Cargo.toml (2)

65-65: LGTM! Interface dependency follows established pattern.

The addition of hypr-membership-interface maintains the consistent workspace dependency structure and alphabetical ordering.


87-87: LGTM! Plugin dependency correctly integrated.

The addition of tauri-plugin-membership follows the established pattern for Tauri plugin dependencies and maintains proper organization within the workspace.

plugins/membership/permissions/autogenerated/reference.md (1)

6-70: Documentation content looks comprehensive.

The permission documentation correctly covers all four permission variants (allow/deny for both commands) and aligns well with the plugin's command structure.

plugins/membership/src/error.rs (1)

1-18: Excellent error handling implementation.

This error enum follows Rust best practices:

  • Uses thiserror::Error for clean error definitions
  • Transparent error wrapping preserves original error context
  • Custom Serialize implementation appropriately converts errors to strings for frontend consumption
  • Covers the expected error sources (HTTP requests and store operations)

The implementation is well-structured and consistent with typical Tauri plugin error handling patterns.

plugins/membership/src/store.rs (1)

1-9: LGTM! Clean and well-structured store key implementation.

The StoreKey enum is properly designed with appropriate trait derives for serialization, type reflection, and storage integration. The implementation follows Tauri plugin best practices.

plugins/membership/src/lib.rs (2)

34-45: Excellent TypeScript export configuration.

The TypeScript export test is well-configured with appropriate formatting options, bigint handling, and proper file output path. This ensures high-quality generated TypeScript bindings.


47-58: Good plugin integration test setup.

The test properly verifies plugin integration by including both the membership plugin and the required store plugin dependency. This ensures the plugin can be initialized correctly in a Tauri app context.

plugins/membership-interface/src/lib.rs (3)

1-9: Excellent use of macro to reduce boilerplate.

The common_derives macro effectively reduces repetitive derive attributes while ensuring consistency across all types. This is a clean approach to maintaining consistent trait implementations.


11-18: Well-designed Subscription struct.

The Subscription struct has appropriate fields for subscription management:

  • status provides current subscription state
  • current_period_end using i64 is suitable for Unix timestamps
  • Optional fields for trial_end and price_id handle varying subscription scenarios appropriately

20-32: Comprehensive subscription status enumeration.

The SubscriptionStatus enum covers all common subscription states that would be expected in a subscription management system. The snake_case serialization ensures consistent API communication.

plugins/membership/js/bindings.gen.ts (1)

1-90: Auto-generated bindings look comprehensive and correct.

The TypeScript bindings are well-structured with:

  • Proper command definitions that match the Rust implementations
  • Correct type definitions for Subscription and SubscriptionStatus
  • Comprehensive event handling utilities with proxy-based implementation
  • Appropriate Tauri API imports

The generated code follows TypeScript conventions and provides a clean API for frontend integration.

plugins/membership/permissions/schemas/schema.json (1)

294-328: Permission schema correctly defines membership plugin commands.

The PermissionKind enum properly includes:

  • Allow/deny permissions for both get_subscription and refresh commands
  • Default permission set that enables both commands
  • Clear descriptions for each permission type

The schema structure follows Tauri conventions and provides comprehensive permission control for the membership plugin.

Comment on lines +32 to +33
let resp = reqwest::get(url).await?;
let data: Subscription = resp.json().await?;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Enhance HTTP client configuration.

The HTTP request lacks important configuration such as authentication headers, timeout, and user agent.

Consider enhancing the HTTP request:

-        let resp = reqwest::get(url).await?;
+        let client = reqwest::Client::builder()
+            .timeout(std::time::Duration::from_secs(30))
+            .user_agent("hypr-desktop/0.1.0")
+            .build()?;
+        
+        let resp = client
+            .get(url)
+            // Add authentication headers if needed
+            // .header("Authorization", "Bearer <token>")
+            .send()
+            .await?;
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
let resp = reqwest::get(url).await?;
let data: Subscription = resp.json().await?;
let client = reqwest::Client::builder()
.timeout(std::time::Duration::from_secs(30))
.user_agent("hypr-desktop/0.1.0")
.build()?;
let resp = client
.get(url)
// Add authentication headers if needed
// .header("Authorization", "Bearer <token>")
.send()
.await?;
let data: Subscription = resp.json().await?;
🤖 Prompt for AI Agents
In plugins/membership/src/ext.rs around lines 32 to 33, the HTTP request uses
reqwest::get without configuring important options like authentication headers,
timeout, and user agent. Replace reqwest::get with a reqwest::Client instance
where you can set these configurations. Create a client with appropriate timeout
settings, add necessary authentication headers and a user agent header, then use
this client to send the GET request and deserialize the response.

@yujonglee yujonglee force-pushed the membership-plugin branch from 241161b to e360769 Compare June 2, 2025 13:13
Copy link
Contributor

@coderabbitai coderabbitai bot 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

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 241161b and e360769.

⛔ Files ignored due to path filters (2)
  • Cargo.lock is excluded by !**/*.lock
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (28)
  • Cargo.toml (2 hunks)
  • apps/app/package.json (1 hunks)
  • apps/desktop/package.json (3 hunks)
  • apps/desktop/src-tauri/Cargo.toml (1 hunks)
  • apps/desktop/src-tauri/capabilities/default.json (1 hunks)
  • apps/docs/package.json (1 hunks)
  • packages/tiptap/package.json (2 hunks)
  • packages/ui/package.json (1 hunks)
  • packages/utils/package.json (1 hunks)
  • plugins/membership-interface/Cargo.toml (1 hunks)
  • plugins/membership-interface/src/lib.rs (1 hunks)
  • plugins/membership/.gitignore (1 hunks)
  • plugins/membership/Cargo.toml (1 hunks)
  • plugins/membership/build.rs (1 hunks)
  • plugins/membership/js/bindings.gen.ts (1 hunks)
  • plugins/membership/js/index.ts (1 hunks)
  • plugins/membership/package.json (1 hunks)
  • plugins/membership/permissions/autogenerated/commands/get_subscription.toml (1 hunks)
  • plugins/membership/permissions/autogenerated/commands/refresh.toml (1 hunks)
  • plugins/membership/permissions/autogenerated/reference.md (1 hunks)
  • plugins/membership/permissions/default.toml (1 hunks)
  • plugins/membership/permissions/schemas/schema.json (1 hunks)
  • plugins/membership/src/commands.rs (1 hunks)
  • plugins/membership/src/error.rs (1 hunks)
  • plugins/membership/src/ext.rs (1 hunks)
  • plugins/membership/src/lib.rs (1 hunks)
  • plugins/membership/src/store.rs (1 hunks)
  • plugins/membership/tsconfig.json (1 hunks)
✅ Files skipped from review due to trivial changes (10)
  • apps/docs/package.json
  • packages/ui/package.json
  • packages/utils/package.json
  • plugins/membership/permissions/autogenerated/commands/get_subscription.toml
  • plugins/membership/permissions/autogenerated/commands/refresh.toml
  • packages/tiptap/package.json
  • apps/desktop/src-tauri/capabilities/default.json
  • apps/app/package.json
  • apps/desktop/package.json
  • plugins/membership-interface/src/lib.rs
🚧 Files skipped from review as they are similar to previous changes (17)
  • plugins/membership-interface/Cargo.toml
  • apps/desktop/src-tauri/Cargo.toml
  • plugins/membership/build.rs
  • plugins/membership/package.json
  • plugins/membership/js/index.ts
  • plugins/membership/permissions/default.toml
  • plugins/membership/tsconfig.json
  • plugins/membership/src/error.rs
  • plugins/membership/.gitignore
  • Cargo.toml
  • plugins/membership/src/store.rs
  • plugins/membership/src/lib.rs
  • plugins/membership/Cargo.toml
  • plugins/membership/src/commands.rs
  • plugins/membership/src/ext.rs
  • plugins/membership/js/bindings.gen.ts
  • plugins/membership/permissions/schemas/schema.json
🧰 Additional context used
🪛 markdownlint-cli2 (0.17.2)
plugins/membership/permissions/autogenerated/reference.md

5-5: Heading levels should only increment by one level at a time
Expected: h3; Actual: h4

(MD001, heading-increment)


5-5: Trailing punctuation in heading
Punctuation: ':'

(MD026, no-trailing-punctuation)

⏰ Context from checks skipped due to timeout of 90000ms (3)
  • GitHub Check: ci
  • GitHub Check: ci (macos, macos-latest)
  • GitHub Check: ci (windows, windows-latest)
🔇 Additional comments (1)
plugins/membership/permissions/autogenerated/reference.md (1)

12-70: Permission table is accurate.

The HTML table correctly documents each permission identifier and its description, matching the plugin’s commands and schema. No changes required here.


Default permissions for the plugin

#### This default permission set includes the following:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Fix heading level and remove trailing colon.

The heading jumps from H2 to H4 and ends with a colon, which violates markdownlint rules (MD001, MD026). It should increment by one level (H3) and drop the colon:

-#### This default permission set includes the following:
+### This default permission set includes the following
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
#### This default permission set includes the following:
### This default permission set includes the following
🧰 Tools
🪛 markdownlint-cli2 (0.17.2)

5-5: Heading levels should only increment by one level at a time
Expected: h3; Actual: h4

(MD001, heading-increment)


5-5: Trailing punctuation in heading
Punctuation: ':'

(MD026, no-trailing-punctuation)

🤖 Prompt for AI Agents
In plugins/membership/permissions/autogenerated/reference.md at line 5, the
heading level incorrectly jumps from H2 to H4 and ends with a colon, violating
markdownlint rules. Change the heading to H3 by using three hash marks instead
of four and remove the trailing colon to fix the formatting.

Comment on lines +7 to +8
- `allow-refresh`
- `allow-get-subscription`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Include full permission identifiers in the default list.

To align with the identifiers in the permission table and avoid ambiguity, update the bullets to use the plugin-prefixed permissions:

- - `allow-refresh`
- - `allow-get-subscription`
+ - `membership:allow-refresh`
+ - `membership:allow-get-subscription`
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
- `allow-refresh`
- `allow-get-subscription`
- `membership:allow-refresh`
- `membership:allow-get-subscription`
🤖 Prompt for AI Agents
In plugins/membership/permissions/autogenerated/reference.md around lines 7 to
8, the permission identifiers are listed without the required plugin prefix.
Update the bullet points to include the full permission identifiers with the
plugin prefix to match the permission table and avoid ambiguity.

@yujonglee yujonglee closed this Jun 3, 2025
@yujonglee yujonglee deleted the membership-plugin branch June 3, 2025 22:24
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