Skip to content

Commit

Permalink
Upgrade bob + tests typescript fixes (#4812)
Browse files Browse the repository at this point in the history
* Upgrade bob + tests typescript fixes

* prettier

* More config + bob bootstrap

* update pipeline

* example build fix

* minor fixes

* more fixes

* .

* .

* chore(dependencies): updated changesets for modified dependencies

* Update tests.yml

* .

* .

* .

* .

* .

* .

* Fix

* Fix release

* add -esm to cli

* changeset

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: Arda TANRIKULU <[email protected]>
  • Loading branch information
3 people committed Nov 18, 2022
1 parent 03f277d commit 88e606e
Show file tree
Hide file tree
Showing 226 changed files with 2,100 additions and 1,668 deletions.
7 changes: 7 additions & 0 deletions .changeset/@graphql-mesh_cli-4812-dependencies.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
"@graphql-mesh/cli": patch
---
dependencies updates:
- Updated dependency [`@graphql-codegen/[email protected]` ↗︎](https://www.npmjs.com/package/@graphql-codegen/typescript/v/2.8.2) (from `2.8.1`, in `dependencies`)
- Updated dependency [`@graphql-codegen/[email protected]` ↗︎](https://www.npmjs.com/package/@graphql-codegen/typescript-operations/v/2.5.7) (from `2.5.6`, in `dependencies`)
- Updated dependency [`@graphql-codegen/[email protected]` ↗︎](https://www.npmjs.com/package/@graphql-codegen/typescript-resolvers/v/2.7.7) (from `2.7.6`, in `dependencies`)
70 changes: 70 additions & 0 deletions .changeset/few-hats-brake.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
---
'auth0-example': minor
'javascript-wiki': minor
'@graphql-mesh/apollo-link': minor
'@graphql-mesh/cache-cfw-kv': minor
'@graphql-mesh/cache-file': minor
'@graphql-mesh/cache-localforage': minor
'@graphql-mesh/cache-redis': minor
'@graphql-mesh/cli': minor
'@graphql-mesh/config': minor
'@graphql-mesh/container': minor
'@graphql-mesh/cross-helpers': minor
'@graphql-mesh/graphql': minor
'@graphql-mesh/grpc': minor
'@graphql-mesh/json-schema': minor
'@graphql-mesh/mongoose': minor
'@graphql-mesh/mysql': minor
'@graphql-mesh/neo4j': minor
'@graphql-mesh/odata': minor
'@graphql-mesh/openapi': minor
'@graphql-mesh/postgraphile': minor
'@graphql-mesh/raml': minor
'@graphql-mesh/soap': minor
'@graphql-mesh/thrift': minor
'@graphql-mesh/tuql': minor
'@graphql-mesh/http': minor
'@graphql-mesh/jit-executor': minor
'json-machete': minor
'@omnigraph/json-schema': minor
'@omnigraph/openapi': minor
'@omnigraph/raml': minor
'@omnigraph/soap': minor
'@graphql-mesh/merger-bare': minor
'@graphql-mesh/merger-federation': minor
'@graphql-mesh/merger-stitching': minor
'@graphql-mesh/plugin-deduplicate-request': minor
'@graphql-mesh/plugin-http-cache': minor
'@graphql-mesh/plugin-http-details-extensions': minor
'@graphql-mesh/plugin-live-query': minor
'@graphql-mesh/plugin-mock': minor
'@graphql-mesh/plugin-newrelic': minor
'@graphql-mesh/plugin-operation-field-permissions': minor
'@graphql-mesh/plugin-prometheus': minor
'@graphql-mesh/plugin-rate-limit': minor
'@graphql-mesh/plugin-response-cache': minor
'@graphql-mesh/plugin-snapshot': minor
'@graphql-mesh/plugin-statsd': minor
'@graphql-mesh/runtime': minor
'@graphql-mesh/store': minor
'@graphql-mesh/string-interpolation': minor
'@graphql-mesh/transform-cache': minor
'@graphql-mesh/transform-encapsulate': minor
'@graphql-mesh/transform-extend': minor
'@graphql-mesh/transform-federation': minor
'@graphql-mesh/transform-filter-schema': minor
'@graphql-mesh/transform-hoist-field': minor
'@graphql-mesh/transform-naming-convention': minor
'@graphql-mesh/transform-prefix': minor
'@graphql-mesh/transform-prune': minor
'@graphql-mesh/transform-rate-limit': minor
'@graphql-mesh/transform-rename': minor
'@graphql-mesh/transform-replace-field': minor
'@graphql-mesh/transform-resolvers-composition': minor
'@graphql-mesh/transform-type-merging': minor
'@graphql-mesh/types': minor
'@graphql-mesh/urql-exchange': minor
'@graphql-mesh/utils': minor
---

Update build flow to fully support both CommonJS and ESM
6 changes: 0 additions & 6 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,6 @@ jobs:
secrets:
githubToken: ${{ secrets.GITHUB_TOKEN }}

typecheck:
uses: the-guild-org/shared-config/.github/workflows/ci.yml@main
with:
script: yarn transpile-ts --noEmit
name: ts

test:
name: ${{matrix.os}} / node ${{matrix.node-version}}
timeout-minutes: 60
Expand Down
4 changes: 2 additions & 2 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
"test-lib": true,
"lib": true,
"coverage": true,
"npm": true,
".bob": true
"npm": true
// ".bob": true
},
"typescript.tsdk": "node_modules/typescript/lib"
}
3 changes: 0 additions & 3 deletions bob.config.js

This file was deleted.

10 changes: 5 additions & 5 deletions examples/auth0/public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@
createAuth0Client({
domain: '{account_name}.{region}.auth0.com',
client_id: '<client_id>',
audience: 'http://localhost:3000/graphql'
audience: 'http://localhost:3000/graphql',
}).then(async auth0 => {
await auth0.loginWithPopup()
const accessToken = await auth0.getTokenSilently()
window.document.body.innerText = accessToken
})
await auth0.loginWithPopup();
const accessToken = await auth0.getTokenSilently();
window.document.body.innerText = accessToken;
});
</script>
</body>
</html>
1 change: 0 additions & 1 deletion examples/openapi-javascript-wiki/.meshrc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,3 @@ additionalResolvers:

