Skip to content

Commit

Permalink
Use modern moduleResolution setting (#553)
Browse files Browse the repository at this point in the history
* Use modern moduleResolution

* revert redundant changes

* move patch to resolutions

* fixed test expectation

* fixed the same expectation in another place
  • Loading branch information
Andarist authored Jun 24, 2024
1 parent 75e7de5 commit d208047
Show file tree
Hide file tree
Showing 11 changed files with 36 additions and 70 deletions.
12 changes: 12 additions & 0 deletions .yarn/patches/superstruct-npm-1.0.4-44d328b887.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
diff --git a/package.json b/package.json
index 6f759661ef1f6ad76ed41b150b63a922b00e11b3..9928998719f56bb23d1b0603ee45ba7e737e1604 100644
--- a/package.json
+++ b/package.json
@@ -4,7 +4,6 @@
"version": "1.0.4",
"license": "MIT",
"repository": "git://github.com/ianstormtaylor/superstruct.git",
- "type": "module",
"main": "./dist/index.cjs",
"module": "./dist/index.mjs",
"types": "./dist/index.d.ts",
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ const assert = require("assert");
const { WebSocket } = require("ws");
const { SimpleProtocolClient } = require("@replayio/protocol");
const replay = require("@replayio/replay");
const fetch = require("node-fetch");

(async () => {
try {
Expand Down Expand Up @@ -29,7 +30,6 @@ const replay = require("@replayio/replay");
})();

async function getTestMetadata(recordingId, apiKey) {
const { default: fetch } = await import("node-fetch");
const resp = await fetch("https://api.replay.io/v1/graphql", {
method: "POST",
headers: {
Expand Down
6 changes: 2 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,12 @@
"typescript": "^5.5.2",
"ws": "^8.17.0"
},
"dependencies": {
"node-fetch": "^3.3.1"
},
"resolutions": {
"@jest/types": "^27.5.1",
"@types/jest": "^28.1.5",
"@types/node": "^20.11.27",
"@jest/environment@npm:^27.5.1": "patch:@jest/environment@npm%3A28.1.3#~/.yarn/patches/@jest-environment-npm-28.1.3-506a81a227.patch",
"@jest/environment@npm:^28.1.3": "patch:@jest/environment@npm%3A28.1.3#~/.yarn/patches/@jest-environment-npm-28.1.3-506a81a227.patch"
"@jest/environment@npm:^28.1.3": "patch:@jest/environment@npm%3A28.1.3#~/.yarn/patches/@jest-environment-npm-28.1.3-506a81a227.patch",
"superstruct": "patch:superstruct@npm%3A1.0.4#~/.yarn/patches/superstruct-npm-1.0.4-44d328b887.patch"
}
}
2 changes: 1 addition & 1 deletion packages/replay/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
"p-map": "^4.0.0",
"query-registry": "^2.6.0",
"semver": "^7.5.4",
"superstruct": "^0.15.4",
"superstruct": "^1.0.4",
"text-table": "^0.2.0",
"ws": "^7.5.0"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/replay/src/metadata/source.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ describe("source", () => {
process.env.BUILDKITE_PULL_REQUEST = "false";

const source = await init();
expect(source).toHaveProperty("source.merge.id", undefined);
expect(source).not.toHaveProperty("source.merge.id");
});

it("includes merge.id when BUILDKITE_PULL_REQUEST is valued", async () => {
Expand Down
2 changes: 1 addition & 1 deletion packages/replayio/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
"query-registry": "^2.6.0",
"semver": "^7.5.4",
"strip-ansi": "^6.0.1",
"superstruct": "^0.15.4",
"superstruct": "^1.0.4",
"table": "^6.8.2",
"undici": "^5.28.4",
"uuid": "^8.3.2",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ describe("source", () => {
process.env.BUILDKITE_PULL_REQUEST = "false";

const source = await init();
expect(source).toHaveProperty("source.merge.id", undefined);
expect(source).not.toHaveProperty("source.merge.id");
});

it("includes merge.id when BUILDKITE_PULL_REQUEST is valued", async () => {
Expand Down
2 changes: 1 addition & 1 deletion packages/test-utils/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import ReplayReporter from "./reporter";

export type { TestMetadataV1, TestMetadataV2, ReplayReporterConfig } from "./reporter";
export type { TestMetadataV1, TestMetadataV2, ReplayReporterConfig, PendingWork } from "./reporter";
export { buildTestId } from "./testId";
export { ReporterError } from "./reporter";
export { pingTestMetrics } from "./metrics";
Expand Down
2 changes: 1 addition & 1 deletion packages/test-utils/src/reporter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ type PostTestPendingWork = PendingWorkEntry<
testRun: TestRun;
}
>;
type PendingWork =
export type PendingWork =
| TestRunPendingWork
| TestRunTestsPendingWork
| UploadPendingWork
Expand Down
3 changes: 2 additions & 1 deletion scripts/tsconfig/base.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
"composite": true,
"incremental": true,
"target": "ES6",
"module": "commonjs",
"module": "Node16",
"moduleResolution": "Node16",
"declaration": true,
"declarationMap": true,
"sourceMap": true,
Expand Down
71 changes: 13 additions & 58 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3378,7 +3378,7 @@ __metadata:
p-map: "npm:^4.0.0"
query-registry: "npm:^2.6.0"
semver: "npm:^7.5.4"
superstruct: "npm:^0.15.4"
superstruct: "npm:^1.0.4"
text-table: "npm:^0.2.0"
ts-jest: "npm:^28.0.6"
typescript: "npm:^5.5.2"
Expand Down Expand Up @@ -7024,13 +7024,6 @@ __metadata:
languageName: node
linkType: hard

"data-uri-to-buffer@npm:^4.0.0":
version: 4.0.1
resolution: "data-uri-to-buffer@npm:4.0.1"
checksum: 10c0/20a6b93107597530d71d4cb285acee17f66bcdfc03fd81040921a81252f19db27588d87fc8fc69e1950c55cfb0bf8ae40d0e5e21d907230813eb5d5a7f9eb45b
languageName: node
linkType: hard

"data-urls@npm:^2.0.0":
version: 2.0.0
resolution: "data-urls@npm:2.0.0"
Expand Down Expand Up @@ -8742,16 +8735,6 @@ __metadata:
languageName: node
linkType: hard

"fetch-blob@npm:^3.1.2, fetch-blob@npm:^3.1.4":
version: 3.2.0
resolution: "fetch-blob@npm:3.2.0"
dependencies:
node-domexception: "npm:^1.0.0"
web-streams-polyfill: "npm:^3.0.3"
checksum: 10c0/60054bf47bfa10fb0ba6cb7742acec2f37c1f56344f79a70bb8b1c48d77675927c720ff3191fa546410a0442c998d27ab05e9144c32d530d8a52fbe68f843b69
languageName: node
linkType: hard

"figures@npm:^3.0.0, figures@npm:^3.2.0":
version: 3.2.0
resolution: "figures@npm:3.2.0"
Expand Down Expand Up @@ -9010,15 +8993,6 @@ __metadata:
languageName: node
linkType: hard

"formdata-polyfill@npm:^4.0.10":
version: 4.0.10
resolution: "formdata-polyfill@npm:4.0.10"
dependencies:
fetch-blob: "npm:^3.1.2"
checksum: 10c0/5392ec484f9ce0d5e0d52fb5a78e7486637d516179b0eb84d81389d7eccf9ca2f663079da56f761355c0a65792810e3b345dc24db9a8bbbcf24ef3c8c88570c6
languageName: node
linkType: hard

"forwarded@npm:0.2.0":
version: 0.2.0
resolution: "forwarded@npm:0.2.0"
Expand Down Expand Up @@ -12666,13 +12640,6 @@ __metadata:
languageName: node
linkType: hard

"node-domexception@npm:^1.0.0":
version: 1.0.0
resolution: "node-domexception@npm:1.0.0"
checksum: 10c0/5e5d63cda29856402df9472335af4bb13875e1927ad3be861dc5ebde38917aecbf9ae337923777af52a48c426b70148815e890a5d72760f1b4d758cc671b1a2b
languageName: node
linkType: hard

"node-fetch@npm:^2.5.0, node-fetch@npm:^2.6.1, node-fetch@npm:^2.6.7, node-fetch@npm:^2.6.8":
version: 2.7.0
resolution: "node-fetch@npm:2.7.0"
Expand All @@ -12687,17 +12654,6 @@ __metadata:
languageName: node
linkType: hard

"node-fetch@npm:^3.3.1":
version: 3.3.2
resolution: "node-fetch@npm:3.3.2"
dependencies:
data-uri-to-buffer: "npm:^4.0.0"
fetch-blob: "npm:^3.1.4"
formdata-polyfill: "npm:^4.0.10"
checksum: 10c0/f3d5e56190562221398c9f5750198b34cf6113aa304e34ee97c94fd300ec578b25b2c2906edba922050fce983338fde0d5d34fcb0fc3336ade5bd0e429ad7538
languageName: node
linkType: hard

"node-forge@npm:^1":
version: 1.3.1
resolution: "node-forge@npm:1.3.1"
Expand Down Expand Up @@ -15072,7 +15028,6 @@ __metadata:
"@replayio/protocol": "npm:^0.73.0"
"@replayio/replay": "workspace:^"
"@types/ws": "npm:^8"
node-fetch: "npm:^3.3.1"
prettier: "npm:^2.7.1"
replayio: "workspace:^"
typescript: "npm:^5.5.2"
Expand Down Expand Up @@ -15116,7 +15071,7 @@ __metadata:
query-registry: "npm:^2.6.0"
semver: "npm:^7.5.4"
strip-ansi: "npm:^6.0.1"
superstruct: "npm:^0.15.4"
superstruct: "npm:^1.0.4"
table: "npm:^6.8.2"
ts-jest: "npm:^28.0.6"
typescript: "npm:^5.5.2"
Expand Down Expand Up @@ -16479,10 +16434,17 @@ __metadata:
languageName: node
linkType: hard

"superstruct@npm:^0.15.4":
version: 0.15.5
resolution: "superstruct@npm:0.15.5"
checksum: 10c0/73ae2043443dcc7868da6e8b4e4895410c79a88e021b514c665161199675ee920d5eadd85bb9dee5a9f515817e62f4b65a67ccb82d29f73259d012afcbcd3ce4
"superstruct@npm:1.0.4":
version: 1.0.4
resolution: "superstruct@npm:1.0.4"
checksum: 10c0/d355f1a96fa314e9df217aa371e8f22854644e7b600b7b0faa36860a8e50f61a60a6f1189ecf166171bf438aa6581bbd0d3adae1a65f03a3c43c62fd843e925c
languageName: node
linkType: hard

"superstruct@patch:superstruct@npm%3A1.0.4#~/.yarn/patches/superstruct-npm-1.0.4-44d328b887.patch":
version: 1.0.4
resolution: "superstruct@patch:superstruct@npm%3A1.0.4#~/.yarn/patches/superstruct-npm-1.0.4-44d328b887.patch::version=1.0.4&hash=dda445"
checksum: 10c0/9d5f71a87afec96e2b5d045b65f3fadfad126c14f34b276eb66b07ffd92f6252bfeaf809d37372f5db8e0c6ff7e4dc522c32c5a079724b585aa29f92db9983e1
languageName: node
linkType: hard

Expand Down Expand Up @@ -17613,13 +17575,6 @@ __metadata:
languageName: node
linkType: hard

"web-streams-polyfill@npm:^3.0.3":
version: 3.3.3
resolution: "web-streams-polyfill@npm:3.3.3"
checksum: 10c0/64e855c47f6c8330b5436147db1c75cb7e7474d924166800e8e2aab5eb6c76aac4981a84261dd2982b3e754490900b99791c80ae1407a9fa0dcff74f82ea3a7f
languageName: node
linkType: hard

"web-vitals@npm:^2.1.4":
version: 2.1.4
resolution: "web-vitals@npm:2.1.4"
Expand Down

0 comments on commit d208047

Please sign in to comment.