8000 feat: support track uv data in VSCode extension. by ShenQingchuan · Pull Request #283 · vue-vine/vue-vine · GitHub
[go: up one dir, main page]

Skip to content

feat: support track uv data in VSCode extension. #283

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

Merged
merged 3 commits into from
Jun 17, 2025

Conversation

ShenQingchuan
Copy link
Member
@ShenQingchuan ShenQingchuan commented Jun 17, 2025

Using Umami to generate UV data:

Data collection warning

Here's an announcement to all Vue Vine users.

From this version (maybe 1.4.12 or 1.5.0) we'll add a UV data tracker in our extension.

We promise not to collect any data other than those triggered by functions such as plugin activation and language server restart, and to carefully abide by the principle of data sensitivity.

Summary by CodeRabbit

  • New Features

    • Added user-configurable settings to control data tracking and the visibility of data tracking warnings in the VSCode extension.
    • Introduced a data tracking system that logs extension activation and server restart events, with user consent and the option to disable tracking.
    • Implemented a warning dialog about data tracking, allowing users to learn more, disable tracking, or hide the warning.
  • Chores

    • Updated dependencies to include the Umami analytics package for event tracking.
    • Set the npm registry configuration for the VSCode extension package.

Copy link
netlify bot commented Jun 17, 2025

Deploy Preview for vue-vine ready!

Name Link
🔨 Latest commit e3eb441
🔍 Latest deploy log https://app.netlify.com/projects/vue-vine/deploys/68518117d8226300085f413b
😎 Deploy Preview https://deploy-preview-283--vue-vine.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

Copy link
pkg-pr-new bot commented Jun 17, 2025

Open in StackBlitz

@vue-vine/compiler

npm i https://pkg.pr.new/vue-vine/vue-vine/@vue-vine/compiler@283

create-vue-vine

npm i https://pkg.pr.new/vue-vine/vue-vine/create-vue-vine@283

@vue-vine/eslint-config

npm i https://pkg.pr.new/vue-vine/vue-vine/@vue-vine/eslint-config@283

@vue-vine/eslint-parser

npm i https://pkg.pr.new/vue-vine/vue-vine/@vue-vine/eslint-parser@283

@vue-vine/eslint-plugin

npm i https://pkg.pr.new/vue-vine/vue-vine/@vue-vine/eslint-plugin@283

@vue-vine/language-server

npm i https://pkg.pr.new/vue-vine/vue-vine/@vue-vine/language-server@283

@vue-vine/language-service

npm i https://pkg.pr.new/vue-vine/vue-vine/@vue-vine/language-service@283

@vue-vine/nuxt

npm i https://pkg.pr.new/vue-vine/vue-vine/@vue-vine/nuxt@283

vue-vine-tsc

npm i https://pkg.pr.new/vue-vine/vue-vine/vue-vine-tsc@283

@vue-vine/vite-plugin

npm i https://pkg.pr.new/vue-vine/vue-vine/@vue-vine/vite-plugin@283

vue-vine

npm i https://pkg.pr.new/vue-vine/vue-vine@283

commit: e3eb441

Copy link
@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: 4

🧹 Nitpick comments (5)
pnpm-workspace.yaml (1)

65-65: Alphabetical order keeps diffs clean.

'@umami/node' is inserted before element-plus, breaking the existing alpha-sort convention inside each catalog. Resorting avoids noisy future diffs.

-    '@umami/node': ^0.4.0
-    element-plus: ^2.9.11
+    element-plus: ^2.9.11
+    '@umami/node': ^0.4.0
packages/vscode-ext/.npmrc (1)

1-1: Double-check the need to pin the registry at package scope.

Setting a private .npmrc overrides any corporate mirror / CI caching rules defined at repo or user level. If the intention is only to guarantee public npm for the Umami package, consider instead:

@umami:registry=https://registry.npmjs.org

to avoid affecting all other scopes.

packages/vscode-ext/src/index.ts (1)

51-57: Two output channels with overlapping purpose.

You create outputChannelName = 'Vine Language Server' for the LSP and another 'Vue Vine Extension' for general logs. Consider re-using one or adopting a naming convention (Vue Vine: LSP, Vue Vine: Extension) to keep VSCode’s Output panel tidy.

packages/vscode-ext/src/view-features.ts (1)

15-16: Don’t await telemetry in the command path.

Restarting the server is a user-visible action; waiting for an HTTP call slows it down. Trigger the call asynchronously and swallow errors.

-    await track.trackEvent('restart_server')
+    void track.trackEvent('restart_server')
+      .catch(err => client.outputChannel?.appendLine(`telemetry failed: ${err}`))
packages/vscode-ext/src/track.ts (1)

