From 66a3c92fd9c68347a04690be947c1fd3d2f2dac1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johan=20Andr=C3=A9n?= Date: Wed, 8 Feb 2023 16:10:00 +0100 Subject: [PATCH] chore: Report ts and js as separate SDKs #389 --- docs/Makefile | 3 +++ sdk/src/kalix.ts | 7 ++++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/docs/Makefile b/docs/Makefile index ee80ddf3..a06c8363 100644 --- a/docs/Makefile +++ b/docs/Makefile @@ -7,6 +7,7 @@ sources := src build/src/managed src_managed := build/src/managed managed_attachments := ${src_managed}/modules/${module}/attachments +managed_ts_attachments := ${src_managed}/modules/typescript/attachments managed_examples := ${src_managed}/modules/${module}/examples managed_partials := ${src_managed}/modules/${module}/partials @@ -38,8 +39,10 @@ attributes: apidocs: cd ../sdk && npm ci && npm run typedoc mkdir -p "${managed_attachments}" + mkdir -p "${managed_ts_attachments}" rsync -a ../sdk/apidocs/ "${managed_attachments}/api/" bin/version.sh > "${managed_attachments}/latest-version.txt" + cp "${managed_attachments}/latest-version.txt" "${managed_ts_attachments}/latest-version.txt" examples: mkdir -p "${managed_examples}" diff --git a/sdk/src/kalix.ts b/sdk/src/kalix.ts index 7c8bfdc8..055e6fb9 100644 --- a/sdk/src/kalix.ts +++ b/sdk/src/kalix.ts @@ -90,7 +90,12 @@ class ServiceInfo { private loadFromPkg(filename: string = userPkgJson) { const json = loadJson(filename); - this.pkgName = json.name; + // try to detect if ts or js through process starting points + if (process.argv.find((arg: string) => arg.endsWith('.ts'))) { + this.pkgName = json.name.replace('javascript', 'typescript'); + } else { + this.pkgName = json.name; + } this.pkgVersion = json.version; } }