Skip to content

Commit

Permalink
Merge pull request #3054 from opral/paraglide-version-telemetry
Browse files Browse the repository at this point in the history
Include paraglide version in Reporting
  • Loading branch information
LorisSigrist authored Aug 9, 2024
2 parents 3e24ea9 + fa42a3a commit 2eff97f
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 5 deletions.
5 changes: 5 additions & 0 deletions .changeset/tiny-suits-rush.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@inlang/paraglide-js": patch
---

Include paraglide version in reporting
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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)
Expand All @@ -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(), ".")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ export const compile = async (args: CompileOptions): Promise<Record<string, stri
{
event: "PARAGLIDE-JS compile executed",
properties: {
version: PARJS_PACKAGE_VERSION,
stack,
},
},
Expand Down

0 comments on commit 2eff97f

Please sign in to comment.