Skip to content
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

[DO NOT MERGE] Initial check-in for supporting telemetry in vscode #6123

Open
wants to merge 25 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
update script to have more log
  • Loading branch information
RodgeFu committed Feb 27, 2025
commit c9c1454c8b13593397b571a39977b2719fee2a5f
4 changes: 4 additions & 0 deletions packages/typespec-vscode/scripts/update-telemetry-key.js
Original file line number Diff line number Diff line change
@@ -11,7 +11,9 @@ if (!newKey) {
const targetPackageJsonFile = path.resolve(__dirname, "../package.json");
console.log(`Updating package.json at ${targetPackageJsonFile}`);
const packageJson = JSON.parse(fs.readFileSync(targetPackageJsonFile, "utf8"));
console.log(`original package.json: \n` + JSON.stringify(packageJson, null, 2));
const oldKey = packageJson.telemetryKey;
console.log(`Original telemetry key: ${oldKey}`);

const getLastSegOfKey = (key) => key.substring(Math.max(0, newKey.length - 12));

@@ -20,6 +22,8 @@ if (!newKey) {
);
packageJson.telemetryKey = newKey;

console.log(`package.json updated to: \n` + JSON.stringify(packageJson, null, 2));

fs.writeFileSync(targetPackageJsonFile, JSON.stringify(packageJson, null, 2));

console.log("package.json updated successfully");