From 9099f9ef972a4f964b3b4e35e28a97429ed23b38 Mon Sep 17 00:00:00 2001 From: Kamil Kisiela Date: Sat, 11 Apr 2020 09:31:25 +0200 Subject: [PATCH] Angular 9 and GraphQL 15 (#1484) --- package.json | 17 ++-- packages/apollo-angular-boost/package.json | 47 +++++----- packages/apollo-angular-boost/tsconfig.json | 3 + .../apollo-angular-boost/tsconfig.test.json | 3 +- .../apollo-angular-cache-ngrx/package.json | 39 ++++---- .../apollo-angular-link-headers/package.json | 31 ++++--- .../apollo-angular-link-headers/tsconfig.json | 6 +- .../package.json | 49 +++++----- .../tsconfig.json | 3 + .../tsconfig.test.json | 3 +- .../package.json | 49 +++++----- .../tsconfig.json | 3 + .../tsconfig.test.json | 3 +- .../apollo-angular-link-http/package.json | 53 +++++------ .../apollo-angular-link-http/tsconfig.json | 3 + .../tsconfig.test.json | 3 +- .../package.json | 25 ++--- .../tsconfig.json | 3 + .../tsconfig.test.json | 3 +- packages/apollo-angular/package.json | 49 +++++----- .../schematics/install/index.ts | 6 +- packages/apollo-angular/tsconfig.json | 3 + packages/apollo-angular/tsconfig.test.json | 3 +- scripts/bump.js | 52 +++++++++++ scripts/version.js | 93 +++++++++++++++++++ tsconfig.json | 13 ++- 26 files changed, 379 insertions(+), 186 deletions(-) create mode 100755 scripts/bump.js create mode 100755 scripts/version.js diff --git a/package.json b/package.json index 92e060f00..a55731518 100644 --- a/package.json +++ b/package.json @@ -15,16 +15,15 @@ "packages/*" ], "devDependencies": { - "@types/jest": "24.9.1", - "codecov": "3.6.1", - "husky": "4.2.1", - "jest": "24.9.0", + "@types/jest": "25.1.4", + "codecov": "3.6.5", + "husky": "4.2.3", + "jest": "25.2.3", "lerna": "3.20.2", - "lint-staged": "10.0.2", - "prettier": "1.19.1", - "rimraf": "3.0.0", + "lint-staged": "10.0.9", + "prettier": "2.0.2", + "rimraf": "3.0.2", "shelljs": "0.8.3", - "tsickle": "0.38.0", - "typescript": "3.5.3" + "typescript": "3.8.3" } } diff --git a/packages/apollo-angular-boost/package.json b/packages/apollo-angular-boost/package.json index d25a092ad..c280a12c3 100644 --- a/packages/apollo-angular-boost/package.json +++ b/packages/apollo-angular-boost/package.json @@ -6,7 +6,7 @@ "main": "build/bundles/ngApolloBoost.umd.js", "module": "build/fesm5/ngApolloBoost.js", "typings": "build/ngApolloBoost.d.ts", - "version": "1.7.0", + "version": "1.8.0-alpha.0", "repository": "https://github.com/apollographql/apollo-angular/tree/master/packages/apollo-angular-boost", "keywords": [ "apollo", @@ -17,40 +17,41 @@ "build": "ng-packagr -p ng-package.js", "test": "yarn test-only", "test-only": "jest --config jest.config.js", - "deploy": "yarn build && npm publish build" + "deploy": "yarn build && npm publish build", + "deploy:next": "yarn build && npm publish build --tag next" }, "peerDependencies": { - "@angular/common": "^6.1.0 || ^7.0.0 || ^8.0.0", - "@angular/core": "^6.1.0 || ^7.0.0 || ^8.0.0" + "@angular/common": "^6.1.0 || ^7.0.0 || ^8.0.0 || ^9.0.0", + "@angular/core": "^6.1.0 || ^7.0.0 || ^8.0.0 || ^9.0.0" }, "dependencies": { - "apollo-angular": "~1.8.0", - "apollo-angular-link-http": "~1.9.0", + "apollo-angular": "~1.9.0-alpha.0", + "apollo-angular-link-http": "~1.10.0-alpha.0", "apollo-cache-inmemory": "~1.6.0", "apollo-client": "^2.6.0", "apollo-link": "~1.2.2", "apollo-link-error": "~1.1.0", "apollo-link-state": "~0.4.1", - "graphql-tag": "~2.10.0" + "graphql-tag": "~2.10.0", + "tslib": "^1.11.0" }, "devDependencies": { - "@angular/animations": "8.2.14", - "@angular/common": "8.2.14", - "@angular/compiler": "8.2.14", - "@angular/compiler-cli": "8.2.14", - "@angular/core": "8.2.14", - "@angular/platform-browser": "8.2.14", - "@angular/platform-browser-dynamic": "8.2.14", - "@angular/platform-server": "8.2.14", - "@types/graphql": "14.5.0", - "@types/jest": "24.9.1", - "graphql": "14.5.8", - "jest": "24.9.0", + "@angular/animations": "9.1.0", + "@angular/common": "9.1.0", + "@angular/compiler": "9.1.0", + "@angular/compiler-cli": "9.1.0", + "@angular/core": "9.1.0", + "@angular/platform-browser": "9.1.0", + "@angular/platform-browser-dynamic": "9.1.0", + "@angular/platform-server": "9.1.0", + "@types/jest": "25.1.4", + "graphql": "15.0.0", + "jest": "25.2.3", "jest-zone-patch": "0.0.10", - "ng-packagr": "5.7.1", + "ng-packagr": "9.1.0", "rxjs": "6.5.4", - "ts-jest": "25.0.0", - "typescript": "3.5.3", - "zone.js": "0.10.2" + "ts-jest": "25.2.1", + "typescript": "3.8.3", + "zone.js": "0.10.3" } } diff --git a/packages/apollo-angular-boost/tsconfig.json b/packages/apollo-angular-boost/tsconfig.json index 64c812400..05735999a 100644 --- a/packages/apollo-angular-boost/tsconfig.json +++ b/packages/apollo-angular-boost/tsconfig.json @@ -4,5 +4,8 @@ "rootDir": ".", "outDir": "build" }, + "angularCompilerOptions": { + "enableIvy": false + }, "include": ["src/**/*.ts"] } diff --git a/packages/apollo-angular-boost/tsconfig.test.json b/packages/apollo-angular-boost/tsconfig.test.json index 2c7b28416..42521b936 100644 --- a/packages/apollo-angular-boost/tsconfig.test.json +++ b/packages/apollo-angular-boost/tsconfig.test.json @@ -1,6 +1,7 @@ { "extends": "./tsconfig.json", "compilerOptions": { - "module": "commonjs" + "module": "commonjs", + "emitDecoratorMetadata": true } } diff --git a/packages/apollo-angular-cache-ngrx/package.json b/packages/apollo-angular-cache-ngrx/package.json index bece28363..658845e9c 100644 --- a/packages/apollo-angular-cache-ngrx/package.json +++ b/packages/apollo-angular-cache-ngrx/package.json @@ -23,36 +23,37 @@ "xbuild": "ng-packagr -p ng-package.js", "xtest": "yarn test-only", "test-only": "jest --config jest.config.js", - "deploy": "yarn build && npm publish build" + "deploy": "yarn build && npm publish build", + "deploy:next": "yarn build && npm publish build --tag next" }, "peerDependencies": { - "@angular/core": "^6.1.0 || ^7.0.0 || ^8.0.0", + "@angular/core": "^6.1.0 || ^7.0.0 || ^8.0.0 || ^9.0.0", "@ngrx/store": "^6.0.0 || ^7.0.0 || ^8.0.0", "rxjs": "^6.0.0" }, "devDependencies": { - "@angular/animations": "8.2.14", - "@angular/common": "8.2.14", - "@angular/compiler": "8.2.14", - "@angular/compiler-cli": "8.2.14", - "@angular/core": "8.2.14", - "@angular/platform-browser": "8.2.14", - "@angular/platform-browser-dynamic": "8.2.14", + "@angular/animations": "9.1.0", + "@angular/common": "9.1.0", + "@angular/compiler": "9.1.0", + "@angular/compiler-cli": "9.1.0", + "@angular/core": "9.1.0", + "@angular/platform-browser": "9.1.0", + "@angular/platform-browser-dynamic": "9.1.0", "@ngrx/store": "8.6.0", - "@types/graphql": "14.5.0", - "@types/jest": "24.9.1", - "graphql": "14.5.8", - "graphql-tag": "2.10.1", - "jest": "24.9.0", + "@types/jest": "25.1.4", + "graphql": "15.0.0", + "graphql-tag": "2.10.3", + "jest": "25.2.3", "jest-zone-patch": "0.0.10", - "ng-packagr": "5.7.1", + "ng-packagr": "9.1.0", "rxjs": "6.5.4", - "ts-jest": "25.0.0", - "typescript": "3.5.3", - "zone.js": "0.10.2" + "ts-jest": "25.2.1", + "typescript": "3.8.3", + "zone.js": "0.10.3" }, "dependencies": { "apollo-cache": "^1.1.0", - "apollo-cache-inmemory": "^1.1.5" + "apollo-cache-inmemory": "^1.1.5", + "tslib": "^1.11.0" } } diff --git a/packages/apollo-angular-link-headers/package.json b/packages/apollo-angular-link-headers/package.json index 97da82d81..74821d998 100644 --- a/packages/apollo-angular-link-headers/package.json +++ b/packages/apollo-angular-link-headers/package.json @@ -7,7 +7,7 @@ "main": "build/bundles/ngApolloLinkHeaders.umd.js", "module": "build/fesm5/ngApolloLinkHeaders.js", "typings": "build/ngApolloLinkHeaders.d.ts", - "version": "1.4.0", + "version": "1.5.0-alpha.0", "repository": "https://github.com/apollographql/apollo-angular/tree/master/packages/apollo-angular-link-headers", "keywords": [ "apollo", @@ -18,23 +18,26 @@ "build": "ng-packagr -p ng-package.js", "test": "yarn test-only", "test-only": "jest --config jest.config.js", - "deploy": "yarn build && npm publish build" + "deploy": "yarn build && npm publish build", + "deploy:next": "yarn build && npm publish build --tag next" + }, + "dependencies": { + "tslib": "^1.11.0" }, "peerDependencies": { - "@angular/common": "^6.0.0 || ^7.0.0 || ^8.0.0", + "@angular/common": "^6.0.0 || ^7.0.0 || ^8.0.0 || ^9.0.0", "apollo-link": "^1.0.0" }, "devDependencies": { - "@angular/common": "8.2.14", - "@angular/core": "8.2.14", - "@types/graphql": "14.5.0", - "@types/jest": "24.9.1", - "apollo-link": "1.2.13", - "graphql": "14.5.8", - "graphql-tag": "2.10.1", - "jest": "24.9.0", - "ng-packagr": "5.7.1", - "ts-jest": "25.0.0", - "typescript": "3.5.3" + "@angular/common": "9.1.0", + "@angular/core": "9.1.0", + "@types/jest": "25.1.4", + "apollo-link": "1.2.14", + "graphql": "15.0.0", + "graphql-tag": "2.10.3", + "jest": "25.2.3", + "ng-packagr": "9.1.0", + "ts-jest": "25.2.1", + "typescript": "3.8.3" } } diff --git a/packages/apollo-angular-link-headers/tsconfig.json b/packages/apollo-angular-link-headers/tsconfig.json index e81ffad68..8f2302f9a 100644 --- a/packages/apollo-angular-link-headers/tsconfig.json +++ b/packages/apollo-angular-link-headers/tsconfig.json @@ -2,6 +2,10 @@ "extends": "../../tsconfig", "compilerOptions": { "rootDir": ".", - "outDir": "build" + "outDir": "build", + "emitDecoratorMetadata": true + }, + "angularCompilerOptions": { + "enableIvy": false } } diff --git a/packages/apollo-angular-link-http-batch/package.json b/packages/apollo-angular-link-http-batch/package.json index f5be47ae5..1d181982d 100644 --- a/packages/apollo-angular-link-http-batch/package.json +++ b/packages/apollo-angular-link-http-batch/package.json @@ -7,7 +7,7 @@ "main": "build/bundles/ngApolloLinkHttpBatch.umd.js", "module": "build/fesm5/ngApolloLinkHttpBatch.js", "typings": "build/ngApolloLinkHttpBatch.d.ts", - "version": "1.7.0", + "version": "1.8.0-alpha.0", "repository": "https://github.com/apollographql/apollo-angular/tree/master/packages/apollo-angular-link-http-batch", "keywords": [ "apollo", @@ -18,39 +18,40 @@ "build": "ng-packagr -p ng-package.js", "test": "yarn test-only", "test-only": "jest --config jest.config.js", - "deploy": "yarn build && npm publish build" + "deploy": "yarn build && npm publish build", + "deploy:next": "yarn build && npm publish build --tag next" }, "peerDependencies": { - "@angular/common": "^6.0.0 || ^7.0.0 || ^8.0.0", - "@angular/core": "^6.0.0 || ^7.0.0 || ^8.0.0", - "graphql": ">=0.11.0 <0.14.0 || ^14.0.0" + "@angular/common": "^6.0.0 || ^7.0.0 || ^8.0.0 || ^9.0.0", + "@angular/core": "^6.0.0 || ^7.0.0 || ^8.0.0 || ^9.0.0", + "graphql": ">=0.11.0 <0.14.0 || ^14.0.0 || ^15.0.0" }, "dependencies": { - "apollo-angular-link-http-common": "~1.8.0", + "apollo-angular-link-http-common": "~1.9.0-alpha.0", "apollo-link": "^1.0.0", - "apollo-link-batch": "^1.1.2" + "apollo-link-batch": "^1.1.2", + "tslib": "^1.11.0" }, "devDependencies": { - "@angular/animations": "8.2.14", - "@angular/common": "8.2.14", - "@angular/compiler": "8.2.14", - "@angular/compiler-cli": "8.2.14", - "@angular/core": "8.2.14", - "@angular/platform-browser": "8.2.14", - "@angular/platform-browser-dynamic": "8.2.14", - "@angular/platform-server": "8.2.14", - "@types/graphql": "14.5.0", - "@types/jest": "24.9.1", + "@angular/animations": "9.1.0", + "@angular/common": "9.1.0", + "@angular/compiler": "9.1.0", + "@angular/compiler-cli": "9.1.0", + "@angular/core": "9.1.0", + "@angular/platform-browser": "9.1.0", + "@angular/platform-browser-dynamic": "9.1.0", + "@angular/platform-server": "9.1.0", + "@types/jest": "25.1.4", "apollo-cache-inmemory": "1.6.5", "apollo-client": "2.6.8", - "graphql": "14.5.8", - "graphql-tag": "2.10.1", - "jest": "24.9.0", + "graphql": "15.0.0", + "graphql-tag": "2.10.3", + "jest": "25.2.3", "jest-zone-patch": "0.0.10", - "ng-packagr": "5.7.1", + "ng-packagr": "9.1.0", "rxjs": "6.5.4", - "ts-jest": "25.0.0", - "typescript": "3.5.3", - "zone.js": "0.10.2" + "ts-jest": "25.2.1", + "typescript": "3.8.3", + "zone.js": "0.10.3" } } diff --git a/packages/apollo-angular-link-http-batch/tsconfig.json b/packages/apollo-angular-link-http-batch/tsconfig.json index 13620572b..6fc85067a 100644 --- a/packages/apollo-angular-link-http-batch/tsconfig.json +++ b/packages/apollo-angular-link-http-batch/tsconfig.json @@ -4,6 +4,9 @@ "rootDir": ".", "outDir": "build" }, + "angularCompilerOptions": { + "enableIvy": false + }, "include": [ "src/**/*.ts", "tests/**/*.ts", diff --git a/packages/apollo-angular-link-http-batch/tsconfig.test.json b/packages/apollo-angular-link-http-batch/tsconfig.test.json index 2c7b28416..42521b936 100644 --- a/packages/apollo-angular-link-http-batch/tsconfig.test.json +++ b/packages/apollo-angular-link-http-batch/tsconfig.test.json @@ -1,6 +1,7 @@ { "extends": "./tsconfig.json", "compilerOptions": { - "module": "commonjs" + "module": "commonjs", + "emitDecoratorMetadata": true } } diff --git a/packages/apollo-angular-link-http-common/package.json b/packages/apollo-angular-link-http-common/package.json index 3cb1a394e..43660a38b 100644 --- a/packages/apollo-angular-link-http-common/package.json +++ b/packages/apollo-angular-link-http-common/package.json @@ -7,7 +7,7 @@ "main": "build/bundles/ngApolloLinkHttpCommon.umd.js", "module": "build/fesm5/ngApolloLinkHttpCommon.js", "typings": "build/ngApolloLinkHttpCommon.d.ts", - "version": "1.8.0", + "version": "1.9.0-alpha.0", "repository": "https://github.com/apollographql/apollo-angular/tree/master/packages/apollo-angular-link-http-common", "keywords": [ "apollo", @@ -18,36 +18,39 @@ "build": "ng-packagr -p ng-package.js", "test": "yarn test-only", "test-only": "exit 0", - "deploy": "yarn build && npm publish build" + "deploy": "yarn build && npm publish build", + "deploy:next": "yarn build && npm publish build --tag next" }, "peerDependencies": { - "@angular/core": "^6.0.0 || ^7.0.0 || ^8.0.0", - "@angular/common": "^6.0.0 || ^7.0.0 || ^8.0.0", + "@angular/core": "^6.0.0 || ^7.0.0 || ^8.0.0 || ^9.0.0", + "@angular/common": "^6.0.0 || ^7.0.0 || ^8.0.0 || ^9.0.0", "apollo-link": "^1.0.0", - "graphql": ">=0.11.0 <0.14.0 || ^14.0.0" + "graphql": ">=0.11.0 <0.14.0 || ^14.0.0 || ^15.0.0" + }, + "dependencies": { + "tslib": "^1.11.0" }, "devDependencies": { - "@angular/animations": "8.2.14", - "@angular/common": "8.2.14", - "@angular/compiler": "8.2.14", - "@angular/compiler-cli": "8.2.14", - "@angular/core": "8.2.14", - "@angular/platform-browser": "8.2.14", - "@angular/platform-browser-dynamic": "8.2.14", - "@angular/platform-server": "8.2.14", - "@types/graphql": "14.5.0", - "@types/jest": "24.9.1", + "@angular/animations": "9.1.0", + "@angular/common": "9.1.0", + "@angular/compiler": "9.1.0", + "@angular/compiler-cli": "9.1.0", + "@angular/core": "9.1.0", + "@angular/platform-browser": "9.1.0", + "@angular/platform-browser-dynamic": "9.1.0", + "@angular/platform-server": "9.1.0", + "@types/jest": "25.1.4", "apollo-cache-inmemory": "1.6.5", "apollo-client": "2.6.8", - "apollo-link": "1.2.13", - "graphql": "14.5.8", - "graphql-tag": "2.10.1", - "jest": "24.9.0", + "apollo-link": "1.2.14", + "graphql": "15.0.0", + "graphql-tag": "2.10.3", + "jest": "25.2.3", "jest-zone-patch": "0.0.10", - "ng-packagr": "5.7.1", + "ng-packagr": "9.1.0", "rxjs": "6.5.4", - "ts-jest": "25.0.0", - "typescript": "3.5.3", - "zone.js": "0.10.2" + "ts-jest": "25.2.1", + "typescript": "3.8.3", + "zone.js": "0.10.3" } } diff --git a/packages/apollo-angular-link-http-common/tsconfig.json b/packages/apollo-angular-link-http-common/tsconfig.json index e81ffad68..81f9cfea0 100644 --- a/packages/apollo-angular-link-http-common/tsconfig.json +++ b/packages/apollo-angular-link-http-common/tsconfig.json @@ -3,5 +3,8 @@ "compilerOptions": { "rootDir": ".", "outDir": "build" + }, + "angularCompilerOptions": { + "enableIvy": false } } diff --git a/packages/apollo-angular-link-http-common/tsconfig.test.json b/packages/apollo-angular-link-http-common/tsconfig.test.json index 2c7b28416..42521b936 100644 --- a/packages/apollo-angular-link-http-common/tsconfig.test.json +++ b/packages/apollo-angular-link-http-common/tsconfig.test.json @@ -1,6 +1,7 @@ { "extends": "./tsconfig.json", "compilerOptions": { - "module": "commonjs" + "module": "commonjs", + "emitDecoratorMetadata": true } } diff --git a/packages/apollo-angular-link-http/package.json b/packages/apollo-angular-link-http/package.json index f436b6e9c..c6f7f9e09 100644 --- a/packages/apollo-angular-link-http/package.json +++ b/packages/apollo-angular-link-http/package.json @@ -7,7 +7,7 @@ "main": "build/bundles/ngApolloLinkHttp.umd.js", "module": "build/fesm5/ngApolloLinkHttp.js", "typings": "build/ngApolloLinkHttp.d.ts", - "version": "1.9.0", + "version": "1.10.0-alpha.0", "repository": "https://github.com/apollographql/apollo-angular/tree/master/packages/apollo-angular-link-http", "keywords": [ "apollo", @@ -18,41 +18,42 @@ "build": "ng-packagr -p ng-package.js", "test": "yarn test-only", "test-only": "jest --config jest.config.js", - "deploy": "yarn build && npm publish build" + "deploy": "yarn build && npm publish build", + "deploy:next": "yarn build && npm publish build --tag next" }, "peerDependencies": { - "@angular/core": "^6.0.0 || ^7.0.0 || ^8.0.0", - "@angular/common": "^6.0.0 || ^7.0.0 || ^8.0.0", + "@angular/core": "^6.0.0 || ^7.0.0 || ^8.0.0 || ^9.0.0", + "@angular/common": "^6.0.0 || ^7.0.0 || ^8.0.0 || ^9.0.0", "apollo-link": "^1.0.0", - "graphql": ">=0.11.0 <0.14.0 || ^14.0.0" + "graphql": ">=0.11.0 <0.14.0 || ^14.0.0 || ^15.0.0" }, "dependencies": { - "apollo-angular-link-http-common": "~1.8.0", - "extract-files": "6.0.0" + "apollo-angular-link-http-common": "~1.9.0-alpha.0", + "extract-files": "6.0.0", + "tslib": "^1.11.0" }, "devDependencies": { - "@angular/animations": "8.2.14", - "@angular/common": "8.2.14", - "@angular/compiler": "8.2.14", - "@angular/compiler-cli": "8.2.14", - "@angular/core": "8.2.14", - "@angular/platform-browser": "8.2.14", - "@angular/platform-browser-dynamic": "8.2.14", - "@angular/platform-server": "8.2.14", - "@types/graphql": "14.5.0", - "@types/jest": "24.9.1", - "apollo-angular": "1.7.0", + "@angular/animations": "9.1.0", + "@angular/common": "9.1.0", + "@angular/compiler": "9.1.0", + "@angular/compiler-cli": "9.1.0", + "@angular/core": "9.1.0", + "@angular/platform-browser": "9.1.0", + "@angular/platform-browser-dynamic": "9.1.0", + "@angular/platform-server": "9.1.0", + "@types/jest": "25.1.4", + "apollo-angular": "1.9.0-alpha.0", "apollo-cache-inmemory": "1.6.5", "apollo-client": "2.6.8", - "apollo-link": "1.2.13", - "graphql": "14.5.8", - "graphql-tag": "2.10.1", - "jest": "24.9.0", + "apollo-link": "1.2.14", + "graphql": "15.0.0", + "graphql-tag": "2.10.3", + "jest": "25.2.3", "jest-zone-patch": "0.0.10", - "ng-packagr": "5.7.1", + "ng-packagr": "9.1.0", "rxjs": "6.5.4", - "ts-jest": "25.0.0", - "typescript": "3.5.3", - "zone.js": "0.10.2" + "ts-jest": "25.2.1", + "typescript": "3.8.3", + "zone.js": "0.10.3" } } diff --git a/packages/apollo-angular-link-http/tsconfig.json b/packages/apollo-angular-link-http/tsconfig.json index e81ffad68..81f9cfea0 100644 --- a/packages/apollo-angular-link-http/tsconfig.json +++ b/packages/apollo-angular-link-http/tsconfig.json @@ -3,5 +3,8 @@ "compilerOptions": { "rootDir": ".", "outDir": "build" + }, + "angularCompilerOptions": { + "enableIvy": false } } diff --git a/packages/apollo-angular-link-http/tsconfig.test.json b/packages/apollo-angular-link-http/tsconfig.test.json index 2c7b28416..42521b936 100644 --- a/packages/apollo-angular-link-http/tsconfig.test.json +++ b/packages/apollo-angular-link-http/tsconfig.test.json @@ -1,6 +1,7 @@ { "extends": "./tsconfig.json", "compilerOptions": { - "module": "commonjs" + "module": "commonjs", + "emitDecoratorMetadata": true } } diff --git a/packages/apollo-angular-link-persisted/package.json b/packages/apollo-angular-link-persisted/package.json index 472b5ff02..01b65d188 100644 --- a/packages/apollo-angular-link-persisted/package.json +++ b/packages/apollo-angular-link-persisted/package.json @@ -7,7 +7,7 @@ "main": "build/bundles/ngApolloLinkPersisted.umd.js", "module": "build/fesm5/ngApolloLinkPersisted.js", "typings": "build/ngApolloLinkPersisted.d.ts", - "version": "1.1.0", + "version": "1.2.0-alpha.0", "repository": "https://github.com/apollographql/apollo-angular/tree/master/packages/apollo-angular-link-persisted", "keywords": [ "apollo", @@ -18,24 +18,25 @@ "build": "ng-packagr -p ng-package.js", "test": "yarn test-only", "test-only": "jest --config jest.config.js", - "deploy": "yarn build && npm publish build" + "deploy": "yarn build && npm publish build", + "deploy:next": "yarn build && npm publish build --tag next" }, "peerDependencies": { "apollo-link": "^1.0.0" }, "dependencies": { "apollo-link-context": "^1.0.7", - "apollo-link-persisted-queries": "~0.2.0" + "apollo-link-persisted-queries": "~0.2.0", + "tslib": "^1.11.0" }, "devDependencies": { - "@types/graphql": "14.5.0", - "@types/jest": "24.9.1", - "apollo-link": "1.2.13", - "graphql": "14.5.8", - "graphql-tag": "2.10.1", - "jest": "24.9.0", - "ng-packagr": "5.7.1", - "ts-jest": "25.0.0", - "typescript": "3.5.3" + "@types/jest": "25.1.4", + "apollo-link": "1.2.14", + "graphql": "15.0.0", + "graphql-tag": "2.10.3", + "jest": "25.2.3", + "ng-packagr": "9.1.0", + "ts-jest": "25.2.1", + "typescript": "3.8.3" } } diff --git a/packages/apollo-angular-link-persisted/tsconfig.json b/packages/apollo-angular-link-persisted/tsconfig.json index e81ffad68..81f9cfea0 100644 --- a/packages/apollo-angular-link-persisted/tsconfig.json +++ b/packages/apollo-angular-link-persisted/tsconfig.json @@ -3,5 +3,8 @@ "compilerOptions": { "rootDir": ".", "outDir": "build" + }, + "angularCompilerOptions": { + "enableIvy": false } } diff --git a/packages/apollo-angular-link-persisted/tsconfig.test.json b/packages/apollo-angular-link-persisted/tsconfig.test.json index 2c7b28416..42521b936 100644 --- a/packages/apollo-angular-link-persisted/tsconfig.test.json +++ b/packages/apollo-angular-link-persisted/tsconfig.test.json @@ -1,6 +1,7 @@ { "extends": "./tsconfig.json", "compilerOptions": { - "module": "commonjs" + "module": "commonjs", + "emitDecoratorMetadata": true } } diff --git a/packages/apollo-angular/package.json b/packages/apollo-angular/package.json index a36d8d06a..81023065d 100644 --- a/packages/apollo-angular/package.json +++ b/packages/apollo-angular/package.json @@ -1,7 +1,7 @@ { "name": "apollo-angular", "description": "Use your GraphQL data in your Angular app, with the Apollo Client", - "version": "1.8.0", + "version": "1.9.0-alpha.0", "author": "Kamil Kisiela (http://github.com/kamilkisiela/)", "license": "MIT", "sideEffects": false, @@ -26,45 +26,46 @@ "test:testing": "jest --config testing/jest.config.js", "test:schematics": "jest --config schematics/jest.config.js", "prebuild": "rm -rf build/", - "deploy": "yarn build && npm publish build" + "deploy": "yarn build && npm publish build", + "deploy:next": "yarn build && npm publish build --tag next" }, "peerDependencies": { - "@angular/core": "^6.1.0 || ^7.0.0 || ^8.0.0", + "@angular/core": "^6.1.0 || ^7.0.0 || ^8.0.0 || ^9.0.0", "apollo-client": "^2.3.4", "apollo-link": "^1.0.0", "rxjs": "^6.0.0", "zone.js": "~0.8.20 || ~0.9.0 || ~0.10.0" }, "dependencies": { - "semver": "^7.0.0" + "semver": "^7.0.0", + "tslib": "^1.11.0" }, "devDependencies": { - "@angular-devkit/core": "8.3.23", - "@angular-devkit/schematics": "8.3.23", - "@angular/common": "8.2.14", - "@angular/compiler": "8.2.14", - "@angular/compiler-cli": "8.2.14", - "@angular/core": "8.2.14", - "@angular/platform-browser": "8.2.14", - "@angular/platform-browser-dynamic": "8.2.14", - "@schematics/angular": "8.3.23", - "@types/graphql": "14.5.0", - "@types/jest": "24.9.1", + "@angular-devkit/core": "9.1.0", + "@angular-devkit/schematics": "9.1.0", + "@angular/common": "9.1.0", + "@angular/compiler": "9.1.0", + "@angular/compiler-cli": "9.1.0", + "@angular/core": "9.1.0", + "@angular/platform-browser": "9.1.0", + "@angular/platform-browser-dynamic": "9.1.0", + "@schematics/angular": "9.1.0", + "@types/jest": "25.1.4", "@types/node": "13.1.6", - "@types/semver": "6.2.0", + "@types/semver": "7.1.0", "apollo-cache-inmemory": "1.6.5", "apollo-client": "2.6.8", - "apollo-link": "1.2.13", + "apollo-link": "1.2.14", "cpx": "1.5.0", - "graphql": "14.5.8", - "graphql-tag": "2.10.1", - "jest": "24.9.0", + "graphql": "15.0.0", + "graphql-tag": "2.10.3", + "jest": "25.2.3", "jest-zone-patch": "0.0.10", - "ng-packagr": "5.7.1", + "ng-packagr": "9.1.0", "rxjs": "6.5.4", - "ts-jest": "25.0.0", - "typescript": "3.5.3", - "zone.js": "0.10.2" + "ts-jest": "25.2.1", + "typescript": "3.8.3", + "zone.js": "0.10.3" }, "schematics": "./schematics/collection.json" } diff --git a/packages/apollo-angular/schematics/install/index.ts b/packages/apollo-angular/schematics/install/index.ts index 886ed60ed..03110a6d1 100644 --- a/packages/apollo-angular/schematics/install/index.ts +++ b/packages/apollo-angular/schematics/install/index.ts @@ -33,13 +33,13 @@ export default function install(options: Schema): Rule { } export const dependenciesMap: Record = { - 'apollo-angular': '^1.8.0', - 'apollo-angular-link-http': '^1.9.0', + 'apollo-angular': '^1.9.0-alpha.0', + 'apollo-angular-link-http': '^1.10.0-alpha.0', 'apollo-link': '^1.2.11', 'apollo-client': '^2.6.0', 'apollo-cache-inmemory': '^1.6.0', 'graphql-tag': '^2.10.0', - graphql: '^14.5.0', + graphql: '^14.6.0', }; function assertTypescriptVersion() { diff --git a/packages/apollo-angular/tsconfig.json b/packages/apollo-angular/tsconfig.json index c0d0cae44..7dd85df1d 100644 --- a/packages/apollo-angular/tsconfig.json +++ b/packages/apollo-angular/tsconfig.json @@ -5,6 +5,9 @@ "baseUrl": ".", "outDir": "build" }, + "angularCompilerOptions": { + "enableIvy": false + }, "include": [ "src/**/*.ts", "tests/**/*.ts" diff --git a/packages/apollo-angular/tsconfig.test.json b/packages/apollo-angular/tsconfig.test.json index 2c7b28416..42521b936 100644 --- a/packages/apollo-angular/tsconfig.test.json +++ b/packages/apollo-angular/tsconfig.test.json @@ -1,6 +1,7 @@ { "extends": "./tsconfig.json", "compilerOptions": { - "module": "commonjs" + "module": "commonjs", + "emitDecoratorMetadata": true } } diff --git a/scripts/bump.js b/scripts/bump.js new file mode 100755 index 000000000..80baed545 --- /dev/null +++ b/scripts/bump.js @@ -0,0 +1,52 @@ +#!/usr/bin/env node + +/// @ts-check +const fs = require('fs'); +const globby = require('globby'); +const {resolve} = require('path'); +const {execSync} = require('child_process'); + +async function main() { + const rootPkg = readJSON(resolve(__dirname, '../package.json')); + const packageDirs = await globby(rootPkg.workspaces, { + cwd: process.cwd(), + onlyDirectories: true, + }); + + packageDirs.forEach(bumpAlha); +} + +/** + * @param {string} packageDir + */ +function bumpAlha(packageDir) { + const filepath = resolve(packageDir, 'package.json'); + const pkg = readJSON(filepath); + + const name = pkg.name; + const version = pkg.version.replace(/-alpha\.(\d+)/, (_, ver) => { + return `-alpha.${parseInt(ver, 10) + 1}`; + }); + + execSync(`./scripts/version.js ${name} ${version}`, { + stdio: 'inherit', + }); +} + +/** + * @param {string} filepath + */ +function readFile(filepath) { + return fs.readFileSync(resolve(__dirname, filepath), { + encoding: 'utf-8', + }); +} + +/** + * @param {string} filepath + */ +function readJSON(filepath) { + return JSON.parse(readFile(filepath)); +} + +main(); diff --git a/scripts/version.js b/scripts/version.js new file mode 100755 index 000000000..3d2d7ef09 --- /dev/null +++ b/scripts/version.js @@ -0,0 +1,93 @@ +#!/usr/bin/env node + +/// @ts-check + +const [, , packageName, packageVersion] = process.argv; +const fs = require('fs'); +const globby = require('globby'); +const {resolve} = require('path'); + +async function main() { + const rootPkg = readJSON(resolve(__dirname, '../package.json')); + const packageDirs = await globby(rootPkg.workspaces, { + cwd: process.cwd(), + onlyDirectories: true, + }); + + packageDirs.forEach(updatePkg); + + const schematics = resolve( + process.cwd(), + 'packages/apollo-angular/schematics/install/index.ts', + ); + + const js = readFile(schematics); + const R = new RegExp(`'${packageName}': '\\^((\\d+\\.\\d+\\.\\d+\\-[a-z]+\\.\\d+)|(\\d+\\.\\d+\\.\\d+))'`, 'g'); + + writeFile( + schematics, + js.replace(R, (all, ver) => all.replace(ver, packageVersion)), + ); +} + +/** + * @param {string} packageDir + */ +function updatePkg(packageDir) { + const filepath = resolve(packageDir, 'package.json'); + const pkg = readJSON(filepath); + + if (pkg.name === packageName) { + pkg.version = packageVersion; + } + + if (pkg.peerDependencies && pkg.peerDependencies[packageName]) { + pkg.peerDependencies[packageName] = `^${packageVersion}`; + } + + if (pkg.dependencies && pkg.dependencies[packageName]) { + pkg.dependencies[packageName] = `~${packageVersion}`; + } + + if (pkg.devDependencies && pkg.devDependencies[packageName]) { + pkg.devDependencies[packageName] = packageVersion; + } + + writeJSON(filepath, pkg); +} + +/** + * @param {string} filepath + */ +function readFile(filepath) { + return fs.readFileSync(resolve(__dirname, filepath), { + encoding: 'utf-8', + }); +} + +/** + * @param {string} filepath + * @param {string} content + */ +function writeFile(filepath, content) { + return fs.writeFileSync(resolve(__dirname, filepath), content, { + encoding: 'utf-8', + }); +} + +/** + * @param {string} filepath + */ +function readJSON(filepath) { + return JSON.parse(readFile(filepath)); +} + +/** + * @param {string} filepath + * @param {object} data + */ +function writeJSON(filepath, data) { + return writeFile(filepath, JSON.stringify(data, null, 2)); +} + +main(); diff --git a/tsconfig.json b/tsconfig.json index b15169fa5..bb1ef9047 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -2,17 +2,26 @@ "compileOnSave": false, "compilerOptions": { "target": "es5", - "module": "es2015", + "module": "esnext", "moduleResolution": "node", + "importHelpers": true, + "inlineSources": true, "sourceMap": true, "declaration": true, "outDir": "build", "lib": ["es6", "dom", "esnext.asynciterable"], "types": ["jest"], - "emitDecoratorMetadata": true, + "downlevelIteration": true, "experimentalDecorators": true, "noImplicitAny": true, "noUnusedLocals": true, "noUnusedParameters": true + }, + "angularCompilerOptions": { + "enableResourceInlining": true, + "fullTemplateTypeCheck": true, + "skipTemplateCodegen": true, + "strictInjectionParameters": true, + "strictMetadataEmit": true } }