Skip to content

Commit

Permalink
Upgrade bob + tests typescript fixes (#4812) (#4821)
Browse files Browse the repository at this point in the history
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: Arda TANRIKULU <[email protected]>
Co-authored-by: Gil Gardosh <[email protected]>
Co-authored-by: enisdenjo <[email protected]>
  • Loading branch information
4 people authored Dec 6, 2022
1 parent 7bc59ef commit 1a28c92
Show file tree
Hide file tree
Showing 235 changed files with 2,161 additions and 1,658 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>
14 changes: 7 additions & 7 deletions examples/graphql-file-upload-example/frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,24 @@
"name": "frontend",
"version": "0.1.0",
"private": true,
"scripts": {
"build": "react-scripts build",
"eject": "react-scripts eject",
"start": "react-scripts start",
"test": "react-scripts test"
},
"dependencies": {
"@apollo/client": "3.7.1",
"@testing-library/jest-dom": "5.16.5",
"@testing-library/react": "13.4.0",
"@testing-library/user-event": "14.4.3",
"@apollo/client": "3.7.1",
"apollo-upload-client": "17.0.0",
"graphql": "16.6.0",
"react": "18.2.0",
"react-dom": "18.2.0",
"react-scripts": "5.0.1",
"web-vitals": "3.1.0"
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject"
},
"browserslist": {
"production": [
">0.2%",
Expand Down
1 change: 1 addition & 0 deletions examples/json-schema-example/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
"@graphql-mesh/cli": "0.80.4",
"@graphql-mesh/json-schema": "0.35.38",
"@graphql-mesh/plugin-mock": "0.0.40",
"@graphql-mesh/transform-naming-convention": "0.12.4",
"graphql": "16.6.0"
},
"devDependencies": {
Expand Down
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', '.bob'],
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',
};
72 changes: 36 additions & 36 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,44 +1,59 @@
{
"name": "graphql-mesh-monorepo",
"license": "MIT",
"version": "0.2.15",
"license": "MIT",
"private": true,
"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/*"
]
},
"scripts": {
"postinstall": "patch-package && husky install",
"prebuild:website": "yarn build",
"build": "bob build",
"build-test-artifacts": "cd examples/json-schema-example && 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/",
"ci:lint": "eslint --output-file eslint_report.json --ext .ts --format json \"./packages/**/src/**/*.ts\"",
"clean": "rm -rf packages/**/dist packages/**/**/dist examples/**/node_modules/.bin/*mesh* .bob",
"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",
"fix-bin": "node scripts/fix-bin.js",
"postbuild": "yarn copy-config-schema && yarn fix-bin",
"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",
"lint": "eslint --ext .ts \"./packages/**/src/**/*.ts\"",
"ci:lint": "eslint --output-file eslint_report.json --ext .ts --format json \"./packages/**/src/**/*.ts\"",
"postbuild": "yarn copy-config-schema && yarn fix-bin",
"postinstall": "patch-package && husky install",
"prebuild": "yarn clean && yarn generate-config-schema",
"prebuild:website": "yarn build",
"prerelease": "yarn build",
"prettier": "prettier --write --list-different .",
"prettier:check": "prettier --check .",
"build-test-artifacts": "cd examples/json-schema-example && yarn build",
"release": "changeset publish",
"test": "cross-env \"JEST=1\" jest --forceExit --no-watchman",
"test-and-build": "yarn build && yarn test",
"prerelease": "yarn build",
"release": "changeset publish"
"test-and-build": "yarn build && yarn test"
},
"devDependencies": {
"@ardatan/graphql-to-config-schema": "0.1.25",
"@babel/core": "7.20.5",
"@babel/plugin-proposal-class-properties": "7.18.6",
"@babel/preset-env": "7.20.2",
"@babel/preset-typescript": "7.18.6",
"@changesets/cli": "2.25.2",
"@changesets/changelog-github": "0.4.7",
"@changesets/cli": "2.25.2",
"@theguild/prettier-config": "1.0.0",
"@types/jest": "29.2.4",
"@types/node": "18.11.11",
"@typescript-eslint/eslint-plugin": "5.45.1",
"@typescript-eslint/parser": "5.45.1",
"babel-jest": "29.3.1",
"bob-the-bundler": "1.7.3",
"bob-the-bundler": "4.0.0",
"eslint": "8.29.0",
"eslint-config-prettier": "8.5.0",
"eslint-config-standard": "17.0.0",
Expand All @@ -56,6 +71,11 @@
"ts-jest": "29.0.3",
"typescript": "4.9.3"
},
"resolutions": {
"graphql": "16.6.0",
"undici": "5.13.0",
"uuid": "7.0.3"
},
"husky": {
"hooks": {
"pre-commit": "lint-staged"
Expand All @@ -68,25 +88,5 @@
"**/*.{ts,tsx,graphql,yml,json,md,js}": [
"prettier --write"
]
},
"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/*"
]
},
"resolutions": {
"graphql": "16.6.0",
"undici": "5.13.0",
"uuid": "7.0.3"
}
}
46 changes: 27 additions & 19 deletions packages/apollo-link/package.json
Original file line number Diff line number Diff line change
@@ -1,28 +1,37 @@
{
"name": "@graphql-mesh/apollo-link",
"version": "8.0.7",
"license": "MIT",
"type": "module",
"repository": {
"type": "git",
"url": "Urigo/graphql-mesh",
"directory": "packages/apollo-link"
},
"sideEffects": false,
"main": "dist/index.js",
"module": "dist/index.mjs",
"typings": "dist/index.d.ts",
"typescript": {
"definition": "dist/index.d.ts"
},
"license": "MIT",
"main": "dist/cjs/index.js",
"module": "dist/esm/index.js",
"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"
},
"typings": "dist/typings/index.d.ts",
"peerDependencies": {
"@apollo/client": "^3.5.9",
"@graphql-mesh/runtime": "^0.44.32",
"graphql": "^15.2.0 || ^16.0.0"
},
"dependencies": {
"@graphql-tools/utils": "9.1.1",
Expand All @@ -31,13 +40,12 @@
"devDependencies": {
"@apollo/client": "3.7.1"
},
"peerDependencies": {
"@graphql-mesh/runtime": "^0.44.32",
"graphql": "^15.2.0 || ^16.0.0",
"@apollo/client": "^3.5.9"
},
"publishConfig": {
"access": "public",
"directory": "dist"
},
"sideEffects": false,
"typescript": {
"definition": "dist/typings/index.d.ts"
}
}
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
Loading

0 comments on commit 1a28c92

Please sign in to comment.