diff --git a/javascript_client/package-lock.json b/javascript_client/package-lock.json index c14448c022..f82037f419 100644 --- a/javascript_client/package-lock.json +++ b/javascript_client/package-lock.json @@ -19,9 +19,9 @@ "@apollo/client": ">=3.3.13", "@rails/actioncable": "^7.0.0", "@types/glob": "^7.1.1", - "@types/jest": "^25.1.2", + "@types/jest": "^25.2.3", "@types/minimist": "^1.2.0", - "@types/node": "^18.0.0", + "@types/node": "^18.19.130", "@types/pako": "^1.0.1", "@types/pusher-js": "^4.2.2", "@types/rails__actioncable": "^6.1.6", @@ -36,8 +36,9 @@ "prettier": "^1.19.1", "pusher-js": "^7.0.3", "relay-runtime": "11.0.2", + "rxjs": "^7.8.2", "ts-jest": "^29.0.0", - "typescript": "5.3.3", + "typescript": ">=5.3.3", "urql": "^2.2.2" }, "engines": { @@ -4563,6 +4564,16 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/rxjs": { + "version": "7.8.2", + "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-7.8.2.tgz", + "integrity": "sha512-dhKf903U/PQZY6boNNtAGdWbG85WAbjT/1xYoZIC7FAY0yWapOBQVsVrDl58W86//e1VpMNBtRV4MaXfdMySFA==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "tslib": "^2.1.0" + } + }, "node_modules/semver": { "version": "7.5.4", "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", diff --git a/javascript_client/package.json b/javascript_client/package.json index 5a2056f5ab..aa379b06e9 100644 --- a/javascript_client/package.json +++ b/javascript_client/package.json @@ -71,9 +71,9 @@ "@apollo/client": ">=3.3.13", "@rails/actioncable": "^7.0.0", "@types/glob": "^7.1.1", - "@types/jest": "^25.1.2", + "@types/jest": "^25.2.3", "@types/minimist": "^1.2.0", - "@types/node": "^18.0.0", + "@types/node": "^18.19.130", "@types/pako": "^1.0.1", "@types/pusher-js": "^4.2.2", "@types/rails__actioncable": "^6.1.6", @@ -88,8 +88,9 @@ "prettier": "^1.19.1", "pusher-js": "^7.0.3", "relay-runtime": "11.0.2", + "rxjs": "^7.8.2", "ts-jest": "^29.0.0", - "typescript": "5.3.3", + "typescript": ">=5.3.3", "urql": "^2.2.2" }, "scripts": { diff --git a/javascript_client/src/__tests__/cliTest.ts b/javascript_client/src/__tests__/cliTest.ts index b476cdb73b..321843b834 100644 --- a/javascript_client/src/__tests__/cliTest.ts +++ b/javascript_client/src/__tests__/cliTest.ts @@ -14,13 +14,13 @@ describe("CLI", () => { it("runs with some options", () => { var buffer = childProcess.execSync("node ./cli.js sync --client=something --header=Abcd:efgh --header=\"Abc: 123 45\" --changeset-version=2023-01-01 --mode=file --path=\"**/doc1.graphql\" --verbose", {stdio: "pipe"}) - var response = buffer.toString().replace(/\033\[[0-9;]*m/g, "") + var response = buffer.toString().replace(/\x1b\[[0-9;]*m/g, "") expect(response).toEqual("No URL; Generating artifacts without syncing them\n[Sync] glob: **/doc1.graphql\n[Sync] 1 files:\n[Sync] - src/__tests__/documents/doc1.graphql\nGenerating client module in src/OperationStoreClient.js...\n✓ Done!\n") }) it("runs with just one header", () => { var buffer = childProcess.execSync("node ./cli.js sync --client=something --header=Ab-cd:ef-gh --mode=file --path=\"**/doc1.graphql\"", {stdio: "pipe"}) - var response = buffer.toString().replace(/\033\[[0-9;]*m/g, "") + var response = buffer.toString().replace(/\x1b\[[0-9;]*m/g, "") expect(response).toEqual("No URL; Generating artifacts without syncing them\nGenerating client module in src/OperationStoreClient.js...\n✓ Done!\n") }) @@ -42,7 +42,7 @@ describe("CLI", () => { it("writes to stdout", () => { let buffer = childProcess.execSync("node ./cli.js sync --client=something --header=Ab-cd:ef-gh --dump-payload --path=\"**/doc1.graphql\"", {stdio: "pipe"}) - let dumpedJSON = buffer.toString().replace(/\033\[[0-9;]*m/g, "") + let dumpedJSON = buffer.toString().replace(/\x1b\[[0-9;]*m/g, "") expect(dumpedJSON).toEqual(`{ "operations": [ { diff --git a/javascript_client/src/__tests__/esmTest.ts b/javascript_client/src/__tests__/esmTest.ts index a6b0254cb9..88f14fc435 100644 --- a/javascript_client/src/__tests__/esmTest.ts +++ b/javascript_client/src/__tests__/esmTest.ts @@ -2,7 +2,7 @@ var childProcess = require("child_process") function runCommand(commandStr: string) { var buffer = childProcess.execSync(commandStr, {stdio: "pipe"}) - return buffer.toString().replace(/\033\[[0-9;]*m/g, "") + return buffer.toString().replace(/\x1b\[[0-9;]*m/g, "") } describe("ESM build", () => { beforeAll(() => { diff --git a/javascript_client/tsconfig.json b/javascript_client/tsconfig.json index 88634cf02f..86f30fd95b 100644 --- a/javascript_client/tsconfig.json +++ b/javascript_client/tsconfig.json @@ -63,6 +63,7 @@ // "emitDecoratorMetadata": true, /* Enables experimental support for emitting type metadata for decorators. */ /* Advanced Options */ - "forceConsistentCasingInFileNames": true /* Disallow inconsistently-cased references to the same file. */ - } + "forceConsistentCasingInFileNames": true, /* Disallow inconsistently-cased references to the same file. */ + "types": ["node", "jest"] + }, }