File tree Expand file tree Collapse file tree 8 files changed +256
-3232
lines changed
Expand file tree Collapse file tree 8 files changed +256
-3232
lines changed Original file line number Diff line number Diff line change 1+ NODE_OPTIONS = --test-coverage-branches=100 --test-coverage-functions=100 --test-coverage-lines=100 --test-reporter=spec --test-reporter-destination=stdout --test-reporter=lcov --test-reporter-destination=./lcov.info
Original file line number Diff line number Diff line change 55node_modules /
66
77# Tests
8- / coverage /
8+ lcov.info
99
1010# Yarn
1111/yarn-error.log
Original file line number Diff line number Diff line change @@ -21,7 +21,7 @@ run = "yarn npm publish --dry-run"
2121
2222[tasks ."checks:test" ]
2323depends = [" yarn" ]
24- run = " node --run test"
24+ run = " node --run test -- --experimental-test-coverage "
2525
2626[tasks ."checks:lint" ]
2727depends = [" yarn" ]
Original file line number Diff line number Diff line change 22 "name" : " expo-server-sdk" ,
33 "version" : " 5.0.0" ,
44 "description" : " Server-side library for working with Expo using Node.js" ,
5- "main" : " build/ExpoClient.js" ,
6- "types" : " build/ExpoClient.d.ts" ,
5+ "type" : " module" ,
6+ "main" : " ./build/ExpoClient.js" ,
7+ "exports" : " ./build/ExpoClient.js" ,
8+ "types" : " ./build/ExpoClient.d.ts" ,
79 "files" : [
810 " build"
911 ],
1416 "build" : " yarn prepack" ,
1517 "lint" : " eslint" ,
1618 "prepack" : " tsc --project tsconfig.build.json" ,
17- "test" : " jest --coverage" ,
18- "tsc" : " tsc"
19- },
20- "jest" : {
21- "coverageDirectory" : " <rootDir>/../coverage" ,
22- "coverageThreshold" : {
23- "global" : {
24- "branches" : 100 ,
25- "functions" : 100 ,
26- "lines" : 100 ,
27- "statements" : 0
28- }
29- },
30- "preset" : " ts-jest" ,
31- "rootDir" : " src" ,
32- "testEnvironment" : " node"
19+ "test" : " node --test --env-file .env" ,
20+ "tsc" : " tsc" ,
21+ "watch" : " tsc --watch"
3322 },
3423 "repository" : {
3524 "type" : " git" ,
5645 "@types/promise-retry" : " 1.1.6" ,
5746 "eslint" : " 9.39.2" ,
5847 "eslint-config-universe" : " 15.0.3" ,
59- "jest" : " 29.7.0" ,
6048 "jiti" : " 2.6.1" ,
6149 "prettier" : " 3.7.4" ,
62- "ts-jest" : " 29.4.6" ,
6350 "typescript" : " 5.9.3"
6451 },
6552 "packageManager" : " yarn@4.12.0"
Original file line number Diff line number Diff line change 66 * https://expo.dev
77 */
88import assert from 'node:assert' ;
9+ import { createRequire } from 'node:module' ;
910import { gzipSync } from 'node:zlib' ;
1011import promiseLimit from 'promise-limit' ;
1112import promiseRetry from 'promise-retry' ;
@@ -19,7 +20,9 @@ import {
1920 pushNotificationReceiptChunkLimit ,
2021 requestRetryMinTimeout ,
2122 sendApiUrl ,
22- } from './ExpoClientValues' ;
23+ } from './ExpoClientValues.ts' ;
24+
25+ const require = createRequire ( import . meta. url ) ;
2326
2427export class Expo {
2528 static pushNotificationChunkSizeLimit = pushNotificationChunkLimit ;
@@ -199,6 +202,9 @@ export class Expo {
199202 const json = JSON . stringify ( options . body ) ;
200203 assert ( json != null , `JSON request body must not be null` ) ;
201204
205+ // NOTE: This can be replaced with an import with the `{ type: "json" }`
206+ // attribute when we drop support for node versions below v20.10.0, when
207+ // import attributes were stabilized
202208 const sdkVersion = require ( '../package.json' ) . version ;
203209 const requestHeaders = new Headers ( {
204210 Accept : 'application/json' ,
You can’t perform that action at this time.
0 commit comments