Skip to content

Commit

Permalink
Resolve Windows FS Issues (#810)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
trevor-scheer authored and JakeDawkins committed Jan 16, 2019
1 parent 3f3c245 commit 9f728b4
Show file tree
Hide file tree
Showing 10 changed files with 150 additions and 1,813 deletions.
59 changes: 37 additions & 22 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,53 +4,68 @@
# https://docs.microsoft.com/azure/devops/pipelines/languages/javascript

jobs:
- job: Linux_Node8
# - job: Linux_Node8

pool:
vmImage: "ubuntu 16.04"
# pool:
# vmImage: "ubuntu 16.04"

steps:
- task: NodeTool@0
inputs:
versionSpec: "8.x"
displayName: "Install Node.js"
# steps:
# - task: NodeTool@0
# inputs:
# versionSpec: "8.x"
# displayName: "Install Node.js"

- script: |
npm run azure
displayName: "npm ci && build && test"
# - script: |
# npm run azure
# displayName: "npm ci && build && test"

- script: |
npm run lint
displayName: "npm run lint"
# - script: |
# npm run lint
# displayName: "npm run lint"

- script: |
ENGINE_API_KEY=$(CHECKS_API_KEY) ./packages/apollo/bin/run client:check
displayName: "Query Check"
# - script: |
# ENGINE_API_KEY=$(CHECKS_API_KEY) ./packages/apollo/bin/run client:check
# displayName: "Query Check"

# - job: Linux_Node10

- job: Linux_Node10
# pool:
# vmImage: "ubuntu 16.04"

# steps:
# - task: NodeTool@0
# inputs:
# versionSpec: "10.x"
# displayName: "Install Node.js"

# - script: |
# npm run azure
# displayName: "npm ci && build && test"

- job: Windows_Node8

pool:
vmImage: "ubuntu 16.04"
vmImage: "vs2017-win2016"

steps:
- task: NodeTool@0
inputs:
versionSpec: "10.x"
versionSpec: "8.14"
displayName: "Install Node.js"

- script: |
npm run azure
displayName: "npm ci && build && test"
- job: Windows_Node8
- job: Windows_Node10

pool:
vmImage: "vs2017-win2016"

steps:
- task: NodeTool@0
inputs:
versionSpec: "8.14"
versionSpec: "10.x"
displayName: "Install Node.js"

- script: |
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"apollo": "./packages/apollo/bin/run"
},
"scripts": {
"azure": "npm ci && npm run build && npm test",
"azure": "npm ci && npm test",
"clean": "git clean -dfqX -- ./node_modules **/{lib,node_modules}/",
"postinstall": "npm run build",
"build": "lerna run build --stream --scope apollo-env && npm run compile && lerna run build --stream --ignore apollo-env",
Expand All @@ -23,6 +23,7 @@
"lint": "prettier --list-different \"packages/*/src/**/*.{js,jsx,ts,tsx}\"",
"lint-fix": "prettier --write \"packages/*/src/**/*.{js,jsx,ts,tsx}\"",
"test": "jest",
"test:debug": "node --inspect-brk=9001 node_modules/.bin/jest --runInBand",
"posttest": "npm run lint",
"circle": "npm run test -- --ci --maxWorkers=2",
"release": "npm run clean && npm ci && lerna publish --exact",
Expand Down
6 changes: 3 additions & 3 deletions packages/apollo-language-server/src/project/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,11 +71,11 @@ export function isClientProject(
export interface GraphQLClientProjectConfig {
clientIdentity?: ClientIdentity;
config: ClientConfig;
rootURI: DocumentUri;
rootURI: Uri;
loadingHandler: LoadingHandler;
}
export class GraphQLClientProject extends GraphQLProject {
public rootURI: DocumentUri;
public rootURI: Uri;
public serviceID?: string;
public config!: ClientConfig;

Expand All @@ -93,7 +93,7 @@ export class GraphQLClientProject extends GraphQLProject {
clientIdentity
}: GraphQLClientProjectConfig) {
const fileSet = new FileSet({
rootPath: Uri.parse(rootURI).fsPath,
rootPath: rootURI.fsPath,
includes: config.client.includes,
excludes: config.client.excludes
});
Expand Down
6 changes: 3 additions & 3 deletions packages/apollo-language-server/src/project/service.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { GraphQLProject, DocumentUri } from "./base";
import { GraphQLProject } from "./base";
import { LoadingHandler } from "../loadingHandler";
import { FileSet } from "../fileSet";
import { ServiceConfig } from "../config";
Expand All @@ -14,7 +14,7 @@ export function isServiceProject(
export interface GraphQLServiceProjectConfig {
clientIdentity?: ClientIdentity;
config: ServiceConfig;
rootURI: DocumentUri;
rootURI: Uri;
loadingHandler: LoadingHandler;
}
export class GraphQLServiceProject extends GraphQLProject {
Expand All @@ -25,7 +25,7 @@ export class GraphQLServiceProject extends GraphQLProject {
loadingHandler
}: GraphQLServiceProjectConfig) {
const fileSet = new FileSet({
rootPath: Uri.parse(rootURI).fsPath,
rootPath: rootURI.fsPath,
includes: config.service.includes,
excludes: config.service.excludes
});
Expand Down
4 changes: 2 additions & 2 deletions packages/apollo-language-server/src/workspace.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,13 +55,13 @@ export class GraphQLWorkspace {
? new GraphQLClientProject({
config,
loadingHandler: this.LanguageServerLoadingHandler,
rootURI: folder.uri,
rootURI: Uri.parse(folder.uri),
clientIdentity
})
: new GraphQLServiceProject({
config: config as ServiceConfig,
loadingHandler: this.LanguageServerLoadingHandler,
rootURI: folder.uri,
rootURI: Uri.parse(folder.uri),
clientIdentity
});

Expand Down
5 changes: 3 additions & 2 deletions packages/apollo/src/Command.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import {
ApolloConfig
} from "apollo-language-server";
import { OclifLoadingHandler } from "./OclifLoadingHandler";
import Uri from "vscode-uri";

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

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

const clientIdentity = {
name: "Apollo CLI",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,69 +37,6 @@ exports[`client:codegen generates operation IDs for swift files when flag is set
}"
`;

exports[`client:codegen writes TypeScript global types to a custom path when globalTypesFile is set 1`] = `
"/* tslint:disable */
// This file was automatically generated and should not be edited.
import { SomeEnum } from \\"./../../__foo__/bar\\";
// ====================================================
// GraphQL query operation: SimpleQuery
// ====================================================
export interface SimpleQuery {
someEnum: SomeEnum;
}
"
`;

exports[`client:codegen writes TypeScript global types to a custom path when globalTypesFile is set 2`] = `
"/* tslint:disable */
// This file was automatically generated and should not be edited.
//==============================================================
// START Enums and Input Objects
//==============================================================
export enum SomeEnum {
bar = \\"bar\\",
foo = \\"foo\\",
}
//==============================================================
// END Enums and Input Objects
//==============================================================
"
`;

exports[`client:codegen writes TypeScript types into a __generated__ directory next to sources when no output is set 1`] = `
"/* tslint:disable */
// This file was automatically generated and should not be edited.
// ====================================================
// GraphQL query operation: SimpleQuery
// ====================================================
export interface SimpleQuery {
hello: string;
}
"
`;

exports[`client:codegen writes TypeScript types into a __generated__ directory next to sources when no output is set 2`] = `
"/* tslint:disable */
// This file was automatically generated and should not be edited.
//==============================================================
// START Enums and Input Objects
//==============================================================
//==============================================================
// END Enums and Input Objects
//==============================================================
"
`;

exports[`client:codegen writes exact Flow types when the useFlowExactObjects flag is set 1`] = `
"
Expand Down
Loading

0 comments on commit 9f728b4

Please sign in to comment.