58-73: Date objects in data may be lost in JSON serialization
JSON.stringify converts Date to ISO strings only when the property value is a Date, but Umami client may internally apply new URLSearchParams() which will call toString() instead (giving an unreadable value).

Safest path: convert outgoing Date values to toISOString() before passing them.

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 08cb3ed and b4cee68.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (6)
  • packages/vscode-ext/.npmrc (1 hunks)
  • packages/vscode-ext/package.json (1 hunks)
  • packages/vscode-ext/src/index.ts (2 hunks)
  • packages/vscode-ext/src/track.ts (1 hunks)
  • packages/vscode-ext/src/view-features.ts (1 hunks)
  • pnpm-workspace.yaml (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (3)
  • GitHub Check: test (lts/*, ubuntu-latest)
  • GitHub Check: test (lts/*, macos-latest)
  • GitHub Check: test (lts/*, windows-latest)
🔇 Additional comments (3)
packages/vscode-ext/src/view-features.ts (1)

6-9: Dependency injection looks good. Passing Track explicitly keeps the module pure and testable—nicely done.

packages/vscode-ext/src/track.ts (2)

4-7: Union type is clear & future-proof
Limiting TrackEvent to a string union makes the API self-documenting and keeps autocomplete tight. Nice!


46-55: ```shell
#!/bin/bash

Download and inspect @umami/node v0.4.0 source for identify payload keys

npm pack @umami/node@0.4.0
tar -xzf umami-node-0.4.0.tgz
grep -R "identify" -n package
grep -R "sessionId" -n package
grep -R "userId" -n package


</details>

</blockquote></details>

</details>

<!-- This is an auto-generated comment by CodeRabbit for review status -->

@vue-vine vue-vine deleted a comment from coderabbitai bot Jun 17, 2025
Copy link
coderabbitai bot commented Jun 17, 2025

Caution

Review failed

The pull request is closed.

Walkthrough

The changes introduce user-configurable data tracking to the VSCode extension "vue-vine-extension." New configuration options allow users to control analytics collection and warning visibility. A tracking class leveraging Umami analytics is implemented, and tracking is integrated into extension activation and server restart events. User-facing warnings and configuration handling are also added.

Changes

File(s) Change Summary
packages/e2e-test/src/fixtures/todo-list.vine.ts Adjusted indentation in template; no logic changes.
packages/vscode-ext/.npmrc Explicitly set npm registry URL.
packages/vscode-ext/package.json Added config options for data tracking and warning; added @umami/node devDependency.
packages/vscode-ext/src/config.ts New module: defines typed config hook for extension settings.
packages/vscode-ext/src/index.ts Integrated tracking and output channel; used new config and warning logic; updated imports.
packages/vscode-ext/src/track.ts New module: defines Track class for Umami-based analytics tracking.
packages/vscode-ext/src/view-features.ts Added data tracking warning; integrated tracking into server restart; updated function signature.
pnpm-workspace.yaml Added @umami/node dependency under 'miscs' catalog.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant VSCode
    participant Extension
    participant Track (Analytics)
    participant Umami

    User->>VSCode: Activates extension
    VSCode->>Extension: Calls activate()
    Extension->>Track: Initialize with config, versions, machineId
    Extension->>Track: trackEvent('extension_activated')
    Track->>Umami: Send activation event
    Extension->>User: (If enabled) Show data tracking warning
    User->>Extension: Responds to warning (Why?/Turn off/Don't show again)
    Extension->>VSCode: Updates config if needed

    User->>Extension: Requests server restart
    Extension->>Track: trackEvent('restart_server')
    Track->>Umami: Send restart event
Loading

Poem

In the garden of code where the Vine does grow,
New settings bloom for users to know.
With tracking in check and warnings anew,
Analytics hop softly, as rabbits do.
Now Umami listens, but only if you wish—
Privacy and carrots, both on your dish! 🥕


📜 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 08cb3ed and e3eb441.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (8)
  • packages/e2e-test/src/fixtures/todo-list.vine.ts (1 hunks)
  • packages/vscode-ext/.npmrc (1 hunks)
  • packages/vscode-ext/package.json (2 hunks)
  • packages/vscode-ext/src/config.ts (1 hunks)
  • packages/vscode-ext/src/index.ts (2 hunks)
  • packages/vscode-ext/src/track.ts (1 hunks)
  • packages/vscode-ext/src/view-features.ts (1 hunks)
  • pnpm-workspace.yaml (1 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.

@ShenQingchuan ShenQingchuan merged commit 32c0d05 into main Jun 17, 2025
8 of 10 checks passed
@ShenQingchuan ShenQingchuan deleted the feat/support-uv-track branch June 17, 2025 14:52
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
0