graphql-language-service-cli 4.0.0-rc.1 → 4.0.0-rc.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/bin/graphql.js CHANGED
@@ -11,5 +11,4 @@ if (process?.env) {
11
11
  process.env.GRAPHQL_NO_NAME_WARNING = true;
12
12
  }
13
13
 
14
- require('@babel/polyfill');
15
14
  require('../dist/cli');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "graphql-language-service-cli",
3
- "version": "4.0.0-rc.1",
3
+ "version": "4.0.0-rc.2",
4
4
  "description": "An interface for building GraphQL language services for IDEs",
5
5
  "contributors": [
6
6
  "Hyohyeon Jeong <asiandrummer@fb.com>",
@@ -35,19 +35,18 @@
35
35
  "graphql": "^16.11.0 || ^17.0.0"
36
36
  },
37
37
  "dependencies": {
38
- "@babel/polyfill": "^7.12.1",
39
38
  "@types/yargs": "16.0.5",
40
- "graphql-language-service": "^6.0.0-rc.0",
41
- "graphql-language-service-server": "^3.0.0-rc.1",
39
+ "graphql-language-service": "^6.0.0-rc.1",
40
+ "graphql-language-service-server": "^3.0.0-rc.2",
42
41
  "yargs": "^16.2.0"
43
42
  },
44
43
  "devDependencies": {
45
- "@typescript/native-preview": "^7.0.0-dev.20260707.2",
46
- "graphql": "^16.14.2"
44
+ "@typescript/native": "npm:typescript@^7.0.2",
45
+ "graphql": "^17.0.2"
47
46
  },
48
47
  "scripts": {
49
- "build": "tsgo -p tsconfig.json && tsgo -p tsconfig.esm.json",
50
- "types:check": "tsgo --noEmit",
48
+ "build": "tsc -p tsconfig.json && tsc -p tsconfig.esm.json",
49
+ "types:check": "tsc --noEmit",
51
50
  "test": "vitest run"
52
51
  }
53
52
  }
@@ -9,38 +9,29 @@ import { describe, it, expect, vi, afterEach } from 'vitest';
9
9
 
10
10
  import main from '../client';
11
11
 
12
- describe('process.stderr.write', () => {
12
+ describe('error output', () => {
13
13
  afterEach(() => {
14
14
  vi.restoreAllMocks();
15
15
  });
16
16
 
17
- it('is passed information on error of string type', () => {
18
- const argv = {
19
- schemaPath: '...',
20
- text: 'foo',
21
- };
22
- const mockStdErrWrite = vi
23
- .spyOn(process.stderr, 'write')
24
- .mockImplementation();
25
- vi.spyOn(process, 'exit').mockImplementation(() => {});
26
- const undefinedWithNewLine = /^undefined\n$/;
17
+ it.each(['autocomplete', 'outline', 'validate'])(
18
+ 'writes the %s error to stderr',
19
+ command => {
20
+ const argv = {
21
+ schemaPath: '...',
22
+ text: 'foo',
23
+ };
24
+ const mockStdErrWrite = vi
25
+ .spyOn(process.stderr, 'write')
26
+ .mockImplementation(() => true);
27
+ const mockExit = vi.spyOn(process, 'exit').mockImplementation(() => {});
28
+ main(command, argv);
27
29
 
28
- main('autocomplete', argv);
29
- expect(mockStdErrWrite).toHaveBeenLastCalledWith(expect.any(String));
30
- expect(mockStdErrWrite).toHaveBeenLastCalledWith(
31
- expect.not.stringMatching(undefinedWithNewLine),
32
- );
33
-
34
- main('outline', argv);
35
- expect(mockStdErrWrite).toHaveBeenLastCalledWith(expect.any(String));
36
- expect(mockStdErrWrite).toHaveBeenLastCalledWith(
37
- expect.not.stringMatching(undefinedWithNewLine),
38
- );
39
-
40
- main('validate', argv);
41
- expect(mockStdErrWrite).toHaveBeenLastCalledWith(expect.any(String));
42
- expect(mockStdErrWrite).toHaveBeenLastCalledWith(
43
- expect.not.stringMatching(undefinedWithNewLine),
44
- );
45
- });
30
+ expect(mockStdErrWrite).toHaveBeenCalledOnce();
31
+ expect(mockStdErrWrite).toHaveBeenCalledWith(
32
+ expect.stringMatching(/^(?!undefined\n$).+\n$/s),
33
+ );
34
+ expect(mockExit).toHaveBeenCalledWith(1);
35
+ },
36
+ );
46
37
  });