Skip to content

Commit

Permalink
Add an additional ES5-compatible bundle (#1909)
Browse files Browse the repository at this point in the history
* Change target to be es2015 in order to make it more compatible

* try to fix

* try to fix es5 target

* Fix

* Bump aggregate-error

* Bump aggregate error

* Bump aggregate error and add missing tslib

* Fix aggregate-error

* Try es2015 again

* Try new bob

* Use latest bob

* Fix bob

Co-authored-by: Arda TANRIKULU <ardatanrikulu@gmail.com>
  • Loading branch information
dotansimha and ardatan committed Sep 4, 2020
1 parent fe85dcb commit 427093b
Show file tree
Hide file tree
Showing 21 changed files with 86 additions and 57 deletions.
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -62,6 +62,7 @@ typings/


dist
dist-es5
build
temp
.idea
Expand Down
12 changes: 11 additions & 1 deletion bob.config.js
@@ -1,3 +1,13 @@
module.exports = {
ignore: ['@graphql-tools/website']
ignore: ['@graphql-tools/website'],
dists: [
{
distDir: 'dist',
distPath: ''
},
{
distDir: 'dist-es5',
distPath: '/es5'
},
]
};
6 changes: 3 additions & 3 deletions package.json
Expand Up @@ -6,7 +6,7 @@
"scripts": {
"predeploy:website": "yarn build:api-docs",
"deploy:website": "cd website && yarn deploy",
"ts:transpile": "tsc --project tsconfig.build.json",
"ts:transpile": "tsc --project tsconfig.build.json && tsc --project tsconfig.build.es5.json",
"build": "yarn ts:transpile && bob build",
"build:api-docs": "node scripts/build-api-docs.js",
"lint": "eslint --ext .ts .",
Expand Down Expand Up @@ -44,7 +44,7 @@
"@types/node": "14.6.4",
"@typescript-eslint/eslint-plugin": "4.0.1",
"@typescript-eslint/parser": "4.0.1",
"bob-the-bundler": "1.1.0",
"@ardatan/bob-the-bundler": "1.2.2",
"eslint": "7.8.1",
"eslint-config-prettier": "6.11.0",
"eslint-config-standard": "14.1.1",
Expand Down Expand Up @@ -85,4 +85,4 @@
"resolutions": {
"graphql": "15.3.0"
}
}
}
2 changes: 1 addition & 1 deletion packages/delegate/package.json
Expand Up @@ -20,7 +20,7 @@
"dependencies": {
"@graphql-tools/schema": "6.2.0",
"@graphql-tools/utils": "6.2.0",
"@ardatan/aggregate-error": "0.0.2",
"@ardatan/aggregate-error": "0.0.6",
"dataloader": "2.0.0",
"is-promise": "4.0.0",
"tslib": "~2.0.1"
Expand Down
5 changes: 3 additions & 2 deletions packages/graphql-tag-pluck/package.json
Expand Up @@ -18,7 +18,8 @@
"@babel/parser": "7.11.5",
"@babel/traverse": "7.11.5",
"@babel/types": "7.11.5",
"@graphql-tools/utils": "6.2.0"
"@graphql-tools/utils": "6.2.0",
"tslib": "~2.0.1"
},
"optionalDependencies": {
"vue-template-compiler": "^2.6.12"
Expand All @@ -31,4 +32,4 @@
"access": "public",
"directory": "dist"
}
}
}
5 changes: 3 additions & 2 deletions packages/graphql-tools/package.json
Expand Up @@ -40,6 +40,7 @@
"@graphql-tools/schema": "6.2.0",
"@graphql-tools/stitch": "6.2.0",
"@graphql-tools/utils": "6.2.0",
"@graphql-tools/wrap": "6.2.0"
"@graphql-tools/wrap": "6.2.0",
"tslib": "~2.0.1"
}
}
}
5 changes: 3 additions & 2 deletions packages/import/package.json
Expand Up @@ -21,6 +21,7 @@
},
"dependencies": {
"fs-extra": "9.0.1",
"resolve-from": "5.0.0"
"resolve-from": "5.0.0",
"tslib": "~2.0.1"
}
}
}
2 changes: 1 addition & 1 deletion packages/links/package.json
Expand Up @@ -35,4 +35,4 @@
"access": "public",
"directory": "dist"
}
}
}
5 changes: 3 additions & 2 deletions packages/load-files/package.json
Expand Up @@ -18,10 +18,11 @@
"dependencies": {
"globby": "11.0.1",
"unixify": "1.0.0",
"fs-extra": "9.0.1"
"fs-extra": "9.0.1",
"tslib": "~2.0.1"
},
"publishConfig": {
"access": "public",
"directory": "dist"
}
}
}
2 changes: 1 addition & 1 deletion packages/load/package.json
Expand Up @@ -36,4 +36,4 @@
"access": "public",
"directory": "dist"
}
}
}
5 changes: 3 additions & 2 deletions packages/loaders/git/package.json
Expand Up @@ -17,10 +17,11 @@
},
"dependencies": {
"@graphql-tools/utils": "6.2.0",
"@graphql-tools/graphql-tag-pluck": "6.2.0"
"@graphql-tools/graphql-tag-pluck": "6.2.0",
"tslib": "~2.0.1"
},
"publishConfig": {
"access": "public",
"directory": "dist"
}
}
}
5 changes: 3 additions & 2 deletions packages/loaders/github/package.json
Expand Up @@ -18,10 +18,11 @@
"dependencies": {
"@graphql-tools/utils": "6.2.0",
"@graphql-tools/graphql-tag-pluck": "6.2.0",
"cross-fetch": "3.0.5"
"cross-fetch": "3.0.5",
"tslib": "~2.0.1"
},
"publishConfig": {
"access": "public",
"directory": "dist"
}
}
}
5 changes: 3 additions & 2 deletions packages/relay-operation-optimizer/package.json
Expand Up @@ -28,7 +28,8 @@
},
"dependencies": {
"@graphql-tools/utils": "6.2.0",
"relay-compiler": "10.0.1"
"relay-compiler": "10.0.1",
"tslib": "~2.0.1"
},
"devDependencies": {
"@types/relay-compiler": "8.0.0"
Expand All @@ -49,4 +50,4 @@
"access": "public",
"directory": "dist"
}
}
}
5 changes: 3 additions & 2 deletions packages/resolvers-composition/package.json
Expand Up @@ -20,10 +20,11 @@
},
"dependencies": {
"@graphql-tools/utils": "6.2.0",
"lodash": "4.17.20"
"lodash": "4.17.20",
"tslib": "~2.0.1"
},
"publishConfig": {
"access": "public",
"directory": "dist"
}
}
}
5 changes: 3 additions & 2 deletions packages/utils/package.json
Expand Up @@ -21,8 +21,9 @@
"graphql-scalars": "1.2.6"
},
"dependencies": {
"@ardatan/aggregate-error": "0.0.2",
"camel-case": "4.1.1"
"@ardatan/aggregate-error": "0.0.6",
"camel-case": "4.1.1",
"tslib": "~2.0.1"
},
"publishConfig": {
"access": "public",
Expand Down
4 changes: 2 additions & 2 deletions packages/utils/tests/validate-documents.spec.ts
Expand Up @@ -55,7 +55,7 @@ describe('validateGraphQlDocuments', () => {
checkValidationErrors(result);
expect(true).toBeFalsy();
} catch (errors) {
expect(errors).toBeInstanceOf(AggregateError);
expect(Symbol.iterator in errors).toBeTruthy();
const generator = errors[Symbol.iterator]();

const error = generator.next().value;
Expand Down Expand Up @@ -117,7 +117,7 @@ describe('checkValidationErrors', () => {
errors = _errors;
}

expect(errors).toBeInstanceOf(AggregateError);
expect(Symbol.iterator in errors).toBeTruthy();

let error;
const generator = errors[Symbol.iterator]();
Expand Down
3 changes: 1 addition & 2 deletions packages/wrap/package.json
Expand Up @@ -21,12 +21,11 @@
"@graphql-tools/delegate": "6.2.0",
"@graphql-tools/schema": "6.2.0",
"@graphql-tools/utils": "6.2.0",
"aggregate-error": "3.1.0",
"is-promise": "4.0.0",
"tslib": "~2.0.1"
},
"publishConfig": {
"access": "public",
"directory": "dist"
}
}
}
7 changes: 7 additions & 0 deletions tsconfig.build.es5.json
@@ -0,0 +1,7 @@
{
"extends": "./tsconfig.build.json",
"compilerOptions": {
"outDir": "dist-es5",
"target": "es5"
}
}
1 change: 1 addition & 0 deletions tsconfig.json
Expand Up @@ -15,6 +15,7 @@
"resolveJsonModule": true,
"sourceMap": true,
"declaration": true,
"downlevelIteration": true,

"suppressImplicitAnyIndexErrors": true,
"noImplicitAny": true,
Expand Down
2 changes: 1 addition & 1 deletion website/package.json
Expand Up @@ -27,4 +27,4 @@
"last 1 safari version"
]
}
}
}
56 changes: 29 additions & 27 deletions yarn.lock
Expand Up @@ -157,10 +157,34 @@
dependencies:
xss "^1.0.6"

