File tree Expand file tree Collapse file tree 7 files changed +47
-305
lines changed
examples/todo-server-tests Expand file tree Collapse file tree 7 files changed +47
-305
lines changed Original file line number Diff line number Diff line change 77 "declaration" : true ,
88 "noEmitOnError" : true ,
99 "verbatimModuleSyntax" : false ,
10+ // TODO: Remove DOM here!! The Node SDK should not need DOM types.
11+ "lib" : [" ESNext" , " DOM" ],
1012 "types" : [" node" ],
1113 "paths" : {
12- "featurehub-javascript-node-sdk" : [" ../../packages/node/src" ]
14+ "featurehub-javascript-client-sdk" : [" ../../packages/js/src" ],
15+ "featurehub-javascript-node-sdk" : [" ../../packages/node/src" ],
16+ /*
17+ This is a workaround to bypass Typescript checking of the cross-sha256 package.
18+ The author of the package improperly exported the source .ts file alongside the js file
19+ */
20+ "cross-sha256" : [
21+ " ../../node_modules/.pnpm/[email protected] /node_modules/cross-sha256/index.d.ts" 22+ ]
1323 }
1424 },
1525 "include" : [" src/**/*" , " features/**/*" ]
Original file line number Diff line number Diff line change 7171 "cross-sha256" : " ^1.2.0" ,
7272 "murmurhash" : " ^2.0.1" ,
7373 "netmask" : " ^2.0.2" ,
74- "restify" : " ^11.1.0" ,
7574 "semver-compare" : " ^1.0.0"
7675 },
7776 "engines" : {
Original file line number Diff line number Diff line change @@ -17,9 +17,9 @@ export declare class EventSource {
1717 readonly readyState : number ;
1818 readonly withCredentials : boolean ;
1919
20- onopen : ( evt : MessageEvent ) => any ;
21- onmessage : ( evt : MessageEvent ) => any ;
22- onerror : ( evt : MessageEvent ) => any ;
20+ onopen ? : ( ( evt : Event ) => void ) | null ;
21+ onmessage ? : ( ( evt : MessageEvent ) => void ) | null ;
22+ onerror ? : ( ( evt : Event ) => void ) | null ;
2323
2424 constructor ( url : string , eventSourceInitDict ?: EventSource . EventSourceInitDict ) ;
2525
Original file line number Diff line number Diff line change 5858 "vite" : " 7.1.10"
5959 },
6060 "dependencies" : {
61- "eventsource" : " ^2.0.2" ,
62- "featurehub-javascript-client-sdk" : " ^1.4.0" ,
63- "restify" : " ^11.1.0"
61+ "eventsource" : " ^4.0.0" ,
62+ "featurehub-javascript-client-sdk" : " workspace:*"
6463 },
6564 "engines" : {
6665 "node" : " >=20.0.0"
Original file line number Diff line number Diff line change 1- /* eslint-disable @typescript-eslint/no-require-imports */
1+ import { EventSource } from "eventsource" ;
22import {
33 EdgeFeatureHubConfig ,
44 type FeatureEnvironmentCollection ,
@@ -20,12 +20,10 @@ import {
2020} from "featurehub-javascript-client-sdk" ;
2121import { URL } from "url" ;
2222
23- const ES = require ( "eventsource" ) ;
24-
2523export * from "featurehub-javascript-client-sdk" ;
2624
2725FeatureHubEventSourceClient . eventSourceProvider = ( url , dict ) => {
28- return new ES ( url , dict ) ;
26+ return new EventSource ( url , dict ) ;
2927} ;
3028
3129interface PromiseLikeData {
Original file line number Diff line number Diff line change 22 "$schema" : " https://json.schemastore.org/tsconfig" ,
33 "extends" : " featurehub-tsconfig/base.json" ,
44 "compilerOptions" : {
5- "module" : " CommonJS" ,
6- "moduleResolution" : " node" ,
75 "declaration" : true ,
86 "declarationMap" : true ,
97 "emitDeclarationOnly" : true ,
108 "noEmitOnError" : true ,
119 "verbatimModuleSyntax" : false ,
12- "types" : [" node" ]
10+ // TODO: Remove DOM here!! The Node SDK should not need DOM types. We need to define a core JS package
11+ "lib" : [" ESNext" , " DOM" ],
12+ "types" : [" node" ],
13+ "paths" : {
14+ "featurehub-javascript-client-sdk" : [" ../js/src" ],
15+ /*
16+ This is a workaround to bypass Typescript checking of the cross-sha256 package.
17+ The author of the package improperly exported the source .ts file alongside the js file
18+ */
19+ "cross-sha256" : [
20+ " ../../node_modules/.pnpm/[email protected] /node_modules/cross-sha256/index.d.ts" 21+ ]
22+ }
1323 },
1424 "include" : [" **/*.ts" , " **/*.tsx" ],
1525 "exclude" : [" node_modules" , " dist" ]
You can’t perform that action at this time.
0 commit comments