Skip to content

Commit 1a28c92

Browse files
ardatangithub-actions[bot]gilgardoshenisdenjo
authored
Upgrade bob + tests typescript fixes (ardatan#4812) (ardatan#4821)
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]>
1 parent 7bc59ef commit 1a28c92

File tree

235 files changed

+2161
-1658
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

235 files changed

+2161
-1658
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
"@graphql-mesh/cli": patch
3+
---
4+
dependencies updates:
5+
- Updated dependency [`@graphql-codegen/[email protected]` ↗︎](https://www.npmjs.com/package/@graphql-codegen/typescript/v/2.8.2) (from `2.8.1`, in `dependencies`)
6+
- 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`)
7+
- 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`)

.changeset/few-hats-brake.md

+70
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
---
2+
'auth0-example': minor
3+
'javascript-wiki': minor
4+
'@graphql-mesh/apollo-link': minor
5+
'@graphql-mesh/cache-cfw-kv': minor
6+
'@graphql-mesh/cache-file': minor
7+
'@graphql-mesh/cache-localforage': minor
8+
'@graphql-mesh/cache-redis': minor
9+
'@graphql-mesh/cli': minor
10+
'@graphql-mesh/config': minor
11+
'@graphql-mesh/container': minor
12+
'@graphql-mesh/cross-helpers': minor
13+
'@graphql-mesh/graphql': minor
14+
'@graphql-mesh/grpc': minor
15+
'@graphql-mesh/json-schema': minor
16+
'@graphql-mesh/mongoose': minor
17+
'@graphql-mesh/mysql': minor
18+
'@graphql-mesh/neo4j': minor
19+
'@graphql-mesh/odata': minor
20+
'@graphql-mesh/openapi': minor
21+
'@graphql-mesh/postgraphile': minor
22+
'@graphql-mesh/raml': minor
23+
'@graphql-mesh/soap': minor
24+
'@graphql-mesh/thrift': minor
25+
'@graphql-mesh/tuql': minor
26+
'@graphql-mesh/http': minor
27+
'@graphql-mesh/jit-executor': minor
28+
'json-machete': minor
29+
'@omnigraph/json-schema': minor
30+
'@omnigraph/openapi': minor
31+
'@omnigraph/raml': minor
32+
'@omnigraph/soap': minor
33+
'@graphql-mesh/merger-bare': minor
34+
'@graphql-mesh/merger-federation': minor
35+
'@graphql-mesh/merger-stitching': minor
36+
'@graphql-mesh/plugin-deduplicate-request': minor
37+
'@graphql-mesh/plugin-http-cache': minor
38+
'@graphql-mesh/plugin-http-details-extensions': minor
39+
'@graphql-mesh/plugin-live-query': minor
40+
'@graphql-mesh/plugin-mock': minor
41+
'@graphql-mesh/plugin-newrelic': minor
42+
'@graphql-mesh/plugin-operation-field-permissions': minor
43+
'@graphql-mesh/plugin-prometheus': minor
44+
'@graphql-mesh/plugin-rate-limit': minor
45+
'@graphql-mesh/plugin-response-cache': minor
46+
'@graphql-mesh/plugin-snapshot': minor
47+
'@graphql-mesh/plugin-statsd': minor
48+
'@graphql-mesh/runtime': minor
49+
'@graphql-mesh/store': minor
50+
'@graphql-mesh/string-interpolation': minor
51+
'@graphql-mesh/transform-cache': minor
52+
'@graphql-mesh/transform-encapsulate': minor
53+
'@graphql-mesh/transform-extend': minor
54+
'@graphql-mesh/transform-federation': minor
55+
'@graphql-mesh/transform-filter-schema': minor
56+
'@graphql-mesh/transform-hoist-field': minor
57+
'@graphql-mesh/transform-naming-convention': minor
58+
'@graphql-mesh/transform-prefix': minor
59+
'@graphql-mesh/transform-prune': minor
60+
'@graphql-mesh/transform-rate-limit': minor
61+
'@graphql-mesh/transform-rename': minor
62+
'@graphql-mesh/transform-replace-field': minor
63+
'@graphql-mesh/transform-resolvers-composition': minor
64+
'@graphql-mesh/transform-type-merging': minor
65+
'@graphql-mesh/types': minor
66+
'@graphql-mesh/urql-exchange': minor
67+
'@graphql-mesh/utils': minor
68+
---
69+
70+
Update build flow to fully support both CommonJS and ESM

