Skip to content

chore: move used vendored packages into philo, strip posthog#10

Open
ComputelessComputer wants to merge 13 commits intomainfrom
chore/move-vendor-into-philo
Open

chore: move used vendored packages into philo, strip posthog#10
ComputelessComputer wants to merge 13 commits intomainfrom
chore/move-vendor-into-philo

Conversation

@ComputelessComputer
Copy link
Copy Markdown
Collaborator

What

  • Moves the used vendored Rust packages from vendor/hyprnote/ into crates/ and plugins/ at the repo root (48 crates + 17 plugins).
  • Drops ~110 unused vendored packages.
  • Creates a philo-owned root Cargo workspace (/Cargo.toml, rust-toolchain.toml, .cargo/config.toml).
  • Deletes vendor/ entirely (was a git submodule pointing at fastrepl/hyprnote); removes .gitmodules and the !vendor/** line in pnpm-workspace.yaml.
  • Strips all posthog/analytics:
    • JS: removed apps/desktop/src/services/analytics.ts and every trackEvent call site across desktop UI (OnboardingModal, EditorBubbleMenu, WidgetExtension, WidgetView, AppLayout, EditableNote).
    • Rust (philo): removed tauri-plugin-analytics dep, plugin registration, and 2 event_fire_and_forget invocations from apps/desktop/src-tauri/src/lib.rs (show_main_window, app_started).
    • Vendored plugins: deleted crates/analytics, plugins/analytics, removed the show_main_window analytics block in plugins/windows/src/ext.rs, and removed tauri-plugin-analytics from plugins/windows/Cargo.toml.
    • Workspace deps: removed hypr-analytics, tauri-plugin-analytics, posthog-rs from root Cargo.toml's [workspace.dependencies].
    • Permissions: removed analytics:default from apps/desktop/src-tauri/capabilities/default.json.
    • package.json: no posthog deps existed in philo's own apps/desktop/package.json or packages/*/package.json — all posthog references lived inside vendor/ and were deleted with it.

Why

John's call — strip telemetry from the desktop app, take ownership of the Rust crates and plugins philo actually uses, drop the rest. Reduces repo surface area significantly and removes a git submodule.

Notes / Judgment Calls

  • The original "59 used packages" inventory missed 6 transitive crates that kept-crates depend on. Restored: data, s3, docs, transcribe-whisper-local, whisper-local, pyannote-local (committed separately as chore: restore 6 transitive vendored crates needed by dep graph).
  • apps/desktop/src-tauri/build.rs had a vendor/hyprnote/plugins/permissions/swift/... path; rewritten to plugins/permissions/swift/....
  • docs/repo-structure.md updated to describe the new crates/ and plugins/ layout instead of vendor/.
  • Removed the source parameter from handleDeletePage in AppLayout.tsx (left dangling after the trackEvent strip — caught by typecheck).
  • The repo had no target/ entry in .gitignore; running cargo metadata materialised target/ and the first git add -A swept it in. Added target/ to .gitignore and removed the accidentally-tracked artifacts in the final commit.

Verification

  • cargo metadata --manifest-path Cargo.toml --format-version 1 resolves cleanly (exit 0).
  • cargo check --manifest-path apps/desktop/src-tauri/Cargo.tomlblocked locally on cidre v0.14.2 build script: xcode-select: error: tool 'xcodebuild' requires Xcode, but active developer directory '/Library/Developer/CommandLineTools' is a command line tools instance. This is a sandbox env issue (would need sudo xcode-select -s which requires a password). Please verify locally.
  • pnpm turbo typecheck --force — 6/6 successful.
  • dprint fmt — 47 files formatted.
  • cargo fmt --all — clean.
  • rg -i 'posthog|trackEvent|tauri.plugin.analytics|hypr-analytics|AnalyticsPayload|AnalyticsPluginExt' excluding lockfiles/node_modules/target — zero hits.

Restored: data, s3, docs, transcribe-whisper-local, whisper-local, pyannote-local.
These are pulled in transitively by kept crates and were missing from the
initial inventory. cargo metadata now resolves cleanly.
- Delete crates/analytics and plugins/analytics
- Remove tauri-plugin-analytics + hypr-analytics + posthog-rs from root workspace deps
- Remove tauri-plugin-analytics dep + plugin registration + 2 event_fire_and_forget calls from apps/desktop/src-tauri/src/lib.rs
- Remove analytics:default permission from default.json
- Remove tauri-plugin-analytics dep from apps/desktop/src-tauri/Cargo.toml
- Remove analytics block from plugins/windows show_main_window
- Delete apps/desktop/src/services/analytics.ts and all trackEvent call sites across desktop UI
- Remove vendor/hyprnote git submodule and .gitmodules
- Drop "!vendor/**" from pnpm-workspace.yaml
- Rewrite apps/desktop/src-tauri/build.rs swift path to plugins/permissions/...
- Update docs/repo-structure.md to describe crates/ and plugins/ instead of vendor/
- Regenerate pnpm-lock.yaml
- dprint fmt on TS/JSON/MD across all owned crates and plugins
- cargo fmt --all
- Drop the unused 'source' parameter from handleDeletePage left over from trackEvent removal
cargo metadata during the workspace setup created target/ which got
captured by 'git add -A'. Add target/ to .gitignore and untrack.
Vendored helper has 8 args; refactoring is out of scope for the vendor-
move PR. Suppresses the only clippy::too_many_arguments error blocking
CI rust job.
cactus-sys/build.rs needs C source at vendor/cactus/cactus/. Was
nested inside the deleted vendor/hyprnote/ submodule; restoring as
direct submodule pinned to upstream commit 89cd7476 (matches the SHA
hyprnote was using).

Required for cactus-sys build to succeed locally on macOS.
CI runs on ubuntu so these never fired upstream. They surface on
macOS local builds. Suppressing rather than refactoring vendored
code:
- crates/cactus: too_many_arguments on run_transcribe_worker
- crates/device-monitor: collapsible_if in macos.rs
- crates/mac: needless_range_loop crate-level
- crates/transcribe-cactus: too_many_arguments + collapsible_if + needless_range_loop crate-level
- plugins/local-stt: needless_return crate-level (cfg-conditional)
Apply dprint formatting to permission schemas + reference markdown that were autogenerated by build scripts during the vendor hoist.
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.

1 participant