Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 14 additions & 3 deletions javascript_client/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 4 additions & 3 deletions javascript_client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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": {
Expand Down
6 changes: 3 additions & 3 deletions javascript_client/src/__tests__/cliTest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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")
})

Expand All @@ -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": [
{
Expand Down
2 changes: 1 addition & 1 deletion javascript_client/src/__tests__/esmTest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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(() => {
Expand Down
5 changes: 3 additions & 2 deletions javascript_client/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
},
}
Loading