-
Notifications
You must be signed in to change notification settings - Fork 31
feat: JSR support for Cloudflare SDK. #415
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
31b96cc
c39756b
ca2cf35
05353a3
0303885
cde1ba4
2c305ca
fba552a
af96d82
8f06f60
5e014f8
4c20848
e588616
cc7f0dc
b416c41
117363c
a7d7dae
4fdab2a
55feca3
9c9ca3c
4b29910
f2cbc4f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -20,3 +20,4 @@ yarn-error.log | |
| .DS_Store | ||
| .vscode | ||
| dump.rdb | ||
| .wrangler | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is the jsr equivalent of package.json. It's used during publishing. The version is hardcoded atm, but I'll submit a separate PR to implement publishing through release-please. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| { | ||
| "name": "@launchdarkly/cloudflare-server-sdk", | ||
| "version": "0.0.3", | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Release please will need to be able to update this. If it is fine for it to re-write the file each time, then you can use the JSON updater.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think it would be like this.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes you are right. I was going to submit a separate PR for the RP work. Maybe i'll just do it together in this PR now that you mentioned it.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I will do this in a separate pr focussed on publishing in CI. |
||
| "exports": "./src/index.ts", | ||
| "publish": { | ||
| "include": ["LICENSE", "README.md", "package.json", "jsr.json", "src/**/*.ts"], | ||
| "exclude": ["src/**/*.test.ts"] | ||
| } | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,10 @@ | ||
| import type { Info, PlatformData, SdkData } from '@launchdarkly/js-server-sdk-common-edge'; | ||
|
|
||
| import { name, version } from '../package.json'; | ||
| // @ts-ignore | ||
| // eslint-disable-next-line prettier/prettier | ||
| import * as packageJson from '../package.json' assert { type: "json" } | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This import assertion is new-ish and is not yet fully supported by jest and prettier. I took a shortcut here and ignore this for now to save time. Hopefully in time we can just remove these ignores. |
||
|
|
||
| const { name, version } = packageJson | ||
|
|
||
| class CloudflarePlatformInfo implements Info { | ||
| platformData(): PlatformData { | ||
|
|
@@ -18,6 +22,6 @@ class CloudflarePlatformInfo implements Info { | |
| } | ||
| } | ||
|
|
||
| const createPlatformInfo = () => new CloudflarePlatformInfo(); | ||
| const createPlatformInfo = (): CloudflarePlatformInfo => new CloudflarePlatformInfo() | ||
|
|
||
| export default createPlatformInfo; | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@trivago/prettier-plugin-sort-importsdoesn't like the new-ish import assertion syntax. See my comments here.