documents:
- example-queries/*.graphql

3 changes: 2 additions & 1 deletion jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ module.exports = {
rootDir: ROOT_DIR,
restoreMocks: true,
reporters: ['default'],
modulePathIgnorePatterns: ['dist'],
modulePathIgnorePatterns: ['dist', 'fixtures', '.bob'],
moduleNameMapper: {
'@graphql-mesh/cross-helpers': '<rootDir>/packages/cross-helpers/node.js',
...pathsToModuleNameMapper(tsconfig.compilerOptions.paths, {
Expand All @@ -32,4 +32,5 @@ module.exports = {
'^.+\\.js$': 'babel-jest',
},
transformIgnorePatterns: [`node_modules/(?!(${ESM_PACKAGES.join('|')})/)`],
resolver: 'bob-the-bundler/jest-resolver.js',
};
34 changes: 17 additions & 17 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@
"version": "0.2.15",
"private": true,
"scripts": {
"clean": "rm -rf packages/**/dist packages/**/**/dist examples/**/node_modules/.bin/*mesh* .bob",
"postinstall": "patch-package && husky install",
"prebuild:website": "yarn build",
"build:website": "cd website && yarn build",
"generate-config-schema": "graphql-to-config-schema --schema ./**/yaml-config.graphql --json ./packages/types/src/config-schema.json --typings ./packages/types/src/config.ts --markdown ./website/src/generated-markdown && prettier --write ./packages/types/src",
"prebuild": "yarn generate-config-schema",
"transpile-ts": "tsc --project tsconfig.build.json",
"build": "yarn transpile-ts && bob build",
"copy-config-schema": "cp ./packages/types/src/config-schema.json ./packages/types/dist/",
"generate-config-schema": "yarn graphql-to-config-schema --schema ./**/yaml-config.graphql --json ./packages/types/src/config-schema.json --typings ./packages/types/src/config.ts --markdown ./website/src/generated-markdown && npx prettier --write ./packages/types/src",
"prebuild": "yarn clean && yarn generate-config-schema",
"build": "bob build",
"fix-bin": "node scripts/fix-bin.js",
"copy-config-schema": "cp ./packages/types/src/config-schema.json ./packages/types/dist/esm && cp ./packages/types/src/config-schema.json ./packages/types/dist/cjs",
"postbuild": "yarn copy-config-schema && yarn fix-bin",
"lint": "eslint --ext .ts \"./packages/**/src/**/*.ts\"",
"ci:lint": "eslint --output-file eslint_report.json --ext .ts --format json \"./packages/**/src/**/*.ts\"",
Expand All @@ -38,7 +38,7 @@
"@typescript-eslint/eslint-plugin": "5.43.0",
"@typescript-eslint/parser": "5.43.0",
"babel-jest": "29.3.1",
"bob-the-bundler": "1.7.3",
"bob-the-bundler": "4.0.0",
"eslint": "8.27.0",
"eslint-config-prettier": "8.5.0",
"eslint-config-standard": "17.0.0",
Expand Down Expand Up @@ -71,17 +71,17 @@
},
"workspaces": {
"packages": [
"./website",
"./packages/*",
"./packages/cache/*",
"./packages/handlers/*",
"./packages/transforms/*",
"./packages/mergers/*",
"./packages/plugins/*",
"./examples/*",
"./examples/federation-example/*",
"./examples/graphql-file-upload-example/frontend",
"./packages/loaders/*"
"website",
"packages/*",
"packages/cache/*",
"packages/handlers/*",
"packages/transforms/*",
"packages/mergers/*",
"packages/plugins/*",
"examples/*",
"examples/federation-example/*",
"examples/graphql-file-upload-example/frontend",
"packages/loaders/*"
]
},
"resolutions": {
Expand Down
34 changes: 21 additions & 13 deletions packages/apollo-link/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,21 +8,28 @@
"directory": "packages/apollo-link"
},
"sideEffects": false,
"main": "dist/index.js",
"module": "dist/index.mjs",
"typings": "dist/index.d.ts",
"main": "dist/cjs/index.js",
"module": "dist/esm/index.js",
"typings": "dist/typings/index.d.ts",
"typescript": {
"definition": "dist/index.d.ts"
"definition": "dist/typings/index.d.ts"
},
"exports": {
".": {
"require": "./dist/index.js",
"import": "./dist/index.mjs"
"require": {
"types": "./dist/typings/index.d.cts",
"default": "./dist/cjs/index.js"
},
"import": {
"types": "./dist/typings/index.d.ts",
"default": "./dist/esm/index.js"
},
"default": {
"types": "./dist/typings/index.d.ts",
"default": "./dist/esm/index.js"
}
},
"./*": {
"require": "./dist/*.js",
"import": "./dist/*.mjs"
}
"./package.json": "./package.json"
},
"dependencies": {
"@graphql-tools/utils": "9.1.1",
Expand All @@ -37,7 +44,8 @@
"@apollo/client": "^3.5.9"
},
"publishConfig": {
"access": "public",
"directory": "dist"
}
"directory": "dist",
"access": "public"
},
"type": "module"
}
4 changes: 2 additions & 2 deletions packages/apollo-link/test/apollo-link.test.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { ApolloClient, FetchResult, InMemoryCache } from '@apollo/client/core';
import { MeshInstance } from '@graphql-mesh/runtime';
import { MeshApolloLink } from '../src';
import { getTestMesh } from '../../testing/getTestMesh';
import { MeshApolloLink } from '../src/index.js';
import { getTestMesh } from '../../testing/getTestMesh.js';
import { parse } from 'graphql';
import { observableToAsyncIterable } from '@graphql-tools/utils';

