Skip to content

Commit 3b4e212

Browse files
authored
fix: Include name and version in platform. (#453)
This embeds the package name and version directly into the source instead of attempting to import the package.json. This has greater compatibility and depends on release-please to update the version.
1 parent 5bfeaba commit 3b4e212

File tree

2 files changed

+5
-7
lines changed

2 files changed

+5
-7
lines changed

packages/sdk/cloudflare/src/createPlatformInfo.ts

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,7 @@
11
import type { Info, PlatformData, SdkData } from '@launchdarkly/js-server-sdk-common-edge';
22

3-
// @ts-ignore
4-
// eslint-disable-next-line prettier/prettier
5-
import * as packageJson from '../package.json' assert { type: "json" }
6-
7-
const { name, version } = packageJson
3+
const name = '@launchdarkly/cloudflare-server-sdk';
4+
const version = '2.5.3'; // x-release-please-version
85

96
class CloudflarePlatformInfo implements Info {
107
platformData(): PlatformData {
@@ -22,6 +19,6 @@ class CloudflarePlatformInfo implements Info {
2219
}
2320
}
2421

25-
const createPlatformInfo = (): CloudflarePlatformInfo => new CloudflarePlatformInfo()
22+
const createPlatformInfo = (): CloudflarePlatformInfo => new CloudflarePlatformInfo();
2623

2724
export default createPlatformInfo;

release-please-config.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@
1111
"type": "json",
1212
"path": "jsr.json",
1313
"jsonpath": "$.version"
14-
}
14+
},
15+
"src/createPlatformInfo.ts"
1516
]
1617
},
1718
"packages/sdk/react-native": {},

0 commit comments

Comments
 (0)