"@ardatan/aggregate-error@0.0.2":
version "0.0.2"
resolved "https://registry.yarnpkg.com/@ardatan/aggregate-error/-/aggregate-error-0.0.2.tgz#0aaa959f44ed98803d9f3ff6b3519edb9d3e50d4"
integrity sha512-jMnka+0hYQr/qNfPb7gqdO0Au2qr2xUBfjA4Uxmnkb9dW7JtMjKhFpdx1wSik3WQSSmifXQinSSrqudqMAJ4XQ==
"@ardatan/aggregate-error@0.0.6":
version "0.0.6"
resolved "https://registry.yarnpkg.com/@ardatan/aggregate-error/-/aggregate-error-0.0.6.tgz#fe6924771ea40fc98dc7a7045c2e872dc8527609"
integrity sha512-vyrkEHG1jrukmzTPtyWB4NLPauUw5bQeg4uhn8f+1SSynmrOcyvlb1GKQjjgoBzElLdfXCRYX8UnBlhklOHYRQ==
dependencies:
tslib "~2.0.1"

"@ardatan/bob-the-bundler@1.2.2":
version "1.2.2"
resolved "https://registry.yarnpkg.com/@ardatan/bob-the-bundler/-/bob-the-bundler-1.2.2.tgz#3bd80fa5c473353f9c4739ff2c2d8bcd7af68001"
integrity sha512-DWsg95cpP5gVgzNAKXOpMTQNJ3U+p1dksdzyKB9AAs0cdvc8+w3jql80gC+lEPIGGohX6yAEbaDUVGYXxgKHdQ==
dependencies:
"@rollup/plugin-node-resolve" "7.1.1"
consola "2.11.3"
cosmiconfig "6.0.0"
cross-spawn "7.0.1"
fs-extra "9.0.0"
globby "11.0.0"
lodash.get "4.4.2"
minimatch "3.0.4"
mkdirp "1.0.4"
p-limit "2.2.2"
rollup "2.3.2"
rollup-plugin-auto-external "2.0.0"
rollup-plugin-generate-package-json "3.2.0"
rollup-plugin-typescript2 "0.27.0"
tslib "^1.11.1"
yargs "15.3.1"