.github/workflows/tests.yml

-6
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,6 @@ jobs:
1515
secrets:
1616
githubToken: ${{ secrets.GITHUB_TOKEN }}
1717

18-
typecheck:
19-
uses: the-guild-org/shared-config/.github/workflows/ci.yml@main
20-
with:
21-
script: yarn transpile-ts --noEmit
22-
name: ts
23-
2418
test:
2519
name: ${{matrix.os}} / node ${{matrix.node-version}}
2620
timeout-minutes: 60

.vscode/settings.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@
2020
"test-lib": true,
2121
"lib": true,
2222
"coverage": true,
23-
"npm": true,
24-
".bob": true
23+
"npm": true
24+
// ".bob": true
2525
},
2626
"typescript.tsdk": "node_modules/typescript/lib"
2727
}

bob.config.js

-3
This file was deleted.

examples/auth0/public/index.html

+5-5
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,12 @@
88
createAuth0Client({
99
domain: '{account_name}.{region}.auth0.com',
1010
client_id: '<client_id>',
11-
audience: 'http://localhost:3000/graphql'
11+
audience: 'http://localhost:3000/graphql',
1212
}).then(async auth0 => {
13-
await auth0.loginWithPopup()
14-
const accessToken = await auth0.getTokenSilently()
15-
window.document.body.innerText = accessToken
16-
})
13+
await auth0.loginWithPopup();
14+
const accessToken = await auth0.getTokenSilently();
15+
window.document.body.innerText = accessToken;
16+
});
1717
</script>
1818
</body>
1919
</html>

examples/graphql-file-upload-example/frontend/package.json