Expand Down
34 changes: 21 additions & 13 deletions packages/cache/cfw-kv/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,21 +11,28 @@
"graphql": "*"
},
"sideEffects": false,
"main": "dist/index.js",
"module": "dist/index.mjs",
"typings": "dist/index.d.ts",
"main": "dist/cjs/index.js",
"module": "dist/esm/index.js",
"typings": "dist/typings/index.d.ts",
"typescript": {
"definition": "dist/index.d.ts"
"definition": "dist/typings/index.d.ts"
},
"exports": {
".": {
"require": "./dist/index.js",
"import": "./dist/index.mjs"
"require": {
"types": "./dist/typings/index.d.cts",
"default": "./dist/cjs/index.js"
},
"import": {
"types": "./dist/typings/index.d.ts",
"default": "./dist/esm/index.js"
},
"default": {
"types": "./dist/typings/index.d.ts",
"default": "./dist/esm/index.js"
}
},
"./*": {
"require": "./dist/*.js",
"import": "./dist/*.mjs"
}
"./package.json": "./package.json"
},
"dependencies": {
"@graphql-mesh/types": "0.86.0",
Expand All @@ -36,7 +43,8 @@
"@cloudflare/workers-types": "3.18.0"
},
"publishConfig": {
"access": "public",
"directory": "dist"
}
"directory": "dist",
"access": "public"
},
"type": "module"
}
34 changes: 21 additions & 13 deletions packages/cache/file/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,21 +11,28 @@
"graphql": "*"
},
"sideEffects": false,
"main": "dist/index.js",
"module": "dist/index.mjs",
"typings": "dist/index.d.ts",
"main": "dist/cjs/index.js",
"module": "dist/esm/index.js",
"typings": "dist/typings/index.d.ts",
"typescript": {
"definition": "dist/index.d.ts"
"definition": "dist/typings/index.d.ts"
},
"exports": {
".": {
"require": "./dist/index.js",
"import": "./dist/index.mjs"
"require": {
"types": "./dist/typings/index.d.cts",
"default": "./dist/cjs/index.js"
},
"import": {
"types": "./dist/typings/index.d.ts",
"default": "./dist/esm/index.js"
},
"default": {
"types": "./dist/typings/index.d.ts",
"default": "./dist/esm/index.js"
}
},
"./*": {
"require": "./dist/*.js",
"import": "./dist/*.mjs"
}
"./package.json": "./package.json"
},
"dependencies": {
"@graphql-mesh/types": "0.86.0",
Expand All @@ -35,7 +42,8 @@
"tslib": "^2.4.0"
},
"publishConfig": {
"access": "public",
"directory": "dist"
}
"directory": "dist",
"access": "public"
},
"type": "module"
}
Loading

0 comments on commit 88e606e

Please sign in to comment.