"@babel/code-frame@7.8.3":
version "7.8.3"
Expand Down Expand Up @@ -2924,7 +2948,7 @@ agent-base@6:
dependencies:
debug "4"

aggregate-error@3.1.0, aggregate-error@^3.0.0:
aggregate-error@^3.0.0:
version "3.1.0"
resolved "https://registry.yarnpkg.com/aggregate-error/-/aggregate-error-3.1.0.tgz#92670ff50f5359bdb7a3e0d40d0ec30c5737687a"
integrity sha512-4I7Td01quW/RpocfNayFdFVk1qSuoh0E7JrbRJ16nH01HhKFQ88INq9Sd+nd72zqRySlr9BmDA8xlEJ6vJMrYA==
Expand Down Expand Up @@ -3694,28 +3718,6 @@ bn.js@^5.1.1:
resolved "https://registry.yarnpkg.com/bn.js/-/bn.js-5.1.1.tgz#48efc4031a9c4041b9c99c6941d903463ab62eb5"
integrity sha512-IUTD/REb78Z2eodka1QZyyEk66pciRcP6Sroka0aI3tG/iwIdYLrBD62RsubR7vqdt3WyX8p4jxeatzmRSphtA==

bob-the-bundler@1.1.0:
version "1.1.0"
resolved "https://registry.yarnpkg.com/bob-the-bundler/-/bob-the-bundler-1.1.0.tgz#fd7cd427f754bf95826055ee356d64a67406387f"
integrity sha512-qqstwyxR7YX3Im8jY3vTV4FwnpuRS8AQclZwR9kg3SaWqZnzvEfJKO+JOf3Kbr1/48Zu6O1qPeKmEHesAyR3uw==
dependencies:
"@rollup/plugin-node-resolve" "7.1.1"
consola "2.11.3"
cosmiconfig "6.0.0"
cross-spawn "7.0.1"
fs-extra "9.0.0"
globby "11.0.0"
lodash.get "4.4.2"
minimatch "3.0.4"
mkdirp "1.0.4"
p-limit "2.2.2"
rollup "2.3.2"
rollup-plugin-auto-external "2.0.0"
rollup-plugin-generate-package-json "3.2.0"
rollup-plugin-typescript2 "0.27.0"
tslib "^1.11.1"
yargs "15.3.1"

body-parser@1.19.0, body-parser@^1.18.3:
version "1.19.0"
resolved "https://registry.yarnpkg.com/body-parser/-/body-parser-1.19.0.tgz#96b2709e57c9c4e09a6fd66a8fd979844f69f08a"
Expand Down

0 comments on commit 427093b

Please sign in to comment.