diff --git a/package.json b/package.json index 1d5368fdd5..f4086c27c2 100644 --- a/package.json +++ b/package.json @@ -15,8 +15,10 @@ "scripts": { "clean": "git clean -dfqX -- ./node_modules **/{lib,node_modules}/", "postinstall": "lerna run prepare", - "build": "lerna run build", - "watch": "lerna run watch --stream --no-sort --concurrency 20", + "build": "lerna run build && npm run compile", + "compile": "tsc --build tsconfig.json", + "compile:clean": "tsc --build tsconfig.json --clean", + "watch": "tsc --build tsconfig.json --watch", "lint": "prettier --list-different \"packages/*/src/**/*.{js,jsx,ts,tsx}\"", "lint-fix": "prettier --write \"packages/*/src/**/*.{js,jsx,ts,tsx}\"", "test": "jest --verbose", @@ -24,7 +26,7 @@ "circle": "npm run test -- --ci --maxWorkers=2", "precommit": "lint-staged", "release": "npm run clean && npm ci && lerna publish --exact", - "packageExtension": "lerna run packageExtension --scope=apollo-vscode" + "package-extension": "lerna run package-extension --scope=apollo-vscode" }, "engines": { "node": ">=8", diff --git a/packages/apollo-language-server/package.json b/packages/apollo-language-server/package.json index 444e98de35..1afb5af477 100644 --- a/packages/apollo-language-server/package.json +++ b/packages/apollo-language-server/package.json @@ -14,15 +14,9 @@ "main": "lib/index.js", "types": "lib/index.d.ts", "scripts": { - "compile": "tsc --build tsconfig.json", - "compile:clean": "tsc --build tsconfig.json --clean", - "watch": "tsc --build tsconfig.json --watch", - "install-dependencies-into-extension": "yarn install --no-lockfile --force --production --modules-folder ../apollo-vscode/server/node_modules", + "prepare": "npm run clean && npm run install-dependencies-into-extension", "clean": "rm -rf ../apollo-vscode/server", - "prebuild": "npm run clean", - "build": "npm run install-dependencies-into-extension && tsc -p .", - "watchOnly": "tsc -w -p .", - "prepare": "npm run build" + "install-dependencies-into-extension": "yarn install --no-lockfile --force --production --modules-folder ../apollo-vscode/server/node_modules" }, "engines": { "node": "*" diff --git a/packages/apollo-language-server/tsconfig.json b/packages/apollo-language-server/tsconfig.json index 6d2b88734c..0cf8a8c419 100644 --- a/packages/apollo-language-server/tsconfig.json +++ b/packages/apollo-language-server/tsconfig.json @@ -1,9 +1,13 @@ { "extends": "../../tsconfig.base", "compilerOptions": { + "composite": true, "outDir": "../apollo-vscode/server", "skipLibCheck": true, }, "include": ["./src/**/*"], - "exclude": [ "**/__tests__/*", "**/__mocks__/*" ] + "exclude": [ "**/__tests__/*", "**/__mocks__/*" ], + "references": [ + { "path": "../apollo" } + ] } diff --git a/packages/apollo-vscode/package.json b/packages/apollo-vscode/package.json index f517ac1aa2..0ba5ed7f1f 100644 --- a/packages/apollo-vscode/package.json +++ b/packages/apollo-vscode/package.json @@ -15,14 +15,9 @@ "main": "./lib/extension", "types": "lib/index.d.ts", "scripts": { - "clean": "rm -rf lib", - "prebuild": "npm run clean", - "build": "tsc", - "watch": "tsc -w -p .", - "prepare": "npm run build", "postinstall": "npm run update-vscode", "update-vscode": "node ../../node_modules/vscode/bin/install", - "packageExtension": "npm run build && npm update --production && ../../node_modules/vsce/out/vsce package --baseContentUrl https://raw.githubusercontent.com/apollographql/apollo-cli/master/packages/apollo-vscode && git clean -dfqX -- ./node_modules" + "package-extension": "npm run build && npm update --production && ../../node_modules/vsce/out/vsce package --baseContentUrl https://raw.githubusercontent.com/apollographql/apollo-cli/master/packages/apollo-vscode && git clean -dfqX -- ./node_modules" }, "engines": { "vscode": "^1.28.0" diff --git a/packages/apollo-vscode/tsconfig.json b/packages/apollo-vscode/tsconfig.json index 904b82aebf..45fa4d0332 100644 --- a/packages/apollo-vscode/tsconfig.json +++ b/packages/apollo-vscode/tsconfig.json @@ -1,6 +1,7 @@ { "extends": "../../tsconfig.base", "compilerOptions": { + "composite": true, "outDir": "lib" }, "include": ["./src/**/*"], diff --git a/packages/apollo/package.json b/packages/apollo/package.json index f07cc249ff..fedbeccdd1 100644 --- a/packages/apollo/package.json +++ b/packages/apollo/package.json @@ -21,11 +21,6 @@ "apollo": "./bin/run" }, "scripts": { - "clean": "rm -rf lib", - "prebuild": "npm run clean", - "build": "tsc", - "watch": "tsc-watch --onSuccess \"cp -r . ../apollo-vscode/server/node_modules/apollo\"", - "prepare": "npm run build", "prepack": "oclif-dev manifest && oclif-dev readme", "postpack": "rm -f oclif.manifest.json", "version": "oclif-dev readme && git add README.md" diff --git a/packages/apollo/tsconfig.json b/packages/apollo/tsconfig.json index 833e1c8872..af59f255e4 100644 --- a/packages/apollo/tsconfig.json +++ b/packages/apollo/tsconfig.json @@ -1,6 +1,7 @@ { "extends": "../../tsconfig.base", "compilerOptions": { + "composite": true, "outDir": "lib", "noImplicitAny": false, "lib": ["es2017"], diff --git a/tsconfig.json b/tsconfig.json new file mode 100644 index 0000000000..8bf13a507f --- /dev/null +++ b/tsconfig.json @@ -0,0 +1,12 @@ +{ + "compilerOptions": { + "composite": true + }, + "files": [], + "include": [], + "references": [ + { "path": "./packages/apollo" }, + { "path": "./packages/apollo-language-server" }, + { "path": "./packages/apollo-vscode" }, + ] +}