+7-7
Original file line numberDiff line numberDiff line change
@@ -2,24 +2,24 @@
22
"name": "frontend",
33
"version": "0.1.0",
44
"private": true,
5+
"scripts": {
6+
"build": "react-scripts build",
7+
"eject": "react-scripts eject",
8+
"start": "react-scripts start",
9+
"test": "react-scripts test"
10+
},
511
"dependencies": {
12+
"@apollo/client": "3.7.1",
613
"@testing-library/jest-dom": "5.16.5",
714
"@testing-library/react": "13.4.0",
815
"@testing-library/user-event": "14.4.3",
9-
"@apollo/client": "3.7.1",
1016
"apollo-upload-client": "17.0.0",
1117
"graphql": "16.6.0",
1218
"react": "18.2.0",
1319
"react-dom": "18.2.0",
1420
"react-scripts": "5.0.1",
1521
"web-vitals": "3.1.0"
1622
},
17-
"scripts": {
18-
"start": "react-scripts start",
19-
"build": "react-scripts build",
20-
"test": "react-scripts test",
21-
"eject": "react-scripts eject"
22-
},
2323
"browserslist": {
2424
"production": [
2525
">0.2%",

examples/json-schema-example/package.json

+1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
"@graphql-mesh/cli": "0.80.4",
1414
"@graphql-mesh/json-schema": "0.35.38",
1515
"@graphql-mesh/plugin-mock": "0.0.40",
16+
"@graphql-mesh/transform-naming-convention": "0.12.4",
1617
"graphql": "16.6.0"
1718
},
1819
"devDependencies": {

examples/openapi-javascript-wiki/.meshrc.yaml

-1
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,3 @@ additionalResolvers:
1313

1414
documents:
1515
- example-queries/*.graphql
16-

jest.config.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ module.exports = {
1515
rootDir: ROOT_DIR,
1616
restoreMocks: true,
1717
reporters: ['default'],
18-
modulePathIgnorePatterns: ['dist', '.bob'],
18+
modulePathIgnorePatterns: ['dist', 'fixtures', '.bob'],
1919
moduleNameMapper: {
2020
'@graphql-mesh/cross-helpers': '<rootDir>/packages/cross-helpers/node.js',
2121
...pathsToModuleNameMapper(tsconfig.compilerOptions.paths, {
@@ -32,4 +32,5 @@ module.exports = {
3232
'^.+\\.js$': 'babel-jest',
3333
},
3434
transformIgnorePatterns: [`node_modules/(?!(${ESM_PACKAGES.join('|')})/)`],
35+
resolver: 'bob-the-bundler/jest-resolver.js',
3536
};

package.json

+36-36
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,59 @@
11
{
22
"name": "graphql-mesh-monorepo",
3-
"license": "MIT",
43
"version": "0.2.15",
4+
"license": "MIT",
55
"private": true,
6+
"workspaces": {
7+
"packages": [
8+
"website",
9+
"packages/*",
10+
"packages/cache/*",
11+
"packages/handlers/*",
12+
"packages/transforms/*",
13+
"packages/mergers/*",
14+
"packages/plugins/*",
15+
"examples/*",
16+
"examples/federation-example/*",
17+
"examples/graphql-file-upload-example/frontend",
18+
"packages/loaders/*"
19+
]
20+
},
621
"scripts": {
7-
"postinstall": "patch-package && husky install",
8-
"prebuild:website": "yarn build",
22+
"build": "bob build",
23+
"build-test-artifacts": "cd examples/json-schema-example && yarn build",
924
"build:website": "cd website && yarn build",
10-
"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",
11-
"prebuild": "yarn generate-config-schema",
12-
"transpile-ts": "tsc --project tsconfig.build.json",
13-
"build": "yarn transpile-ts && bob build",
14-
"copy-config-schema": "cp ./packages/types/src/config-schema.json ./packages/types/dist/",
25+
"ci:lint": "eslint --output-file eslint_report.json --ext .ts --format json \"./packages/**/src/**/*.ts\"",
26+
"clean": "rm -rf packages/**/dist packages/**/**/dist examples/**/node_modules/.bin/*mesh* .bob",
27+
"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",
1528
"fix-bin": "node scripts/fix-bin.js",
16-
"postbuild": "yarn copy-config-schema && yarn fix-bin",
29+
"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",
1730
"lint": "eslint --ext .ts \"./packages/**/src/**/*.ts\"",
18-
"ci:lint": "eslint --output-file eslint_report.json --ext .ts --format json \"./packages/**/src/**/*.ts\"",
31+
"postbuild": "yarn copy-config-schema && yarn fix-bin",
32+
"postinstall": "patch-package && husky install",
33+
"prebuild": "yarn clean && yarn generate-config-schema",
34+
"prebuild:website": "yarn build",
35+
"prerelease": "yarn build",
1936
"prettier": "prettier --write --list-different .",
2037
"prettier:check": "prettier --check .",
21-
"build-test-artifacts": "cd examples/json-schema-example && yarn build",
38+
"release": "changeset publish",
2239
"test": "cross-env \"JEST=1\" jest --forceExit --no-watchman",
23-
"test-and-build": "yarn build && yarn test",
24-
"prerelease": "yarn build",
25-
"release": "changeset publish"
40+
"test-and-build": "yarn build && yarn test"
2641
},
2742
"devDependencies": {
2843
"@ardatan/graphql-to-config-schema": "0.1.25",
2944
"@babel/core": "7.20.5",
3045
"@babel/plugin-proposal-class-properties": "7.18.6",
3146
"@babel/preset-env": "7.20.2",
3247
"@babel/preset-typescript": "7.18.6",
33-
"@changesets/cli": "2.25.2",
3448
"@changesets/changelog-github": "0.4.7",
49+
"@changesets/cli": "2.25.2",
3550
"@theguild/prettier-config": "1.0.0",
3651
"@types/jest": "29.2.4",
3752
"@types/node": "18.11.11",
3853
"@typescript-eslint/eslint-plugin": "5.45.1",
3954
"@typescript-eslint/parser": "5.45.1",
4055
"babel-jest": "29.3.1",
41-
"bob-the-bundler": "1.7.3",
56+
"bob-the-bundler": "4.0.0",
4257
"eslint": "8.29.0",
4358
"eslint-config-prettier": "8.5.0",
4459
"eslint-config-standard": "17.0.0",
@@ -56,6 +71,11 @@
5671
"ts-jest": "29.0.3",
5772
"typescript": "4.9.3"
5873
},
74+
"resolutions": {
75+
"graphql": "16.6.0",
76+
"undici": "5.13.0",
77+
"uuid": "7.0.3"
78+
},
5979
"husky": {
6080
"hooks": {
6181
"pre-commit": "lint-staged"
@@ -68,25 +88,5 @@
6888
"**/*.{ts,tsx,graphql,yml,json,md,js}": [
6989
"prettier --write"
7090
]
71-
},
72-
"workspaces": {
73-
"packages": [
74-
"./website",
75-
"./packages/*",
76-
"./packages/cache/*",
77-
"./packages/handlers/*",
78-
"./packages/transforms/*",
79-
"./packages/mergers/*",
80-
"./packages/plugins/*",
81-
"./examples/*",
82-
"./examples/federation-example/*",
83-
"./examples/graphql-file-upload-example/frontend",
84-
"./packages/loaders/*"
85-
]
86-
},
87-
"resolutions": {
88-
"graphql": "16.6.0",
89-
"undici": "5.13.0",
90-
"uuid": "7.0.3"
9191
}
9292
}

packages/apollo-link/package.json

+27-19
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,37 @@
11
{
22
"name": "@graphql-mesh/apollo-link",
33
"version": "8.0.7",
4-
"license": "MIT",
4+
"type": "module",
55
"repository": {
66
"type": "git",
77
"url": "Urigo/graphql-mesh",
88
"directory": "packages/apollo-link"
99
},
10-
"sideEffects": false,
11-
"main": "dist/index.js",
12-
"module": "dist/index.mjs",
13-
"typings": "dist/index.d.ts",
14-
"typescript": {
15-
"definition": "dist/index.d.ts"
16-
},
10+
"license": "MIT",
11+
"main": "dist/cjs/index.js",
12+
"module": "dist/esm/index.js",
1713
"exports": {
1814
".": {
19-
"require": "./dist/index.js",
20-
"import": "./dist/index.mjs"
15+
"require": {
16+
"types": "./dist/typings/index.d.cts",
17+
"default": "./dist/cjs/index.js"
18+
},
19+
"import": {
20+
"types": "./dist/typings/index.d.ts",
21+
"default": "./dist/esm/index.js"
22+
},
23+
"default": {
24+
"types": "./dist/typings/index.d.ts",
25+
"default": "./dist/esm/index.js"
26+
}
2127
},
22-
"./*": {
23-
"require": "./dist/*.js",
24-
"import": "./dist/*.mjs"
25-
}
28+
"./package.json": "./package.json"
29+
},
30+
"typings": "dist/typings/index.d.ts",
31+
"peerDependencies": {
32+
"@apollo/client": "^3.5.9",
33+
"@graphql-mesh/runtime": "^0.44.32",
34+
"graphql": "^15.2.0 || ^16.0.0"
2635
},
2736
"dependencies": {
2837
"@graphql-tools/utils": "9.1.1",
@@ -31,13 +40,12 @@
3140
"devDependencies": {
3241
"@apollo/client": "3.7.1"
3342
},
34-
"peerDependencies": {
35-
"@graphql-mesh/runtime": "^0.44.32",
36-
"graphql": "^15.2.0 || ^16.0.0",
37-
"@apollo/client": "^3.5.9"
38-
},
3943
"publishConfig": {
4044
"access": "public",
4145
"directory": "dist"
46+
},
47+
"sideEffects": false,
48+
"typescript": {
49+
"definition": "dist/typings/index.d.ts"
4250
}
4351
}

packages/apollo-link/test/apollo-link.test.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { ApolloClient, FetchResult, InMemoryCache } from '@apollo/client/core';
22
import { MeshInstance } from '@graphql-mesh/runtime';
3-
import { MeshApolloLink } from '../src';
4-
import { getTestMesh } from '../../testing/getTestMesh';
3+
import { MeshApolloLink } from '../src/index.js';
4+
import { getTestMesh } from '../../testing/getTestMesh.js';
55
import { parse } from 'graphql';
66
import { observableToAsyncIterable } from '@graphql-tools/utils';
77

0 commit comments

Comments
 (0)