-
Notifications
You must be signed in to change notification settings - Fork 467
feat: add path2 plugin for centralized path resolution with dev isolation #2486
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…tion - Create path2 plugin that returns app_data_dir in dev (com.hyprnote.dev) and data_dir/hyprnote in production - Add TypeScript bindings via tauri-specta - Remove leftover plugins/db directory and @hypr/plugin-db references - Integrate plugin into desktop app Co-Authored-By: yujonglee <[email protected]>
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
❌ Deploy Preview for hyprnote failed.
|
❌ Deploy Preview for hyprnote-storybook failed.
|
|
Devin is archived and cannot be woken up. Please unarchive Devin if you want to continue using it. |
How to use the Graphite Merge QueueAdd either label to this PR to merge it via the merge queue:
You must have a Graphite account in order to use the merge queue. Sign up using this link. An organization admin has enabled the Graphite Merge Queue in this repository. Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue. This stack of pull requests is managed by Graphite. Learn more about stacking. |
Merge activity
|
…tion (#2486) # feat: add path2 plugin for centralized path resolution with dev isolation ## Summary This PR introduces a new `path2` plugin that centralizes path resolution logic for Hyprnote. The key behavior is dev environment isolation: in debug builds, the plugin returns `app_data_dir` (which resolves to `com.hyprnote.dev`), while in release builds it returns `data_dir/hyprnote` (shared across staging/nightly/stable). The plugin provides both Rust and TypeScript APIs: - Rust: `app.path2().base()` - TypeScript: `import { commands } from "@hypr/plugin-path2"; commands.base()` Also cleans up orphaned `@hypr/plugin-db` references from `packages/tiptap` and `packages/utils`. ## Review & Testing Checklist for Human - [ ] **Verify `cfg!(debug_assertions)` is the correct mechanism for dev detection** - This is a compile-time check, meaning the path logic is baked in at build time. Confirm this matches the intended behavior (staging/nightly/stable builds should all use release mode). - [ ] **Check that `@hypr/plugin-db` removal doesn't break anything** - The PR removes this dependency from `packages/tiptap/package.json` and `packages/utils/package.json`. Verify no code in these packages actually imports from `@hypr/plugin-db`. - [ ] **Review the `create_dir_all` side effect in `base()`** - The function creates the directory if it doesn't exist. Confirm this is acceptable behavior for a path resolution function. - [ ] **Test the plugin in the running desktop app** - Run `ONBOARDING=0 pnpm -F desktop tauri dev` and verify the path resolution works correctly. Check that data is written to the expected location. ### Notes - Link to Devin run: https://app.devin.ai/sessions/6893a63da49c44f28ee5e560ebcd4b15 - Requested by: yujonglee (@yujonglee)

feat: add path2 plugin for centralized path resolution with dev isolation
Summary
This PR introduces a new
path2plugin that centralizes path resolution logic for Hyprnote. The key behavior is dev environment isolation: in debug builds, the plugin returnsapp_data_dir(which resolves tocom.hyprnote.dev), while in release builds it returnsdata_dir/hyprnote(shared across staging/nightly/stable).The plugin provides both Rust and TypeScript APIs:
app.path2().base()import { commands } from "@hypr/plugin-path2"; commands.base()Also cleans up orphaned
@hypr/plugin-dbreferences frompackages/tiptapandpackages/utils.Review & Testing Checklist for Human
Verify
cfg!(debug_assertions)is the correct mechanism for dev detection - This is a compile-time check, meaning the path logic is baked in at build time. Confirm this matches the intended behavior (staging/nightly/stable builds should all use release mode).Check that
@hypr/plugin-dbremoval doesn't break anything - The PR removes this dependency frompackages/tiptap/package.jsonandpackages/utils/package.json. Verify no code in these packages actually imports from@hypr/plugin-db.Review the
create_dir_allside effect inbase()- The function creates the directory if it doesn't exist. Confirm this is acceptable behavior for a path resolution function.Test the plugin in the running desktop app - Run
ONBOARDING=0 pnpm -F desktop tauri devand verify the path resolution works correctly. Check that data is written to the expected location.Notes