From fa42a3ac049538b2e4a25e1b370c0e9f8ea37e8d Mon Sep 17 00:00:00 2001 From: LorisSigrist Date: Fri, 9 Aug 2024 15:21:41 +0200 Subject: [PATCH] Include paraglide version --- .changeset/tiny-suits-rush.md | 5 ++++ .../src/cli/commands/init/command.ts | 25 +++++++++++++++---- .../paraglide-js/src/compiler/compile.ts | 1 + 3 files changed, 26 insertions(+), 5 deletions(-) create mode 100644 .changeset/tiny-suits-rush.md diff --git a/.changeset/tiny-suits-rush.md b/.changeset/tiny-suits-rush.md new file mode 100644 index 0000000000..e3a57e6540 --- /dev/null +++ b/.changeset/tiny-suits-rush.md @@ -0,0 +1,5 @@ +--- +"@inlang/paraglide-js": patch +--- + +Include paraglide version in reporting diff --git a/inlang/source-code/paraglide/paraglide-js/src/cli/commands/init/command.ts b/inlang/source-code/paraglide/paraglide-js/src/cli/commands/init/command.ts index f72a2f6b6c..e562643a09 100644 --- a/inlang/source-code/paraglide/paraglide-js/src/cli/commands/init/command.ts +++ b/inlang/source-code/paraglide/paraglide-js/src/cli/commands/init/command.ts @@ -36,7 +36,10 @@ export const initCommand = new Command() const logger = new Logger({ silent: false, prefix: false }) logger.box("Welcome to inlang Paraglide-JS 🪂") - telemetry.capture({ event: "PARAGLIDE-JS init started" }) + telemetry.capture({ + event: "PARAGLIDE-JS init started", + properties: { version: PARJS_PACKAGE_VERSION }, + }) const ctx = { logger, @@ -49,11 +52,20 @@ export const initCommand = new Command() const ctx2 = await enforcePackageJsonExists(ctx1) const ctx3 = await initializeInlangProject(ctx2) const ctx4 = await promptForOutdir(ctx3) - telemetry.capture({ event: "PARAGLIDE-JS init project initialized" }) + telemetry.capture({ + event: "PARAGLIDE-JS init project initialized", + properties: { version: PARJS_PACKAGE_VERSION }, + }) const ctx5 = await addParaglideJsToDevDependencies(ctx4) - telemetry.capture({ event: "PARAGLIDE-JS init added to devDependencies" }) + telemetry.capture({ + event: "PARAGLIDE-JS init added to devDependencies", + properties: { version: PARJS_PACKAGE_VERSION }, + }) const ctx6 = await addCompileStepToPackageJSON(ctx5) - telemetry.capture({ event: "PARAGLIDE-JS init added compile commands" }) + telemetry.capture({ + event: "PARAGLIDE-JS init added compile commands", + properties: { version: PARJS_PACKAGE_VERSION }, + }) const ctx7 = await maybeChangeTsConfig(ctx6) const ctx8 = await maybeAddSherlock(ctx7) const ctx9 = await maybeAddNinja(ctx8) @@ -67,7 +79,10 @@ export const initCommand = new Command() ) } - telemetry.capture({ event: "PARAGLIDE-JS init finished" }) + telemetry.capture({ + event: "PARAGLIDE-JS init finished", + properties: { version: PARJS_PACKAGE_VERSION }, + }) const absoluteSettingsPath = nodePath.resolve(ctx9.projectPath, "settings.json") const relativeSettingsFilePath = absoluteSettingsPath.replace(process.cwd(), ".") diff --git a/inlang/source-code/paraglide/paraglide-js/src/compiler/compile.ts b/inlang/source-code/paraglide/paraglide-js/src/compiler/compile.ts index d0c5fb3e50..c9df3dbb21 100644 --- a/inlang/source-code/paraglide/paraglide-js/src/compiler/compile.ts +++ b/inlang/source-code/paraglide/paraglide-js/src/compiler/compile.ts @@ -62,6 +62,7 @@ export const compile = async (args: CompileOptions): Promise