Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Resolve Windows FS Issues #810

Merged
merged 6 commits into from
Jan 15, 2019
Merged
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
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)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

YAS

: 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`] = `
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why was this removed?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was a result of muddying up, then deleting, and finally regenerating this test snap. The test is skipped, so the snap is obsolete. Side note: doesn't jest normally find these and remove them with -u?

Can totally revert this change!

"/* 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