Skip to content

Commit

Permalink
chore: Report ts and js as separate SDKs #389
Browse files Browse the repository at this point in the history
  • Loading branch information
johanandren committed Feb 8, 2023
1 parent 38533ff commit 66a3c92
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
3 changes: 3 additions & 0 deletions docs/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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}"
Expand Down
7 changes: 6 additions & 1 deletion sdk/src/kalix.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
Expand Down

0 comments on commit 66a3c92

Please sign in to comment.