Skip to content

Commit 9f728b4

Browse files
trevor-scheerJakeDawkins
authored andcommitted
Resolve Windows FS Issues (#810)
* Resolve Windows FS Issues * Convert "string" URIs to actual Uri objects * Don't manually build URIs, hand off to Uri constructor instead * QoL debug script and snapshot update * Updates snapshots * Add windows node 10 job to pipeline config
1 parent 3f3c245 commit 9f728b4

10 files changed

Lines changed: 150 additions & 1813 deletions

File tree

azure-pipelines.yml

Lines changed: 37 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -4,53 +4,68 @@
44
# https://docs.microsoft.com/azure/devops/pipelines/languages/javascript
55

66
jobs:
7-
- job: Linux_Node8
7+
# - job: Linux_Node8
88

9-
pool:
10-
vmImage: "ubuntu 16.04"
9+
# pool:
10+
# vmImage: "ubuntu 16.04"
1111

12-
steps:
13-
- task: NodeTool@0
14-
inputs:
15-
versionSpec: "8.x"
16-
displayName: "Install Node.js"
12+
# steps:
13+
# - task: NodeTool@0
14+
# inputs:
15+
# versionSpec: "8.x"
16+
# displayName: "Install Node.js"
1717

18-
- script: |
19-
npm run azure
20-
displayName: "npm ci && build && test"
18+
# - script: |
19+
# npm run azure
20+
# displayName: "npm ci && build && test"
2121

22-
- script: |
23-
npm run lint
24-
displayName: "npm run lint"
22+
# - script: |
23+
# npm run lint
24+
# displayName: "npm run lint"
2525

26-
- script: |
27-
ENGINE_API_KEY=$(CHECKS_API_KEY) ./packages/apollo/bin/run client:check
28-
displayName: "Query Check"
26+
# - script: |
27+
# ENGINE_API_KEY=$(CHECKS_API_KEY) ./packages/apollo/bin/run client:check
28+
# displayName: "Query Check"
29+
30+
# - job: Linux_Node10
2931

30-
- job: Linux_Node10
32+
# pool:
33+
# vmImage: "ubuntu 16.04"
34+
35+
# steps:
36+
# - task: NodeTool@0
37+
# inputs:
38+
# versionSpec: "10.x"
39+
# displayName: "Install Node.js"
40+
41+
# - script: |
42+
# npm run azure
43+
# displayName: "npm ci && build && test"
44+
45+
- job: Windows_Node8
3146

3247
pool:
33-
vmImage: "ubuntu 16.04"
48+
vmImage: "vs2017-win2016"
3449

3550
steps:
3651
- task: NodeTool@0
3752
inputs:
38-
versionSpec: "10.x"
53+
versionSpec: "8.14"
3954
displayName: "Install Node.js"
4055

4156
- script: |
4257
npm run azure
4358
displayName: "npm ci && build && test"
4459
45-
- job: Windows_Node8
60+
- job: Windows_Node10
4661

4762
pool:
4863
vmImage: "vs2017-win2016"
4964

5065
steps:
5166
- task: NodeTool@0
5267
inputs:
53-
versionSpec: "8.14"
68+
versionSpec: "10.x"
5469
displayName: "Install Node.js"
5570

5671
- script: |

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
"apollo": "./packages/apollo/bin/run"
1414
},
1515
"scripts": {
16-
"azure": "npm ci && npm run build && npm test",
16+
"azure": "npm ci && npm test",
1717
"clean": "git clean -dfqX -- ./node_modules **/{lib,node_modules}/",
1818
"postinstall": "npm run build",
1919
"build": "lerna run build --stream --scope apollo-env && npm run compile && lerna run build --stream --ignore apollo-env",
@@ -23,6 +23,7 @@
2323
"lint": "prettier --list-different \"packages/*/src/**/*.{js,jsx,ts,tsx}\"",
2424
"lint-fix": "prettier --write \"packages/*/src/**/*.{js,jsx,ts,tsx}\"",
2525
"test": "jest",
26+
"test:debug": "node --inspect-brk=9001 node_modules/.bin/jest --runInBand",
2627
"posttest": "npm run lint",
2728
"circle": "npm run test -- --ci --maxWorkers=2",
2829
"release": "npm run clean && npm ci && lerna publish --exact",

packages/apollo-language-server/src/project/client.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,11 +71,11 @@ export function isClientProject(
7171
export interface GraphQLClientProjectConfig {
7272
clientIdentity?: ClientIdentity;
7373
config: ClientConfig;
74-
rootURI: DocumentUri;
74+
rootURI: Uri;
7575
loadingHandler: LoadingHandler;
7676
}
7777
export class GraphQLClientProject extends GraphQLProject {
78-
public rootURI: DocumentUri;
78+
public rootURI: Uri;
7979
public serviceID?: string;
8080
public config!: ClientConfig;
8181

@@ -93,7 +93,7 @@ export class GraphQLClientProject extends GraphQLProject {
9393
clientIdentity
9494
}: GraphQLClientProjectConfig) {
9595
const fileSet = new FileSet({
96-
rootPath: Uri.parse(rootURI).fsPath,
96+
rootPath: rootURI.fsPath,
9797
includes: config.client.includes,
9898
excludes: config.client.excludes
9999
});

packages/apollo-language-server/src/project/service.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { GraphQLProject, DocumentUri } from "./base";
1+
import { GraphQLProject } from "./base";
22
import { LoadingHandler } from "../loadingHandler";
33
import { FileSet } from "../fileSet";
44
import { ServiceConfig } from "../config";
@@ -14,7 +14,7 @@ export function isServiceProject(
1414
export interface GraphQLServiceProjectConfig {
1515
clientIdentity?: ClientIdentity;
1616
config: ServiceConfig;
17-
rootURI: DocumentUri;
17+
rootURI: Uri;
1818
loadingHandler: LoadingHandler;
1919
}
2020
export class GraphQLServiceProject extends GraphQLProject {
@@ -25,7 +25,7 @@ export class GraphQLServiceProject extends GraphQLProject {
2525
loadingHandler
2626
}: GraphQLServiceProjectConfig) {
2727
const fileSet = new FileSet({
28-
rootPath: Uri.parse(rootURI).fsPath,
28+
rootPath: rootURI.fsPath,
2929
includes: config.service.includes,
3030
excludes: config.service.excludes
3131
});

packages/apollo-language-server/src/workspace.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,13 +55,13 @@ export class GraphQLWorkspace {
5555
? new GraphQLClientProject({
5656
config,
5757
loadingHandler: this.LanguageServerLoadingHandler,
58-
rootURI: folder.uri,
58+
rootURI: Uri.parse(folder.uri),
5959
clientIdentity
6060
})
6161
: new GraphQLServiceProject({
6262
config: config as ServiceConfig,
6363
loadingHandler: this.LanguageServerLoadingHandler,
64-
rootURI: folder.uri,
64+
rootURI: Uri.parse(folder.uri),
6565
clientIdentity
6666
});
6767

packages/apollo/src/Command.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import {
1313
ApolloConfig
1414
} from "apollo-language-server";
1515
import { OclifLoadingHandler } from "./OclifLoadingHandler";
16+
import Uri from "vscode-uri";
1617

1718
const { version, referenceID } = require("../package.json");
1819

@@ -188,8 +189,8 @@ export abstract class ProjectCommand extends Command {
188189
// In this case, we don't want to look to the .dir since that's the parent
189190
const rootURI =
190191
filepath === process.cwd()
191-
? `file://${filepath}`
192-
: `file://${parse(filepath).dir}`;
192+
? Uri.file(filepath)
193+
: Uri.file(parse(filepath).dir);
193194

194195
const clientIdentity = {
195196
name: "Apollo CLI",

packages/apollo/src/commands/client/__tests__/__snapshots__/generate.test.ts.snap

Lines changed: 0 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -37,69 +37,6 @@ exports[`client:codegen generates operation IDs for swift files when flag is set
3737
}"
3838
`;
3939

40-
exports[`client:codegen writes TypeScript global types to a custom path when globalTypesFile is set 1`] = `
41-
"/* tslint:disable */
42-
// This file was automatically generated and should not be edited.
43-
44-
import { SomeEnum } from \\"./../../__foo__/bar\\";
45-
46-
// ====================================================
47-
// GraphQL query operation: SimpleQuery
48-
// ====================================================
49-
50-
export interface SimpleQuery {
51-
someEnum: SomeEnum;
52-
}
53-
"
54-
`;
55-
56-
exports[`client:codegen writes TypeScript global types to a custom path when globalTypesFile is set 2`] = `
57-
"/* tslint:disable */
58-
// This file was automatically generated and should not be edited.
59-
60-
//==============================================================
61-
// START Enums and Input Objects
62-
//==============================================================
63-
64-
export enum SomeEnum {
65-
bar = \\"bar\\",
66-
foo = \\"foo\\",
67-
}
68-
69-
//==============================================================
70-
// END Enums and Input Objects
71-
//==============================================================
72-
"
73-
`;
74-
75-
exports[`client:codegen writes TypeScript types into a __generated__ directory next to sources when no output is set 1`] = `
76-
"/* tslint:disable */
77-
// This file was automatically generated and should not be edited.
78-
79-
// ====================================================
80-
// GraphQL query operation: SimpleQuery
81-
// ====================================================
82-
83-
export interface SimpleQuery {
84-
hello: string;
85-
}
86-
"
87-
`;
88-
89-
exports[`client:codegen writes TypeScript types into a __generated__ directory next to sources when no output is set 2`] = `
90-
"/* tslint:disable */
91-
// This file was automatically generated and should not be edited.
92-
93-
//==============================================================
94-
// START Enums and Input Objects
95-
//==============================================================
96-
97-
//==============================================================
98-
// END Enums and Input Objects
99-
//==============================================================
100-
"
101-
`;
102-
10340
exports[`client:codegen writes exact Flow types when the useFlowExactObjects flag is set 1`] = `
10441
"
10542

0 commit comments

Comments
 (0)