diff --git a/.changeset/@graphql-mesh_cli-4812-dependencies.md b/.changeset/@graphql-mesh_cli-4812-dependencies.md new file mode 100644 index 0000000000000..16611bfcf5784 --- /dev/null +++ b/.changeset/@graphql-mesh_cli-4812-dependencies.md @@ -0,0 +1,7 @@ +--- +"@graphql-mesh/cli": patch +--- +dependencies updates: + - Updated dependency [`@graphql-codegen/typescript@2.8.2` ↗︎](https://www.npmjs.com/package/@graphql-codegen/typescript/v/2.8.2) (from `2.8.1`, in `dependencies`) + - Updated dependency [`@graphql-codegen/typescript-operations@2.5.7` ↗︎](https://www.npmjs.com/package/@graphql-codegen/typescript-operations/v/2.5.7) (from `2.5.6`, in `dependencies`) + - Updated dependency [`@graphql-codegen/typescript-resolvers@2.7.7` ↗︎](https://www.npmjs.com/package/@graphql-codegen/typescript-resolvers/v/2.7.7) (from `2.7.6`, in `dependencies`) diff --git a/.changeset/few-hats-brake.md b/.changeset/few-hats-brake.md new file mode 100644 index 0000000000000..85af6109f77ee --- /dev/null +++ b/.changeset/few-hats-brake.md @@ -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 diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 5f8c248794344..3749d85297043 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -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 diff --git a/.vscode/settings.json b/.vscode/settings.json index fe5fe0eaf8109..6e4483a437016 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -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" } diff --git a/bob.config.js b/bob.config.js deleted file mode 100644 index 8c960e1740de7..0000000000000 --- a/bob.config.js +++ /dev/null @@ -1,3 +0,0 @@ -module.exports = { - ignore: ['@graphql-mesh/container', '@graphql-mesh/cross-helpers'], -}; diff --git a/examples/auth0/public/index.html b/examples/auth0/public/index.html index 84080c9eff135..ae6b548d2e329 100644 --- a/examples/auth0/public/index.html +++ b/examples/auth0/public/index.html @@ -8,12 +8,12 @@ createAuth0Client({ domain: '{account_name}.{region}.auth0.com', 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; + }); diff --git a/examples/graphql-file-upload-example/frontend/package.json b/examples/graphql-file-upload-example/frontend/package.json index 4bd33b9302f90..7dc537797f170 100644 --- a/examples/graphql-file-upload-example/frontend/package.json +++ b/examples/graphql-file-upload-example/frontend/package.json @@ -2,11 +2,17 @@ "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", @@ -14,12 +20,6 @@ "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%", diff --git a/examples/json-schema-example/package.json b/examples/json-schema-example/package.json index d8cbb1e7b680d..510a1c68f464f 100644 --- a/examples/json-schema-example/package.json +++ b/examples/json-schema-example/package.json @@ -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": { diff --git a/examples/openapi-javascript-wiki/.meshrc.yaml b/examples/openapi-javascript-wiki/.meshrc.yaml index 58254b089d456..5b7a78d46c212 100644 --- a/examples/openapi-javascript-wiki/.meshrc.yaml +++ b/examples/openapi-javascript-wiki/.meshrc.yaml @@ -13,4 +13,3 @@ additionalResolvers: documents: - example-queries/*.graphql - diff --git a/jest.config.js b/jest.config.js index 9689f9091940d..7959cfbd3a9aa 100644 --- a/jest.config.js +++ b/jest.config.js @@ -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': '/packages/cross-helpers/node.js', ...pathsToModuleNameMapper(tsconfig.compilerOptions.paths, { @@ -32,4 +32,5 @@ module.exports = { '^.+\\.js$': 'babel-jest', }, transformIgnorePatterns: [`node_modules/(?!(${ESM_PACKAGES.join('|')})/)`], + resolver: 'bob-the-bundler/jest-resolver.js', }; diff --git a/package.json b/package.json index b6a477f3d5654..13782eb93511e 100644 --- a/package.json +++ b/package.json @@ -1,28 +1,43 @@ { "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", @@ -30,15 +45,15 @@ "@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", @@ -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" @@ -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" } } diff --git a/packages/apollo-link/package.json b/packages/apollo-link/package.json index d5a1de67b098b..8ae039008f209 100644 --- a/packages/apollo-link/package.json +++ b/packages/apollo-link/package.json @@ -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", @@ -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" } } diff --git a/packages/apollo-link/test/apollo-link.test.ts b/packages/apollo-link/test/apollo-link.test.ts index 0b89a8233bdfe..f05d5a522e66f 100644 --- a/packages/apollo-link/test/apollo-link.test.ts +++ b/packages/apollo-link/test/apollo-link.test.ts @@ -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'; diff --git a/packages/cache/cfw-kv/package.json b/packages/cache/cfw-kv/package.json index 232665ad2eb34..14d4317b7829d 100644 --- a/packages/cache/cfw-kv/package.json +++ b/packages/cache/cfw-kv/package.json @@ -1,25 +1,33 @@ { "name": "@graphql-mesh/cache-cfw-kv", "version": "0.0.49", + "type": "module", "repository": { "type": "git", "url": "Urigo/graphql-mesh", "directory": "packages/cache/cfw-kv" }, "license": "MIT", - "main": "dist/index.js", - "module": "dist/index.mjs", + "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/index.d.ts", + "typings": "dist/typings/index.d.ts", "peerDependencies": { "graphql": "*" }, @@ -37,6 +45,6 @@ }, "sideEffects": false, "typescript": { - "definition": "dist/index.d.ts" + "definition": "dist/typings/index.d.ts" } } diff --git a/packages/cache/file/package.json b/packages/cache/file/package.json index 2df0bdef2ff53..eb6cf1e62bfe3 100644 --- a/packages/cache/file/package.json +++ b/packages/cache/file/package.json @@ -1,25 +1,33 @@ { "name": "@graphql-mesh/cache-file", "version": "0.9.47", + "type": "module", "repository": { "type": "git", "url": "Urigo/graphql-mesh", "directory": "packages/cache/file" }, "license": "MIT", - "main": "dist/index.js", - "module": "dist/index.mjs", + "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/index.d.ts", + "typings": "dist/typings/index.d.ts", "peerDependencies": { "graphql": "*" }, @@ -36,6 +44,6 @@ }, "sideEffects": false, "typescript": { - "definition": "dist/index.d.ts" + "definition": "dist/typings/index.d.ts" } } diff --git a/packages/cache/localforage/package.json b/packages/cache/localforage/package.json index 70963a7b39f58..5defa89f12a16 100644 --- a/packages/cache/localforage/package.json +++ b/packages/cache/localforage/package.json @@ -1,25 +1,33 @@ { "name": "@graphql-mesh/cache-localforage", "version": "0.6.63", + "type": "module", "repository": { "type": "git", "url": "Urigo/graphql-mesh", "directory": "packages/cache/localforage" }, "license": "MIT", - "main": "dist/index.js", - "module": "dist/index.mjs", + "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/index.d.ts", + "typings": "dist/typings/index.d.ts", "peerDependencies": { "graphql": "*" }, @@ -35,6 +43,6 @@ }, "sideEffects": false, "typescript": { - "definition": "dist/index.d.ts" + "definition": "dist/typings/index.d.ts" } } diff --git a/packages/cache/localforage/src/index.ts b/packages/cache/localforage/src/index.ts index 61d22cd5e34e5..8feead45da729 100644 --- a/packages/cache/localforage/src/index.ts +++ b/packages/cache/localforage/src/index.ts @@ -1,5 +1,5 @@ import { KeyValueCache, KeyValueCacheSetOptions, YamlConfig } from '@graphql-mesh/types'; -import { createInMemoryLRUDriver } from './InMemoryLRUDriver'; +import { createInMemoryLRUDriver } from './InMemoryLRUDriver.js'; import LocalForage from 'localforage'; LocalForage.defineDriver(createInMemoryLRUDriver()).catch(err => diff --git a/packages/cache/redis/package.json b/packages/cache/redis/package.json index 4564132e9c355..7a8df4bf99aae 100644 --- a/packages/cache/redis/package.json +++ b/packages/cache/redis/package.json @@ -1,25 +1,33 @@ { "name": "@graphql-mesh/cache-redis", "version": "0.10.47", + "type": "module", "repository": { "type": "git", "url": "Urigo/graphql-mesh", "directory": "packages/cache/redis" }, "license": "MIT", - "main": "dist/index.js", - "module": "dist/index.mjs", + "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/index.d.ts", + "typings": "dist/typings/index.d.ts", "peerDependencies": { "graphql": "*" }, @@ -32,12 +40,15 @@ "ioredis-mock": "8.2.2", "tslib": "^2.4.0" }, + "devDependencies": { + "@types/ioredis-mock": "8.2.0" + }, "publishConfig": { "access": "public", "directory": "dist" }, "sideEffects": false, "typescript": { - "definition": "dist/index.d.ts" + "definition": "dist/typings/index.d.ts" } } diff --git a/packages/cache/redis/test/cache.spec.ts b/packages/cache/redis/test/cache.spec.ts index 3ddf649933d24..be751e12a248f 100644 --- a/packages/cache/redis/test/cache.spec.ts +++ b/packages/cache/redis/test/cache.spec.ts @@ -1,5 +1,5 @@ /* eslint-disable no-new */ -import RedisCache from '../src'; +import RedisCache from '../src/index.js'; import Redis from 'ioredis'; import { PubSub } from '@graphql-mesh/utils'; diff --git a/packages/cli/package.json b/packages/cli/package.json index 21b983457601c..bd18b1bf5ff15 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -1,6 +1,7 @@ { "name": "@graphql-mesh/cli", "version": "0.80.4", + "type": "module", "repository": { "type": "git", "url": "Urigo/graphql-mesh", @@ -8,23 +9,31 @@ }, "license": "MIT", "bin": { - "mesh": "dist/bin.js", - "gql-mesh": "dist/bin.js", - "graphql-mesh": "dist/bin.js" + "mesh": "dist/cjs/bin.js", + "gql-mesh": "dist/cjs/bin.js", + "graphql-mesh": "dist/cjs/bin.js", + "graphql-mesh-esm": "dist/esm/bin.js" }, - "main": "dist/index.js", - "module": "dist/index.mjs", + "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/index.d.ts", + "typings": "dist/typings/index.d.ts", "peerDependencies": { "graphql": "*" }, @@ -80,9 +89,10 @@ "graphql-mesh": { "input": "src/bin.ts" } - } + }, + "./package.json": "./package.json" }, "typescript": { - "definition": "dist/index.d.ts" + "definition": "dist/typings/index.d.ts" } } diff --git a/packages/cli/src/bin.ts b/packages/cli/src/bin.ts index 701c521383763..8f29ad1f5503a 100644 --- a/packages/cli/src/bin.ts +++ b/packages/cli/src/bin.ts @@ -1,6 +1,7 @@ +#!/usr/bin/env node import { DefaultLogger } from '@graphql-mesh/utils'; import { graphqlMesh, DEFAULT_CLI_PARAMS } from '.'; -import { handleFatalError } from './handleFatalError'; +import { handleFatalError } from './handleFatalError.js'; graphqlMesh(DEFAULT_CLI_PARAMS).catch(e => handleFatalError(e, new DefaultLogger(DEFAULT_CLI_PARAMS.initialLoggerPrefix)) diff --git a/packages/cli/src/commands/serve/serve.ts b/packages/cli/src/commands/serve/serve.ts index b26d505917da3..e99259ca191b6 100644 --- a/packages/cli/src/commands/serve/serve.ts +++ b/packages/cli/src/commands/serve/serve.ts @@ -9,11 +9,11 @@ import { fs, process } from '@graphql-mesh/cross-helpers'; import { createServer as createHTTPSServer } from 'https'; import { MeshInstance, ServeMeshOptions } from '@graphql-mesh/runtime'; -import { handleFatalError } from '../../handleFatalError'; +import { handleFatalError } from '../../handleFatalError.js'; import open from 'open'; import { useServer } from 'graphql-ws/lib/use/ws'; import dnscache from 'dnscache'; -import { GraphQLMeshCLIParams } from '../..'; +import { GraphQLMeshCLIParams } from '../../index.js'; import type { Logger } from '@graphql-mesh/types'; import { createMeshHTTPHandler } from '@graphql-mesh/http'; diff --git a/packages/cli/src/commands/ts-artifacts.ts b/packages/cli/src/commands/ts-artifacts.ts index 504cecda0ac00..42c78480ea8fd 100644 --- a/packages/cli/src/commands/ts-artifacts.ts +++ b/packages/cli/src/commands/ts-artifacts.ts @@ -11,7 +11,7 @@ import * as typedDocumentNodePlugin from '@graphql-codegen/typed-document-node'; import { fs, path as pathModule } from '@graphql-mesh/cross-helpers'; import ts from 'typescript'; import { pathExists, writeFile, writeJSON } from '@graphql-mesh/utils'; -import { generateOperations } from './generate-operations'; +import { generateOperations } from './generate-operations.js'; import { GraphQLMeshCLIParams } from '..'; import JSON5 from 'json5'; diff --git a/packages/cli/src/index.ts b/packages/cli/src/index.ts index 0f74c76d13b54..1ca49c060a4fd 100644 --- a/packages/cli/src/index.ts +++ b/packages/cli/src/index.ts @@ -1,11 +1,11 @@ -import { findAndParseConfig } from './config'; +import { findAndParseConfig } from './config.js'; import { getMesh, GetMeshOptions, ServeMeshOptions } from '@graphql-mesh/runtime'; -import { generateTsArtifacts } from './commands/ts-artifacts'; -import { serveMesh } from './commands/serve/serve'; +import { generateTsArtifacts } from './commands/ts-artifacts.js'; +import { serveMesh } from './commands/serve/serve.js'; import { fs, path as pathModule, process } from '@graphql-mesh/cross-helpers'; import { FsStoreStorageAdapter, MeshStore } from '@graphql-mesh/store'; import { writeFile, pathExists, rmdirs, DefaultLogger, defaultImportFn } from '@graphql-mesh/utils'; -import { handleFatalError } from './handleFatalError'; +import { handleFatalError } from './handleFatalError.js'; import yargs from 'yargs'; import { hideBin } from 'yargs/helpers'; import { Logger, YamlConfig } from '@graphql-mesh/types'; diff --git a/packages/config/package.json b/packages/config/package.json index 4463ad742bc09..3435637ae2b32 100644 --- a/packages/config/package.json +++ b/packages/config/package.json @@ -1,25 +1,33 @@ { "name": "@graphql-mesh/config", "version": "8.0.36", + "type": "module", "repository": { "type": "git", "url": "Urigo/graphql-mesh", "directory": "packages/config" }, "license": "MIT", - "main": "dist/index.js", - "module": "dist/index.mjs", + "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/index.d.ts", + "typings": "dist/typings/index.d.ts", "peerDependencies": { "@graphql-mesh/runtime": "^0.44.37", "graphql": "*" @@ -49,6 +57,6 @@ }, "sideEffects": false, "typescript": { - "definition": "dist/index.d.ts" + "definition": "dist/typings/index.d.ts" } } diff --git a/packages/config/src/index.ts b/packages/config/src/index.ts index 9b75107dbd3ad..a8a5a8eb88027 100644 --- a/packages/config/src/index.ts +++ b/packages/config/src/index.ts @@ -1,2 +1,2 @@ -export * from './process'; -export * from './utils'; +export * from './process.js'; +export * from './utils.js'; diff --git a/packages/config/src/process.ts b/packages/config/src/process.ts index d6f21e5ad9104..e1a9feae582c2 100644 --- a/packages/config/src/process.ts +++ b/packages/config/src/process.ts @@ -18,13 +18,13 @@ import { resolveDocuments, resolveLogger, resolveCustomFetch, -} from './utils'; +} from './utils.js'; import { FsStoreStorageAdapter, MeshStore, InMemoryStoreStorageAdapter } from '@graphql-mesh/store'; import { pascalCase } from 'pascal-case'; import { camelCase } from 'camel-case'; import { defaultImportFn, parseWithCache, resolveAdditionalResolvers } from '@graphql-mesh/utils'; import { useMaskedErrors } from '@envelop/core'; -import { getAdditionalResolversFromTypeDefs } from './getAdditionalResolversFromTypeDefs'; +import { getAdditionalResolversFromTypeDefs } from './getAdditionalResolversFromTypeDefs.js'; const ENVELOP_CORE_PLUGINS_MAP = { maskedErrors: { diff --git a/packages/config/src/utils.ts b/packages/config/src/utils.ts index c32e12525dbd5..6d4afef63925f 100644 --- a/packages/config/src/utils.ts +++ b/packages/config/src/utils.ts @@ -62,7 +62,7 @@ export async function getPackage({ !error.message.includes(`Cannot find package '${moduleName}'`) && !error.message.includes(`Could not locate module`) ) { - throw new Error(`Unable to load ${type} matching ${name}: ${error.stack}`); + throw new Error(`Unable to load ${type} matching ${name} while resolving ${moduleName}: ${error.stack}`); } } } diff --git a/packages/container/package.json b/packages/container/package.json index 00620f8c96996..0e6ab42341e25 100644 --- a/packages/container/package.json +++ b/packages/container/package.json @@ -1,12 +1,33 @@ { "name": "@graphql-mesh/container", "version": "0.1.207", + "type": "module", "repository": { "type": "git", "url": "Urigo/graphql-mesh", "directory": "packages/container" }, "license": "MIT", + "main": "dist/cjs/index.js", + "module": "dist/esm/index.js", + "exports": { + ".": { + "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" + } + }, + "./package.json": "./package.json" + }, + "typings": "dist/typings/index.d.ts", "scripts": { "start": "graphql-mesh dev" }, @@ -33,6 +54,10 @@ "tslib": "2.4.1" }, "publishConfig": { - "access": "public" + "access": "public", + "directory": "dist" + }, + "typescript": { + "definition": "dist/typings/index.d.ts" } } diff --git a/packages/cross-helpers/package.json b/packages/cross-helpers/package.json index da17628e64523..1b14aaf48af4f 100644 --- a/packages/cross-helpers/package.json +++ b/packages/cross-helpers/package.json @@ -2,25 +2,30 @@ "name": "@graphql-mesh/cross-helpers", "version": "0.2.10", "description": "Cross Platform Helpers for GraphQL Mesh", - "author": "Arda TANRIKULU ", "repository": { "type": "git", "url": "Urigo/graphql-mesh", "directory": "packages/cross-helpers" }, + "author": "Arda TANRIKULU ", "license": "MIT", - "sideEffects": false, "main": "node.js", "browser": "browser.js", - "react-native": "react-native.js", "types": "index.d.ts", + "typings": "./index.d.ts", "dependencies": { "@graphql-tools/utils": "9.1.1", + "path-browserify": "1.0.1", "react-native-fs": "2.20.0", - "react-native-path": "0.0.5", - "path-browserify": "1.0.1" + "react-native-path": "0.0.5" }, "publishConfig": { "access": "public" + }, + "sideEffects": false, + "bob": false, + "react-native": "react-native.js", + "typescript": { + "definition": "./index.d.ts" } } diff --git a/packages/handlers/graphql/package.json b/packages/handlers/graphql/package.json index c7c30bc721351..f756cd724b6f5 100644 --- a/packages/handlers/graphql/package.json +++ b/packages/handlers/graphql/package.json @@ -1,25 +1,33 @@ { "name": "@graphql-mesh/graphql", "version": "0.32.4", + "type": "module", "repository": { "type": "git", "url": "Urigo/graphql-mesh", "directory": "packages/handlers/graphql" }, "license": "MIT", - "main": "dist/index.js", - "module": "dist/index.mjs", + "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/index.d.ts", + "typings": "dist/typings/index.d.ts", "peerDependencies": { "graphql": "*" }, @@ -42,6 +50,6 @@ }, "sideEffects": false, "typescript": { - "definition": "dist/index.d.ts" + "definition": "dist/typings/index.d.ts" } } diff --git a/packages/handlers/graphql/test/handler.spec.ts b/packages/handlers/graphql/test/handler.spec.ts index 146713b5310c1..fec5d392eec6d 100644 --- a/packages/handlers/graphql/test/handler.spec.ts +++ b/packages/handlers/graphql/test/handler.spec.ts @@ -1,7 +1,7 @@ /* eslint-disable import/no-extraneous-dependencies */ /* eslint-disable import/no-nodejs-modules */ import InMemoryLRUCache from '@graphql-mesh/cache-localforage'; -import GraphQLHandler from '../src'; +import GraphQLHandler from '../src/index.js'; import { PubSub, defaultImportFn, DefaultLogger } from '@graphql-mesh/utils'; import { promises as fsPromises } from 'fs'; import { join } from 'path'; diff --git a/packages/handlers/grpc/package.json b/packages/handlers/grpc/package.json index e12ccabaa7623..65116c8a09172 100644 --- a/packages/handlers/grpc/package.json +++ b/packages/handlers/grpc/package.json @@ -1,25 +1,33 @@ { "name": "@graphql-mesh/grpc", "version": "0.27.0", + "type": "module", "repository": { "type": "git", "url": "Urigo/graphql-mesh", "directory": "packages/handlers/grpc" }, "license": "MIT", - "main": "dist/index.js", - "module": "dist/index.mjs", + "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/index.d.ts", + "typings": "dist/typings/index.d.ts", "peerDependencies": { "graphql": "*" }, @@ -50,6 +58,6 @@ }, "sideEffects": false, "typescript": { - "definition": "dist/index.d.ts" + "definition": "dist/typings/index.d.ts" } } diff --git a/packages/handlers/grpc/src/index.ts b/packages/handlers/grpc/src/index.ts index a932a53c97f5c..04f738740e6b0 100644 --- a/packages/handlers/grpc/src/index.ts +++ b/packages/handlers/grpc/src/index.ts @@ -21,7 +21,7 @@ import { IFileDescriptorSet } from 'protobufjs/ext/descriptor'; import { FileDescriptorSet } from 'protobufjs/ext/descriptor/index.js'; import descriptor from 'protobufjs/ext/descriptor/index.js'; -import { addIncludePathResolver, addMetaDataToCall, getTypeName } from './utils'; +import { addIncludePathResolver, addMetaDataToCall, getTypeName } from './utils.js'; import { GraphQLEnumTypeConfig, GraphQLResolveInfo, specifiedDirectives } from 'graphql'; import { path, process } from '@graphql-mesh/cross-helpers'; import { StoreProxy } from '@graphql-mesh/store'; diff --git a/packages/handlers/grpc/src/utils.ts b/packages/handlers/grpc/src/utils.ts index 503d4ae89fbf2..1384390536ad2 100644 --- a/packages/handlers/grpc/src/utils.ts +++ b/packages/handlers/grpc/src/utils.ts @@ -12,7 +12,7 @@ import { SchemaComposer } from 'graphql-compose'; import lodashGet from 'lodash.get'; import { Root } from 'protobufjs'; -import { getGraphQLScalar, isScalarType } from './scalars'; +import { getGraphQLScalar, isScalarType } from './scalars.js'; export function getTypeName( schemaComposer: SchemaComposer, diff --git a/packages/handlers/grpc/test/handler.spec.ts b/packages/handlers/grpc/test/handler.spec.ts index c8f7fd50cc611..97e3902c20a87 100644 --- a/packages/handlers/grpc/test/handler.spec.ts +++ b/packages/handlers/grpc/test/handler.spec.ts @@ -3,7 +3,7 @@ import { GraphQLSchema, printSchema, validateSchema } from 'graphql'; import InMemoryLRUCache from '@graphql-mesh/cache-localforage'; import { PubSub } from '@graphql-mesh/utils'; -import GrpcHandler from '../src'; +import GrpcHandler from '../src/index.js'; import { InMemoryStoreStorageAdapter, MeshStore } from '@graphql-mesh/store'; import { DefaultLogger } from '@graphql-mesh/utils'; import type { YamlConfig } from '@graphql-mesh/types'; diff --git a/packages/handlers/grpc/test/scalars.spec.ts b/packages/handlers/grpc/test/scalars.spec.ts index dbd1cc90a1321..4f2495275e3b0 100644 --- a/packages/handlers/grpc/test/scalars.spec.ts +++ b/packages/handlers/grpc/test/scalars.spec.ts @@ -1,4 +1,4 @@ -import { getGraphQLScalar, isScalarType } from '../src/scalars'; +import { getGraphQLScalar, isScalarType } from '../src/scalars.js'; describe.each<[string, string]>([ ['bool', 'Boolean'], diff --git a/packages/handlers/grpc/test/utils.spec.ts b/packages/handlers/grpc/test/utils.spec.ts index 5ca880e8470b1..f87a318a429df 100644 --- a/packages/handlers/grpc/test/utils.spec.ts +++ b/packages/handlers/grpc/test/utils.spec.ts @@ -2,7 +2,7 @@ import { process } from '@graphql-mesh/cross-helpers'; import { Metadata } from '@grpc/grpc-js'; -import { addMetaDataToCall } from '../src/utils'; +import { addMetaDataToCall } from '../src/utils.js'; describe('grpc utils', () => { describe('addMetaDataToCall', () => { diff --git a/packages/handlers/json-schema/package.json b/packages/handlers/json-schema/package.json index 9a3b58c1564f3..c1ad18f6f2722 100644 --- a/packages/handlers/json-schema/package.json +++ b/packages/handlers/json-schema/package.json @@ -1,25 +1,33 @@ { "name": "@graphql-mesh/json-schema", "version": "0.35.38", + "type": "module", "repository": { "type": "git", "url": "Urigo/graphql-mesh", "directory": "packages/handlers/json-schema" }, "license": "MIT", - "main": "dist/index.js", - "module": "dist/index.mjs", + "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/index.d.ts", + "typings": "dist/typings/index.d.ts", "peerDependencies": { "graphql": "*" }, @@ -42,6 +50,6 @@ }, "sideEffects": false, "typescript": { - "definition": "dist/index.d.ts" + "definition": "dist/typings/index.d.ts" } } diff --git a/packages/handlers/json-schema/test/handler.spec.ts b/packages/handlers/json-schema/test/handler.spec.ts index dc6569dd2e2a8..7844b80659d9c 100644 --- a/packages/handlers/json-schema/test/handler.spec.ts +++ b/packages/handlers/json-schema/test/handler.spec.ts @@ -3,7 +3,7 @@ import { InMemoryStoreStorageAdapter, MeshStore } from '@graphql-mesh/store'; import { defaultImportFn, DefaultLogger, getHeadersObj, PubSub } from '@graphql-mesh/utils'; import { execute, parse } from 'graphql'; import LocalforageCache from '@graphql-mesh/cache-localforage'; -import JsonSchemaHandler from '../src'; +import JsonSchemaHandler from '../src/index.js'; import { Headers, Response } from '@whatwg-node/fetch'; describe('JSON Schema Handler', () => { diff --git a/packages/handlers/mongoose/package.json b/packages/handlers/mongoose/package.json index f614662d431cb..4175976ab7ddc 100644 --- a/packages/handlers/mongoose/package.json +++ b/packages/handlers/mongoose/package.json @@ -1,25 +1,33 @@ { "name": "@graphql-mesh/mongoose", "version": "0.11.32", + "type": "module", "repository": { "type": "git", "url": "Urigo/graphql-mesh", "directory": "packages/handlers/mongoose" }, "license": "MIT", - "main": "dist/index.js", - "module": "dist/index.mjs", + "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/index.d.ts", + "typings": "dist/typings/index.d.ts", "peerDependencies": { "graphql": "*", "mongoose": "*" @@ -42,6 +50,6 @@ }, "sideEffects": false, "typescript": { - "definition": "dist/index.d.ts" + "definition": "dist/typings/index.d.ts" } } diff --git a/packages/handlers/mysql/package.json b/packages/handlers/mysql/package.json index 410cdcb9b5c78..b538da513d1d4 100644 --- a/packages/handlers/mysql/package.json +++ b/packages/handlers/mysql/package.json @@ -1,25 +1,33 @@ { "name": "@graphql-mesh/mysql", "version": "0.17.33", + "type": "module", "repository": { "type": "git", "url": "Urigo/graphql-mesh", "directory": "packages/handlers/mysql" }, "license": "MIT", - "main": "dist/index.js", - "module": "dist/index.mjs", + "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/index.d.ts", + "typings": "dist/typings/index.d.ts", "peerDependencies": { "graphql": "*" }, @@ -48,9 +56,9 @@ }, "sideEffects": false, "buildOptions": { - "input": "./src/index.ts" + "input": "./src/index.js" }, "typescript": { - "definition": "dist/index.d.ts" + "definition": "dist/typings/index.d.ts" } } diff --git a/packages/handlers/neo4j/package.json b/packages/handlers/neo4j/package.json index 8452f334e4c39..38966756e2b0d 100644 --- a/packages/handlers/neo4j/package.json +++ b/packages/handlers/neo4j/package.json @@ -1,25 +1,33 @@ { "name": "@graphql-mesh/neo4j", "version": "0.20.40", + "type": "module", "repository": { "type": "git", "url": "Urigo/graphql-mesh", "directory": "packages/handlers/neo4j" }, "license": "MIT", - "main": "dist/index.js", - "module": "dist/index.mjs", + "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/index.d.ts", + "typings": "dist/typings/index.d.ts", "peerDependencies": { "graphql": "*" }, @@ -41,9 +49,9 @@ }, "sideEffects": false, "buildOptions": { - "input": "./src/index.ts" + "input": "./src/index.js" }, "typescript": { - "definition": "dist/index.d.ts" + "definition": "dist/typings/index.d.ts" } } diff --git a/packages/handlers/odata/package.json b/packages/handlers/odata/package.json index aa3ec0e4d8232..b3d2e2a13c8ec 100644 --- a/packages/handlers/odata/package.json +++ b/packages/handlers/odata/package.json @@ -1,25 +1,33 @@ { "name": "@graphql-mesh/odata", "version": "0.20.35", + "type": "module", "repository": { "type": "git", "url": "Urigo/graphql-mesh", "directory": "packages/handlers/odata" }, "license": "MIT", - "main": "dist/index.js", - "module": "dist/index.mjs", + "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/index.d.ts", + "typings": "dist/typings/index.d.ts", "peerDependencies": { "graphql": "*" }, @@ -52,6 +60,6 @@ }, "sideEffects": false, "typescript": { - "definition": "dist/index.d.ts" + "definition": "dist/typings/index.d.ts" } } diff --git a/packages/handlers/odata/test/custom-fetch.ts b/packages/handlers/odata/test/custom-fetch.ts index 8660e2d5a6ce7..7ed4a5ced3244 100644 --- a/packages/handlers/odata/test/custom-fetch.ts +++ b/packages/handlers/odata/test/custom-fetch.ts @@ -4,8 +4,9 @@ export const MockRequest = function (url: string, config: RequestInit) { return { url, ...config, - text: async () => config.body.toString('utf-8'), - json: async () => JSON.parse(config.body.toString('utf-8')), + // TODO: Arda - replace any with strict type + text: async () => (config.body as any).toString('utf-8'), + json: async () => JSON.parse((config.body as any).toString('utf-8')), clone() { return this; }, @@ -31,7 +32,7 @@ export const mockFetch = function (...args: Parameters = ServerAdapter>; diff --git a/packages/jit-executor/package.json b/packages/jit-executor/package.json index 227d9f613c31d..7823eca71d7b8 100644 --- a/packages/jit-executor/package.json +++ b/packages/jit-executor/package.json @@ -1,25 +1,33 @@ { "name": "@graphql-mesh/jit-executor", "version": "0.0.57", + "type": "module", "repository": { "type": "git", "url": "Urigo/graphql-mesh", "directory": "packages/jit-executor" }, "license": "MIT", - "main": "dist/index.js", - "module": "dist/index.mjs", + "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/index.d.ts", + "typings": "dist/typings/index.d.ts", "peerDependencies": { "graphql": "*" }, @@ -36,6 +44,6 @@ }, "sideEffects": false, "typescript": { - "definition": "dist/index.d.ts" + "definition": "dist/typings/index.d.ts" } } diff --git a/packages/json-machete/package.json b/packages/json-machete/package.json index 856ab5b336f20..db5223f7383e2 100644 --- a/packages/json-machete/package.json +++ b/packages/json-machete/package.json @@ -1,25 +1,33 @@ { "name": "json-machete", "version": "0.16.5", + "type": "module", "repository": { "type": "git", "url": "Urigo/graphql-mesh", "directory": "packages/json-machete" }, "license": "MIT", - "main": "dist/index.js", - "module": "dist/index.mjs", + "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/index.d.ts", + "typings": "dist/typings/index.d.ts", "dependencies": { "@graphql-mesh/cross-helpers": "0.2.10", "@graphql-mesh/types": "0.87.1", @@ -41,6 +49,6 @@ }, "sideEffects": false, "typescript": { - "definition": "dist/index.d.ts" + "definition": "dist/typings/index.d.ts" } } diff --git a/packages/json-machete/src/compareJSONSchemas.ts b/packages/json-machete/src/compareJSONSchemas.ts index 2302e3ddb0f7a..fbc164e66a20a 100644 --- a/packages/json-machete/src/compareJSONSchemas.ts +++ b/packages/json-machete/src/compareJSONSchemas.ts @@ -1,7 +1,7 @@ -import { JSONSchema } from './types'; -import { visitJSONSchema } from './visitJSONSchema'; +import { JSONSchema } from './types.js'; +import { visitJSONSchema } from './visitJSONSchema.js'; import { AggregateError } from '@graphql-tools/utils'; -import { resolvePath } from './dereferenceObject'; +import { resolvePath } from './dereferenceObject.js'; export async function compareJSONSchemas(oldSchema: JSONSchema, newSchema: JSONSchema) { const breakingChanges: string[] = []; diff --git a/packages/json-machete/src/dereferenceObject.ts b/packages/json-machete/src/dereferenceObject.ts index 7e5cbd0bcc068..79d7b46e27c51 100644 --- a/packages/json-machete/src/dereferenceObject.ts +++ b/packages/json-machete/src/dereferenceObject.ts @@ -3,7 +3,7 @@ import { path as pathModule, process } from '@graphql-mesh/cross-helpers'; import urlJoin from 'url-join'; import { fetch as crossUndiciFetch } from '@whatwg-node/fetch'; import { defaultImportFn, DefaultLogger, isUrl, readFileOrUrl } from '@graphql-mesh/utils'; -import { handleUntitledDefinitions } from './healUntitledDefinitions'; +import { handleUntitledDefinitions } from './healUntitledDefinitions.js'; export const resolvePath = (path: string, root: any): any => { try { diff --git a/packages/json-machete/src/healJSONSchema.ts b/packages/json-machete/src/healJSONSchema.ts index 3279890714368..8eb77c2c00b20 100644 --- a/packages/json-machete/src/healJSONSchema.ts +++ b/packages/json-machete/src/healJSONSchema.ts @@ -1,5 +1,5 @@ -import { JSONSchema, JSONSchemaObject } from './types'; -import { visitJSONSchema } from './visitJSONSchema'; +import { JSONSchema, JSONSchemaObject } from './types.js'; +import { visitJSONSchema } from './visitJSONSchema.js'; import toJsonSchema from 'to-json-schema'; import { DefaultLogger } from '@graphql-mesh/utils'; import { Logger } from '@graphql-mesh/types'; diff --git a/packages/json-machete/src/index.ts b/packages/json-machete/src/index.ts index 92cbd58576a42..4371b2878d462 100644 --- a/packages/json-machete/src/index.ts +++ b/packages/json-machete/src/index.ts @@ -1,7 +1,7 @@ -export * from './compareJSONSchemas'; -export * from './dereferenceObject'; -export * from './healJSONSchema'; -export * from './referenceJSONSchema'; -export * from './visitJSONSchema'; -export * from './types'; -export * from './healUntitledDefinitions'; +export * from './compareJSONSchemas.js'; +export * from './dereferenceObject.js'; +export * from './healJSONSchema.js'; +export * from './referenceJSONSchema.js'; +export * from './visitJSONSchema.js'; +export * from './types.js'; +export * from './healUntitledDefinitions.js'; diff --git a/packages/json-machete/src/referenceJSONSchema.ts b/packages/json-machete/src/referenceJSONSchema.ts index 968bad07f2f8e..ec13f4a4393d6 100644 --- a/packages/json-machete/src/referenceJSONSchema.ts +++ b/packages/json-machete/src/referenceJSONSchema.ts @@ -1,5 +1,5 @@ -import { JSONSchemaObject } from './types'; -import { visitJSONSchema } from './visitJSONSchema'; +import { JSONSchemaObject } from './types.js'; +import { visitJSONSchema } from './visitJSONSchema.js'; import { DefaultLogger } from '@graphql-mesh/utils'; export async function referenceJSONSchema(schema: JSONSchemaObject, logger = new DefaultLogger('referenceJSONSchema')) { diff --git a/packages/json-machete/src/visitJSONSchema.ts b/packages/json-machete/src/visitJSONSchema.ts index bdd1814cf3e6f..67cfd2f99bdc8 100644 --- a/packages/json-machete/src/visitJSONSchema.ts +++ b/packages/json-machete/src/visitJSONSchema.ts @@ -1,4 +1,4 @@ -import { JSONSchemaObject, JSONSchema } from './types'; +import { JSONSchemaObject, JSONSchema } from './types.js'; export interface JSONSchemaVisitorContext { visitedSubschemaResultMap: WeakMap; diff --git a/packages/json-machete/tests/compareJSONSchemas.test.ts b/packages/json-machete/tests/compareJSONSchemas.test.ts index b47d4a9282b77..342025a6fc810 100644 --- a/packages/json-machete/tests/compareJSONSchemas.test.ts +++ b/packages/json-machete/tests/compareJSONSchemas.test.ts @@ -1,4 +1,4 @@ -import { compareJSONSchemas } from '../src/compareJSONSchemas'; +import { compareJSONSchemas } from '../src/compareJSONSchemas.js'; describe('compareJSONSchemas', () => { it('should throw on removed field', async () => { diff --git a/packages/json-machete/tests/dereferenceObject.test.ts b/packages/json-machete/tests/dereferenceObject.test.ts index 14bd705dc8d37..b945edb7f7e62 100644 --- a/packages/json-machete/tests/dereferenceObject.test.ts +++ b/packages/json-machete/tests/dereferenceObject.test.ts @@ -1,5 +1,5 @@ import { JSONSchemaObject } from '@json-schema-tools/meta-schema'; -import { dereferenceObject } from '../src/dereferenceObject'; +import { dereferenceObject } from '../src/dereferenceObject.js'; describe('dereferenceObject', () => { it('should resolve all $ref', async () => { diff --git a/packages/json-machete/tests/healJSONSchema.test.ts b/packages/json-machete/tests/healJSONSchema.test.ts index 1f7a8a69bbf69..b9336364189fe 100644 --- a/packages/json-machete/tests/healJSONSchema.test.ts +++ b/packages/json-machete/tests/healJSONSchema.test.ts @@ -1,5 +1,5 @@ import { JSONSchema, JSONSchemaObject } from '@json-schema-tools/meta-schema'; -import { healJSONSchema } from '../src/healJSONSchema'; +import { healJSONSchema } from '../src/healJSONSchema.js'; describe('healJSONSchema', () => { it('should add titles for non-primitive definitions if missing', async () => { diff --git a/packages/json-machete/tests/referenceJSONSchema.test.ts b/packages/json-machete/tests/referenceJSONSchema.test.ts index 6c312d0fc4f50..449d0e4e794f3 100644 --- a/packages/json-machete/tests/referenceJSONSchema.test.ts +++ b/packages/json-machete/tests/referenceJSONSchema.test.ts @@ -1,5 +1,5 @@ import { JSONSchemaObject } from '@json-schema-tools/meta-schema'; -import { referenceJSONSchema } from '../src/referenceJSONSchema'; +import { referenceJSONSchema } from '../src/referenceJSONSchema.js'; describe('referenceJSONSchema', () => { it('should create definitions under definitions prop and put references in other places', async () => { diff --git a/packages/loaders/json-schema/package.json b/packages/loaders/json-schema/package.json index dcd9fcd6a5d3a..4d00904c537cd 100644 --- a/packages/loaders/json-schema/package.json +++ b/packages/loaders/json-schema/package.json @@ -1,25 +1,33 @@ { "name": "@omnigraph/json-schema", "version": "0.36.11", + "type": "module", "repository": { "type": "git", "url": "Urigo/graphql-mesh", "directory": "packages/loaders/json-schema" }, "license": "MIT", - "main": "dist/index.js", - "module": "dist/index.mjs", + "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/index.d.ts", + "typings": "dist/typings/index.d.ts", "peerDependencies": { "graphql": "*" }, @@ -54,6 +62,6 @@ }, "sideEffects": false, "typescript": { - "definition": "dist/index.d.ts" + "definition": "dist/typings/index.d.ts" } } diff --git a/packages/loaders/json-schema/src/addExecutionLogicToComposer.ts b/packages/loaders/json-schema/src/addExecutionLogicToComposer.ts index eb7376de654b7..3ec6909c67c2c 100644 --- a/packages/loaders/json-schema/src/addExecutionLogicToComposer.ts +++ b/packages/loaders/json-schema/src/addExecutionLogicToComposer.ts @@ -1,10 +1,10 @@ import { GraphQLJSON, ObjectTypeComposer, ObjectTypeComposerFieldConfig, SchemaComposer } from 'graphql-compose'; import { Logger, MeshFetch, MeshPubSub } from '@graphql-mesh/types'; -import { JSONSchemaLinkConfig, JSONSchemaOperationConfig, OperationHeadersConfiguration } from './types'; -import { getOperationMetadata, isPubSubOperationConfig, isFileUpload } from './utils'; +import { JSONSchemaLinkConfig, JSONSchemaOperationConfig, OperationHeadersConfiguration } from './types.js'; +import { getOperationMetadata, isPubSubOperationConfig, isFileUpload } from './utils.js'; import { createGraphQLError, memoize1 } from '@graphql-tools/utils'; import urlJoin from 'url-join'; -import { resolveDataByUnionInputType } from './resolveDataByUnionInputType'; +import { resolveDataByUnionInputType } from './resolveDataByUnionInputType.js'; import { stringify as qsStringify, parse as qsParse, IStringifyOptions } from 'qs'; import { getNamedType, diff --git a/packages/loaders/json-schema/src/bundle.ts b/packages/loaders/json-schema/src/bundle.ts index c55f523870e4d..590d53b15e6cc 100644 --- a/packages/loaders/json-schema/src/bundle.ts +++ b/packages/loaders/json-schema/src/bundle.ts @@ -1,11 +1,11 @@ import { referenceJSONSchema, JSONSchemaObject, dereferenceObject } from 'json-machete'; import { DefaultLogger } from '@graphql-mesh/utils'; -import { getDereferencedJSONSchemaFromOperations } from './getDereferencedJSONSchemaFromOperations'; +import { getDereferencedJSONSchemaFromOperations } from './getDereferencedJSONSchemaFromOperations.js'; import { Logger, MeshFetch, MeshPubSub } from '@graphql-mesh/types'; -import { JSONSchemaOperationConfig, OperationHeadersConfiguration } from './types'; +import { JSONSchemaOperationConfig, OperationHeadersConfiguration } from './types.js'; import { fetch as crossUndiciFetch } from '@whatwg-node/fetch'; import { GraphQLSchema } from 'graphql'; -import { getGraphQLSchemaFromDereferencedJSONSchema } from './getGraphQLSchemaFromDereferencedJSONSchema'; +import { getGraphQLSchemaFromDereferencedJSONSchema } from './getGraphQLSchemaFromDereferencedJSONSchema.js'; import type { IStringifyOptions } from 'qs'; import { ResolverData } from '@graphql-mesh/string-interpolation'; diff --git a/packages/loaders/json-schema/src/getComposerFromJSONSchema.ts b/packages/loaders/json-schema/src/getComposerFromJSONSchema.ts index 7f297eb66610e..38371a5c71de6 100644 --- a/packages/loaders/json-schema/src/getComposerFromJSONSchema.ts +++ b/packages/loaders/json-schema/src/getComposerFromJSONSchema.ts @@ -55,12 +55,12 @@ import Ajv from 'ajv'; import addFormats from 'ajv-formats'; import { memoize1 } from '@graphql-tools/utils'; import { visitJSONSchema, JSONSchema, JSONSchemaObject } from 'json-machete'; -import { getStringScalarWithMinMaxLength } from './getStringScalarWithMinMaxLength'; -import { getJSONSchemaStringFormatScalarMap } from './getJSONSchemaStringFormatScalarMap'; -import { getUnionTypeComposers } from './getUnionTypeComposers'; -import { getValidTypeName } from './getValidTypeName'; -import { getGenericJSONScalar } from './getGenericJSONScalar'; -import { getValidateFnForSchemaPath } from './getValidateFnForSchemaPath'; +import { getStringScalarWithMinMaxLength } from './getStringScalarWithMinMaxLength.js'; +import { getJSONSchemaStringFormatScalarMap } from './getJSONSchemaStringFormatScalarMap.js'; +import { getUnionTypeComposers } from './getUnionTypeComposers.js'; +import { getValidTypeName } from './getValidTypeName.js'; +import { getGenericJSONScalar } from './getGenericJSONScalar.js'; +import { getValidateFnForSchemaPath } from './getValidateFnForSchemaPath.js'; const isListTC = memoize1(function isListTC(type: any): type is ListComposer { return type instanceof ListComposer; diff --git a/packages/loaders/json-schema/src/getDereferencedJSONSchemaFromOperations.ts b/packages/loaders/json-schema/src/getDereferencedJSONSchemaFromOperations.ts index 5d9692ea4cf78..ce53d8b5639aa 100644 --- a/packages/loaders/json-schema/src/getDereferencedJSONSchemaFromOperations.ts +++ b/packages/loaders/json-schema/src/getDereferencedJSONSchemaFromOperations.ts @@ -1,5 +1,5 @@ -import { JSONSchemaOperationConfig } from './types'; -import { getReferencedJSONSchemaFromOperations } from './getReferencedJSONSchemaFromOperations'; +import { JSONSchemaOperationConfig } from './types.js'; +import { getReferencedJSONSchemaFromOperations } from './getReferencedJSONSchemaFromOperations.js'; import { dereferenceObject, healJSONSchema, JSONSchemaObject } from 'json-machete'; import { Logger } from '@graphql-mesh/types'; import { getInterpolatedHeadersFactory } from '@graphql-mesh/string-interpolation'; diff --git a/packages/loaders/json-schema/src/getGenericJSONScalar.ts b/packages/loaders/json-schema/src/getGenericJSONScalar.ts index 5ca0225b069b6..698de4b013c8d 100644 --- a/packages/loaders/json-schema/src/getGenericJSONScalar.ts +++ b/packages/loaders/json-schema/src/getGenericJSONScalar.ts @@ -1,7 +1,7 @@ import { util } from '@graphql-mesh/cross-helpers'; import { JSONSchemaObject } from 'json-machete'; import { GraphQLJSON, SchemaComposer } from 'graphql-compose'; -import { getValidTypeName } from './getValidTypeName'; +import { getValidTypeName } from './getValidTypeName.js'; export function getGenericJSONScalar({ isInput, diff --git a/packages/loaders/json-schema/src/getGraphQLSchemaFromDereferencedJSONSchema.ts b/packages/loaders/json-schema/src/getGraphQLSchemaFromDereferencedJSONSchema.ts index 0bc20e9b28e72..c81867869a90c 100644 --- a/packages/loaders/json-schema/src/getGraphQLSchemaFromDereferencedJSONSchema.ts +++ b/packages/loaders/json-schema/src/getGraphQLSchemaFromDereferencedJSONSchema.ts @@ -1,8 +1,8 @@ import { specifiedDirectives } from 'graphql'; import { SchemaComposer } from 'graphql-compose'; import { JSONSchemaObject } from 'json-machete'; -import { addExecutionLogicToComposer, AddExecutionLogicToComposerOptions } from './addExecutionLogicToComposer'; -import { getComposerFromJSONSchema } from './getComposerFromJSONSchema'; +import { addExecutionLogicToComposer, AddExecutionLogicToComposerOptions } from './addExecutionLogicToComposer.js'; +import { getComposerFromJSONSchema } from './getComposerFromJSONSchema.js'; export async function getGraphQLSchemaFromDereferencedJSONSchema( name: string, diff --git a/packages/loaders/json-schema/src/getReferencedJSONSchemaFromOperations.ts b/packages/loaders/json-schema/src/getReferencedJSONSchemaFromOperations.ts index a19a69d7d24df..6086d35bc34cc 100644 --- a/packages/loaders/json-schema/src/getReferencedJSONSchemaFromOperations.ts +++ b/packages/loaders/json-schema/src/getReferencedJSONSchemaFromOperations.ts @@ -4,8 +4,8 @@ import { defaultImportFn, DefaultLogger, readFileOrUrl } from '@graphql-mesh/uti import { AnySchema, JSONSchema, JSONSchemaObject } from 'json-machete'; import toJsonSchema from 'to-json-schema'; import { JSONSchemaOperationResponseConfig } from '.'; -import { JSONSchemaOperationConfig } from './types'; -import { getOperationMetadata } from './utils'; +import { JSONSchemaOperationConfig } from './types.js'; +import { getOperationMetadata } from './utils.js'; async function handleOperationResponseConfig( operationResponseConfig: JSONSchemaOperationResponseConfig, diff --git a/packages/loaders/json-schema/src/getStringScalarWithMinMaxLength.ts b/packages/loaders/json-schema/src/getStringScalarWithMinMaxLength.ts index b6222538a2f3b..ed26cd702c95f 100644 --- a/packages/loaders/json-schema/src/getStringScalarWithMinMaxLength.ts +++ b/packages/loaders/json-schema/src/getStringScalarWithMinMaxLength.ts @@ -1,6 +1,6 @@ import { JSONSchemaObject } from '@json-schema-tools/meta-schema'; import { SchemaComposer } from 'graphql-compose'; -import { getValidTypeName } from './getValidTypeName'; +import { getValidTypeName } from './getValidTypeName.js'; export function getStringScalarWithMinMaxLength({ schemaComposer, diff --git a/packages/loaders/json-schema/src/getTypeResolverFromOutputTCs.ts b/packages/loaders/json-schema/src/getTypeResolverFromOutputTCs.ts index ce356ff30c887..5f97534c0111d 100644 --- a/packages/loaders/json-schema/src/getTypeResolverFromOutputTCs.ts +++ b/packages/loaders/json-schema/src/getTypeResolverFromOutputTCs.ts @@ -2,7 +2,7 @@ import { GraphQLError, GraphQLResolveInfo, GraphQLTypeResolver } from 'graphql'; import { ObjectTypeComposer, UnionTypeComposer } from 'graphql-compose'; import Ajv, { ValidateFunction, ErrorObject } from 'ajv'; import { JSONSchemaObject } from 'json-machete'; -import { TypeComposers } from './getComposerFromJSONSchema'; +import { TypeComposers } from './getComposerFromJSONSchema.js'; import { createGraphQLError } from '@graphql-tools/utils'; export function getTypeResolverFromOutputTCs( diff --git a/packages/loaders/json-schema/src/getUnionTypeComposers.ts b/packages/loaders/json-schema/src/getUnionTypeComposers.ts index 32c7330ccedb9..f7bd74bb073ba 100644 --- a/packages/loaders/json-schema/src/getUnionTypeComposers.ts +++ b/packages/loaders/json-schema/src/getUnionTypeComposers.ts @@ -10,8 +10,8 @@ import { SchemaComposer, UnionTypeComposer, } from 'graphql-compose'; -import { TypeComposers } from './getComposerFromJSONSchema'; -import { getTypeResolverFromOutputTCs } from './getTypeResolverFromOutputTCs'; +import { TypeComposers } from './getComposerFromJSONSchema.js'; +import { getTypeResolverFromOutputTCs } from './getTypeResolverFromOutputTCs.js'; const ONE_OF_DEFINITION = /* GraphQL */ ` directive @oneOf on INPUT_OBJECT | FIELD_DEFINITION diff --git a/packages/loaders/json-schema/src/index.ts b/packages/loaders/json-schema/src/index.ts index e4d8581f21a32..3c1a1a7b6eab6 100644 --- a/packages/loaders/json-schema/src/index.ts +++ b/packages/loaders/json-schema/src/index.ts @@ -1,9 +1,9 @@ -import { loadGraphQLSchemaFromJSONSchemas } from './loadGraphQLSchemaFromJSONSchemas'; +import { loadGraphQLSchemaFromJSONSchemas } from './loadGraphQLSchemaFromJSONSchemas.js'; export default loadGraphQLSchemaFromJSONSchemas; export { loadGraphQLSchemaFromJSONSchemas }; -export * from './getComposerFromJSONSchema'; -export * from './getDereferencedJSONSchemaFromOperations'; -export * from './getReferencedJSONSchemaFromOperations'; -export * from './getGraphQLSchemaFromDereferencedJSONSchema'; -export * from './types'; -export * from './bundle'; +export * from './getComposerFromJSONSchema.js'; +export * from './getDereferencedJSONSchemaFromOperations.js'; +export * from './getReferencedJSONSchemaFromOperations.js'; +export * from './getGraphQLSchemaFromDereferencedJSONSchema.js'; +export * from './types.js'; +export * from './bundle.js'; diff --git a/packages/loaders/json-schema/src/loadGraphQLSchemaFromJSONSchemas.ts b/packages/loaders/json-schema/src/loadGraphQLSchemaFromJSONSchemas.ts index f8d7ea8a4416b..8839f3acf5bc3 100644 --- a/packages/loaders/json-schema/src/loadGraphQLSchemaFromJSONSchemas.ts +++ b/packages/loaders/json-schema/src/loadGraphQLSchemaFromJSONSchemas.ts @@ -1,7 +1,7 @@ import { DefaultLogger } from '@graphql-mesh/utils'; -import { getDereferencedJSONSchemaFromOperations } from './getDereferencedJSONSchemaFromOperations'; -import { getGraphQLSchemaFromDereferencedJSONSchema } from './getGraphQLSchemaFromDereferencedJSONSchema'; -import { JSONSchemaLoaderOptions } from './types'; +import { getDereferencedJSONSchemaFromOperations } from './getDereferencedJSONSchemaFromOperations.js'; +import { getGraphQLSchemaFromDereferencedJSONSchema } from './getGraphQLSchemaFromDereferencedJSONSchema.js'; +import { JSONSchemaLoaderOptions } from './types.js'; export async function loadGraphQLSchemaFromJSONSchemas(name: string, options: JSONSchemaLoaderOptions) { const logger = options.logger || new DefaultLogger(name); diff --git a/packages/loaders/json-schema/src/utils.ts b/packages/loaders/json-schema/src/utils.ts index 5694150bb6ecb..82bde1c7d749a 100644 --- a/packages/loaders/json-schema/src/utils.ts +++ b/packages/loaders/json-schema/src/utils.ts @@ -1,5 +1,5 @@ import { OperationTypeNode } from 'graphql'; -import { JSONSchemaOperationConfig, JSONSchemaPubSubOperationConfig, HTTPMethod } from './types'; +import { JSONSchemaOperationConfig, JSONSchemaPubSubOperationConfig, HTTPMethod } from './types.js'; export function isPubSubOperationConfig( operationConfig: JSONSchemaOperationConfig diff --git a/packages/loaders/json-schema/test/execution.test.ts b/packages/loaders/json-schema/test/execution.test.ts index 6006df1ee64a5..e8d2f8f35a12a 100644 --- a/packages/loaders/json-schema/test/execution.test.ts +++ b/packages/loaders/json-schema/test/execution.test.ts @@ -1,7 +1,7 @@ import { getHeadersObj } from '@graphql-mesh/utils'; import { Request, Response } from '@whatwg-node/fetch'; import { execute, OperationTypeNode, parse } from 'graphql'; -import loadGraphQLSchemaFromJSONSchemas from '../src'; +import loadGraphQLSchemaFromJSONSchemas from '../src/index.js'; describe('Execution', () => { it('should not send headers with empty value', async () => { diff --git a/packages/loaders/json-schema/test/getComposerFromSchema.test.ts b/packages/loaders/json-schema/test/getComposerFromSchema.test.ts index 3a33c1742d856..2e1938eafbc59 100644 --- a/packages/loaders/json-schema/test/getComposerFromSchema.test.ts +++ b/packages/loaders/json-schema/test/getComposerFromSchema.test.ts @@ -1,4 +1,4 @@ -import { getComposerFromJSONSchema } from '../src/getComposerFromJSONSchema'; +import { getComposerFromJSONSchema } from '../src/getComposerFromJSONSchema.js'; import { execute, GraphQLBoolean, diff --git a/packages/loaders/openapi/package.json b/packages/loaders/openapi/package.json index ec3aa5c995449..b4be217c7df98 100644 --- a/packages/loaders/openapi/package.json +++ b/packages/loaders/openapi/package.json @@ -1,25 +1,33 @@ { "name": "@omnigraph/openapi", "version": "0.17.11", + "type": "module", "repository": { "type": "git", "url": "Urigo/graphql-mesh", "directory": "packages/loaders/openapi" }, "license": "MIT", - "main": "dist/index.js", - "module": "dist/index.mjs", + "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/index.d.ts", + "typings": "dist/typings/index.d.ts", "peerDependencies": { "graphql": "*" }, @@ -56,6 +64,6 @@ }, "sideEffects": false, "typescript": { - "definition": "dist/index.d.ts" + "definition": "dist/typings/index.d.ts" } } diff --git a/packages/loaders/openapi/src/bundle.ts b/packages/loaders/openapi/src/bundle.ts index 1df4dc35bd108..e2fa54e7f84e6 100644 --- a/packages/loaders/openapi/src/bundle.ts +++ b/packages/loaders/openapi/src/bundle.ts @@ -3,8 +3,8 @@ import { createBundle as createJSONSchemaLoaderBundle, JSONSchemaLoaderBundle as OpenAPILoaderBundle, } from '@omnigraph/json-schema'; -import { getJSONSchemaOptionsFromOpenAPIOptions } from './getJSONSchemaOptionsFromOpenAPIOptions'; -import { OpenAPILoaderOptions } from './types'; +import { getJSONSchemaOptionsFromOpenAPIOptions } from './getJSONSchemaOptionsFromOpenAPIOptions.js'; +import { OpenAPILoaderOptions } from './types.js'; /** * Creates a bundle by downloading and resolving the internal references once diff --git a/packages/loaders/openapi/src/getJSONSchemaOptionsFromOpenAPIOptions.ts b/packages/loaders/openapi/src/getJSONSchemaOptionsFromOpenAPIOptions.ts index a4cbe3dd42ff4..0b6686f4be424 100644 --- a/packages/loaders/openapi/src/getJSONSchemaOptionsFromOpenAPIOptions.ts +++ b/packages/loaders/openapi/src/getJSONSchemaOptionsFromOpenAPIOptions.ts @@ -9,9 +9,9 @@ import { JSONSchemaPubSubOperationConfig, OperationHeadersConfiguration, } from '@omnigraph/json-schema'; -import { getFieldNameFromPath } from './utils'; +import { getFieldNameFromPath } from './utils.js'; import { OperationTypeNode } from 'graphql'; -import { OpenAPILoaderSelectQueryOrMutationFieldConfig } from './types'; +import { OpenAPILoaderSelectQueryOrMutationFieldConfig } from './types.js'; import { Logger } from '@graphql-mesh/types'; import { getInterpolatedHeadersFactory } from '@graphql-mesh/string-interpolation'; import { process } from '@graphql-mesh/cross-helpers'; diff --git a/packages/loaders/openapi/src/index.ts b/packages/loaders/openapi/src/index.ts index 0fd0f14c05a36..d6e2bb881b449 100644 --- a/packages/loaders/openapi/src/index.ts +++ b/packages/loaders/openapi/src/index.ts @@ -1,4 +1,4 @@ -export { loadGraphQLSchemaFromOpenAPI as default } from './loadGraphQLSchemaFromOpenAPI'; -export { getJSONSchemaOptionsFromOpenAPIOptions } from './getJSONSchemaOptionsFromOpenAPIOptions'; -export { OpenAPILoaderOptions } from './types'; -export * from './bundle'; +export { loadGraphQLSchemaFromOpenAPI as default } from './loadGraphQLSchemaFromOpenAPI.js'; +export { getJSONSchemaOptionsFromOpenAPIOptions } from './getJSONSchemaOptionsFromOpenAPIOptions.js'; +export { OpenAPILoaderOptions } from './types.js'; +export * from './bundle.js'; diff --git a/packages/loaders/openapi/src/loadGraphQLSchemaFromOpenAPI.ts b/packages/loaders/openapi/src/loadGraphQLSchemaFromOpenAPI.ts index f71a0ac7d982c..873b4c3444114 100644 --- a/packages/loaders/openapi/src/loadGraphQLSchemaFromOpenAPI.ts +++ b/packages/loaders/openapi/src/loadGraphQLSchemaFromOpenAPI.ts @@ -1,6 +1,6 @@ import { loadGraphQLSchemaFromJSONSchemas } from '@omnigraph/json-schema'; import { OpenAPILoaderOptions } from '.'; -import { getJSONSchemaOptionsFromOpenAPIOptions } from './getJSONSchemaOptionsFromOpenAPIOptions'; +import { getJSONSchemaOptionsFromOpenAPIOptions } from './getJSONSchemaOptionsFromOpenAPIOptions.js'; /** * Creates a local GraphQLSchema instance from a OpenAPI Document. diff --git a/packages/loaders/openapi/tests/additionalProperties.test.ts b/packages/loaders/openapi/tests/additionalProperties.test.ts index 093de388fda78..cb173d1074ac6 100644 --- a/packages/loaders/openapi/tests/additionalProperties.test.ts +++ b/packages/loaders/openapi/tests/additionalProperties.test.ts @@ -2,7 +2,7 @@ import { printSchemaWithDirectives } from '@graphql-tools/utils'; import { Response } from '@whatwg-node/fetch'; import { createServerAdapter } from '@whatwg-node/server'; import { execute, parse } from 'graphql'; -import { loadGraphQLSchemaFromOpenAPI } from '../src/loadGraphQLSchemaFromOpenAPI'; +import { loadGraphQLSchemaFromOpenAPI } from '../src/loadGraphQLSchemaFromOpenAPI.js'; const serverAdapter = createServerAdapter(request => { if (request.url.endsWith('/test')) { diff --git a/packages/loaders/openapi/tests/authentication.test.ts b/packages/loaders/openapi/tests/authentication.test.ts index 0ffdf35f3b007..215d261138df7 100644 --- a/packages/loaders/openapi/tests/authentication.test.ts +++ b/packages/loaders/openapi/tests/authentication.test.ts @@ -1,7 +1,7 @@ /* eslint-disable import/no-nodejs-modules */ import { execute, parse } from 'graphql'; -import { loadGraphQLSchemaFromOpenAPI } from '../src/loadGraphQLSchemaFromOpenAPI'; -import { startServer } from './example_api_server'; +import { loadGraphQLSchemaFromOpenAPI } from '../src/loadGraphQLSchemaFromOpenAPI.js'; +import { startServer } from './example_api_server.js'; import { fetch } from '@whatwg-node/fetch'; import { Server } from 'http'; import { AddressInfo } from 'net'; diff --git a/packages/loaders/openapi/tests/basket.test.ts b/packages/loaders/openapi/tests/basket.test.ts index 8de6673797fe2..4016ad6134ac9 100644 --- a/packages/loaders/openapi/tests/basket.test.ts +++ b/packages/loaders/openapi/tests/basket.test.ts @@ -1,7 +1,7 @@ import { printSchemaWithDirectives } from '@graphql-tools/utils'; import { Headers } from '@whatwg-node/fetch'; import { execute, parse } from 'graphql'; -import loadGraphQLSchemaFromOpenAPI, { createBundle } from '../src'; +import loadGraphQLSchemaFromOpenAPI, { createBundle } from '../src/index.js'; describe('Basket', () => { it('should generate the correct bundle', async () => { diff --git a/packages/loaders/openapi/tests/calendly.test.ts b/packages/loaders/openapi/tests/calendly.test.ts index 95f3ef3f184b8..9511c593a1d1e 100644 --- a/packages/loaders/openapi/tests/calendly.test.ts +++ b/packages/loaders/openapi/tests/calendly.test.ts @@ -1,7 +1,7 @@ import { graphql } from 'graphql'; import { printSchemaWithDirectives } from '@graphql-tools/utils'; -import loadGraphQLSchemaFromOpenAPI from '../src'; +import loadGraphQLSchemaFromOpenAPI from '../src/index.js'; describe('Calendly', () => { it('should generate the correct schema', async () => { diff --git a/packages/loaders/openapi/tests/cloudfunction.test.ts b/packages/loaders/openapi/tests/cloudfunction.test.ts index 583190dfba88f..877c2e4ab2aca 100644 --- a/packages/loaders/openapi/tests/cloudfunction.test.ts +++ b/packages/loaders/openapi/tests/cloudfunction.test.ts @@ -1,6 +1,6 @@ import { GraphQLSchema, parse, validate } from 'graphql'; import { join } from 'path'; -import { loadGraphQLSchemaFromOpenAPI } from '../src/loadGraphQLSchemaFromOpenAPI'; +import { loadGraphQLSchemaFromOpenAPI } from '../src/loadGraphQLSchemaFromOpenAPI.js'; import { printSchemaWithDirectives } from '@graphql-tools/utils'; describe('OpenAPI Loader: Cloudfunction', () => { diff --git a/packages/loaders/openapi/tests/cloudfunction_expanded.test.ts b/packages/loaders/openapi/tests/cloudfunction_expanded.test.ts index 8f8a2267dbf55..f92e0941f8c7f 100644 --- a/packages/loaders/openapi/tests/cloudfunction_expanded.test.ts +++ b/packages/loaders/openapi/tests/cloudfunction_expanded.test.ts @@ -1,6 +1,6 @@ import { GraphQLSchema, parse, validate } from 'graphql'; import { join } from 'path'; -import { loadGraphQLSchemaFromOpenAPI } from '../src/loadGraphQLSchemaFromOpenAPI'; +import { loadGraphQLSchemaFromOpenAPI } from '../src/loadGraphQLSchemaFromOpenAPI.js'; import { printSchemaWithDirectives } from '@graphql-tools/utils'; describe('Cloudfunction', () => { diff --git a/packages/loaders/openapi/tests/docusign.test.ts b/packages/loaders/openapi/tests/docusign.test.ts index 4bfa0c0a83bf3..1b894108ea351 100644 --- a/packages/loaders/openapi/tests/docusign.test.ts +++ b/packages/loaders/openapi/tests/docusign.test.ts @@ -1,6 +1,6 @@ import { GraphQLSchema } from 'graphql'; import { join } from 'path'; -import { loadGraphQLSchemaFromOpenAPI } from '../src/loadGraphQLSchemaFromOpenAPI'; +import { loadGraphQLSchemaFromOpenAPI } from '../src/loadGraphQLSchemaFromOpenAPI.js'; import { printSchemaWithDirectives } from '@graphql-tools/utils'; describe('Docusign', () => { diff --git a/packages/loaders/openapi/tests/example_api.test.ts b/packages/loaders/openapi/tests/example_api.test.ts index 31f58221ea4a4..de9e07952de8c 100644 --- a/packages/loaders/openapi/tests/example_api.test.ts +++ b/packages/loaders/openapi/tests/example_api.test.ts @@ -1,12 +1,12 @@ /* eslint-disable import/no-nodejs-modules */ import { execute, graphql, GraphQLInputObjectType, GraphQLObjectType, GraphQLSchema, parse, validate } from 'graphql'; import 'json-bigint-patch'; -import { loadGraphQLSchemaFromOpenAPI } from '../src/loadGraphQLSchemaFromOpenAPI'; +import { loadGraphQLSchemaFromOpenAPI } from '../src/loadGraphQLSchemaFromOpenAPI.js'; -import { startServer } from './example_api_server'; +import { startServer } from './example_api_server.js'; import { fetch } from '@whatwg-node/fetch'; import { printSchemaWithDirectives } from '@graphql-tools/utils'; -import { createBundle, OpenAPILoaderOptions } from '../src'; +import { createBundle, OpenAPILoaderOptions } from '../src/index.js'; import { Server } from 'http'; import { AddressInfo } from 'net'; diff --git a/packages/loaders/openapi/tests/example_api2.test.ts b/packages/loaders/openapi/tests/example_api2.test.ts index 4f04bdb626559..7b3e469c09eab 100644 --- a/packages/loaders/openapi/tests/example_api2.test.ts +++ b/packages/loaders/openapi/tests/example_api2.test.ts @@ -1,7 +1,7 @@ import { graphql, GraphQLSchema } from 'graphql'; -import { loadGraphQLSchemaFromOpenAPI } from '../src/loadGraphQLSchemaFromOpenAPI'; -import { startServer, stopServer } from './example_api2_server'; +import { loadGraphQLSchemaFromOpenAPI } from '../src/loadGraphQLSchemaFromOpenAPI.js'; +import { startServer, stopServer } from './example_api2_server.js'; import { fetch } from '@whatwg-node/fetch'; import { printSchemaWithDirectives } from '@graphql-tools/utils'; import getPort from 'get-port'; diff --git a/packages/loaders/openapi/tests/example_api4.test.ts b/packages/loaders/openapi/tests/example_api4.test.ts index 071d2fe5760bb..b3f8fe2474bdf 100644 --- a/packages/loaders/openapi/tests/example_api4.test.ts +++ b/packages/loaders/openapi/tests/example_api4.test.ts @@ -1,5 +1,5 @@ import { execute, GraphQLSchema, parse } from 'graphql'; -import { loadGraphQLSchemaFromOpenAPI } from '../src/loadGraphQLSchemaFromOpenAPI'; +import { loadGraphQLSchemaFromOpenAPI } from '../src/loadGraphQLSchemaFromOpenAPI.js'; import { fetch } from '@whatwg-node/fetch'; import { printSchemaWithDirectives } from '@graphql-tools/utils'; diff --git a/packages/loaders/openapi/tests/example_api5.test.ts b/packages/loaders/openapi/tests/example_api5.test.ts index eb37baf7a1f1a..76296f2278b5c 100644 --- a/packages/loaders/openapi/tests/example_api5.test.ts +++ b/packages/loaders/openapi/tests/example_api5.test.ts @@ -1,7 +1,7 @@ import { execute, GraphQLSchema, parse } from 'graphql'; -import { loadGraphQLSchemaFromOpenAPI } from '../src/loadGraphQLSchemaFromOpenAPI'; -import { startServer, stopServer } from './example_api5_server'; +import { loadGraphQLSchemaFromOpenAPI } from '../src/loadGraphQLSchemaFromOpenAPI.js'; +import { startServer, stopServer } from './example_api5_server.js'; import { fetch } from '@whatwg-node/fetch'; import { printSchemaWithDirectives } from '@graphql-tools/utils'; import getPort from 'get-port'; diff --git a/packages/loaders/openapi/tests/example_api6.test.ts b/packages/loaders/openapi/tests/example_api6.test.ts index 160f0230fdad3..8710f8bec6a0a 100644 --- a/packages/loaders/openapi/tests/example_api6.test.ts +++ b/packages/loaders/openapi/tests/example_api6.test.ts @@ -2,9 +2,9 @@ import { printSchemaWithDirectives } from '@graphql-tools/utils'; import { fetch } from '@whatwg-node/fetch'; import { parse, validate, GraphQLSchema, execute } from 'graphql'; -import { startServer, stopServer } from './example_api6_server'; -import { OpenAPILoaderOptions } from '../src'; -import { loadGraphQLSchemaFromOpenAPI } from '../src/loadGraphQLSchemaFromOpenAPI'; +import { startServer, stopServer } from './example_api6_server.js'; +import { OpenAPILoaderOptions } from '../src/index.js'; +import { loadGraphQLSchemaFromOpenAPI } from '../src/loadGraphQLSchemaFromOpenAPI.js'; import getPort from 'get-port'; let createdSchema: GraphQLSchema; diff --git a/packages/loaders/openapi/tests/example_api7.test.ts b/packages/loaders/openapi/tests/example_api7.test.ts index 506f12c868dbc..5f0ed39ea9e8d 100644 --- a/packages/loaders/openapi/tests/example_api7.test.ts +++ b/packages/loaders/openapi/tests/example_api7.test.ts @@ -5,8 +5,8 @@ import { createServer, Server } from 'http'; import { AbortController, fetch } from '@whatwg-node/fetch'; import { GraphQLSchema } from 'graphql'; -import { loadGraphQLSchemaFromOpenAPI } from '../src/loadGraphQLSchemaFromOpenAPI'; -import { startServer, stopServer, pubsub } from './example_api7_server'; +import { loadGraphQLSchemaFromOpenAPI } from '../src/loadGraphQLSchemaFromOpenAPI.js'; +import { startServer, stopServer, pubsub } from './example_api7_server.js'; import { AddressInfo } from 'net'; let createdSchema: GraphQLSchema; diff --git a/packages/loaders/openapi/tests/example_api8.test.ts b/packages/loaders/openapi/tests/example_api8.test.ts index aaa10d23d01d1..46d10f55ecba5 100644 --- a/packages/loaders/openapi/tests/example_api8.test.ts +++ b/packages/loaders/openapi/tests/example_api8.test.ts @@ -1,8 +1,8 @@ /* eslint-disable import/no-nodejs-modules */ import { execute, GraphQLSchema, parse } from 'graphql'; -import { loadGraphQLSchemaFromOpenAPI } from '../src/loadGraphQLSchemaFromOpenAPI'; -import { startServer } from './example_api8_server'; +import { loadGraphQLSchemaFromOpenAPI } from '../src/loadGraphQLSchemaFromOpenAPI.js'; +import { startServer } from './example_api8_server.js'; import { fetch } from '@whatwg-node/fetch'; import { printSchemaWithDirectives } from '@graphql-tools/utils'; import { Server } from 'http'; diff --git a/packages/loaders/openapi/tests/example_api_combined.test.ts b/packages/loaders/openapi/tests/example_api_combined.test.ts index 83bd9f2b78bf2..8b96a4a6b85b7 100644 --- a/packages/loaders/openapi/tests/example_api_combined.test.ts +++ b/packages/loaders/openapi/tests/example_api_combined.test.ts @@ -1,9 +1,9 @@ /* eslint-disable import/no-nodejs-modules */ import { execute, GraphQLSchema, parse } from 'graphql'; -import { loadGraphQLSchemaFromOpenAPI } from '../src/loadGraphQLSchemaFromOpenAPI'; +import { loadGraphQLSchemaFromOpenAPI } from '../src/loadGraphQLSchemaFromOpenAPI.js'; import { printSchemaWithDirectives } from '@graphql-tools/utils'; import { fetch } from '@whatwg-node/fetch'; -import { startServer } from './example_api_server'; +import { startServer } from './example_api_server.js'; import { Server } from 'http'; import { AddressInfo } from 'net'; diff --git a/packages/loaders/openapi/tests/explode.test.ts b/packages/loaders/openapi/tests/explode.test.ts index 09fe7452c9a1e..411dda8e50620 100644 --- a/packages/loaders/openapi/tests/explode.test.ts +++ b/packages/loaders/openapi/tests/explode.test.ts @@ -1,6 +1,6 @@ import { Response } from '@whatwg-node/fetch'; import { execute, GraphQLSchema, parse } from 'graphql'; -import loadGraphQLSchemaFromOpenAPI from '../src'; +import loadGraphQLSchemaFromOpenAPI from '../src/index.js'; describe('Explode parameter', () => { let schema: GraphQLSchema; diff --git a/packages/loaders/openapi/tests/file-upload.test.ts b/packages/loaders/openapi/tests/file-upload.test.ts index d0a28b8c11ca0..0ae854a953c71 100644 --- a/packages/loaders/openapi/tests/file-upload.test.ts +++ b/packages/loaders/openapi/tests/file-upload.test.ts @@ -2,8 +2,8 @@ import { createYoga } from 'graphql-yoga'; import { fetch, File, FormData } from '@whatwg-node/fetch'; import { graphql, GraphQLSchema } from 'graphql'; -import { startServer as startAPIServer, stopServer as stopAPIServer } from './file_upload_api_server'; -import loadGraphQLSchemaFromOpenAPI from '../src'; +import { startServer as startAPIServer, stopServer as stopAPIServer } from './file_upload_api_server.js'; +import loadGraphQLSchemaFromOpenAPI from '../src/index.js'; import { createServer, Server } from 'http'; import { AddressInfo } from 'net'; diff --git a/packages/loaders/openapi/tests/fixtures/dictionary.json b/packages/loaders/openapi/tests/fixtures/dictionary.json index 5e99fc4ae1701..a7931cf3736b3 100644 --- a/packages/loaders/openapi/tests/fixtures/dictionary.json +++ b/packages/loaders/openapi/tests/fixtures/dictionary.json @@ -67,10 +67,10 @@ "description": "A user represents a natural person", "properties": { "traits": { - "type": "object", - "additionalProperties": { - "$ref": "#/components/schemas/trait" - } + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/trait" + } } } }, diff --git a/packages/loaders/openapi/tests/government_social_work.test.ts b/packages/loaders/openapi/tests/government_social_work.test.ts index bb99a37af6b95..e91e31fd1e952 100644 --- a/packages/loaders/openapi/tests/government_social_work.test.ts +++ b/packages/loaders/openapi/tests/government_social_work.test.ts @@ -2,7 +2,7 @@ import { printSchemaWithDirectives } from '@graphql-tools/utils'; import { fetch } from '@whatwg-node/fetch'; import { GraphQLSchema, parse, validate } from 'graphql'; -import { loadGraphQLSchemaFromOpenAPI } from '../src/loadGraphQLSchemaFromOpenAPI'; +import { loadGraphQLSchemaFromOpenAPI } from '../src/loadGraphQLSchemaFromOpenAPI.js'; let createdSchema: GraphQLSchema; diff --git a/packages/loaders/openapi/tests/multiple-responses-swagger.test.ts b/packages/loaders/openapi/tests/multiple-responses-swagger.test.ts index b0f1129f62b08..6195b579332b2 100644 --- a/packages/loaders/openapi/tests/multiple-responses-swagger.test.ts +++ b/packages/loaders/openapi/tests/multiple-responses-swagger.test.ts @@ -1,5 +1,5 @@ import { printSchema } from 'graphql'; -import loadGraphQLSchemaFromOpenAPI from '../src'; +import loadGraphQLSchemaFromOpenAPI from '../src/index.js'; describe('Multiple Responses Swagger', () => { it('should create correct response types with 204 empty response', async () => { diff --git a/packages/loaders/openapi/tests/nested_objects.test.ts b/packages/loaders/openapi/tests/nested_objects.test.ts index 02833f70bd7af..3b0c349a8724a 100644 --- a/packages/loaders/openapi/tests/nested_objects.test.ts +++ b/packages/loaders/openapi/tests/nested_objects.test.ts @@ -2,9 +2,9 @@ import { printSchemaWithDirectives } from '@graphql-tools/utils'; import { fetch } from '@whatwg-node/fetch'; import getPort from 'get-port'; import { GraphQLSchema, parse, validate, execute } from 'graphql'; -import { loadGraphQLSchemaFromOpenAPI } from '../src/loadGraphQLSchemaFromOpenAPI'; +import { loadGraphQLSchemaFromOpenAPI } from '../src/loadGraphQLSchemaFromOpenAPI.js'; -import { startServer, stopServer } from './nested_objects_server'; +import { startServer, stopServer } from './nested_objects_server.js'; let createdSchema: GraphQLSchema; diff --git a/packages/loaders/openapi/tests/non_string_links.test.ts b/packages/loaders/openapi/tests/non_string_links.test.ts index e55e9bf904f7d..b109def9084e5 100644 --- a/packages/loaders/openapi/tests/non_string_links.test.ts +++ b/packages/loaders/openapi/tests/non_string_links.test.ts @@ -1,5 +1,5 @@ import { printSchemaWithDirectives } from '@graphql-tools/utils'; -import loadGraphQLSchemaFromOpenAPI from '../src'; +import loadGraphQLSchemaFromOpenAPI from '../src/index.js'; describe('Links on non-object fields', () => { it('should generate the correct schema', async () => { diff --git a/packages/loaders/openapi/tests/query-arguments.test.ts b/packages/loaders/openapi/tests/query-arguments.test.ts index dba2dac8afb8b..117b7adc52ce8 100644 --- a/packages/loaders/openapi/tests/query-arguments.test.ts +++ b/packages/loaders/openapi/tests/query-arguments.test.ts @@ -4,8 +4,8 @@ import { graphql, GraphQLSchema } from 'graphql'; import { Server } from 'http'; import { AddressInfo } from 'net'; -import { loadGraphQLSchemaFromOpenAPI } from '../src/loadGraphQLSchemaFromOpenAPI'; -import { getServer } from './query_arguments_server'; +import { loadGraphQLSchemaFromOpenAPI } from '../src/loadGraphQLSchemaFromOpenAPI.js'; +import { getServer } from './query_arguments_server.js'; let server: Server; let createdSchema: GraphQLSchema; diff --git a/packages/loaders/openapi/tests/query-params-with-post.test.ts b/packages/loaders/openapi/tests/query-params-with-post.test.ts index 1cdff34ab4b08..b1033032865ad 100644 --- a/packages/loaders/openapi/tests/query-params-with-post.test.ts +++ b/packages/loaders/openapi/tests/query-params-with-post.test.ts @@ -1,5 +1,5 @@ import { execute, parse } from 'graphql'; -import loadGraphQLSchemaFromOpenAPI from '../src'; +import loadGraphQLSchemaFromOpenAPI from '../src/index.js'; import { Request, Response } from '@whatwg-node/fetch'; describe('Query Params with POST', () => { diff --git a/packages/loaders/openapi/tests/schemas.test.ts b/packages/loaders/openapi/tests/schemas.test.ts index 74e9ec8b94c30..743400835a2a0 100644 --- a/packages/loaders/openapi/tests/schemas.test.ts +++ b/packages/loaders/openapi/tests/schemas.test.ts @@ -1,5 +1,5 @@ import { printSchemaWithDirectives } from '@graphql-tools/utils'; -import loadGraphQLSchemaFromOpenAPI, { createBundle } from '../src'; +import loadGraphQLSchemaFromOpenAPI, { createBundle } from '../src/index.js'; const schemas = { DeepL: 'deepl.json', diff --git a/packages/loaders/raml/package.json b/packages/loaders/raml/package.json index f55f50cb2a1f9..bf28c059d30f6 100644 --- a/packages/loaders/raml/package.json +++ b/packages/loaders/raml/package.json @@ -1,25 +1,33 @@ { "name": "@omnigraph/raml", "version": "0.7.44", + "type": "module", "repository": { "type": "git", "url": "Urigo/graphql-mesh", "directory": "packages/loaders/raml" }, "license": "MIT", - "main": "dist/index.js", - "module": "dist/index.mjs", + "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/index.d.ts", + "typings": "dist/typings/index.d.ts", "peerDependencies": { "graphql": "*" }, @@ -42,6 +50,6 @@ }, "sideEffects": false, "typescript": { - "definition": "dist/index.d.ts" + "definition": "dist/typings/index.d.ts" } } diff --git a/packages/loaders/raml/src/bundle.ts b/packages/loaders/raml/src/bundle.ts index 8cf5cae3f95e0..1ae35d78267b8 100644 --- a/packages/loaders/raml/src/bundle.ts +++ b/packages/loaders/raml/src/bundle.ts @@ -3,8 +3,8 @@ import { createBundle as createJSONSchemaLoaderBundle, JSONSchemaLoaderBundle as RAMLLoaderBundle, } from '@omnigraph/json-schema'; -import { getJSONSchemaOptionsFromRAMLOptions } from './getJSONSchemaOptionsFromRAMLOptions'; -import { RAMLLoaderOptions } from './types'; +import { getJSONSchemaOptionsFromRAMLOptions } from './getJSONSchemaOptionsFromRAMLOptions.js'; +import { RAMLLoaderOptions } from './types.js'; /** * Creates a bundle by downloading and resolving the internal references once diff --git a/packages/loaders/raml/src/getJSONSchemaOptionsFromRAMLOptions.ts b/packages/loaders/raml/src/getJSONSchemaOptionsFromRAMLOptions.ts index cd682fafd9822..315f92751b8ca 100644 --- a/packages/loaders/raml/src/getJSONSchemaOptionsFromRAMLOptions.ts +++ b/packages/loaders/raml/src/getJSONSchemaOptionsFromRAMLOptions.ts @@ -4,9 +4,9 @@ import { getAbsolutePath, getCwd, JSONSchemaObject } from 'json-machete'; import { api10, loadApi } from '@ardatan/raml-1-parser'; import { fetch as crossUndiciFetch } from '@whatwg-node/fetch'; import toJsonSchema from 'to-json-schema'; -import { RAMLLoaderOptions, RAMLLoaderSelectQueryOrMutationFieldConfig } from './types'; +import { RAMLLoaderOptions, RAMLLoaderSelectQueryOrMutationFieldConfig } from './types.js'; import { asArray } from '@graphql-tools/utils'; -import { getFieldNameFromPath } from './utils'; +import { getFieldNameFromPath } from './utils.js'; import { getInterpolatedHeadersFactory } from '@graphql-mesh/string-interpolation'; import { process } from '@graphql-mesh/cross-helpers'; diff --git a/packages/loaders/raml/src/index.ts b/packages/loaders/raml/src/index.ts index 5881eebad877b..eafe16e2489a2 100644 --- a/packages/loaders/raml/src/index.ts +++ b/packages/loaders/raml/src/index.ts @@ -1,4 +1,4 @@ -export { loadGraphQLSchemaFromRAML as default } from './loadGraphQLSchemaFromRAML'; -export { getJSONSchemaOptionsFromRAMLOptions } from './getJSONSchemaOptionsFromRAMLOptions'; -export { RAMLLoaderOptions } from './types'; -export * from './bundle'; +export { loadGraphQLSchemaFromRAML as default } from './loadGraphQLSchemaFromRAML.js'; +export { getJSONSchemaOptionsFromRAMLOptions } from './getJSONSchemaOptionsFromRAMLOptions.js'; +export { RAMLLoaderOptions } from './types.js'; +export * from './bundle.js'; diff --git a/packages/loaders/raml/src/loadGraphQLSchemaFromRAML.ts b/packages/loaders/raml/src/loadGraphQLSchemaFromRAML.ts index b2e7c55ee360f..dafc24dfc9dbe 100644 --- a/packages/loaders/raml/src/loadGraphQLSchemaFromRAML.ts +++ b/packages/loaders/raml/src/loadGraphQLSchemaFromRAML.ts @@ -1,6 +1,6 @@ import { loadGraphQLSchemaFromJSONSchemas } from '@omnigraph/json-schema'; -import { getJSONSchemaOptionsFromRAMLOptions } from './getJSONSchemaOptionsFromRAMLOptions'; -import { RAMLLoaderOptions } from './types'; +import { getJSONSchemaOptionsFromRAMLOptions } from './getJSONSchemaOptionsFromRAMLOptions.js'; +import { RAMLLoaderOptions } from './types.js'; /** * Creates a local GraphQLSchema instance from a RAML API Document. diff --git a/packages/loaders/soap/package.json b/packages/loaders/soap/package.json index 8cbf7bea4d6b7..052fe3b2248e3 100644 --- a/packages/loaders/soap/package.json +++ b/packages/loaders/soap/package.json @@ -1,20 +1,28 @@ { "name": "@omnigraph/soap", "version": "0.2.3", + "type": "module", "license": "MIT", - "main": "dist/index.js", - "module": "dist/index.mjs", + "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/index.d.ts", + "typings": "dist/typings/index.d.ts", "peerDependencies": { "graphql": "*" }, @@ -35,6 +43,6 @@ }, "sideEffects": false, "typescript": { - "definition": "dist/index.d.ts" + "definition": "dist/typings/index.d.ts" } } diff --git a/packages/loaders/soap/src/SOAPLoader.ts b/packages/loaders/soap/src/SOAPLoader.ts index e269f4d244f35..9b119c412d509 100644 --- a/packages/loaders/soap/src/SOAPLoader.ts +++ b/packages/loaders/soap/src/SOAPLoader.ts @@ -23,7 +23,7 @@ import { XSSimpleType, XSElement, XSDObject, -} from './types'; +} from './types.js'; import { GraphQLURL, GraphQLByte, @@ -47,7 +47,7 @@ import { GraphQLString, } from 'graphql'; import { MeshFetch } from '@graphql-mesh/types'; -import { PARSE_XML_OPTIONS, SoapAnnotations } from './utils'; +import { PARSE_XML_OPTIONS, SoapAnnotations } from './utils.js'; export interface SOAPLoaderOptions { fetch: MeshFetch; diff --git a/packages/loaders/soap/src/executor.ts b/packages/loaders/soap/src/executor.ts index 5029b7afaa2df..3218cafb39070 100644 --- a/packages/loaders/soap/src/executor.ts +++ b/packages/loaders/soap/src/executor.ts @@ -9,7 +9,7 @@ import { } from 'graphql'; import { parse as parseXML, j2xParser as JSONToXMLConverter } from 'fast-xml-parser'; import { MeshFetch } from '@graphql-mesh/types'; -import { PARSE_XML_OPTIONS, SoapAnnotations } from './utils'; +import { PARSE_XML_OPTIONS, SoapAnnotations } from './utils.js'; import { Executor, getDirective, getRootTypes } from '@graphql-tools/utils'; function isOriginallyListType(type: GraphQLOutputType): boolean { diff --git a/packages/loaders/soap/src/index.ts b/packages/loaders/soap/src/index.ts index ac98cd948c46b..8eb32881821a4 100644 --- a/packages/loaders/soap/src/index.ts +++ b/packages/loaders/soap/src/index.ts @@ -1,3 +1,3 @@ -export * from './SOAPLoader'; -export * from './types'; -export * from './executor'; +export * from './SOAPLoader.js'; +export * from './types.js'; +export * from './executor.js'; diff --git a/packages/loaders/soap/test/examples.test.ts b/packages/loaders/soap/test/examples.test.ts index d951e9180e4be..fb58e415ea4fa 100644 --- a/packages/loaders/soap/test/examples.test.ts +++ b/packages/loaders/soap/test/examples.test.ts @@ -1,5 +1,5 @@ /* eslint-disable import/no-nodejs-modules */ -import { SOAPLoader } from '../src'; +import { SOAPLoader } from '../src/index.js'; import { promises } from 'fs'; import { printSchema } from 'graphql'; import { join } from 'path'; diff --git a/packages/loaders/soap/test/soap.test.ts b/packages/loaders/soap/test/soap.test.ts index 6bbc4002e7f9c..8277875ccd6fb 100644 --- a/packages/loaders/soap/test/soap.test.ts +++ b/packages/loaders/soap/test/soap.test.ts @@ -1,8 +1,8 @@ -import { SOAPLoader } from '../src/SOAPLoader'; +import { SOAPLoader } from '../src/SOAPLoader.js'; import { fetch } from '@whatwg-node/fetch'; import { parse } from 'graphql'; -import { createExecutorFromSchemaAST } from '../src/executor'; -import { getDocumentNodeFromSchema, printSchemaWithDirectives } from '@graphql-tools/utils'; +import { createExecutorFromSchemaAST } from '../src/executor.js'; +import { printSchemaWithDirectives } from '@graphql-tools/utils'; describe('SOAP Loader', () => { it('should generate the schema correctly', async () => { @@ -19,7 +19,7 @@ describe('SOAP Loader', () => { }); await soapLoader.fetchWSDL('https://www.crcind.com/csp/samples/SOAP.Demo.cls?WSDL'); const schema = soapLoader.buildSchema(); - const executor = createExecutorFromSchemaAST(getDocumentNodeFromSchema(schema), fetch); + const executor = createExecutorFromSchemaAST(schema, fetch); const result: any = await executor({ document: parse(/* GraphQL */ ` mutation AddInteger { diff --git a/packages/mergers/bare/package.json b/packages/mergers/bare/package.json index 980d1ce920f56..dec3ff4f7a5f3 100644 --- a/packages/mergers/bare/package.json +++ b/packages/mergers/bare/package.json @@ -1,25 +1,33 @@ { "name": "@graphql-mesh/merger-bare", "version": "0.15.51", + "type": "module", "repository": { "type": "git", "url": "Urigo/graphql-mesh", "directory": "packages/mergers/bare" }, "license": "MIT", - "main": "dist/index.js", - "module": "dist/index.mjs", + "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/index.d.ts", + "typings": "dist/typings/index.d.ts", "peerDependencies": { "graphql": "*" }, @@ -37,6 +45,6 @@ }, "sideEffects": false, "typescript": { - "definition": "dist/index.d.ts" + "definition": "dist/typings/index.d.ts" } } diff --git a/packages/mergers/federation/package.json b/packages/mergers/federation/package.json index d5ebb96833c39..311af89d0700d 100644 --- a/packages/mergers/federation/package.json +++ b/packages/mergers/federation/package.json @@ -1,25 +1,33 @@ { "name": "@graphql-mesh/merger-federation", "version": "0.12.49", + "type": "module", "repository": { "type": "git", "url": "Urigo/graphql-mesh", "directory": "packages/mergers/federation" }, "license": "MIT", - "main": "dist/index.js", - "module": "dist/index.mjs", + "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/index.d.ts", + "typings": "dist/typings/index.d.ts", "peerDependencies": { "graphql": "*" }, @@ -40,6 +48,6 @@ }, "sideEffects": false, "typescript": { - "definition": "dist/index.d.ts" + "definition": "dist/typings/index.d.ts" } } diff --git a/packages/mergers/stitching/package.json b/packages/mergers/stitching/package.json index e8307050d66e3..0217ba01f175d 100644 --- a/packages/mergers/stitching/package.json +++ b/packages/mergers/stitching/package.json @@ -1,25 +1,33 @@ { "name": "@graphql-mesh/merger-stitching", "version": "0.17.11", + "type": "module", "repository": { "type": "git", "url": "Urigo/graphql-mesh", "directory": "packages/mergers/stitching" }, "license": "MIT", - "main": "dist/index.js", - "module": "dist/index.mjs", + "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/index.d.ts", + "typings": "dist/typings/index.d.ts", "peerDependencies": { "graphql": "*" }, @@ -40,6 +48,6 @@ }, "sideEffects": false, "typescript": { - "definition": "dist/index.d.ts" + "definition": "dist/typings/index.d.ts" } } diff --git a/packages/plugins/deduplicate-request/package.json b/packages/plugins/deduplicate-request/package.json index 6e5a36aacbaef..bf86d50481a2a 100644 --- a/packages/plugins/deduplicate-request/package.json +++ b/packages/plugins/deduplicate-request/package.json @@ -1,25 +1,33 @@ { "name": "@graphql-mesh/plugin-deduplicate-request", "version": "0.0.13", + "type": "module", "repository": { "type": "git", "url": "Urigo/graphql-mesh", "directory": "packages/plugins/deduplicate-request" }, "license": "MIT", - "main": "dist/index.js", - "module": "dist/index.mjs", + "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/index.d.ts", + "typings": "dist/typings/index.d.ts", "peerDependencies": { "graphql": "*" }, @@ -35,6 +43,6 @@ }, "sideEffects": false, "typescript": { - "definition": "dist/index.d.ts" + "definition": "dist/typings/index.d.ts" } } diff --git a/packages/plugins/deduplicate-request/tests/useDeduplicateRequest.test.ts b/packages/plugins/deduplicate-request/tests/useDeduplicateRequest.test.ts index e0b4d3d036e00..213806fb3d9a4 100644 --- a/packages/plugins/deduplicate-request/tests/useDeduplicateRequest.test.ts +++ b/packages/plugins/deduplicate-request/tests/useDeduplicateRequest.test.ts @@ -1,6 +1,6 @@ // eslint-disable-next-line import/no-extraneous-dependencies -import { wrapFetchWithPlugins } from '../../../runtime/src/get-mesh'; -import useDeduplicateRequest from '../src/index'; +import { wrapFetchWithPlugins } from '../../../runtime/src/get-mesh.js'; +import useDeduplicateRequest from '../src/index.js'; // eslint-disable-next-line import/no-nodejs-modules import http from 'http'; import { fetch as originalFetch } from '@whatwg-node/fetch'; diff --git a/packages/plugins/hive/package.json b/packages/plugins/hive/package.json index 395ae3161621f..1639fdf565acc 100644 --- a/packages/plugins/hive/package.json +++ b/packages/plugins/hive/package.json @@ -1,25 +1,33 @@ { "name": "@graphql-mesh/plugin-hive", "version": "0.0.4", + "type": "module", "repository": { "type": "git", "url": "Urigo/graphql-mesh", "directory": "packages/plugins/hive" }, "license": "MIT", - "main": "dist/index.js", - "module": "dist/index.mjs", + "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/index.d.ts", + "typings": "dist/typings/index.d.ts", "peerDependencies": { "graphql": "*" }, @@ -39,6 +47,6 @@ }, "sideEffects": false, "typescript": { - "definition": "dist/index.d.ts" + "definition": "dist/typings/index.d.ts" } } diff --git a/packages/plugins/http-cache/package.json b/packages/plugins/http-cache/package.json index efa060d61b5be..cec3b1bbc5a0e 100644 --- a/packages/plugins/http-cache/package.json +++ b/packages/plugins/http-cache/package.json @@ -1,25 +1,33 @@ { "name": "@graphql-mesh/plugin-http-cache", "version": "0.0.11", + "type": "module", "repository": { "type": "git", "url": "Urigo/graphql-mesh", "directory": "packages/plugins/http-cache" }, "license": "MIT", - "main": "dist/index.js", - "module": "dist/index.mjs", + "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/index.d.ts", + "typings": "dist/typings/index.d.ts", "peerDependencies": { "graphql": "*" }, @@ -39,6 +47,6 @@ }, "sideEffects": false, "typescript": { - "definition": "dist/index.d.ts" + "definition": "dist/typings/index.d.ts" } } diff --git a/packages/plugins/http-details-extensions/package.json b/packages/plugins/http-details-extensions/package.json index 2a0880ec8f2ff..d98d6bfe95c63 100644 --- a/packages/plugins/http-details-extensions/package.json +++ b/packages/plugins/http-details-extensions/package.json @@ -1,25 +1,33 @@ { "name": "@graphql-mesh/plugin-http-details-extensions", "version": "0.0.12", + "type": "module", "repository": { "type": "git", "url": "Urigo/graphql-mesh", "directory": "packages/plugins/http-details-extensions" }, "license": "MIT", - "main": "dist/index.js", - "module": "dist/index.mjs", + "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/index.d.ts", + "typings": "dist/typings/index.d.ts", "peerDependencies": { "graphql": "*" }, @@ -36,6 +44,6 @@ }, "sideEffects": false, "typescript": { - "definition": "dist/index.d.ts" + "definition": "dist/typings/index.d.ts" } } diff --git a/packages/plugins/live-query/package.json b/packages/plugins/live-query/package.json index 807e73297ea7e..237e60232d0a1 100644 --- a/packages/plugins/live-query/package.json +++ b/packages/plugins/live-query/package.json @@ -1,25 +1,33 @@ { "name": "@graphql-mesh/plugin-live-query", "version": "0.1.49", + "type": "module", "repository": { "type": "git", "url": "Urigo/graphql-mesh", "directory": "packages/plugins/live-query" }, "license": "MIT", - "main": "dist/index.js", - "module": "dist/index.mjs", + "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/index.d.ts", + "typings": "dist/typings/index.d.ts", "peerDependencies": { "graphql": "*" }, @@ -38,6 +46,6 @@ }, "sideEffects": false, "typescript": { - "definition": "dist/index.d.ts" + "definition": "dist/typings/index.d.ts" } } diff --git a/packages/plugins/live-query/src/index.ts b/packages/plugins/live-query/src/index.ts index 6412bc7815b59..a8c510a2c45db 100644 --- a/packages/plugins/live-query/src/index.ts +++ b/packages/plugins/live-query/src/index.ts @@ -2,7 +2,7 @@ import { useLiveQuery } from '@envelop/live-query'; import { MeshPluginOptions, YamlConfig } from '@graphql-mesh/types'; import { defaultResourceIdentifierNormalizer, InMemoryLiveQueryStore } from '@n1ru4l/in-memory-live-query-store'; import { Plugin } from '@envelop/core'; -import { useInvalidateByResult } from './useInvalidateByResult'; +import { useInvalidateByResult } from './useInvalidateByResult.js'; import { process } from '@graphql-mesh/cross-helpers'; import { stringInterpolator } from '@graphql-mesh/string-interpolation'; diff --git a/packages/plugins/mock/package.json b/packages/plugins/mock/package.json index 2fd534b789575..850256738da71 100644 --- a/packages/plugins/mock/package.json +++ b/packages/plugins/mock/package.json @@ -1,25 +1,33 @@ { "name": "@graphql-mesh/plugin-mock", "version": "0.0.40", + "type": "module", "repository": { "type": "git", "url": "Urigo/graphql-mesh", "directory": "packages/plugins/mock" }, "license": "MIT", - "main": "dist/index.js", - "module": "dist/index.mjs", + "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/index.d.ts", + "typings": "dist/typings/index.d.ts", "peerDependencies": { "graphql": "*" }, @@ -46,6 +54,6 @@ }, "sideEffects": false, "typescript": { - "definition": "dist/index.d.ts" + "definition": "dist/typings/index.d.ts" } } diff --git a/packages/plugins/mock/tests/mocking.spec.ts b/packages/plugins/mock/tests/mocking.spec.ts index fb47e784586ce..88ffdbe575a9b 100644 --- a/packages/plugins/mock/tests/mocking.spec.ts +++ b/packages/plugins/mock/tests/mocking.spec.ts @@ -4,7 +4,7 @@ import { buildSchema, execute, parse, specifiedRules, subscribe, validate } from import InMemoryLRUCache from '@graphql-mesh/cache-localforage'; import { DefaultLogger, PubSub } from '@graphql-mesh/utils'; import { envelop, useSchema, useEngine } from '@envelop/core'; -import useMock from '../src'; +import useMock from '../src/index.js'; describe('mocking', () => { let cache: InMemoryLRUCache; diff --git a/packages/plugins/newrelic/package.json b/packages/plugins/newrelic/package.json index ae08b185296cd..700b150efee2f 100644 --- a/packages/plugins/newrelic/package.json +++ b/packages/plugins/newrelic/package.json @@ -1,25 +1,33 @@ { "name": "@graphql-mesh/plugin-newrelic", "version": "0.2.32", + "type": "module", "repository": { "type": "git", "url": "Urigo/graphql-mesh", "directory": "packages/plugins/newrelic" }, "license": "MIT", - "main": "dist/index.js", - "module": "dist/index.mjs", + "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/index.d.ts", + "typings": "dist/typings/index.d.ts", "peerDependencies": { "graphql": "*", "newrelic": "^7 || ^8.0.0" @@ -43,6 +51,6 @@ }, "sideEffects": false, "typescript": { - "definition": "dist/index.d.ts" + "definition": "dist/typings/index.d.ts" } } diff --git a/packages/plugins/operation-field-permissions/package.json b/packages/plugins/operation-field-permissions/package.json index ae11f0973b704..8778d1c8be8d0 100644 --- a/packages/plugins/operation-field-permissions/package.json +++ b/packages/plugins/operation-field-permissions/package.json @@ -1,25 +1,33 @@ { "name": "@graphql-mesh/plugin-operation-field-permissions", "version": "0.0.24", + "type": "module", "repository": { "type": "git", "url": "Urigo/graphql-mesh", "directory": "packages/plugins/operation-field-permissions" }, "license": "MIT", - "main": "dist/index.js", - "module": "dist/index.mjs", + "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/index.d.ts", + "typings": "dist/typings/index.d.ts", "peerDependencies": { "graphql": "*" }, @@ -35,6 +43,6 @@ }, "sideEffects": false, "typescript": { - "definition": "dist/index.d.ts" + "definition": "dist/typings/index.d.ts" } } diff --git a/packages/plugins/prometheus/package.json b/packages/plugins/prometheus/package.json index 49e3ebe3c7573..7e223536df889 100644 --- a/packages/plugins/prometheus/package.json +++ b/packages/plugins/prometheus/package.json @@ -1,25 +1,33 @@ { "name": "@graphql-mesh/plugin-prometheus", "version": "0.2.15", + "type": "module", "repository": { "type": "git", "url": "Urigo/graphql-mesh", "directory": "packages/plugins/prometheus" }, "license": "MIT", - "main": "dist/index.js", - "module": "dist/index.mjs", + "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/index.d.ts", + "typings": "dist/typings/index.d.ts", "peerDependencies": { "graphql": "*", "graphql-yoga": "3.1.1", @@ -40,6 +48,6 @@ }, "sideEffects": false, "typescript": { - "definition": "dist/index.d.ts" + "definition": "dist/typings/index.d.ts" } } diff --git a/packages/plugins/rate-limit/package.json b/packages/plugins/rate-limit/package.json index 04f0d95dcdd9b..81d8da9b10a8d 100644 --- a/packages/plugins/rate-limit/package.json +++ b/packages/plugins/rate-limit/package.json @@ -1,25 +1,33 @@ { "name": "@graphql-mesh/plugin-rate-limit", "version": "0.1.2", + "type": "module", "repository": { "type": "git", "url": "Urigo/graphql-mesh", "directory": "packages/plugins/response-cache" }, "license": "MIT", - "main": "dist/index.js", - "module": "dist/index.mjs", + "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/index.d.ts", + "typings": "dist/typings/index.d.ts", "peerDependencies": { "graphql": "*" }, @@ -40,6 +48,6 @@ }, "sideEffects": false, "typescript": { - "definition": "dist/index.d.ts" + "definition": "dist/typings/index.d.ts" } } diff --git a/packages/plugins/rate-limit/tests/rate-limit.spec.ts b/packages/plugins/rate-limit/tests/rate-limit.spec.ts index eae1c9f5b0a5f..832e370c9bf98 100644 --- a/packages/plugins/rate-limit/tests/rate-limit.spec.ts +++ b/packages/plugins/rate-limit/tests/rate-limit.spec.ts @@ -1,7 +1,7 @@ /* eslint-disable import/no-extraneous-dependencies */ import { defaultImportFn, DefaultLogger, PubSub } from '@graphql-mesh/utils'; import InMemoryLRUCache from '@graphql-mesh/cache-localforage'; -import useMeshRateLimit from '../src'; +import useMeshRateLimit from '../src/index.js'; import { makeExecutableSchema } from '@graphql-tools/schema'; import { envelop, useSchema, useEngine } from '@envelop/core'; import { Logger } from '@graphql-mesh/types'; diff --git a/packages/plugins/response-cache/package.json b/packages/plugins/response-cache/package.json index f2638968e6b95..7cbfe7b584476 100644 --- a/packages/plugins/response-cache/package.json +++ b/packages/plugins/response-cache/package.json @@ -1,25 +1,33 @@ { "name": "@graphql-mesh/plugin-response-cache", "version": "0.1.54", + "type": "module", "repository": { "type": "git", "url": "Urigo/graphql-mesh", "directory": "packages/plugins/response-cache" }, "license": "MIT", - "main": "dist/index.js", - "module": "dist/index.mjs", + "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/index.d.ts", + "typings": "dist/typings/index.d.ts", "peerDependencies": { "graphql": "*" }, @@ -38,6 +46,6 @@ }, "sideEffects": false, "typescript": { - "definition": "dist/index.d.ts" + "definition": "dist/typings/index.d.ts" } } diff --git a/packages/plugins/snapshot/package.json b/packages/plugins/snapshot/package.json index 5b3f4d1141a0d..02ea94dcb08ca 100644 --- a/packages/plugins/snapshot/package.json +++ b/packages/plugins/snapshot/package.json @@ -1,25 +1,33 @@ { "name": "@graphql-mesh/plugin-snapshot", "version": "0.0.14", + "type": "module", "repository": { "type": "git", "url": "Urigo/graphql-mesh", "directory": "packages/plugins/snapshot" }, "license": "MIT", - "main": "dist/index.js", - "module": "dist/index.mjs", + "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/index.d.ts", + "typings": "dist/typings/index.d.ts", "peerDependencies": { "graphql": "*" }, @@ -38,6 +46,6 @@ }, "sideEffects": false, "typescript": { - "definition": "dist/index.d.ts" + "definition": "dist/typings/index.d.ts" } } diff --git a/packages/plugins/statsd/package.json b/packages/plugins/statsd/package.json index 3dec4aebe682c..a99736368af9b 100644 --- a/packages/plugins/statsd/package.json +++ b/packages/plugins/statsd/package.json @@ -1,25 +1,33 @@ { "name": "@graphql-mesh/plugin-statsd", "version": "0.0.33", + "type": "module", "repository": { "type": "git", "url": "Urigo/graphql-mesh", "directory": "packages/plugins/statsd" }, "license": "MIT", - "main": "dist/index.js", - "module": "dist/index.mjs", + "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/index.d.ts", + "typings": "dist/typings/index.d.ts", "peerDependencies": { "graphql": "*", "hot-shots": "^8.0.0 || ^9.0.0" @@ -39,6 +47,6 @@ }, "sideEffects": false, "typescript": { - "definition": "dist/index.d.ts" + "definition": "dist/typings/index.d.ts" } } diff --git a/packages/runtime/package.json b/packages/runtime/package.json index b91704bde7efd..576113eb21305 100644 --- a/packages/runtime/package.json +++ b/packages/runtime/package.json @@ -1,25 +1,33 @@ { "name": "@graphql-mesh/runtime", "version": "0.44.37", + "type": "module", "repository": { "type": "git", "url": "Urigo/graphql-mesh", "directory": "packages/runtime" }, "license": "MIT", - "main": "dist/index.js", - "module": "dist/index.mjs", + "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/index.d.ts", + "typings": "dist/typings/index.d.ts", "peerDependencies": { "graphql": "*" }, @@ -47,6 +55,6 @@ }, "sideEffects": false, "typescript": { - "definition": "dist/index.d.ts" + "definition": "dist/typings/index.d.ts" } } diff --git a/packages/runtime/src/get-mesh.ts b/packages/runtime/src/get-mesh.ts index c39e1df785b43..c4fdab5f8d188 100644 --- a/packages/runtime/src/get-mesh.ts +++ b/packages/runtime/src/get-mesh.ts @@ -7,7 +7,7 @@ import { validate, specifiedRules, } from 'graphql'; -import { ExecuteMeshFn, GetMeshOptions, MeshExecutor, SubscribeMeshFn } from './types'; +import { ExecuteMeshFn, GetMeshOptions, MeshExecutor, SubscribeMeshFn } from './types.js'; import { MeshPubSub, KeyValueCache, @@ -22,7 +22,7 @@ import { OnDelegateHook, } from '@graphql-mesh/types'; -import { MESH_CONTEXT_SYMBOL } from './constants'; +import { MESH_CONTEXT_SYMBOL } from './constants.js'; import { applySchemaTransforms, groupTransforms, @@ -44,8 +44,8 @@ import { } from '@graphql-tools/utils'; import { envelop, Plugin, useEngine, useExtendContext } from '@envelop/core'; import { OneOfInputObjectsRule, useExtendedValidation } from '@envelop/extended-validation'; -import { getInContextSDK } from './in-context-sdk'; -import { useSubschema } from './useSubschema'; +import { getInContextSDK } from './in-context-sdk.js'; +import { useSubschema } from './useSubschema.js'; import { fetch as defaultFetchFn } from '@whatwg-node/fetch'; type SdkRequester = (document: DocumentNode, variables?: any, operationContext?: any) => any; diff --git a/packages/runtime/src/in-context-sdk.ts b/packages/runtime/src/in-context-sdk.ts index 84a0b81352197..c4326703ef366 100644 --- a/packages/runtime/src/in-context-sdk.ts +++ b/packages/runtime/src/in-context-sdk.ts @@ -28,7 +28,7 @@ import { OperationDefinitionNode, DocumentNode, } from 'graphql'; -import { MESH_API_CONTEXT_SYMBOL } from './constants'; +import { MESH_API_CONTEXT_SYMBOL } from './constants.js'; export async function getInContextSDK( unifiedSchema: GraphQLSchema, diff --git a/packages/runtime/src/index.ts b/packages/runtime/src/index.ts index ae635f433703d..1275494b850d4 100644 --- a/packages/runtime/src/index.ts +++ b/packages/runtime/src/index.ts @@ -1,3 +1,3 @@ -export * from './get-mesh'; -export * from './types'; -export * from './useSubschema'; +export * from './get-mesh.js'; +export * from './types.js'; +export * from './useSubschema.js'; diff --git a/packages/runtime/src/types.ts b/packages/runtime/src/types.ts index 4cbe112568279..edd81bdc54643 100644 --- a/packages/runtime/src/types.ts +++ b/packages/runtime/src/types.ts @@ -11,8 +11,8 @@ import { } from '@graphql-mesh/types'; import { DocumentNode, ExecutionResult } from 'graphql'; import { IResolvers, Source } from '@graphql-tools/utils'; -import { MESH_CONTEXT_SYMBOL } from './constants'; -import { MeshInstance } from './get-mesh'; +import { MESH_CONTEXT_SYMBOL } from './constants.js'; +import { MeshInstance } from './get-mesh.js'; import { envelop } from '@envelop/core'; export type GetMeshOptions = { diff --git a/packages/runtime/test/getMesh.test.ts b/packages/runtime/test/getMesh.test.ts index 7edfae93290a8..42b5eb4a45325 100644 --- a/packages/runtime/test/getMesh.test.ts +++ b/packages/runtime/test/getMesh.test.ts @@ -7,8 +7,8 @@ import { defaultImportFn, DefaultLogger, PubSub } from '@graphql-mesh/utils'; import { makeExecutableSchema } from '@graphql-tools/schema'; import { printSchemaWithDirectives } from '@graphql-tools/utils'; import { parse } from 'graphql'; -import { getMesh } from '../src/get-mesh'; -import { MeshResolvedSource } from '../src/types'; +import { getMesh } from '../src/get-mesh.js'; +import { MeshResolvedSource } from '../src/types.js'; describe('getMesh', () => { const baseDir = __dirname; diff --git a/packages/runtime/test/useSubschema.test.ts b/packages/runtime/test/useSubschema.test.ts index 29a5a5cecbe57..dc5e8631fd6b2 100644 --- a/packages/runtime/test/useSubschema.test.ts +++ b/packages/runtime/test/useSubschema.test.ts @@ -14,7 +14,7 @@ import { subscribe, specifiedRules, } from 'graphql'; -import { useSubschema } from '../src/useSubschema'; +import { useSubschema } from '../src/useSubschema.js'; describe('useSubschema', () => { const sdl = /* GraphQL */ ` diff --git a/packages/store/package.json b/packages/store/package.json index 344125c590baf..2bceca24e2989 100644 --- a/packages/store/package.json +++ b/packages/store/package.json @@ -1,25 +1,33 @@ { "name": "@graphql-mesh/store", "version": "0.8.65", + "type": "module", "repository": { "type": "git", "url": "Urigo/graphql-mesh", "directory": "packages/store" }, "license": "MIT", - "main": "dist/index.js", - "module": "dist/index.mjs", + "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/index.d.ts", + "typings": "dist/typings/index.d.ts", "peerDependencies": { "graphql": "*" }, @@ -40,6 +48,6 @@ }, "sideEffects": false, "typescript": { - "definition": "dist/index.d.ts" + "definition": "dist/typings/index.d.ts" } } diff --git a/packages/store/test/mesh-store.spec.ts b/packages/store/test/mesh-store.spec.ts index d4d78571d5fbd..959cb6883b051 100644 --- a/packages/store/test/mesh-store.spec.ts +++ b/packages/store/test/mesh-store.spec.ts @@ -4,7 +4,7 @@ import { MeshStore, PredefinedProxyOptions, ReadonlyStoreError, -} from '../src'; +} from '../src/index.js'; describe('MeshStore and storage', () => { describe('MeshStore', () => { @@ -54,6 +54,8 @@ describe('MeshStore and storage', () => { throw new Error('Validation failed! you changed 1 to 2!'); } }, + fromJSON: value => value, + toJSON: value => value, }); try { diff --git a/packages/string-interpolation/package.json b/packages/string-interpolation/package.json index 701d4218b51de..02e0682a6cb8d 100644 --- a/packages/string-interpolation/package.json +++ b/packages/string-interpolation/package.json @@ -1,40 +1,49 @@ { "name": "@graphql-mesh/string-interpolation", "version": "0.3.3", - "license": "MIT", + "type": "module", "description": "Dynamic string manipulation", - "sideEffects": false, - "main": "dist/index.js", - "module": "dist/index.mjs", - "typings": "dist/index.d.ts", - "typescript": { - "definition": "dist/index.d.ts" + "repository": { + "type": "git", + "url": "Urigo/graphql-mesh", + "directory": "packages/string-interpolation" }, + "author": "Arda TANRIKULU ", + "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": { "graphql": "*" }, "dependencies": { - "json-pointer": "0.6.2", "dayjs": "1.11.6", + "json-pointer": "0.6.2", "lodash.get": "4.4.2" }, - "author": "Arda TANRIKULU ", - "repository": { - "type": "git", - "url": "Urigo/graphql-mesh", - "directory": "packages/string-interpolation" - }, "publishConfig": { - "access": "public" + "access": "public", + "directory": "dist" + }, + "sideEffects": false, + "typescript": { + "definition": "dist/typings/index.d.ts" } } diff --git a/packages/string-interpolation/src/index.ts b/packages/string-interpolation/src/index.ts index 0a84e6485d6dd..a50352561872c 100644 --- a/packages/string-interpolation/src/index.ts +++ b/packages/string-interpolation/src/index.ts @@ -1,4 +1,4 @@ -import { Interpolator } from './interpolator'; +import { Interpolator } from './interpolator.js'; import dayjs from 'dayjs'; const hashCode = (s: string) => s.split('').reduce((a, b) => ((a << 5) - a + b.charCodeAt(0)) | 0, 0); @@ -27,4 +27,4 @@ stringInterpolator.registerModifier('base64', (value: any) => { } }); -export * from './resolver-data-factory'; +export * from './resolver-data-factory.js'; diff --git a/packages/string-interpolation/src/resolver-data-factory.ts b/packages/string-interpolation/src/resolver-data-factory.ts index 72d5accaaea47..a425dc891dbf3 100644 --- a/packages/string-interpolation/src/resolver-data-factory.ts +++ b/packages/string-interpolation/src/resolver-data-factory.ts @@ -1,4 +1,4 @@ -import { stringInterpolator } from './index'; +import { stringInterpolator } from './index.js'; import { GraphQLInputType, GraphQLResolveInfo } from 'graphql'; export type ResolverData = { diff --git a/packages/transforms/cache/package.json b/packages/transforms/cache/package.json index ffbff68e071fb..7e2e3771f04fe 100644 --- a/packages/transforms/cache/package.json +++ b/packages/transforms/cache/package.json @@ -1,25 +1,33 @@ { "name": "@graphql-mesh/transform-cache", "version": "0.12.67", + "type": "module", "repository": { "type": "git", "url": "Urigo/graphql-mesh", "directory": "packages/transforms/cache" }, "license": "MIT", - "main": "dist/index.js", - "module": "dist/index.mjs", + "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/index.d.ts", + "typings": "dist/typings/index.d.ts", "peerDependencies": { "graphql": "*" }, @@ -43,6 +51,6 @@ }, "sideEffects": false, "typescript": { - "definition": "dist/index.d.ts" + "definition": "dist/typings/index.d.ts" } } diff --git a/packages/transforms/cache/src/index.ts b/packages/transforms/cache/src/index.ts index 85cb88517062c..4573373bb991f 100644 --- a/packages/transforms/cache/src/index.ts +++ b/packages/transforms/cache/src/index.ts @@ -1,7 +1,7 @@ /* eslint-disable @typescript-eslint/no-floating-promises */ import { MeshTransform, MeshTransformOptions, YamlConfig } from '@graphql-mesh/types'; import { ResolversComposerMapping, composeResolvers } from '@graphql-tools/resolvers-composition'; -import { computeCacheKey } from './compute-cache-key'; +import { computeCacheKey } from './compute-cache-key.js'; import { extractResolvers } from '@graphql-mesh/utils'; import { addResolversToSchema } from '@graphql-tools/schema'; import { GraphQLSchema } from 'graphql'; diff --git a/packages/transforms/cache/test/cache.spec.ts b/packages/transforms/cache/test/cache.spec.ts index 9754993d4df22..cce9101458c3c 100644 --- a/packages/transforms/cache/test/cache.spec.ts +++ b/packages/transforms/cache/test/cache.spec.ts @@ -1,4 +1,10 @@ -import { YamlConfig, MeshPubSub, KeyValueCache, MeshTransformOptions, ImportFn } from '@graphql-mesh/types'; +import { + YamlConfig, + MeshPubSub, + KeyValueCache, + MeshTransformOptions, + ImportFn, +} from '@graphql-mesh/types'; import LocalforageCache from '@graphql-mesh/cache-localforage'; import { addResolversToSchema, makeExecutableSchema } from '@graphql-tools/schema'; import { @@ -11,9 +17,9 @@ import { OperationDefinitionNode, FieldNode, } from 'graphql'; -import CacheTransform from '../src'; -import { computeCacheKey } from '../src/compute-cache-key'; -import { PubSub } from '@graphql-mesh/utils'; +import CacheTransform from '../src/index.js'; +import { computeCacheKey } from '../src/compute-cache-key.js'; +import { DefaultLogger, PubSub } from '@graphql-mesh/utils'; import dayjs from 'dayjs'; import { hashObject } from '@graphql-mesh/string-interpolation'; @@ -160,7 +166,9 @@ describe('cache', () => { describe('Resolvers Composition', () => { it('should replace resolvers correctly with a specific type and field', async () => { - expect(schema.getQueryType()?.getFields().user.resolve.name).toBe(spies.Query.user.bind(null).name); + expect(schema.getQueryType()?.getFields().user.resolve.name).toBe( + spies.Query.user.bind(null).name, + ); const transform = new CacheTransform({ apiName: 'test', @@ -173,16 +181,25 @@ describe('cache', () => { ], pubsub, baseDir, + logger: new DefaultLogger(), }); const modifiedSchema = transform.transformSchema(schema); - expect(modifiedSchema!.getQueryType()?.getFields().user.resolve.name).not.toBe(spies.Query.user.bind(null).name); - expect(modifiedSchema!.getQueryType()?.getFields().users.resolve.name).toBe(spies.Query.users.bind(null).name); + expect(modifiedSchema!.getQueryType()?.getFields().user.resolve.name).not.toBe( + spies.Query.user.bind(null).name, + ); + expect(modifiedSchema!.getQueryType()?.getFields().users.resolve.name).toBe( + spies.Query.users.bind(null).name, + ); }); it('should replace resolvers correctly with a wildcard', async () => { - expect(schema.getQueryType()?.getFields().user.resolve.name).toBe(spies.Query.user.bind(null).name); - expect(schema.getQueryType()?.getFields().users.resolve.name).toBe(spies.Query.users.bind(null).name); + expect(schema.getQueryType()?.getFields().user.resolve.name).toBe( + spies.Query.user.bind(null).name, + ); + expect(schema.getQueryType()?.getFields().users.resolve.name).toBe( + spies.Query.users.bind(null).name, + ); const transform = new CacheTransform({ apiName: 'test', @@ -195,19 +212,25 @@ describe('cache', () => { ], pubsub, baseDir, + logger: new DefaultLogger(), }); const modifiedSchema = transform.transformSchema(schema); - expect(modifiedSchema!.getQueryType()?.getFields().user.resolve.name).not.toBe(spies.Query.user.bind(null).name); + expect(modifiedSchema!.getQueryType()?.getFields().user.resolve.name).not.toBe( + spies.Query.user.bind(null).name, + ); expect(modifiedSchema!.getQueryType()?.getFields().users.resolve.name).not.toBe( - spies.Query.users.bind(null).name + spies.Query.users.bind(null).name, ); }); }); describe('Cache Wrapper', () => { - const checkCache = async (config: YamlConfig.CacheTransformConfig[], cacheKeyToCheck?: string) => { + const checkCache = async ( + config: YamlConfig.CacheTransformConfig[], + cacheKeyToCheck?: string, + ) => { const transform = new CacheTransform({ apiName: 'test', importFn, @@ -215,6 +238,7 @@ describe('cache', () => { config, pubsub, baseDir, + logger: new DefaultLogger(), }); const modifiedSchema = transform.transformSchema(schema); @@ -303,7 +327,7 @@ describe('cache', () => { cacheKey, }, ], - cacheKey + cacheKey, ); }); @@ -317,7 +341,7 @@ describe('cache', () => { cacheKey, }, ], - cacheKey + cacheKey, ); }); @@ -333,7 +357,7 @@ describe('cache', () => { }, }, ], - key + key, ); expect(await cache.get(key)).toBeDefined(); @@ -351,7 +375,7 @@ describe('cache', () => { cacheKey: `query-user-{args.id}`, }, ], - 'query-user-1' + 'query-user-1', ); const otherIdQuery = parse(/* GraphQL */ ` @@ -382,7 +406,7 @@ describe('cache', () => { cacheKey: `query-user-{argsHash}`, }, ], - expectedHash + expectedHash, ); }); @@ -396,7 +420,7 @@ describe('cache', () => { cacheKey: `{args.id|hash}`, }, ], - expectedHash + expectedHash, ); }); @@ -410,7 +434,7 @@ describe('cache', () => { cacheKey: `{args.id}-{yyyy-MM-dd|date}`, }, ], - expectedHash + expectedHash, ); }); }); @@ -441,6 +465,7 @@ describe('cache', () => { cache, pubsub, baseDir, + logger: new DefaultLogger(), }); const schemaWithCache = transform.transformSchema(schema); @@ -500,6 +525,7 @@ describe('cache', () => { cache, pubsub, baseDir, + logger: new DefaultLogger(), }); const schemaWithCache = transform.transformSchema(schema); @@ -560,6 +586,7 @@ describe('cache', () => { cache, pubsub, baseDir, + logger: new DefaultLogger(), }; let callCount = 0; @@ -571,7 +598,8 @@ describe('cache', () => { `, resolvers: { Query: { - foo: () => new Promise(resolve => setTimeout(() => resolve((callCount++).toString()), 300)), + foo: () => + new Promise(resolve => setTimeout(() => resolve((callCount++).toString()), 300)), }, }, }); @@ -605,6 +633,7 @@ describe('cache', () => { cache, pubsub, baseDir, + logger: new DefaultLogger(), }; function getNewSchema() { return makeExecutableSchema({ @@ -661,6 +690,7 @@ describe('cache', () => { cache, pubsub, baseDir, + logger: new DefaultLogger(), }; function getNewSchema() { return makeExecutableSchema({ diff --git a/packages/transforms/encapsulate/package.json b/packages/transforms/encapsulate/package.json index d02fe159c473e..6e16caec3c932 100644 --- a/packages/transforms/encapsulate/package.json +++ b/packages/transforms/encapsulate/package.json @@ -1,25 +1,33 @@ { "name": "@graphql-mesh/transform-encapsulate", "version": "0.3.115", + "type": "module", "repository": { "type": "git", "url": "Urigo/graphql-mesh", "directory": "packages/transforms/encapsulate" }, "license": "MIT", - "main": "dist/index.js", - "module": "dist/index.mjs", + "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/index.d.ts", + "typings": "dist/typings/index.d.ts", "peerDependencies": { "graphql": "*" }, @@ -31,12 +39,15 @@ "@graphql-tools/wrap": "9.2.18", "tslib": "^2.4.0" }, + "devDependencies": { + "@graphql-tools/schema": "9.0.10" + }, "publishConfig": { "access": "public", "directory": "dist" }, "sideEffects": false, "typescript": { - "definition": "dist/index.d.ts" + "definition": "dist/typings/index.d.ts" } } diff --git a/packages/transforms/encapsulate/test/encapsulate.spec.ts b/packages/transforms/encapsulate/test/encapsulate.spec.ts index 6e25f069b4a9f..16c3396d78582 100644 --- a/packages/transforms/encapsulate/test/encapsulate.spec.ts +++ b/packages/transforms/encapsulate/test/encapsulate.spec.ts @@ -1,8 +1,8 @@ -import Transform from '../src/index'; +import Transform from '../src/index.js'; import { execute, parse, getIntrospectionQuery } from 'graphql'; import InMemoryLRUCache from '@graphql-mesh/cache-localforage'; import { ImportFn, MeshPubSub } from '@graphql-mesh/types'; -import { PubSub } from '@graphql-mesh/utils'; +import { DefaultLogger, PubSub } from '@graphql-mesh/utils'; import { wrapSchema } from '@graphql-tools/wrap'; import { makeExecutableSchema } from '@graphql-tools/schema'; @@ -53,6 +53,7 @@ describe('encapsulate', () => { baseDir, apiName: 'test', importFn, + logger: new DefaultLogger(), }), ], }); @@ -73,13 +74,16 @@ describe('encapsulate', () => { baseDir, apiName: 'test', importFn, + logger: new DefaultLogger(), }), ], }); expect(newSchema.getSubscriptionType().getFields().test).toBeDefined(); expect(newSchema.getSubscriptionType().getFields().getSomething).not.toBeDefined(); - expect(newSchema.getSubscriptionType().getFields().test.type.toString()).toBe('testSubscription!'); + expect(newSchema.getSubscriptionType().getFields().test.type.toString()).toBe( + 'testSubscription!', + ); }); it('should wrap the schema and group Query correctly', async () => { @@ -93,6 +97,7 @@ describe('encapsulate', () => { baseDir, apiName: 'test', importFn, + logger: new DefaultLogger(), }), ], }); @@ -119,6 +124,7 @@ describe('encapsulate', () => { baseDir, apiName: 'test', importFn, + logger: new DefaultLogger(), }), ], }); @@ -148,6 +154,7 @@ describe('encapsulate', () => { baseDir, apiName: 'test', importFn, + logger: new DefaultLogger(), }), ], }); @@ -185,6 +192,7 @@ describe('encapsulate', () => { baseDir, apiName: 'test', importFn, + logger: new DefaultLogger(), }), ], }); diff --git a/packages/transforms/extend/package.json b/packages/transforms/extend/package.json index bd780d908358c..dd43767939b2c 100644 --- a/packages/transforms/extend/package.json +++ b/packages/transforms/extend/package.json @@ -1,25 +1,33 @@ { "name": "@graphql-mesh/transform-extend", "version": "0.10.78", + "type": "module", "repository": { "type": "git", "url": "Urigo/graphql-mesh", "directory": "packages/transforms/extend" }, "license": "MIT", - "main": "dist/index.js", - "module": "dist/index.mjs", + "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/index.d.ts", + "typings": "dist/typings/index.d.ts", "peerDependencies": { "graphql": "*" }, @@ -40,6 +48,6 @@ }, "sideEffects": false, "typescript": { - "definition": "dist/index.d.ts" + "definition": "dist/typings/index.d.ts" } } diff --git a/packages/transforms/federation/package.json b/packages/transforms/federation/package.json index e41fa0b8ffef8..5891f7a0f6687 100644 --- a/packages/transforms/federation/package.json +++ b/packages/transforms/federation/package.json @@ -1,25 +1,33 @@ { "name": "@graphql-mesh/transform-federation", "version": "0.9.60", + "type": "module", "repository": { "type": "git", "url": "Urigo/graphql-mesh", "directory": "packages/transforms/federation" }, "license": "MIT", - "main": "dist/index.js", - "module": "dist/index.mjs", + "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/index.d.ts", + "typings": "dist/typings/index.d.ts", "peerDependencies": { "graphql": "*" }, @@ -41,6 +49,6 @@ }, "sideEffects": false, "typescript": { - "definition": "dist/index.d.ts" + "definition": "dist/typings/index.d.ts" } } diff --git a/packages/transforms/filter-schema/package.json b/packages/transforms/filter-schema/package.json index 9ea88cfc9befd..4b4d1a2040db6 100644 --- a/packages/transforms/filter-schema/package.json +++ b/packages/transforms/filter-schema/package.json @@ -1,25 +1,33 @@ { "name": "@graphql-mesh/transform-filter-schema", "version": "0.14.115", + "type": "module", "repository": { "type": "git", "url": "Urigo/graphql-mesh", "directory": "packages/transforms/filter-schema" }, "license": "MIT", - "main": "dist/index.js", - "module": "dist/index.mjs", + "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/index.d.ts", + "typings": "dist/typings/index.d.ts", "peerDependencies": { "graphql": "*" }, @@ -41,6 +49,6 @@ }, "sideEffects": false, "typescript": { - "definition": "dist/index.d.ts" + "definition": "dist/typings/index.d.ts" } } diff --git a/packages/transforms/filter-schema/src/index.ts b/packages/transforms/filter-schema/src/index.ts index ecf332258973e..b09d1c45fd522 100644 --- a/packages/transforms/filter-schema/src/index.ts +++ b/packages/transforms/filter-schema/src/index.ts @@ -1,6 +1,6 @@ import { YamlConfig } from '@graphql-mesh/types'; -import WrapFilter from './wrapFilter'; -import BareFilter from './bareFilter'; +import WrapFilter from './wrapFilter.js'; +import BareFilter from './bareFilter.js'; interface FilterTransformConstructor { new (options: { config: YamlConfig.FilterSchemaTransform }): BareFilter | WrapFilter; diff --git a/packages/transforms/filter-schema/test/transform.spec.ts b/packages/transforms/filter-schema/test/transform.spec.ts index ebb524642c7af..61db29ae9e6fa 100644 --- a/packages/transforms/filter-schema/test/transform.spec.ts +++ b/packages/transforms/filter-schema/test/transform.spec.ts @@ -1,17 +1,9 @@ import { buildSchema, printSchema } from 'graphql'; -import FilterSchemaTransform from '../src'; -import { PubSub } from '@graphql-mesh/utils'; -import InMemoryLRUCache from '@graphql-mesh/cache-localforage'; -import { ImportFn } from '@graphql-mesh/types'; +import FilterSchemaTransform from '../src/index.js'; import { wrapSchema } from '@graphql-tools/wrap'; import { pruneSchema } from '@graphql-tools/utils'; describe('filter', () => { - const cache = new InMemoryLRUCache(); - const pubsub = new PubSub(); - const baseDir: string = undefined; - const importFn: ImportFn = m => import(m); - it('filters correctly with array of rules', async () => { let schema = buildSchema(/* GraphQL */ ` type User { @@ -40,13 +32,8 @@ describe('filter', () => { schema = wrapSchema({ schema, transforms: [ - FilterSchemaTransform({ - config: ['!Comment', 'User.posts.{message, author}', 'Query.user.!pk'], - apiName: '', - cache, - pubsub, - baseDir, - importFn, + new FilterSchemaTransform({ + config: { filters: ['!Comment', 'User.posts.{message, author}', 'Query.user.!pk'] }, }), ], }); @@ -101,13 +88,8 @@ type Query { schema = wrapSchema({ schema, transforms: [ - FilterSchemaTransform({ + new FilterSchemaTransform({ config: { filters: ['!Comment', 'User.posts.{message, author}', 'Query.user.!pk'] }, - apiName: '', - cache, - pubsub, - baseDir, - importFn, }), ], }); @@ -179,7 +161,7 @@ type Query { schema = wrapSchema({ schema, transforms: [ - FilterSchemaTransform({ + new FilterSchemaTransform({ config: { mode: 'bare', filters: [ @@ -191,11 +173,6 @@ type Query { 'Query.user.!pk', ], }, - apiName: '', - cache, - pubsub, - baseDir, - importFn, }), ], }); @@ -238,16 +215,11 @@ type Query { schema = wrapSchema({ schema, transforms: [ - FilterSchemaTransform({ + new FilterSchemaTransform({ config: { mode: 'bare', filters: ['Query.*.!pk'], }, - apiName: '', - cache, - pubsub, - baseDir, - importFn, }), ], }); @@ -284,16 +256,11 @@ type Query { schema = wrapSchema({ schema, transforms: [ - FilterSchemaTransform({ + new FilterSchemaTransform({ config: { mode: 'bare', filters: ['Query.*.!pk', 'Query.userOne.!age'], }, - apiName: '', - cache, - pubsub, - baseDir, - importFn, }), ], }); @@ -330,16 +297,11 @@ type Query { schema = wrapSchema({ schema, transforms: [ - FilterSchemaTransform({ + new FilterSchemaTransform({ config: { mode: 'wrap', filters: ['Query.*.!pk'], }, - apiName: '', - cache, - pubsub, - baseDir, - importFn, }), ], }); @@ -376,16 +338,11 @@ type Query { schema = wrapSchema({ schema, transforms: [ - FilterSchemaTransform({ + new FilterSchemaTransform({ config: { mode: 'wrap', filters: ['Query.*.!pk', 'Query.userOne.!age'], }, - apiName: '', - cache, - pubsub, - baseDir, - importFn, }), ], }); @@ -434,13 +391,8 @@ type Query { schema = wrapSchema({ schema, transforms: [ - FilterSchemaTransform({ - config: ['User.!{a,b,c,d,e}', 'Query.!admin', 'Book.{id,name,author}'], - apiName: '', - cache, - pubsub, - baseDir, - importFn, + new FilterSchemaTransform({ + config: { filters: ['User.!{a,b,c,d,e}', 'Query.!admin', 'Book.{id,name,author}'] }, }), ], }); @@ -481,13 +433,8 @@ type Query { schema = wrapSchema({ schema, transforms: [ - FilterSchemaTransform({ - config: ['Mutation.!*'], - apiName: '', - cache, - pubsub, - baseDir, - importFn, + new FilterSchemaTransform({ + config: { filters: ['Mutation.!*'] }, }), ], }); @@ -528,13 +475,8 @@ type Query { schema = wrapSchema({ schema, transforms: [ - FilterSchemaTransform({ - config: ['User.{id, username}', 'Query.!{admin}', 'Book.{id}'], - apiName: '', - cache, - pubsub, - baseDir, - importFn, + new FilterSchemaTransform({ + config: { filters: ['User.{id, username}', 'Query.!{admin}', 'Book.{id}'] }, }), ], }); @@ -585,13 +527,8 @@ type Query { schema = wrapSchema({ schema, transforms: [ - FilterSchemaTransform({ - config: ['!Book'], - apiName: '', - cache, - pubsub, - baseDir, - importFn, + new FilterSchemaTransform({ + config: { filters: ['!Book'] }, }), ], }); @@ -654,13 +591,8 @@ type Query { schema = wrapSchema({ schema, transforms: [ - FilterSchemaTransform({ + new FilterSchemaTransform({ config: { mode: 'bare', filters: ['Type.!Comment', 'Type.!{Notification, Mention}'] }, - apiName: '', - cache, - pubsub, - baseDir, - importFn, }), ], }); @@ -724,14 +656,9 @@ type Query { schema = wrapSchema({ schema, transforms: [ - FilterSchemaTransform({ + new FilterSchemaTransform({ // bizarre case, but logic should still work config: { mode: 'bare', filters: ['Type.{Query, User, Post, String, ID}'] }, - apiName: '', - cache, - pubsub, - baseDir, - importFn, }), ], }); @@ -787,13 +714,8 @@ type Query { schema = wrapSchema({ schema, transforms: [ - FilterSchemaTransform({ - config: ['!User'], - apiName: '', - cache, - pubsub, - baseDir, - importFn, + new FilterSchemaTransform({ + config: { filters: ['!User'] }, }), ], }); @@ -851,13 +773,8 @@ type Query { schema = wrapSchema({ schema, transforms: [ - FilterSchemaTransform({ - config: ['!AuthRule'], - apiName: '', - cache, - pubsub, - baseDir, - importFn, + new FilterSchemaTransform({ + config: { filters: ['!AuthRule'] }, }), ], }); @@ -914,13 +831,8 @@ type Query { schema = wrapSchema({ schema, transforms: [ - FilterSchemaTransform({ - config: ['Query.user.!{pk, age}', 'Query.book.title'], - apiName: '', - cache, - pubsub, - baseDir, - importFn, + new FilterSchemaTransform({ + config: { filters: ['Query.user.!{pk, age}', 'Query.book.title'] }, }), ], }); diff --git a/packages/transforms/hive/package.json b/packages/transforms/hive/package.json index a21cfca616242..adba47090dfe2 100644 --- a/packages/transforms/hive/package.json +++ b/packages/transforms/hive/package.json @@ -1,25 +1,33 @@ { "name": "@graphql-mesh/transform-hive", "version": "0.0.4", + "type": "module", "repository": { "type": "git", "url": "Urigo/graphql-mesh", "directory": "packages/transforms/hive" }, "license": "MIT", - "main": "dist/index.js", - "module": "dist/index.mjs", + "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/index.d.ts", + "typings": "dist/typings/index.d.ts", "peerDependencies": { "graphql": "*" }, @@ -38,6 +46,6 @@ }, "sideEffects": false, "typescript": { - "definition": "dist/index.d.ts" + "definition": "dist/typings/index.d.ts" } } diff --git a/packages/transforms/hoist-field/package.json b/packages/transforms/hoist-field/package.json index 78c432434a4e5..2b9875d48e321 100644 --- a/packages/transforms/hoist-field/package.json +++ b/packages/transforms/hoist-field/package.json @@ -1,25 +1,33 @@ { "name": "@graphql-mesh/transform-hoist-field", "version": "0.1.79", + "type": "module", "repository": { "type": "git", "url": "Urigo/graphql-mesh", "directory": "packages/transforms/hoist-field" }, "license": "MIT", - "main": "dist/index.js", - "module": "dist/index.mjs", + "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/index.d.ts", + "typings": "dist/typings/index.d.ts", "peerDependencies": { "graphql": "*" }, @@ -39,6 +47,6 @@ }, "sideEffects": false, "typescript": { - "definition": "dist/index.d.ts" + "definition": "dist/typings/index.d.ts" } } diff --git a/packages/transforms/hoist-field/test/transform.spec.ts b/packages/transforms/hoist-field/test/transform.spec.ts index 0e1ceeb4796a6..d9476eadb1563 100644 --- a/packages/transforms/hoist-field/test/transform.spec.ts +++ b/packages/transforms/hoist-field/test/transform.spec.ts @@ -2,9 +2,9 @@ import InMemoryLRUCache from '@graphql-mesh/cache-localforage'; import { MeshPubSub } from '@graphql-mesh/types'; import { wrapSchema } from '@graphql-tools/wrap'; import { buildSchema, GraphQLField, GraphQLObjectType, printSchema } from 'graphql'; -import { defaultImportFn, PubSub } from '@graphql-mesh/utils'; +import { defaultImportFn, DefaultLogger, PubSub } from '@graphql-mesh/utils'; -import HoistFieldTransform from '../src'; +import HoistFieldTransform from '../src/index.js'; describe('hoist', () => { const importFn = defaultImportFn; @@ -49,6 +49,7 @@ describe('hoist', () => { pubsub, baseDir, importFn, + logger: new DefaultLogger(), }), ], }); @@ -85,6 +86,7 @@ describe('hoist', () => { pubsub, baseDir, importFn, + logger: new DefaultLogger(), }), ], }); @@ -116,6 +118,7 @@ describe('hoist', () => { pubsub, baseDir, importFn, + logger: new DefaultLogger(), }), ], }); @@ -155,6 +158,7 @@ describe('hoist', () => { pubsub, baseDir, importFn, + logger: new DefaultLogger(), }), ], }); @@ -196,6 +200,7 @@ describe('hoist', () => { pubsub, baseDir, importFn, + logger: new DefaultLogger(), }), ], }); diff --git a/packages/transforms/naming-convention/package.json b/packages/transforms/naming-convention/package.json index e83b9a7272a13..a6de05a424f25 100644 --- a/packages/transforms/naming-convention/package.json +++ b/packages/transforms/naming-convention/package.json @@ -1,25 +1,33 @@ { "name": "@graphql-mesh/transform-naming-convention", "version": "0.12.4", + "type": "module", "repository": { "type": "git", "url": "Urigo/graphql-mesh", "directory": "packages/transforms/naming-convention" }, "license": "MIT", - "main": "dist/index.js", - "module": "dist/index.mjs", + "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/index.d.ts", + "typings": "dist/typings/index.d.ts", "peerDependencies": { "graphql": "*" }, @@ -45,6 +53,6 @@ }, "sideEffects": false, "typescript": { - "definition": "dist/index.d.ts" + "definition": "dist/typings/index.d.ts" } } diff --git a/packages/transforms/naming-convention/src/bareNamingConvention.ts b/packages/transforms/naming-convention/src/bareNamingConvention.ts index 844ef4010894f..12b2ea6a2521f 100644 --- a/packages/transforms/naming-convention/src/bareNamingConvention.ts +++ b/packages/transforms/naming-convention/src/bareNamingConvention.ts @@ -17,7 +17,7 @@ import { import { MeshTransform, YamlConfig, MeshTransformOptions } from '@graphql-mesh/types'; import { MapperKind, mapSchema, renameType } from '@graphql-tools/utils'; -import { NAMING_CONVENTIONS, IGNORED_ROOT_FIELD_NAMES, IGNORED_TYPE_NAMES } from './shared'; +import { NAMING_CONVENTIONS, IGNORED_ROOT_FIELD_NAMES, IGNORED_TYPE_NAMES } from './shared.js'; export declare type GraphQLTypePointer = | GraphQLList diff --git a/packages/transforms/naming-convention/src/index.ts b/packages/transforms/naming-convention/src/index.ts index 710c0811450c5..bb1a5765b39d7 100644 --- a/packages/transforms/naming-convention/src/index.ts +++ b/packages/transforms/naming-convention/src/index.ts @@ -1,7 +1,7 @@ import { YamlConfig, MeshTransformOptions } from '@graphql-mesh/types'; -import WrapNamingConvention from './wrapNamingConvention'; -import BareNamingConvention from './bareNamingConvention'; +import WrapNamingConvention from './wrapNamingConvention.js'; +import BareNamingConvention from './bareNamingConvention.js'; interface NamingConventionTransformConstructor { new (options: MeshTransformOptions): | WrapNamingConvention diff --git a/packages/transforms/naming-convention/src/wrapNamingConvention.ts b/packages/transforms/naming-convention/src/wrapNamingConvention.ts index 413c91970abdb..725ae1741ae59 100644 --- a/packages/transforms/naming-convention/src/wrapNamingConvention.ts +++ b/packages/transforms/naming-convention/src/wrapNamingConvention.ts @@ -12,7 +12,7 @@ import { ExecutionResult, ExecutionRequest } from '@graphql-tools/utils'; import { Transform, SubschemaConfig, DelegationContext } from '@graphql-tools/delegate'; import { applyRequestTransforms, applyResultTransforms, applySchemaTransforms } from '@graphql-mesh/utils'; -import { NAMING_CONVENTIONS, IGNORED_ROOT_FIELD_NAMES, IGNORED_TYPE_NAMES } from './shared'; +import { NAMING_CONVENTIONS, IGNORED_ROOT_FIELD_NAMES, IGNORED_TYPE_NAMES } from './shared.js'; export default class NamingConventionTransform implements MeshTransform { private transforms: Transform[] = []; diff --git a/packages/transforms/naming-convention/test/bareNamingConvention.spec.ts b/packages/transforms/naming-convention/test/bareNamingConvention.spec.ts index fb07ce7f7565f..f8cc00287a061 100644 --- a/packages/transforms/naming-convention/test/bareNamingConvention.spec.ts +++ b/packages/transforms/naming-convention/test/bareNamingConvention.spec.ts @@ -1,4 +1,4 @@ -import NamingConventionTransform from '../src/index'; +import NamingConventionTransform from '../src/index.js'; import { buildSchema, printSchema, @@ -10,7 +10,7 @@ import { } from 'graphql'; import InMemoryLRUCache from '@graphql-mesh/cache-localforage'; import { ImportFn, MeshPubSub } from '@graphql-mesh/types'; -import { PubSub } from '@graphql-mesh/utils'; +import { DefaultLogger, PubSub } from '@graphql-mesh/utils'; import { makeExecutableSchema } from '@graphql-tools/schema'; describe('namingConvention - bare', () => { @@ -61,6 +61,7 @@ describe('namingConvention - bare', () => { pubsub, baseDir, importFn, + logger: new DefaultLogger(), }); const newSchema = transform.transformSchema(schema, {} as any); @@ -147,7 +148,12 @@ describe('namingConvention - bare', () => { }; }, userByType: () => { - return { first_name: 'John', last_name: 'Smith', Type: 'admin', interests: ['books', 'comics'] }; + return { + first_name: 'John', + last_name: 'Smith', + Type: 'admin', + interests: ['books', 'comics'], + }; }, node: (_, { id }) => { return { @@ -178,6 +184,7 @@ describe('namingConvention - bare', () => { pubsub, baseDir, importFn, + logger: new DefaultLogger(), }); const newSchema = transform.transformSchema(schema, {} as any); @@ -285,6 +292,7 @@ describe('namingConvention - bare', () => { pubsub, baseDir, importFn, + logger: new DefaultLogger(), }); const newSchema = transform.transformSchema(schema, {} as any); @@ -316,6 +324,7 @@ type Query { pubsub, baseDir, importFn, + logger: new DefaultLogger(), }); const newSchema = transform.transformSchema(schema, {} as any); diff --git a/packages/transforms/naming-convention/test/wrapNamingConvention.spec.ts b/packages/transforms/naming-convention/test/wrapNamingConvention.spec.ts index c3fe95c6d8730..d9eb06fed02d5 100644 --- a/packages/transforms/naming-convention/test/wrapNamingConvention.spec.ts +++ b/packages/transforms/naming-convention/test/wrapNamingConvention.spec.ts @@ -1,8 +1,15 @@ -import NamingConventionTransform from '../src/index'; -import { buildSchema, GraphQLObjectType, GraphQLEnumType, execute, parse, GraphQLUnionType } from 'graphql'; +import NamingConventionTransform from '../src/index.js'; +import { + buildSchema, + GraphQLObjectType, + GraphQLEnumType, + execute, + parse, + GraphQLUnionType, +} from 'graphql'; import InMemoryLRUCache from '@graphql-mesh/cache-localforage'; import { ImportFn, MeshPubSub } from '@graphql-mesh/types'; -import { PubSub } from '@graphql-mesh/utils'; +import { DefaultLogger, PubSub } from '@graphql-mesh/utils'; import { wrapSchema } from '@graphql-tools/wrap'; import { addResolversToSchema } from '@graphql-tools/schema'; import { printSchemaWithDirectives } from '@graphql-tools/utils'; @@ -58,6 +65,7 @@ describe('namingConvention wrap', () => { cache, pubsub, baseDir, + logger: new DefaultLogger(), }), ], }); @@ -146,7 +154,12 @@ describe('namingConvention wrap', () => { }; }, userByType: () => { - return { first_name: 'John', last_name: 'Smith', Type: 'admin', interests: ['books', 'comics'] }; + return { + first_name: 'John', + last_name: 'Smith', + Type: 'admin', + interests: ['books', 'comics'], + }; }, node: (_, { id }) => { return { @@ -180,6 +193,7 @@ describe('namingConvention wrap', () => { fieldArgumentNames: 'pascalCase', }, baseDir, + logger: new DefaultLogger(), }), ], }); @@ -291,6 +305,7 @@ describe('namingConvention wrap', () => { fieldNames: 'camelCase', }, baseDir, + logger: new DefaultLogger(), }), ], }); @@ -328,6 +343,7 @@ type Query { fieldNames: 'snakeCase', }, baseDir, + logger: new DefaultLogger(), }), ], }); diff --git a/packages/transforms/prefix/package.json b/packages/transforms/prefix/package.json index 1ab5c6447aa70..4880362b15dcf 100644 --- a/packages/transforms/prefix/package.json +++ b/packages/transforms/prefix/package.json @@ -1,25 +1,33 @@ { "name": "@graphql-mesh/transform-prefix", "version": "0.11.105", + "type": "module", "repository": { "type": "git", "url": "Urigo/graphql-mesh", "directory": "packages/transforms/prefix" }, "license": "MIT", - "main": "dist/index.js", - "module": "dist/index.mjs", + "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/index.d.ts", + "typings": "dist/typings/index.d.ts", "peerDependencies": { "graphql": "*" }, @@ -42,6 +50,6 @@ }, "sideEffects": false, "typescript": { - "definition": "dist/index.d.ts" + "definition": "dist/typings/index.d.ts" } } diff --git a/packages/transforms/prefix/src/barePrefix.ts b/packages/transforms/prefix/src/barePrefix.ts index 4d9a272e93823..a611903acc142 100644 --- a/packages/transforms/prefix/src/barePrefix.ts +++ b/packages/transforms/prefix/src/barePrefix.ts @@ -7,7 +7,7 @@ import { } from 'graphql'; import { MeshTransform, YamlConfig, MeshTransformOptions } from '@graphql-mesh/types'; import { MapperKind, mapSchema, renameType } from '@graphql-tools/utils'; -import { ignoreList as defaultIgnoreList } from './shared'; +import { ignoreList as defaultIgnoreList } from './shared.js'; const rootOperations = new Set(['Query', 'Mutation', 'Subscription']); diff --git a/packages/transforms/prefix/src/index.ts b/packages/transforms/prefix/src/index.ts index c99ffeb5a9e4a..dd8c13581a5f5 100644 --- a/packages/transforms/prefix/src/index.ts +++ b/packages/transforms/prefix/src/index.ts @@ -1,6 +1,6 @@ import { YamlConfig, MeshTransformOptions } from '@graphql-mesh/types'; -import WrapPrefix from './wrapPrefix'; -import BarePrefix from './barePrefix'; +import WrapPrefix from './wrapPrefix.js'; +import BarePrefix from './barePrefix.js'; interface PrefixTransformConstructor { new (options: MeshTransformOptions): BarePrefix | WrapPrefix; diff --git a/packages/transforms/prefix/src/wrapPrefix.ts b/packages/transforms/prefix/src/wrapPrefix.ts index 2289478673fc1..f7c8cd622254f 100644 --- a/packages/transforms/prefix/src/wrapPrefix.ts +++ b/packages/transforms/prefix/src/wrapPrefix.ts @@ -4,7 +4,7 @@ import { RenameTypes, RenameRootFields } from '@graphql-tools/wrap'; import { ExecutionResult, ExecutionRequest } from '@graphql-tools/utils'; import { Transform, SubschemaConfig, DelegationContext } from '@graphql-tools/delegate'; import { applyRequestTransforms, applyResultTransforms, applySchemaTransforms } from '@graphql-mesh/utils'; -import { ignoreList as defaultIgnoreList } from './shared'; +import { ignoreList as defaultIgnoreList } from './shared.js'; export default class WrapPrefix implements MeshTransform { private transforms: Transform[] = []; diff --git a/packages/transforms/prefix/test/barePrefix.spec.ts b/packages/transforms/prefix/test/barePrefix.spec.ts index 1c204cde5214e..f761aa7c498b0 100644 --- a/packages/transforms/prefix/test/barePrefix.spec.ts +++ b/packages/transforms/prefix/test/barePrefix.spec.ts @@ -1,8 +1,8 @@ -import PrefixTransform from '../src'; +import PrefixTransform from '../src/index.js'; import { printSchema, GraphQLSchema, GraphQLObjectType, execute, parse } from 'graphql'; import InMemoryLRUCache from '@graphql-mesh/cache-localforage'; import { MeshPubSub } from '@graphql-mesh/types'; -import { PubSub } from '@graphql-mesh/utils'; +import { DefaultLogger, PubSub } from '@graphql-mesh/utils'; import { makeExecutableSchema } from '@graphql-tools/schema'; describe('barePrefix', () => { @@ -64,6 +64,7 @@ describe('barePrefix', () => { cache, pubsub, importFn: m => import(m), + logger: new DefaultLogger(), }).transformSchema(schema, { schema }, schema); expect(newSchema.getType('User')).toBeUndefined(); @@ -82,6 +83,7 @@ describe('barePrefix', () => { cache, pubsub, importFn: m => import(m), + logger: new DefaultLogger(), }).transformSchema(schema, { schema }, schema); expect(newSchema.getType('Query')).toBeDefined(); @@ -99,6 +101,7 @@ describe('barePrefix', () => { cache, pubsub, importFn: m => import(m), + logger: new DefaultLogger(), }).transformSchema(schema, { schema }, schema); const postFields = (newSchema.getType('T_Post') as GraphQLObjectType).getFields(); @@ -114,6 +117,7 @@ describe('barePrefix', () => { cache, pubsub, importFn: m => import(m), + logger: new DefaultLogger(), }).transformSchema(schema, { schema }, schema); expect(newSchema.getType('Query')).toBeDefined(); @@ -133,6 +137,7 @@ describe('barePrefix', () => { cache, pubsub, importFn: m => import(m), + logger: new DefaultLogger(), }).transformSchema(schema, { schema }, schema); expect(newSchema.getType('Query')).toBeDefined(); @@ -151,6 +156,7 @@ describe('barePrefix', () => { cache, pubsub, importFn: m => import(m), + logger: new DefaultLogger(), }).transformSchema(schema, { schema }, schema); expect(newSchema.getType('Query')).toBeDefined(); @@ -171,6 +177,7 @@ describe('barePrefix', () => { cache, pubsub, importFn: m => import(m), + logger: new DefaultLogger(), }).transformSchema(schema, { schema }, schema); const queryFields = (newSchema.getType('Query') as GraphQLObjectType).getFields(); @@ -196,6 +203,7 @@ describe('barePrefix', () => { cache, pubsub, importFn: m => import(m), + logger: new DefaultLogger(), }).transformSchema(schema, { schema }, schema); const queryFields = (newSchema.getType('Query') as GraphQLObjectType).getFields(); @@ -219,6 +227,7 @@ describe('barePrefix', () => { cache, pubsub, importFn: m => import(m), + logger: new DefaultLogger(), }).transformSchema(schema, { schema }, schema); const result = await execute({ diff --git a/packages/transforms/prefix/test/wrapPrefix.spec.ts b/packages/transforms/prefix/test/wrapPrefix.spec.ts index 10e8147b51f08..2416a94ea01e7 100644 --- a/packages/transforms/prefix/test/wrapPrefix.spec.ts +++ b/packages/transforms/prefix/test/wrapPrefix.spec.ts @@ -1,8 +1,8 @@ -import PrefixTransform from '../src'; +import PrefixTransform from '../src/index.js'; import { printSchema, GraphQLSchema, GraphQLObjectType, execute, parse } from 'graphql'; import InMemoryLRUCache from '@graphql-mesh/cache-localforage'; import { MeshPubSub } from '@graphql-mesh/types'; -import { PubSub } from '@graphql-mesh/utils'; +import { DefaultLogger, PubSub } from '@graphql-mesh/utils'; import { wrapSchema } from '@graphql-tools/wrap'; import { makeExecutableSchema } from '@graphql-tools/schema'; @@ -67,13 +67,16 @@ describe('wrapPrefix', () => { cache, pubsub, importFn: m => import(m), + logger: new DefaultLogger(), }), ], }); expect(newSchema.getType('User')).toBeUndefined(); expect(newSchema.getType('T_User')).toBeDefined(); - expect((newSchema.getType('Query') as GraphQLObjectType).getFields()).not.toHaveProperty('T_user'); + expect((newSchema.getType('Query') as GraphQLObjectType).getFields()).not.toHaveProperty( + 'T_user', + ); expect(printSchema(newSchema)).toMatchSnapshot(); }); @@ -90,6 +93,7 @@ describe('wrapPrefix', () => { cache, pubsub, importFn: m => import(m), + logger: new DefaultLogger(), }), ], }); @@ -111,6 +115,7 @@ describe('wrapPrefix', () => { cache, pubsub, importFn: m => import(m), + logger: new DefaultLogger(), }), ], }); @@ -131,6 +136,7 @@ describe('wrapPrefix', () => { cache, pubsub, importFn: m => import(m), + logger: new DefaultLogger(), }), ], }); @@ -154,6 +160,7 @@ describe('wrapPrefix', () => { cache, pubsub, importFn: m => import(m), + logger: new DefaultLogger(), }), ], }); @@ -176,6 +183,7 @@ describe('wrapPrefix', () => { cache, pubsub, importFn: m => import(m), + logger: new DefaultLogger(), }), ], }); @@ -200,6 +208,7 @@ describe('wrapPrefix', () => { cache, pubsub, importFn: m => import(m), + logger: new DefaultLogger(), }), ], }); @@ -229,6 +238,7 @@ describe('wrapPrefix', () => { cache, pubsub, importFn: m => import(m), + logger: new DefaultLogger(), }), ], }); @@ -258,6 +268,7 @@ describe('wrapPrefix', () => { cache, pubsub, importFn: m => import(m), + logger: new DefaultLogger(), }), ], }); @@ -280,6 +291,7 @@ describe('wrapPrefix', () => { cache, pubsub, importFn: m => import(m), + logger: new DefaultLogger(), }), ], }); diff --git a/packages/transforms/prune/package.json b/packages/transforms/prune/package.json index f524ff70a71b6..e4da8c78305f3 100644 --- a/packages/transforms/prune/package.json +++ b/packages/transforms/prune/package.json @@ -1,25 +1,33 @@ { "name": "@graphql-mesh/transform-prune", "version": "0.0.88", + "type": "module", "repository": { "type": "git", "url": "Urigo/graphql-mesh", "directory": "packages/transforms/prune" }, "license": "MIT", - "main": "dist/index.js", - "module": "dist/index.mjs", + "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/index.d.ts", + "typings": "dist/typings/index.d.ts", "peerDependencies": { "graphql": "*" }, @@ -34,6 +42,6 @@ }, "sideEffects": false, "typescript": { - "definition": "dist/index.d.ts" + "definition": "dist/typings/index.d.ts" } } diff --git a/packages/transforms/rate-limit/package.json b/packages/transforms/rate-limit/package.json index 87720ffea1bff..a848a5992f1f4 100644 --- a/packages/transforms/rate-limit/package.json +++ b/packages/transforms/rate-limit/package.json @@ -1,25 +1,33 @@ { "name": "@graphql-mesh/transform-rate-limit", "version": "0.1.80", + "type": "module", "repository": { "type": "git", "url": "Urigo/graphql-mesh", "directory": "packages/transforms/rate-limit" }, "license": "MIT", - "main": "dist/index.js", - "module": "dist/index.mjs", + "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/index.d.ts", + "typings": "dist/typings/index.d.ts", "peerDependencies": { "graphql": "*" }, @@ -42,6 +50,6 @@ }, "sideEffects": false, "typescript": { - "definition": "dist/index.d.ts" + "definition": "dist/typings/index.d.ts" } } diff --git a/packages/transforms/rate-limit/tests/rate-limit.spec.ts b/packages/transforms/rate-limit/tests/rate-limit.spec.ts index d57800d78dd87..f3e0c55f39350 100644 --- a/packages/transforms/rate-limit/tests/rate-limit.spec.ts +++ b/packages/transforms/rate-limit/tests/rate-limit.spec.ts @@ -1,6 +1,6 @@ import { defaultImportFn, DefaultLogger, PubSub } from '@graphql-mesh/utils'; import InMemoryLRUCache from '@graphql-mesh/cache-localforage'; -import RateLimitTransform from '../src'; +import RateLimitTransform from '../src/index.js'; import { makeExecutableSchema } from '@graphql-tools/schema'; import { wrapSchema } from '@graphql-tools/wrap'; import { execute, parse } from 'graphql'; diff --git a/packages/transforms/rename/package.json b/packages/transforms/rename/package.json index 29e4541d64ceb..2fde85c933d0d 100644 --- a/packages/transforms/rename/package.json +++ b/packages/transforms/rename/package.json @@ -1,25 +1,33 @@ { "name": "@graphql-mesh/transform-rename", "version": "0.13.3", + "type": "module", "repository": { "type": "git", "url": "Urigo/graphql-mesh", "directory": "packages/transforms/rename" }, "license": "MIT", - "main": "dist/index.js", - "module": "dist/index.mjs", + "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/index.d.ts", + "typings": "dist/typings/index.d.ts", "peerDependencies": { "graphql": "*" }, @@ -42,6 +50,6 @@ }, "sideEffects": false, "typescript": { - "definition": "dist/index.d.ts" + "definition": "dist/typings/index.d.ts" } } diff --git a/packages/transforms/rename/src/bareRename.ts b/packages/transforms/rename/src/bareRename.ts index 0d9ae2847e4af..82eda69926c35 100644 --- a/packages/transforms/rename/src/bareRename.ts +++ b/packages/transforms/rename/src/bareRename.ts @@ -1,7 +1,7 @@ import { GraphQLSchema, defaultFieldResolver, GraphQLFieldConfig, GraphQLAbstractType } from 'graphql'; import { MeshTransform, YamlConfig } from '@graphql-mesh/types'; import { renameType, MapperKind, mapSchema } from '@graphql-tools/utils'; -import { ignoreList } from './shared'; +import { ignoreList } from './shared.js'; type RenameMapObject = Map; diff --git a/packages/transforms/rename/src/index.ts b/packages/transforms/rename/src/index.ts index d4883b07896dd..c39d76daa5dd5 100644 --- a/packages/transforms/rename/src/index.ts +++ b/packages/transforms/rename/src/index.ts @@ -1,6 +1,6 @@ import { YamlConfig } from '@graphql-mesh/types'; -import WrapRename from './wrapRename'; -import BareRename from './bareRename'; +import WrapRename from './wrapRename.js'; +import BareRename from './bareRename.js'; interface RenameTransformConstructor { new (options: { config: YamlConfig.RenameTransform }): BareRename | WrapRename; diff --git a/packages/transforms/rename/src/wrapRename.ts b/packages/transforms/rename/src/wrapRename.ts index da13fd48c5504..1be9cea27fec9 100644 --- a/packages/transforms/rename/src/wrapRename.ts +++ b/packages/transforms/rename/src/wrapRename.ts @@ -9,7 +9,7 @@ import { import { ExecutionResult, ExecutionRequest } from '@graphql-tools/utils'; import { Transform, SubschemaConfig, DelegationContext } from '@graphql-tools/delegate'; import { applyRequestTransforms, applyResultTransforms, applySchemaTransforms } from '@graphql-mesh/utils'; -import { ignoreList } from './shared'; +import { ignoreList } from './shared.js'; export default class WrapRename implements Transform { private transforms: Transform[] = []; diff --git a/packages/transforms/rename/test/bareRename.spec.ts b/packages/transforms/rename/test/bareRename.spec.ts index bb17ccf09b944..2f068f2c0ff68 100644 --- a/packages/transforms/rename/test/bareRename.spec.ts +++ b/packages/transforms/rename/test/bareRename.spec.ts @@ -1,9 +1,12 @@ -import RenameTransform from './../src/index'; -import { buildSchema, graphql, GraphQLObjectType, GraphQLNonNull, GraphQLScalarType } from 'graphql'; +import RenameTransform from './../src/index.js'; +import { + buildSchema, + graphql, + GraphQLObjectType, + GraphQLNonNull, + GraphQLScalarType, +} from 'graphql'; import { makeExecutableSchema } from '@graphql-tools/schema'; -import InMemoryLRUCache from '@graphql-mesh/cache-localforage'; -import { ImportFn, MeshPubSub } from '@graphql-mesh/types'; -import { PubSub } from '@graphql-mesh/utils'; describe('rename', () => { const schema = makeExecutableSchema({ @@ -51,15 +54,6 @@ describe('rename', () => { }, }, }); - let cache: InMemoryLRUCache; - let pubsub: MeshPubSub; - const baseDir: string = undefined; - const importFn: ImportFn = m => import(m); - - beforeEach(() => { - cache = new InMemoryLRUCache(); - pubsub = new PubSub(); - }); it('should change the name of a type', () => { const transform = new RenameTransform({ @@ -76,11 +70,6 @@ describe('rename', () => { }, ], }, - apiName: '', - cache, - pubsub, - baseDir, - importFn, }); const newSchema = transform.transformSchema(schema, {} as any); @@ -106,11 +95,6 @@ describe('rename', () => { }, ], }, - apiName: '', - cache, - pubsub, - baseDir, - importFn, }); const newSchema = transform.transformSchema(schema, {} as any); @@ -138,11 +122,6 @@ describe('rename', () => { }, ], }, - apiName: '', - cache, - pubsub, - baseDir, - importFn, }); const transformedSchema = transform.transformSchema(schema, {} as any); @@ -176,11 +155,6 @@ describe('rename', () => { }, ], }, - apiName: '', - cache, - pubsub, - baseDir, - importFn, }); const transformedSchema = transform.transformSchema(schema, {} as any); @@ -238,11 +212,6 @@ describe('rename', () => { }, ], }, - apiName: '', - cache, - pubsub, - baseDir, - importFn, }); const newSchema = transform.transformSchema(schema, {} as any); @@ -272,11 +241,6 @@ describe('rename', () => { }, ], }, - apiName: '', - cache, - pubsub, - baseDir, - importFn, }); const newSchema = transform.transformSchema(schema, {} as any); @@ -285,13 +249,21 @@ describe('rename', () => { const bookField = (newSchema.getType('Prefixed_MyBook') as GraphQLObjectType).getFields(); expect((userField.id.type as GraphQLNonNull).ofType.toString()).toBe('ID'); - expect((userField.name.type as GraphQLNonNull).ofType.toString()).toBe('String'); + expect((userField.name.type as GraphQLNonNull).ofType.toString()).toBe( + 'String', + ); - expect((profileField.id.type as GraphQLNonNull).ofType.toString()).toBe('ID'); - expect((profileField.isActive.type as GraphQLNonNull).ofType.toString()).toBe('Boolean'); + expect((profileField.id.type as GraphQLNonNull).ofType.toString()).toBe( + 'ID', + ); + expect( + (profileField.isActive.type as GraphQLNonNull).ofType.toString(), + ).toBe('Boolean'); expect((bookField.id.type as GraphQLNonNull).ofType.toString()).toBe('ID'); - expect((bookField.hits.type as GraphQLNonNull).ofType.toString()).toBe('Int'); + expect((bookField.hits.type as GraphQLNonNull).ofType.toString()).toBe( + 'Int', + ); }); it('should change the name of multiple fields', () => { @@ -312,11 +284,6 @@ describe('rename', () => { }, ], }, - apiName: '', - cache, - pubsub, - baseDir, - importFn, }); const newSchema = transform.transformSchema(schema, {} as any); @@ -349,11 +316,6 @@ describe('rename', () => { }, ], }, - apiName: '', - cache, - pubsub, - baseDir, - importFn, }); const newSchema = transform.transformSchema(schema, {} as any); @@ -393,11 +355,6 @@ describe('rename', () => { }, ], }, - apiName: '', - cache, - pubsub, - baseDir, - importFn, }); const newSchema = transform.transformSchema(schema, {} as any); @@ -432,11 +389,6 @@ describe('rename', () => { }, ], }, - apiName: '', - cache, - pubsub, - baseDir, - importFn, }); const newSchema = transform.transformSchema(schema, {} as any); @@ -473,11 +425,6 @@ describe('rename', () => { }, ], }, - apiName: '', - cache, - pubsub, - baseDir, - importFn, }); const newSchema = transform.transformSchema(schema, {} as any); @@ -517,11 +464,6 @@ describe('rename', () => { }, ], }, - apiName: '', - cache, - pubsub, - baseDir, - importFn, }); const newSchema = transform.transformSchema(schema, {} as any); @@ -550,11 +492,6 @@ describe('rename', () => { }, ], }, - apiName: '', - cache, - pubsub, - baseDir, - importFn, }); const newSchema = transform.transformSchema(schema, {} as any); @@ -596,11 +533,6 @@ describe('rename', () => { }, ], }, - apiName: '', - cache, - pubsub, - baseDir, - importFn, }); const newSchema = transform.transformSchema(schema, {} as any); @@ -631,11 +563,6 @@ describe('rename', () => { }, ], }, - apiName: '', - cache, - pubsub, - baseDir, - importFn, }); const transformedSchema = transform.transformSchema(schema, {} as any); @@ -668,11 +595,6 @@ describe('rename', () => { }, ], }, - apiName: '', - cache, - pubsub, - baseDir, - importFn: m => import(m), }); const newSchema = transform.transformSchema(schema, {} as any); diff --git a/packages/transforms/rename/test/wrapRename.spec.ts b/packages/transforms/rename/test/wrapRename.spec.ts index 23df3fc2c3adb..a6312a26cd9fc 100644 --- a/packages/transforms/rename/test/wrapRename.spec.ts +++ b/packages/transforms/rename/test/wrapRename.spec.ts @@ -1,9 +1,13 @@ -import RenameTransform from './../src/index'; -import { buildSchema, graphql, GraphQLObjectType, printSchema, GraphQLNonNull, GraphQLScalarType } from 'graphql'; +import RenameTransform from './../src/index.js'; +import { + buildSchema, + graphql, + GraphQLObjectType, + printSchema, + GraphQLNonNull, + GraphQLScalarType, +} from 'graphql'; import { makeExecutableSchema } from '@graphql-tools/schema'; -import InMemoryLRUCache from '@graphql-mesh/cache-localforage'; -import { MeshPubSub } from '@graphql-mesh/types'; -import { PubSub } from '@graphql-mesh/utils'; import { wrapSchema } from '@graphql-tools/wrap'; describe('rename', () => { @@ -12,7 +16,12 @@ describe('rename', () => { type Query { my_user: MyUser! my_book: MyBook! - profile(profile_id: ID!, role: String, some_argument: String, another_argument: Int): Profile + profile( + profile_id: ID! + role: String + some_argument: String + another_argument: Int + ): Profile my_node(id: ID!): MyNode } @@ -52,22 +61,12 @@ describe('rename', () => { }, }, }); - let cache: InMemoryLRUCache; - let pubsub: MeshPubSub; - const baseDir: string = undefined; - - beforeEach(() => { - cache = new InMemoryLRUCache(); - pubsub = new PubSub(); - }); it('should change the name of a type', () => { const newSchema = wrapSchema({ schema, transforms: [ new RenameTransform({ - apiName: '', - importFn: m => import(m), config: { renames: [ { @@ -80,9 +79,6 @@ describe('rename', () => { }, ], }, - cache, - pubsub, - baseDir, }), ], }); @@ -97,8 +93,6 @@ describe('rename', () => { schema, transforms: [ new RenameTransform({ - apiName: '', - importFn: m => import(m), config: { mode: 'wrap', renames: [ @@ -114,9 +108,6 @@ describe('rename', () => { }, ], }, - cache, - pubsub, - baseDir, }), ], }); @@ -149,11 +140,6 @@ describe('rename', () => { }, ], }, - apiName: '', - cache, - pubsub, - baseDir, - importFn: m => import(m), }), ], }); @@ -191,11 +177,6 @@ describe('rename', () => { }, ], }, - apiName: '', - cache, - pubsub, - baseDir, - importFn: m => import(m), }), ], }); @@ -242,8 +223,6 @@ describe('rename', () => { schema, transforms: [ new RenameTransform({ - apiName: '', - importFn: m => import(m), config: { mode: 'wrap', renames: [ @@ -258,9 +237,6 @@ describe('rename', () => { }, ], }, - cache, - pubsub, - baseDir, }), ], }); @@ -280,8 +256,6 @@ describe('rename', () => { schema, transforms: [ new RenameTransform({ - apiName: '', - importFn: m => import(m), config: { mode: 'wrap', renames: [ @@ -296,9 +270,6 @@ describe('rename', () => { }, ], }, - cache, - pubsub, - baseDir, }), ], }); @@ -307,13 +278,21 @@ describe('rename', () => { const bookField = (newSchema.getType('Prefixed_MyBook') as GraphQLObjectType).getFields(); expect((userField.id.type as GraphQLNonNull).ofType.toString()).toBe('ID'); - expect((userField.name.type as GraphQLNonNull).ofType.toString()).toBe('String'); + expect((userField.name.type as GraphQLNonNull).ofType.toString()).toBe( + 'String', + ); - expect((profileField.id.type as GraphQLNonNull).ofType.toString()).toBe('ID'); - expect((profileField.isActive.type as GraphQLNonNull).ofType.toString()).toBe('Boolean'); + expect((profileField.id.type as GraphQLNonNull).ofType.toString()).toBe( + 'ID', + ); + expect( + (profileField.isActive.type as GraphQLNonNull).ofType.toString(), + ).toBe('Boolean'); expect((bookField.id.type as GraphQLNonNull).ofType.toString()).toBe('ID'); - expect((bookField.hits.type as GraphQLNonNull).ofType.toString()).toBe('Int'); + expect((bookField.hits.type as GraphQLNonNull).ofType.toString()).toBe( + 'Int', + ); expect(printSchema(newSchema)).toMatchSnapshot(); }); @@ -322,8 +301,6 @@ describe('rename', () => { schema, transforms: [ new RenameTransform({ - apiName: '', - importFn: m => import(m), config: { renames: [ { @@ -339,9 +316,6 @@ describe('rename', () => { }, ], }, - cache, - pubsub, - baseDir, }), ], }); @@ -363,8 +337,6 @@ describe('rename', () => { schema, transforms: [ new RenameTransform({ - apiName: '', - importFn: m => import(m), config: { mode: 'wrap', renames: [ @@ -381,9 +353,6 @@ describe('rename', () => { }, ], }, - cache, - pubsub, - baseDir, }), ], }); @@ -413,8 +382,6 @@ describe('rename', () => { schema, transforms: [ new RenameTransform({ - apiName: '', - importFn: m => import(m), config: { renames: [ { @@ -429,9 +396,6 @@ describe('rename', () => { }, ], }, - cache, - pubsub, - baseDir, }), ], }); @@ -456,8 +420,6 @@ describe('rename', () => { schema, transforms: [ new RenameTransform({ - apiName: '', - importFn: m => import(m), config: { renames: [ { @@ -472,9 +434,6 @@ describe('rename', () => { }, ], }, - cache, - pubsub, - baseDir, }), ], }); @@ -499,8 +458,6 @@ describe('rename', () => { schema, transforms: [ new RenameTransform({ - apiName: '', - importFn: m => import(m), config: { renames: [ { @@ -517,9 +474,6 @@ describe('rename', () => { }, ], }, - cache, - pubsub, - baseDir, }), ], }); @@ -547,8 +501,6 @@ describe('rename', () => { schema, transforms: [ new RenameTransform({ - apiName: '', - importFn: m => import(m), config: { renames: [ { @@ -565,9 +517,6 @@ describe('rename', () => { }, ], }, - cache, - pubsub, - baseDir, }), ], }); @@ -585,8 +534,6 @@ describe('rename', () => { schema, transforms: [ new RenameTransform({ - apiName: '', - importFn: m => import(m), config: { mode: 'wrap', renames: [ @@ -603,9 +550,6 @@ describe('rename', () => { }, ], }, - cache, - pubsub, - baseDir, }), ], }); @@ -636,8 +580,6 @@ describe('rename', () => { schema, transforms: [ new RenameTransform({ - apiName: '', - importFn: m => import(m), config: { mode: 'wrap', renames: [ @@ -655,9 +597,6 @@ describe('rename', () => { }, ], }, - cache, - pubsub, - baseDir, }), ], }); @@ -681,8 +620,6 @@ describe('rename', () => { schema, transforms: [ new RenameTransform({ - apiName: '', - importFn: m => import(m), config: { mode: 'wrap', renames: [ @@ -701,9 +638,6 @@ describe('rename', () => { }, ], }, - cache, - pubsub, - baseDir, }), ], }); @@ -727,8 +661,6 @@ describe('rename', () => { schema, transforms: [ new RenameTransform({ - apiName: '', - importFn: m => import(m), config: { mode: 'wrap', renames: [ @@ -748,9 +680,6 @@ describe('rename', () => { }, ], }, - cache, - pubsub, - baseDir, }), ], }); @@ -791,11 +720,6 @@ describe('rename', () => { }, ], }, - apiName: '', - cache, - pubsub, - baseDir, - importFn: m => import(m), }), ], }); @@ -819,8 +743,6 @@ describe('rename', () => { schema, transforms: [ new RenameTransform({ - apiName: '', - importFn: m => import(m), config: { mode: 'wrap', renames: [ @@ -834,9 +756,6 @@ describe('rename', () => { }, ], }, - cache, - pubsub, - baseDir, }), ], }); @@ -864,8 +783,6 @@ describe('rename', () => { `); const transform = new RenameTransform({ - apiName: '', - importFn: m => import(m), config: { mode: 'bare', renames: [ @@ -881,9 +798,6 @@ describe('rename', () => { }, ], }, - cache, - pubsub, - baseDir, }); const newSchema = transform.transformSchema(schema, {} as any); diff --git a/packages/transforms/replace-field/package.json b/packages/transforms/replace-field/package.json index c426d9cc0e5da..223b52ef682f0 100644 --- a/packages/transforms/replace-field/package.json +++ b/packages/transforms/replace-field/package.json @@ -1,25 +1,33 @@ { "name": "@graphql-mesh/transform-replace-field", "version": "0.3.112", + "type": "module", "repository": { "type": "git", "url": "Urigo/graphql-mesh", "directory": "packages/transforms/replace-field" }, "license": "MIT", - "main": "dist/index.js", - "module": "dist/index.mjs", + "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/index.d.ts", + "typings": "dist/typings/index.d.ts", "peerDependencies": { "graphql": "*" }, @@ -42,6 +50,6 @@ }, "sideEffects": false, "typescript": { - "definition": "dist/index.d.ts" + "definition": "dist/typings/index.d.ts" } } diff --git a/packages/transforms/replace-field/test/replace-field.spec.ts b/packages/transforms/replace-field/test/replace-field.spec.ts index b985086c0d4b5..2e1fa62bb8f1c 100644 --- a/packages/transforms/replace-field/test/replace-field.spec.ts +++ b/packages/transforms/replace-field/test/replace-field.spec.ts @@ -3,9 +3,9 @@ import { execute, parse, printSchema, GraphQLObjectType } from 'graphql'; import InMemoryLRUCache from '@graphql-mesh/cache-localforage'; import { ImportFn, MeshPubSub } from '@graphql-mesh/types'; import { makeExecutableSchema } from '@graphql-tools/schema'; -import { PubSub } from '@graphql-mesh/utils'; +import { DefaultLogger, PubSub } from '@graphql-mesh/utils'; -import ReplaceFieldTransform from '../src'; +import ReplaceFieldTransform from '../src/index.js'; import { pruneSchema } from '@graphql-tools/utils'; const importFn: ImportFn = m => @@ -15,8 +15,12 @@ const importFn: ImportFn = m => }); describe('replace-field', () => { - const mockQueryBooks = jest.fn().mockImplementation(() => ({ books: [{ title: 'abc' }, { title: 'def' }] })); - const mockBooksApiResponseBooks = jest.fn().mockImplementation(() => [{ title: 'ghi' }, { title: 'lmn' }]); + const mockQueryBooks = jest + .fn() + .mockImplementation(() => ({ books: [{ title: 'abc' }, { title: 'def' }] })); + const mockBooksApiResponseBooks = jest + .fn() + .mockImplementation(() => [{ title: 'ghi' }, { title: 'lmn' }]); const schemaDefs = /* GraphQL */ ` type Query { @@ -75,6 +79,7 @@ describe('replace-field', () => { baseDir, apiName: '', importFn, + logger: new DefaultLogger(), }); const schema = makeExecutableSchema({ typeDefs: schemaDefs, @@ -82,7 +87,9 @@ describe('replace-field', () => { const transformedSchema = pruneSchema(transform.transformSchema(schema)); expect(transformedSchema.getType('BooksApiResponse')).toBeUndefined(); - expect((transformedSchema.getType('Query') as GraphQLObjectType).getFields().books.type.toString()).toBe('[Book]'); + expect( + (transformedSchema.getType('Query') as GraphQLObjectType).getFields().books.type.toString(), + ).toBe('[Book]'); expect(printSchema(transformedSchema)).toMatchSnapshot(); }); @@ -130,6 +137,7 @@ describe('replace-field', () => { baseDir, apiName: '', importFn, + logger: new DefaultLogger(), }); const schema = makeExecutableSchema({ typeDefs: schemaDefs, @@ -144,7 +152,9 @@ describe('replace-field', () => { }); const transformedSchema = pruneSchema(transform.transformSchema(schema)); - expect((transformedSchema.getType('Author') as GraphQLObjectType).getFields().age.type.toString()).toBe('String'); + expect( + (transformedSchema.getType('Author') as GraphQLObjectType).getFields().age.type.toString(), + ).toBe('String'); expect(printSchema(transformedSchema)).toMatchSnapshot(); const result = await execute({ @@ -190,6 +200,7 @@ describe('replace-field', () => { baseDir, apiName: '', importFn, + logger: new DefaultLogger(), }); const schema = makeExecutableSchema({ typeDefs: schemaDefs, @@ -205,7 +216,9 @@ describe('replace-field', () => { const transformedSchema = pruneSchema(transform.transformSchema(schema)); expect(transformedSchema.getType('BooksApiResponse')).toBeUndefined(); - expect((transformedSchema.getType('Query') as GraphQLObjectType).getFields().books.type.toString()).toBe('[Book]'); + expect( + (transformedSchema.getType('Query') as GraphQLObjectType).getFields().books.type.toString(), + ).toBe('[Book]'); const result = await execute({ schema: transformedSchema, @@ -251,6 +264,7 @@ describe('replace-field', () => { baseDir, apiName: '', importFn, + logger: new DefaultLogger(), }); const schema = makeExecutableSchema({ typeDefs: schemaDefs, @@ -263,7 +277,9 @@ describe('replace-field', () => { const transformedSchema = pruneSchema(transform.transformSchema(schema)); expect(transformedSchema.getType('Author')).toBeUndefined(); - expect((transformedSchema.getType('Book') as GraphQLObjectType).getFields().author.type.toString()).toBe('String!'); + expect( + (transformedSchema.getType('Book') as GraphQLObjectType).getFields().author.type.toString(), + ).toBe('String!'); const result: any = await execute({ schema: transformedSchema, @@ -324,6 +340,7 @@ describe('replace-field', () => { baseDir, apiName: '', importFn, + logger: new DefaultLogger(), }); const schema = makeExecutableSchema({ typeDefs: schemaDefs, @@ -340,8 +357,12 @@ describe('replace-field', () => { expect(transformedSchema.getType('BooksApiResponse')).toBeUndefined(); expect(transformedSchema.getType('Author')).toBeUndefined(); - expect((transformedSchema.getType('Query') as GraphQLObjectType).getFields().books.type.toString()).toBe('[Book]'); - expect((transformedSchema.getType('Book') as GraphQLObjectType).getFields().author.type.toString()).toBe('String!'); + expect( + (transformedSchema.getType('Query') as GraphQLObjectType).getFields().books.type.toString(), + ).toBe('[Book]'); + expect( + (transformedSchema.getType('Book') as GraphQLObjectType).getFields().author.type.toString(), + ).toBe('String!'); expect(printSchema(transformedSchema)).toMatchSnapshot(); const result = await execute({ @@ -389,6 +410,7 @@ describe('replace-field', () => { baseDir, apiName: '', importFn, + logger: new DefaultLogger(), }); const schema = makeExecutableSchema({ typeDefs: schemaDefs, @@ -453,6 +475,7 @@ describe('replace-field', () => { baseDir, apiName: '', importFn, + logger: new DefaultLogger(), }); const schema = makeExecutableSchema({ typeDefs: schemaDefs, @@ -464,7 +487,9 @@ describe('replace-field', () => { }); const transformedSchema = pruneSchema(transform.transformSchema(schema)); - expect((transformedSchema.getType('Book') as GraphQLObjectType).getFields().code.type.toString()).toBe('String!'); + expect( + (transformedSchema.getType('Book') as GraphQLObjectType).getFields().code.type.toString(), + ).toBe('String!'); const result: any = await execute({ schema: transformedSchema, @@ -519,6 +544,7 @@ describe('replace-field', () => { baseDir, apiName: '', importFn, + logger: new DefaultLogger(), }); const schema = makeExecutableSchema({ typeDefs: schemaDefs, @@ -530,10 +556,14 @@ describe('replace-field', () => { }); const transformedSchema = pruneSchema(transform.transformSchema(schema)); - expect((transformedSchema.getType('Author') as GraphQLObjectType).getFields().name).toBeUndefined(); - expect((transformedSchema.getType('Author') as GraphQLObjectType).getFields().fullName.type.toString()).toBe( - 'String' - ); + expect( + (transformedSchema.getType('Author') as GraphQLObjectType).getFields().name, + ).toBeUndefined(); + expect( + (transformedSchema.getType('Author') as GraphQLObjectType) + .getFields() + .fullName.type.toString(), + ).toBe('String'); const result: any = await execute({ schema: transformedSchema, @@ -579,6 +609,7 @@ describe('replace-field', () => { baseDir, apiName: '', importFn, + logger: new DefaultLogger(), }); const schema = makeExecutableSchema({ typeDefs: schemaDefs, @@ -594,10 +625,14 @@ describe('replace-field', () => { const transformedSchema = pruneSchema(transform.transformSchema(schema)); expect(transformedSchema.getType('BooksApiResponse')).toBeUndefined(); - expect((transformedSchema.getType('Query') as GraphQLObjectType).getFields().books).toBeUndefined(); - expect((transformedSchema.getType('Query') as GraphQLObjectType).getFields().ourBooks.type.toString()).toBe( - '[Book]' - ); + expect( + (transformedSchema.getType('Query') as GraphQLObjectType).getFields().books, + ).toBeUndefined(); + expect( + (transformedSchema.getType('Query') as GraphQLObjectType) + .getFields() + .ourBooks.type.toString(), + ).toBe('[Book]'); const result = await execute({ schema: transformedSchema, @@ -644,6 +679,7 @@ describe('replace-field', () => { baseDir, apiName: '', importFn, + logger: new DefaultLogger(), }); const schema = makeExecutableSchema({ typeDefs: schemaDefs, @@ -656,10 +692,14 @@ describe('replace-field', () => { const transformedSchema = pruneSchema(transform.transformSchema(schema)); expect(transformedSchema.getType('Author')).toBeUndefined(); - expect((transformedSchema.getType('Book') as GraphQLObjectType).getFields().author).toBeUndefined(); - expect((transformedSchema.getType('Book') as GraphQLObjectType).getFields().authorName.type.toString()).toBe( - 'String!' - ); + expect( + (transformedSchema.getType('Book') as GraphQLObjectType).getFields().author, + ).toBeUndefined(); + expect( + (transformedSchema.getType('Book') as GraphQLObjectType) + .getFields() + .authorName.type.toString(), + ).toBe('String!'); const result: any = await execute({ schema: transformedSchema, @@ -707,6 +747,7 @@ describe('replace-field', () => { baseDir, apiName: '', importFn, + logger: new DefaultLogger(), }); const schema = makeExecutableSchema({ typeDefs: schemaDefs, @@ -721,10 +762,14 @@ describe('replace-field', () => { }); const transformedSchema = pruneSchema(transform.transformSchema(schema)); - expect((transformedSchema.getType('Query') as GraphQLObjectType).getFields().books).toBeUndefined(); - expect((transformedSchema.getType('Query') as GraphQLObjectType).getFields().ourBooks.type.toString()).toBe( - '[Book]' - ); + expect( + (transformedSchema.getType('Query') as GraphQLObjectType).getFields().books, + ).toBeUndefined(); + expect( + (transformedSchema.getType('Query') as GraphQLObjectType) + .getFields() + .ourBooks.type.toString(), + ).toBe('[Book]'); const result = await execute({ schema: transformedSchema, @@ -777,6 +822,7 @@ describe('replace-field', () => { baseDir, apiName: '', importFn, + logger: new DefaultLogger(), }); const schema = makeExecutableSchema({ typeDefs: schemaDefs, @@ -788,10 +834,14 @@ describe('replace-field', () => { }); const transformedSchema = pruneSchema(transform.transformSchema(schema)); - expect((transformedSchema.getType('Book') as GraphQLObjectType).getFields().code).toBeUndefined(); - expect((transformedSchema.getType('Book') as GraphQLObjectType).getFields().isAvailable.type.toString()).toBe( - 'Boolean' - ); + expect( + (transformedSchema.getType('Book') as GraphQLObjectType).getFields().code, + ).toBeUndefined(); + expect( + (transformedSchema.getType('Book') as GraphQLObjectType) + .getFields() + .isAvailable.type.toString(), + ).toBe('Boolean'); const result: any = await execute({ schema: transformedSchema, @@ -834,6 +884,7 @@ describe('replace-field', () => { baseDir, apiName: '', importFn, + logger: new DefaultLogger(), }); const schema = makeExecutableSchema({ typeDefs: schemaDefs, @@ -856,7 +907,7 @@ describe('replace-field', () => { expect.arrayContaining([ expect.objectContaining({ name: 'maxResults' }), expect.objectContaining({ name: 'orderBy' }), - ]) + ]), ); expect(mockBooksApiResponseBooks).not.toHaveBeenCalled(); @@ -929,6 +980,7 @@ describe('replace-field', () => { baseDir, apiName: '', importFn, + logger: new DefaultLogger(), }); const schema = makeExecutableSchema({ typeDefs: schemaDefs, @@ -936,12 +988,18 @@ describe('replace-field', () => { const transformedSchema = pruneSchema(transform.transformSchema(schema)); expect(transformedSchema.getType('BooksApiResponse')).toBeUndefined(); - expect((transformedSchema.getType('Book') as GraphQLObjectType).getFields().code).toBeUndefined(); - expect((transformedSchema.getType('Book') as GraphQLObjectType).getFields().isAvailable.type.toString()).toBe( - 'Boolean' - ); + expect( + (transformedSchema.getType('Book') as GraphQLObjectType).getFields().code, + ).toBeUndefined(); + expect( + (transformedSchema.getType('Book') as GraphQLObjectType) + .getFields() + .isAvailable.type.toString(), + ).toBe('Boolean'); expect(transformedSchema.getType('Author')).toBeUndefined(); - expect((transformedSchema.getType('Book') as GraphQLObjectType).getFields().author.type.toString()).toBe('String!'); + expect( + (transformedSchema.getType('Book') as GraphQLObjectType).getFields().author.type.toString(), + ).toBe('String!'); expect(printSchema(transformedSchema)).toMatchSnapshot(); }); diff --git a/packages/transforms/resolvers-composition/package.json b/packages/transforms/resolvers-composition/package.json index 8dc03907f3c03..c5621c8686165 100644 --- a/packages/transforms/resolvers-composition/package.json +++ b/packages/transforms/resolvers-composition/package.json @@ -1,25 +1,33 @@ { "name": "@graphql-mesh/transform-resolvers-composition", "version": "0.12.111", + "type": "module", "repository": { "type": "git", "url": "Urigo/graphql-mesh", "directory": "packages/transforms/resolvers-composition" }, "license": "MIT", - "main": "dist/index.js", - "module": "dist/index.mjs", + "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/index.d.ts", + "typings": "dist/typings/index.d.ts", "peerDependencies": { "graphql": "*" }, @@ -36,6 +44,6 @@ }, "sideEffects": false, "typescript": { - "definition": "dist/index.d.ts" + "definition": "dist/typings/index.d.ts" } } diff --git a/packages/transforms/resolvers-composition/test/transform.spec.ts b/packages/transforms/resolvers-composition/test/transform.spec.ts index 4e124dd73fe24..5fca41cb5f3b1 100644 --- a/packages/transforms/resolvers-composition/test/transform.spec.ts +++ b/packages/transforms/resolvers-composition/test/transform.spec.ts @@ -1,8 +1,8 @@ import InMemoryLRUCache from '@graphql-mesh/cache-localforage'; import { makeExecutableSchema } from '@graphql-tools/schema'; -import { PubSub } from '@graphql-mesh/utils'; +import { DefaultLogger, PubSub } from '@graphql-mesh/utils'; import { join } from 'path'; -import ResolversCompositionTransform, { ResolversComposition } from '../src'; +import ResolversCompositionTransform, { ResolversComposition } from '../src/index.js'; import { execute, parse } from 'graphql'; describe('transform', () => { @@ -21,6 +21,7 @@ describe('transform', () => { baseDir, apiName: '', importFn: m => import(m), + logger: new DefaultLogger(), }); const schema = makeExecutableSchema({ typeDefs: /* GraphQL */ ` @@ -59,6 +60,7 @@ describe('transform', () => { baseDir, apiName: '', importFn: m => import(m), + logger: new DefaultLogger(), }); const schema = makeExecutableSchema({ typeDefs: /* GraphQL */ ` diff --git a/packages/transforms/type-merging/package.json b/packages/transforms/type-merging/package.json index 3fb5ca155f9c0..e61a08bb080c0 100644 --- a/packages/transforms/type-merging/package.json +++ b/packages/transforms/type-merging/package.json @@ -1,25 +1,33 @@ { "name": "@graphql-mesh/transform-type-merging", "version": "0.4.56", + "type": "module", "repository": { "type": "git", "url": "Urigo/graphql-mesh", "directory": "packages/transforms/type-merging" }, "license": "MIT", - "main": "dist/index.js", - "module": "dist/index.mjs", + "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/index.d.ts", + "typings": "dist/typings/index.d.ts", "peerDependencies": { "graphql": "*" }, @@ -36,6 +44,6 @@ }, "sideEffects": false, "typescript": { - "definition": "dist/index.d.ts" + "definition": "dist/typings/index.d.ts" } } diff --git a/packages/types/package.json b/packages/types/package.json index d8f906ac6b2a6..727200a0dcbb0 100644 --- a/packages/types/package.json +++ b/packages/types/package.json @@ -1,25 +1,33 @@ { "name": "@graphql-mesh/types", "version": "0.87.1", + "type": "module", "repository": { "type": "git", "url": "Urigo/graphql-mesh", "directory": "packages/types" }, "license": "MIT", - "main": "dist/index.js", - "module": "dist/index.mjs", + "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/index.d.ts", + "typings": "dist/typings/index.d.ts", "peerDependencies": { "graphql": "*" }, @@ -37,6 +45,6 @@ }, "sideEffects": false, "typescript": { - "definition": "dist/index.d.ts" + "definition": "dist/typings/index.d.ts" } } diff --git a/packages/types/src/index.ts b/packages/types/src/index.ts index e95af8ad74ad7..14fa11ce201d9 100644 --- a/packages/types/src/index.ts +++ b/packages/types/src/index.ts @@ -1,7 +1,7 @@ /* eslint-disable @typescript-eslint/no-misused-new */ import { IResolvers, Executor } from '@graphql-tools/utils'; import { GraphQLSchema, GraphQLResolveInfo, DocumentNode, SelectionSetNode } from 'graphql'; -import * as YamlConfig from './config'; +import * as YamlConfig from './config.js'; import { Transform, MergedTypeConfig, diff --git a/packages/urql/package.json b/packages/urql/package.json index b9da3076e2685..731ba6113d229 100644 --- a/packages/urql/package.json +++ b/packages/urql/package.json @@ -1,28 +1,38 @@ { "name": "@graphql-mesh/urql-exchange", "version": "8.0.6", - "license": "MIT", + "type": "module", "repository": { "type": "git", "url": "Urigo/graphql-mesh", "directory": "packages/urql" }, - "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": { + "@graphql-mesh/runtime": "^0.44.32", + "@urql/core": "^2.4.3", + "graphql": "^15.2.0 || ^16.0.0", + "wonka": "^4.0.15" }, "dependencies": { "@graphql-tools/utils": "9.1.1", @@ -32,14 +42,12 @@ "@urql/core": "2.6.1", "wonka": "4.0.15" }, - "peerDependencies": { - "@graphql-mesh/runtime": "^0.44.32", - "graphql": "^15.2.0 || ^16.0.0", - "@urql/core": "^2.4.3", - "wonka": "^4.0.15" - }, "publishConfig": { "access": "public", "directory": "dist" + }, + "sideEffects": false, + "typescript": { + "definition": "dist/typings/index.d.ts" } } diff --git a/packages/urql/test/urql-exchange.test.ts b/packages/urql/test/urql-exchange.test.ts index 6f3f67ec8c68f..61617560a5f8d 100644 --- a/packages/urql/test/urql-exchange.test.ts +++ b/packages/urql/test/urql-exchange.test.ts @@ -1,7 +1,7 @@ import { createClient, Client, OperationResult } from '@urql/core'; import { MeshInstance } from '@graphql-mesh/runtime'; -import { meshExchange } from '../src'; -import { getTestMesh } from '../../testing/getTestMesh'; +import { meshExchange } from '../src/index.js'; +import { getTestMesh } from '../../testing/getTestMesh.js'; import { observableToAsyncIterable } from '@graphql-tools/utils'; import { pipe, toObservable } from 'wonka'; diff --git a/packages/utils/package.json b/packages/utils/package.json index 24a99419e643d..923b67ad6af4b 100644 --- a/packages/utils/package.json +++ b/packages/utils/package.json @@ -1,25 +1,33 @@ { "name": "@graphql-mesh/utils", "version": "0.42.9", + "type": "module", "repository": { "type": "git", "url": "Urigo/graphql-mesh", "directory": "packages/utils" }, "license": "MIT", - "main": "dist/index.js", - "module": "dist/index.mjs", + "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/index.d.ts", + "typings": "dist/typings/index.d.ts", "peerDependencies": { "graphql": "*" }, @@ -48,6 +56,6 @@ }, "sideEffects": false, "typescript": { - "definition": "dist/index.d.ts" + "definition": "dist/typings/index.d.ts" } } diff --git a/packages/utils/src/defaultImportFn.ts b/packages/utils/src/defaultImportFn.ts index bd3a11ac85cbe..0ebc89b17449c 100644 --- a/packages/utils/src/defaultImportFn.ts +++ b/packages/utils/src/defaultImportFn.ts @@ -1,6 +1,6 @@ import { path as pathModule } from '@graphql-mesh/cross-helpers'; -export async function defaultImportFn(path: string): Promise { +async function defaultImportFn(path: string): Promise { let module = await import(/* @vite-ignore */ path) .catch(e => { if (e.code === 'ERR_REQUIRE_ESM') { @@ -30,3 +30,5 @@ export async function defaultImportFn(path: string): Promise { } return module; } + +export { defaultImportFn }; diff --git a/packages/utils/src/index.ts b/packages/utils/src/index.ts index a7ef703374bdb..21d252a718965 100644 --- a/packages/utils/src/index.ts +++ b/packages/utils/src/index.ts @@ -1,16 +1,16 @@ -export * from './read-file-or-url'; -export * from './load-from-module-export-expression'; -export * from './with-cancel'; -export * from './extract-resolvers'; -export * from './group-transforms'; -export * from './apply-transforms'; -export * from './fs-operations'; -export * from './global-lru-cache'; -export * from './sanitize-name-for-graphql'; -export * from './resolve-additional-resolvers'; -export * from './logger'; -export * from './parseAndPrintWithCache'; -export * from './defaultImportFn'; -export * from './pubsub'; -export * from './fileURLToPath'; -export * from './getHeadersObj'; +export * from './read-file-or-url.js'; +export * from './load-from-module-export-expression.js'; +export * from './with-cancel.js'; +export * from './extract-resolvers.js'; +export * from './group-transforms.js'; +export * from './apply-transforms.js'; +export * from './fs-operations.js'; +export * from './global-lru-cache.js'; +export * from './sanitize-name-for-graphql.js'; +export * from './resolve-additional-resolvers.js'; +export * from './logger.js'; +export * from './parseAndPrintWithCache.js'; +export * from './defaultImportFn.js'; +export * from './pubsub.js'; +export * from './fileURLToPath.js'; +export * from './getHeadersObj.js'; diff --git a/packages/utils/src/load-from-module-export-expression.ts b/packages/utils/src/load-from-module-export-expression.ts index 6e065b5a7634f..45d8bd4892acc 100644 --- a/packages/utils/src/load-from-module-export-expression.ts +++ b/packages/utils/src/load-from-module-export-expression.ts @@ -1,7 +1,7 @@ /* eslint-disable @typescript-eslint/return-await */ import { path } from '@graphql-mesh/cross-helpers'; import { ImportFn } from '@graphql-mesh/types'; -import { defaultImportFn } from './defaultImportFn'; +import { defaultImportFn } from './defaultImportFn.js'; type LoadFromModuleExportExpressionOptions = { defaultExportName: string; diff --git a/packages/utils/src/parseAndPrintWithCache.ts b/packages/utils/src/parseAndPrintWithCache.ts index 3a36735196a6a..d2d4a8564dff6 100644 --- a/packages/utils/src/parseAndPrintWithCache.ts +++ b/packages/utils/src/parseAndPrintWithCache.ts @@ -1,6 +1,6 @@ import { memoize1 } from '@graphql-tools/utils'; import { DocumentNode, parse, print } from 'graphql'; -import { createLruCache } from './global-lru-cache'; +import { createLruCache } from './global-lru-cache.js'; const parseCache = createLruCache(1000, 3600); const printCache = createLruCache(1000, 3600); diff --git a/packages/utils/src/read-file-or-url.ts b/packages/utils/src/read-file-or-url.ts index c7b77ed1a3d12..3c6d91f11f132 100644 --- a/packages/utils/src/read-file-or-url.ts +++ b/packages/utils/src/read-file-or-url.ts @@ -1,7 +1,7 @@ import { DEFAULT_SCHEMA, load as loadYamlFromJsYaml, Schema, Type } from 'js-yaml'; import { fs, path as pathModule } from '@graphql-mesh/cross-helpers'; import { ImportFn, Logger, MeshFetch } from '@graphql-mesh/types'; -import { loadFromModuleExportExpression } from './load-from-module-export-expression'; +import { loadFromModuleExportExpression } from './load-from-module-export-expression.js'; export interface ReadFileOrUrlOptions extends RequestInit { allowUnknownExtensions?: boolean; diff --git a/packages/utils/src/resolve-additional-resolvers.ts b/packages/utils/src/resolve-additional-resolvers.ts index c62fe594103c0..aed56c79ffd6c 100644 --- a/packages/utils/src/resolve-additional-resolvers.ts +++ b/packages/utils/src/resolve-additional-resolvers.ts @@ -13,12 +13,12 @@ import { isObjectType, GraphQLNamedType, } from 'graphql'; -import { withFilter } from './with-filter'; +import { withFilter } from './with-filter.js'; import lodashGet from 'lodash.get'; import lodashSet from 'lodash.set'; import toPath from 'lodash.topath'; import { stringInterpolator } from '@graphql-mesh/string-interpolation'; -import { loadFromModuleExportExpression } from './load-from-module-export-expression'; +import { loadFromModuleExportExpression } from './load-from-module-export-expression.js'; import { process } from '@graphql-mesh/cross-helpers'; function getTypeByPath(type: GraphQLType, path: string[]): GraphQLNamedType { diff --git a/packages/utils/test/pubsub.spec.ts b/packages/utils/test/pubsub.spec.ts index 87ecafd57ca47..1a9d5dd0c4f50 100644 --- a/packages/utils/test/pubsub.spec.ts +++ b/packages/utils/test/pubsub.spec.ts @@ -1,4 +1,4 @@ -import { PubSub } from '../src/pubsub'; +import { PubSub } from '../src/pubsub.js'; describe('Mesh PubSub', () => { it('should handle topics properly', async () => { diff --git a/packages/utils/test/read-file-or-url.spec.ts b/packages/utils/test/read-file-or-url.spec.ts index bb3c52c3b5c7b..8e623747f0572 100644 --- a/packages/utils/test/read-file-or-url.spec.ts +++ b/packages/utils/test/read-file-or-url.spec.ts @@ -1,8 +1,8 @@ import { writeFileSync } from 'fs'; import { tmpdir } from 'os'; import { join, relative } from 'path'; -import { DefaultLogger } from '../src/logger'; -import { readFile } from '../src/read-file-or-url'; +import { DefaultLogger } from '../src/logger.js'; +import { readFile } from '../src/read-file-or-url.js'; import { fetch } from '@whatwg-node/fetch'; describe('readFile', () => { diff --git a/packages/utils/test/sanitize-name-for-graphql.test.ts b/packages/utils/test/sanitize-name-for-graphql.test.ts index 5286d58e90bc7..37b828e7af100 100644 --- a/packages/utils/test/sanitize-name-for-graphql.test.ts +++ b/packages/utils/test/sanitize-name-for-graphql.test.ts @@ -1,4 +1,4 @@ -import { removeClosedBrackets } from '../src/sanitize-name-for-graphql'; +import { removeClosedBrackets } from '../src/sanitize-name-for-graphql.js'; it.each([ { input: 'foo(bar)q', output: 'foobarq' }, diff --git a/packages/utils/test/with-filter.spec.ts b/packages/utils/test/with-filter.spec.ts index 9d433fdb9196c..5fd2f3f3247ac 100644 --- a/packages/utils/test/with-filter.spec.ts +++ b/packages/utils/test/with-filter.spec.ts @@ -1,4 +1,4 @@ -import { withFilter } from '../src/with-filter'; +import { withFilter } from '../src/with-filter.js'; function isEven(x: number) { if (x === undefined) { diff --git a/renovate.json b/renovate.json index 88d0cbc0d0d07..7c98680e23723 100644 --- a/renovate.json +++ b/renovate.json @@ -10,9 +10,9 @@ "excludePackagePatterns": [ "@changesets/*", "typescript", - "typedoc*", + "typedoc*", "^@theguild/", - "@graphql-inspector/core", + "@graphql-inspector/core", "next" ], "matchPackagePatterns": ["*"], diff --git a/scripts/fix-bin.js b/scripts/fix-bin.js index 836b0bd3429f0..d2c81cfb2d3bf 100644 --- a/scripts/fix-bin.js +++ b/scripts/fix-bin.js @@ -1,8 +1,16 @@ -const { readdirSync, lstatSync, ensureSymlinkSync, chmodSync, writeFileSync } = require('fs-extra'); +const { + readdirSync, + lstatSync, + ensureSymlinkSync, + chmodSync, + writeFileSync, + unlinkSync, + existsSync, +} = require('fs-extra'); const { resolve, join } = require('path'); const absoluteExamplesDirPath = resolve(__dirname, '../examples'); -const absoluteGraphqlMeshBinPath = resolve(__dirname, '../packages/cli/dist/bin.js'); +const absoluteGraphqlMeshBinPath = resolve(__dirname, '../packages/cli/dist/cjs/bin.js'); const dir = readdirSync(absoluteExamplesDirPath); dir.push('../website'); for (const path of dir) { diff --git a/tsconfig.build.json b/tsconfig.build.json deleted file mode 100644 index cbfb5a5124e34..0000000000000 --- a/tsconfig.build.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "extends": "./tsconfig.json", - "exclude": ["**/node_modules", "**/dist", "**/test/*.ts", "*.spec.ts", "packages/playground"] -} diff --git a/tsconfig.json b/tsconfig.json index 58984c6187758..5c403c220d818 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -25,22 +25,22 @@ "allowJs": true, "paths": { - "@graphql-mesh/cli": ["packages/cli/src/index.ts"], - "@graphql-mesh/runtime": ["packages/runtime/src/index.ts"], - "@graphql-mesh/config": ["packages/config/src/index.ts"], - "@graphql-mesh/types": ["packages/types/src/index.ts"], - "@graphql-mesh/utils": ["packages/utils/src/index.ts"], - "@graphql-mesh/store": ["packages/store/src/index.ts"], - "@graphql-mesh/http": ["packages/http/src/index.ts"], - "@graphql-mesh/cache-*": ["packages/cache/*/src/index.ts"], - "@graphql-mesh/transform-*": ["packages/transforms/*/src/index.ts"], - "@graphql-mesh/merger-*": ["packages/mergers/*/src/index.ts"], - "@graphql-mesh/plugin-*": ["packages/plugins/*/src/index.ts"], + "@graphql-mesh/cli": ["packages/cli/src/index"], + "@graphql-mesh/runtime": ["packages/runtime/src/index"], + "@graphql-mesh/config": ["packages/config/src/index"], + "@graphql-mesh/types": ["packages/types/src/index"], + "@graphql-mesh/utils": ["packages/utils/src/index"], + "@graphql-mesh/store": ["packages/store/src/index"], + "@graphql-mesh/http": ["packages/http/src/index"], + "@graphql-mesh/cache-*": ["packages/cache/*/src/index"], + "@graphql-mesh/transform-*": ["packages/transforms/*/src/index"], + "@graphql-mesh/merger-*": ["packages/mergers/*/src/index"], + "@graphql-mesh/plugin-*": ["packages/plugins/*/src/index"], "@graphql-mesh/cross-helpers": ["packages/cross-helpers/index"], "@graphql-mesh/string-interpolation": ["packages/string-interpolation/src/index"], - "@graphql-mesh/*": ["packages/handlers/*/src/index.ts"], - "json-machete": ["packages/json-machete/src/index.ts"], - "@omnigraph/*": ["packages/loaders/*/src/index.ts"] + "@graphql-mesh/*": ["packages/handlers/*/src/index"], + "json-machete": ["packages/json-machete/src/index"], + "@omnigraph/*": ["packages/loaders/*/src/index"] } }, "include": ["./declarations.d.ts", "packages"], diff --git a/website/package.json b/website/package.json index 008620641f734..6d85f773a1ebe 100644 --- a/website/package.json +++ b/website/package.json @@ -4,11 +4,11 @@ "type": "module", "private": true, "scripts": { + "analyze": "cross-env ANALYZE=true next build", "build": "next build && next-sitemap --config next-sitemap.config.cjs ", "dev": "next dev", "next": "next", - "start": "next start", - "analyze": "cross-env ANALYZE=true next build" + "start": "next start" }, "dependencies": { "@theguild/components": "4.4.0", @@ -18,6 +18,17 @@ "react-dom": "18.2.0", "react-icons": "4.7.1" }, + "devDependencies": { + "@theguild/algolia": "1.0.2", + "@theguild/tailwind-config": "0.2.1", + "@types/node": "18.11.10", + "@types/react": "18.0.26", + "cross-env": "7.0.3", + "eslint-config-next": "13.0.6", + "postcss-import": "15.0.1", + "tailwindcss": "3.2.4", + "typescript": "4.9.3" + }, "browserslist": { "production": [ ">0.2%", @@ -29,16 +40,5 @@ "last 1 firefox version", "last 1 safari version" ] - }, - "devDependencies": { - "@theguild/algolia": "1.0.2", - "@theguild/tailwind-config": "0.2.1", - "@types/node": "18.11.11", - "@types/react": "18.0.26", - "cross-env": "7.0.3", - "eslint-config-next": "13.0.6", - "postcss-import": "15.0.1", - "tailwindcss": "3.2.4", - "typescript": "4.9.3" } } diff --git a/website/src/pages/docs/cache/cfwKv.mdx b/website/src/pages/docs/cache/cfwKv.mdx index de91a17c15e5f..caa630b69979c 100644 --- a/website/src/pages/docs/cache/cfwKv.mdx +++ b/website/src/pages/docs/cache/cfwKv.mdx @@ -2,7 +2,7 @@ import { PackageCmd } from '@theguild/components' # CloudFlare Workers KV -If you are using Mesh on Cloudflare Workers, you can use [*KV*](https://developers.cloudflare.com/workers/runtime-apis/kv/) as a storage. +If you are using Mesh on Cloudflare Workers, you can use [_KV_](https://developers.cloudflare.com/workers/runtime-apis/kv/) as a storage. To get started with this caching strategy, install it: diff --git a/website/src/pages/docs/config-reference.mdx b/website/src/pages/docs/config-reference.mdx index ba33da4e10e02..1460e142c1f11 100644 --- a/website/src/pages/docs/config-reference.mdx +++ b/website/src/pages/docs/config-reference.mdx @@ -6,46 +6,38 @@ Commonly, configuration file is named `.meshrc.yaml` and placed in the root of y `yml`, `json`, `.ts`, `.js` and `.cjs` files are also supported. - ## `sources` Mandatory field. Defines the list of your external data sources for your API mesh. Acceptable external sources, with detailed specific configurations, available in the [Handlers](/docs/handlers) section. - ## `transforms` Defines the list of manipulations to apply to the unified mesh schema. Available transforms available in the [Transforms](/docs/transforms) section. - ## `additionalTypeDefs` Additional type definitions, or type definitions overrides you wish to add to the schema mesh. [Read more](/docs/getting-started/combine-multiple-sources#setup-hierarchy-with-nested-queries) - ## `additionalResolvers` Additional resolvers, or resolvers overrides you wish to add to the schema mesh. [Read more](/docs/guides/extending-unified-schema#programmatic-additionalresolvers) - ## `plugins` Extend the mesh schema's capabilities with additional [plugins](/docs/plugins/plugins-introduction). - ## `additionalEnvelopPlugins` Additional plugins from [Envelop Ecosystem](https://www.envelop.dev/plugins). [Read more](/docs/plugins/plugins-introduction#additional-plugins) - ## `cache` Configure the [caching strategy](/docs/cache) for your unified schema. - ## `serve` Mesh as a server configuration. [Read more](/docs/getting-started/customize-mesh-server#provide-a-standalone-server-implementation) @@ -56,7 +48,6 @@ import Serve from '../../generated-markdown/ServeConfig.generated.md' - ## `sdk` SDK generation configurations. [Read more](/docs/guides/mesh-sdk#getting-started) @@ -67,7 +58,6 @@ import SDK from '../../generated-markdown/SDKConfig.generated.md' - ## `documents` Provide a query or queries for GraphQL Playground, validation and SDK Generation. @@ -75,37 +65,30 @@ The value can be the file path, glob expression for the file paths or the SDL. `.js`, `.jsx`, `.graphql`, `.gql`, `.ts` and `.tsx` files are supported. [Read more](/docs/guides/mesh-sdk#getting-started) - ## `customFetch` Path to a custom W3 Compatible Fetch Implementation. [Example](/docs/handlers/openapi#accepting-one-of-the-cookies-header-or-context-value) - ## `logger` Logger instance that matches `Console` interface of NodeJS. - ## `merger` Merge method. Either 'stitching', 'bare' or 'federation' are acceptable. - ## `pubsub` PubSub Implementation. - ## `skipSSLValidation` Allow connections to an SSL endpoint without certificates (type: `Boolean`). - ## `codegen` GraphQL Code Generator Configuration. [Read more](/docs/guides/graphql-code-generator#customizing-the-graphql-code-generator-configuration - ## `require` Loads specific require extensions before running the GraphQL Code Generator and reading the configuration. diff --git a/website/src/pages/docs/getting-started/deploy-mesh-gateway.mdx b/website/src/pages/docs/getting-started/deploy-mesh-gateway.mdx index 070df0d7f9a4e..125a5029392f6 100644 --- a/website/src/pages/docs/getting-started/deploy-mesh-gateway.mdx +++ b/website/src/pages/docs/getting-started/deploy-mesh-gateway.mdx @@ -85,7 +85,7 @@ const app = createBuiltMeshHTTPHandler() export const handler: Handler = configure({ // Pass Mesh HTTP handler as app - app, + app }) ``` @@ -103,6 +103,7 @@ self.addEventListener('fetch', createBuiltMeshHTTPHandler()) ``` You can see the following examples for more details: + - [Response Caching on a REST API](https://github.com/Urigo/graphql-mesh/tree/master/examples/cloudflare-workers) - [Response Caching on a GraphQL API](https://github.com/Urigo/graphql-mesh/tree/master/examples/spacex-cfw) @@ -171,7 +172,7 @@ app.route({ // Second parameter adds Fastify's `req` and `reply` to the GraphQL Context const response = await meshHttp.handleNodeRequest(req, { req, - reply, + reply }) response.headers.forEach((value, key) => { reply.header(key, value) @@ -182,7 +183,7 @@ app.route({ reply.send(response.body) return reply - }, + } }) ``` @@ -208,7 +209,7 @@ import { createBuiltMeshHTTPHandler } from './.mesh' const app = new Koa() const meshHttp = createBuiltMeshHTTPHandler() -app.use(async (ctx) => { +app.use(async ctx => { // Second parameter adds Koa's context into GraphQL Context const response = await meshHttp.handleNodeRequest(ctx.req, ctx) @@ -234,10 +235,7 @@ import { createBuiltMeshHTTPHandler } from './.mesh' const meshHttp = createBuiltMeshHTTPHandler() -export { - meshHttp as get, - meshHttp as post, -} +export { meshHttp as get, meshHttp as post } ``` ## Mesh and Docker diff --git a/website/src/pages/docs/guides/auth0.mdx b/website/src/pages/docs/guides/auth0.mdx index 4c2c6be8efba4..872610e351ed0 100644 --- a/website/src/pages/docs/guides/auth0.mdx +++ b/website/src/pages/docs/guides/auth0.mdx @@ -1,4 +1,3 @@ - import { PackageCmd } from '@theguild/components' # Adding Authentication with Auth0 @@ -80,28 +79,29 @@ The complete code should look like this: ```yaml filename=".meshrc.yaml" additionalTypeDefs: | + """ + Describes the authentication object as provided by Auth0. + """ + type AuthenticationInfo { """ - Describes the authentication object as provided by Auth0. + String that uniquely identifies an authenticated user. """ - type AuthenticationInfo { - """ - String that uniquely identifies an authenticated user. - """ - sub: String! - } + sub: String! + } - extend type Query { - """ - The authentication information of the request. - """ - authInfo: AuthenticationInfo - } + extend type Query { + """ + The authentication information of the request. + """ + authInfo: AuthenticationInfo + } additionalResolvers: - ./additionalResolvers.ts ``` In `additionalResolvers.ts`: + ```ts filename="additionalResolvers.ts" export const resolvers = { Query: { @@ -109,13 +109,13 @@ export const resolvers = { return context._auth0 } } -}; +} ``` Then we can start our server. The Mesh server can be started via `yarn start`. ```sh -> yarn start +start > yarn yarn run v1.22.10 $ mesh dev ``` @@ -243,7 +243,7 @@ plugins: # You can combine this with `@graphql-mesh/plugin-operation-field-permissions` - operationFieldPermissions: permissions: - - if: "context._auth0?.sub != null" + - if: 'context._auth0?.sub != null' allow: - - "*" + - '*' ``` diff --git a/website/src/pages/docs/guides/mesh-sdk.mdx b/website/src/pages/docs/guides/mesh-sdk.mdx index ec776afc106e7..5bd965c4cc251 100644 --- a/website/src/pages/docs/guides/mesh-sdk.mdx +++ b/website/src/pages/docs/guides/mesh-sdk.mdx @@ -11,19 +11,19 @@ Mesh's execute function could be used to directly carry out a query: ```ts import { execute } from './.mesh' -const exampleDocument = /* GraphQL */` +const exampleDocument = /* GraphQL */ ` query myQuery($someVar: String!) { - foo(someArg: $someVar) { - bar - } + foo(someArg: $someVar) { + bar + } } -`; +` const exampleVariables = { someArg: 'SOME_VALUE' -}; +} -const result = await execute(document, variables); +const result = await execute(document, variables) ``` ## Generating fully type safe SDK diff --git a/website/src/pages/docs/handlers/json-schema.mdx b/website/src/pages/docs/handlers/json-schema.mdx index f1a952f951536..9d69c31bb5e47 100644 --- a/website/src/pages/docs/handlers/json-schema.mdx +++ b/website/src/pages/docs/handlers/json-schema.mdx @@ -182,8 +182,8 @@ sources: ``` - Note that `queryParams` are automatically added to the query. - If argument is defined both on handler AND operation level, the operation level argument will be used. + Note that `queryParams` are automatically added to the query. If argument is defined both on handler AND operation + level, the operation level argument will be used. ## CodeSandBox Example diff --git a/website/src/pages/docs/handlers/openapi.mdx b/website/src/pages/docs/handlers/openapi.mdx index a9dbe5f52ad19..033535142dbd4 100644 --- a/website/src/pages/docs/handlers/openapi.mdx +++ b/website/src/pages/docs/handlers/openapi.mdx @@ -51,10 +51,7 @@ We use `operationId` for the names, and aim to keep it as close as possible to o ### Type naming -We adjust `operationId` only when necessary according to the GraphQL spec: - - Chars ` ` (white space), `.`, `/`, `:` and `-` are replaced with `_` (underscore) - - Other chars which are not latin/digits are replaced with their char codes - - If first char of the name is a digit, we prefix it with `_` (GraphQL spec doesn’t allow that) +We adjust `operationId` only when necessary according to the GraphQL spec: - Chars ` ` (white space), `.`, `/`, `:` and `-` are replaced with `_` (underscore) - Other chars which are not latin/digits are replaced with their char codes - If first char of the name is a digit, we prefix it with `_` (GraphQL spec doesn’t allow that) ### Unnamed types @@ -113,8 +110,6 @@ export default(url: string, init: RequestInit, context: MeshContext) { } ``` - - ### Setting / Unsetting the cookie Of course, using GraphQL Mesh as a Gateway for both the mobile application and web application is excellent. Still, there's one thing missing: the setting of the cookie for the web application. diff --git a/website/src/pages/docs/migration/new-openapi-to-openapi.mdx b/website/src/pages/docs/migration/new-openapi-to-openapi.mdx index 7defa8435f3a3..cfc26d8c0db63 100644 --- a/website/src/pages/docs/migration/new-openapi-to-openapi.mdx +++ b/website/src/pages/docs/migration/new-openapi-to-openapi.mdx @@ -4,7 +4,10 @@ import { PackageCmd, Callout } from '@theguild/components' After a period of development the new-openAPI handler (v0.8.2) was merged with the openAPI handler (v0.32.0), effectively replacing it. -Note: If you migrate from new-openAPI handler prior to v0.8.2 or to openAPI handler later than v0.32.0, some additional steps might be required. + + Note: If you migrate from new-openAPI handler prior to v0.8.2 or to openAPI handler later than v0.32.0, some + additional steps might be required. + ## Dependency Update diff --git a/website/src/pages/docs/migration/openapi-0.31-0.32.mdx b/website/src/pages/docs/migration/openapi-0.31-0.32.mdx index ca9b7b59a61dc..3aae10619a83c 100644 --- a/website/src/pages/docs/migration/openapi-0.31-0.32.mdx +++ b/website/src/pages/docs/migration/openapi-0.31-0.32.mdx @@ -39,25 +39,25 @@ Here is an example with batch of usages combined: ```tsx const handlerOptions = { - operationHeaders: { - // Basic auth. Add to the query input: {usernameAndPassword: "user123:pass123"} - authorization: 'Basic {args.usernameAndPassword|base64}', - // In the header. Add to the query input: {apiKey: "abcdef"} - access_token: '{args.apiKey}', - // In the cookie. Add to the query input: {apiKey: "abcdef"} - cookie: 'access_token={args.apiKey}', - }, - queryParams: { - // In the query string. Add to the query input: {apiKey: "abcdef"} - access_token: '{args.apiKey}', - }, + operationHeaders: { + // Basic auth. Add to the query input: {usernameAndPassword: "user123:pass123"} + authorization: 'Basic {args.usernameAndPassword|base64}', + // In the header. Add to the query input: {apiKey: "abcdef"} + access_token: '{args.apiKey}', + // In the cookie. Add to the query input: {apiKey: "abcdef"} + cookie: 'access_token={args.apiKey}' + }, + queryParams: { + // In the query string. Add to the query input: {apiKey: "abcdef"} + access_token: '{args.apiKey}' + } } ``` ## Miscellaneous - Input arguments: Now, users can input parameters both through config options (`operationHeaders` and/or `queryParams`) AND through request query input arguments. In case both exists for the same argument, request query value will override the config value. -For reference, former behavior was config-defined arguments resulted in complete removal of those arguments from GraphQL type. + For reference, former behavior was config-defined arguments resulted in complete removal of those arguments from GraphQL type. - Error object: used to include `path` (e.g `'/users/{username}'`) now includes `url` instead (e.g `'[http://localhost:3000/api/users/abcdef](http://localhost:3002/api/users/abcdef)'`) - string as JSON objects: while old handler accepted simple strings as responses for `type: “object”` fields, the new handler will throw error - Request Body: where requestBody exists, it’s input argument will be named `input` and accept both json objects and other types of inputs (where former handler used different field named based on content type or input type name) @@ -66,7 +66,7 @@ For reference, former behavior was config-defined arguments resulted in complete - AnyOf and OneOf handle: | Case | Previous | Currently | -| ---------------------------------------------------------- | ----------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------| +| ---------------------------------------------------------- | ----------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | | anyOf contains mixture of object type and scalar | resolve this case to generic JSON | result will be object containing the object type and a field for the scalar | | anyOf contains mixture of object type and a untyped object | pick out the object type schema without defaulting to the arbitrary JSON type | result will be object containing the object type and a JSON scalar | | anyOf contains mixture of untyped object and a scalar | defaults to the arbitrary JSON type | result will be object containing a JSON scalar and a field for the scalar | diff --git a/website/src/pages/docs/plugins/http-cache.mdx b/website/src/pages/docs/plugins/http-cache.mdx index d28212d4b3b92..6ab7cbad387fb 100644 --- a/website/src/pages/docs/plugins/http-cache.mdx +++ b/website/src/pages/docs/plugins/http-cache.mdx @@ -6,9 +6,9 @@ Usually server environments don't have browser's HTTP caching logic. This plugin brings [HTTP Caching](https://developer.mozilla.org/en-US/docs/Web/HTTP/Caching) to your GraphQL Mesh gateway. - The defined cache storage will be used for this plugin. By default, GraphQL Mesh uses [LocalForage](/docs/cache/localforage) as a cache storage. - For example, you need to follow this section to configure [Redis](/docs/cache/redis) as your cache storage. - You can find other options under the same category. + The defined cache storage will be used for this plugin. By default, GraphQL Mesh uses + [LocalForage](/docs/cache/localforage) as a cache storage. For example, you need to follow this section to configure + [Redis](/docs/cache/redis) as your cache storage. You can find other options under the same category. ## Getting Started @@ -21,4 +21,3 @@ Then add the plugin to your configuration; plugins: httpCache: {} ``` - diff --git a/website/src/pages/docs/plugins/http-details-extensions.mdx b/website/src/pages/docs/plugins/http-details-extensions.mdx index 0b2ca626fba63..ffd5b126f7afa 100644 --- a/website/src/pages/docs/plugins/http-details-extensions.mdx +++ b/website/src/pages/docs/plugins/http-details-extensions.mdx @@ -15,6 +15,7 @@ plugins: ``` Then you get the results like below; + ```json { "data": { @@ -33,18 +34,18 @@ Then you get the results like below; "method": "GET", "headers": { "Accept": "application/json", - "Content-Type": "application/json", - }, + "Content-Type": "application/json" + } }, "response": { "timestamp": "2020-01-01T00:00:00.000Z", "status": 200, "statusText": "OK", "headers": { - "Content-Type": "application/json", - }, + "Content-Type": "application/json" + } }, - "responseTime": 9999, + "responseTime": 9999 } ] } diff --git a/website/src/pages/docs/plugins/new-relic.mdx b/website/src/pages/docs/plugins/new-relic.mdx index 922b87d73d077..bb52c29aea3a1 100644 --- a/website/src/pages/docs/plugins/new-relic.mdx +++ b/website/src/pages/docs/plugins/new-relic.mdx @@ -13,9 +13,11 @@ You can instrument your GraphQL application with New Relic reporting in order to ### Enabling required NewRelic feature flags + Some additional configuration is needed to allow Mesh send the collected information correctly to NewRelic. You can add the following to your `.env` file; + ```shell filename=".env" NEW_RELIC_FEATURE_FLAG_UNDICI_INSTRUMENTATION=true NEW_RELIC_FEATURE_FLAG_UNDICI_ASYNC_TRACKING=true @@ -30,9 +32,9 @@ exports.config = { feature_flag: { undici_instrumentation: true, undici_async_tracking: true, - new_promise_tracking: true, - }, -}; + new_promise_tracking: true + } +} ``` ## Example Configuration diff --git a/website/src/pages/docs/plugins/prometheus.mdx b/website/src/pages/docs/plugins/prometheus.mdx index 86a3e17e29f07..63ce9edad7952 100644 --- a/website/src/pages/docs/plugins/prometheus.mdx +++ b/website/src/pages/docs/plugins/prometheus.mdx @@ -6,6 +6,7 @@ Prometheus is a platform for scraping metrics from services and utilities. You can use `@graphql-mesh/plugin-prometheus` plugin to expose and collect metrics from all phases of your GraphQL execution including internal query planning and outgoing HTTP requests. This plugin tracks the complete gateway execution flow and exposes the following metrics: + - Successful requests (`requestCount`) - Request summary (`requestSummary`) - errors (categorized by `phase`) diff --git a/website/src/pages/docs/plugins/rate-limit.mdx b/website/src/pages/docs/plugins/rate-limit.mdx index a670fcba800bf..bbae9b6995072 100644 --- a/website/src/pages/docs/plugins/rate-limit.mdx +++ b/website/src/pages/docs/plugins/rate-limit.mdx @@ -15,7 +15,7 @@ You can use `@graphql-mesh/plugin-rate-limit` plugin in order to limit the rate plugins: - rateLimit: config: - # Add as many rules as you want + # Add as many rules as you want - type: Query field: foo max: 5 # requests limit for a time period diff --git a/website/src/pages/docs/plugins/response-caching.mdx b/website/src/pages/docs/plugins/response-caching.mdx index 5279a999be957..8519cc32f89d8 100644 --- a/website/src/pages/docs/plugins/response-caching.mdx +++ b/website/src/pages/docs/plugins/response-caching.mdx @@ -2,16 +2,16 @@ import { Callout, PackageCmd } from '@theguild/components' # GraphQL Response Caching -*GraphQL Response Caching* is a feature that allows you to cache the response of a GraphQL query. This is useful when you want to reduce the number of requests to your sources. For example, if you have a GraphQL query that fetches a list of products, you can cache the response of this query so that the next time the same query is made, the response is fetched from the cache instead of making a request to the underlying sources. +_GraphQL Response Caching_ is a feature that allows you to cache the response of a GraphQL query. This is useful when you want to reduce the number of requests to your sources. For example, if you have a GraphQL query that fetches a list of products, you can cache the response of this query so that the next time the same query is made, the response is fetched from the cache instead of making a request to the underlying sources. GraphQL Mesh's Response Cache Plugin uses [Envelop's Response Caching](https://www.envelop.dev/docs/guides/adding-a-graphql-response-cache) under the hood. You can [learn more on Envelop's docs](https://www.envelop.dev/docs/guides/adding-a-graphql-response-cache). - The defined cache storage will be used for this plugin. By default, GraphQL Mesh uses [Localforage](/docs/cache/localforage) as a cache storage. - For example, you need to follow this section to configure [Redis](/docs/cache/redis) as your cache storage. - You can find other options under the same category. + The defined cache storage will be used for this plugin. By default, GraphQL Mesh uses + [Localforage](/docs/cache/localforage) as a cache storage. For example, you need to follow this section to configure + [Redis](/docs/cache/redis) as your cache storage. You can find other options under the same category. ## Getting Started @@ -52,8 +52,8 @@ If you need to cache based on the user; # ... plugins: - responseCache: - if: "context.headers.authorization != null" - session: "{context.headers.authorization}" + if: 'context.headers.authorization != null' + session: '{context.headers.authorization}' ``` If you don't want to invalidate automatically based on mutations; diff --git a/website/src/pages/docs/transforms/federation.mdx b/website/src/pages/docs/transforms/federation.mdx index 7af73d77c88a7..63a81f0d9e5bc 100644 --- a/website/src/pages/docs/transforms/federation.mdx +++ b/website/src/pages/docs/transforms/federation.mdx @@ -45,7 +45,7 @@ resolveReference: ./userResolveReference.ts ```ts filename="userResolveReference.ts" // So we can point to an existing query field to resolve that entity -export default function (root, context, info) { +export default function (root, context, info) { return context.accounts.Query.user({ root, args: { id: root.id }, context, info }) } ``` diff --git a/website/src/pages/docs/transforms/naming-convention.mdx b/website/src/pages/docs/transforms/naming-convention.mdx index 576e2d1cac9a0..d6a01e6e35ea2 100644 --- a/website/src/pages/docs/transforms/naming-convention.mdx +++ b/website/src/pages/docs/transforms/naming-convention.mdx @@ -11,7 +11,8 @@ The `naming-convention` transforms allow you to apply casing and other conventio ## How to use? - In this example, enumValues fields are converted to uppercase, while fieldNames are converted to camel case to enforce consistency. + In this example, enumValues fields are converted to uppercase, while fieldNames are converted to camel case to enforce + consistency. Add the following configuration to your Mesh config file: diff --git a/website/src/pages/docs/transforms/rename.mdx b/website/src/pages/docs/transforms/rename.mdx index f792194d63a5b..66528f80586d4 100644 --- a/website/src/pages/docs/transforms/rename.mdx +++ b/website/src/pages/docs/transforms/rename.mdx @@ -56,7 +56,7 @@ transforms: ### RegEx example You can use RegEx flags to enable the use of regular expressions when renaming using this transform. This way you can rename multiple types, fields or both. -For example, you could use the key value pair field: api(.*) in the from object to rename any field of the corresponding type that begins with "api". +For example, you could use the key value pair field: api(.\*) in the from object to rename any field of the corresponding type that begins with "api". ```yaml filename=".meshrc.yaml" - rename: diff --git a/website/src/pages/docs/transforms/transforms-introduction.mdx b/website/src/pages/docs/transforms/transforms-introduction.mdx index 03c43a1bf2ceb..828fa2a5d1853 100644 --- a/website/src/pages/docs/transforms/transforms-introduction.mdx +++ b/website/src/pages/docs/transforms/transforms-introduction.mdx @@ -315,11 +315,11 @@ If you have use cases for which you would require to introduce either "bare" or | Extend | ✅ | ❌ | [docs](/docs/transforms/extend) | | Federation | ❌ | ✅ | [docs](/docs/transforms/federation) | | Filter Schema | ✅ | ✅ | [docs](/docs/transforms/filter-schema) | -| hoist | | | [docs](/docs/transforms/hoist) | +| hoist | | | [docs](/docs/transforms/hoist) | | Naming Convention | ✅ | ✅ | [docs](/docs/transforms/naming-convention) | | Prefix | ✅ | ✅ | [docs](/docs/transforms/prefix) | | prune | | | [docs](/docs/transforms/prune) | | Rename | ✅ | ✅ | [docs](/docs/transforms/rename) | | Replace Field | ✅ | ❌ | [docs](/docs/transforms/replace-field) | | Resolvers Composition | ✅ | ✅ | [docs](/docs/transforms/resolvers-composition) | -| type-merging | | | [docs](/docs/transforms/type-merging) | +| type-merging | | | [docs](/docs/transforms/type-merging) | diff --git a/yarn.lock b/yarn.lock index eddd74532cfaa..bd62d03bec78b 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4749,24 +4749,13 @@ "@babel/helper-module-imports" "^7.10.4" "@rollup/pluginutils" "^3.1.0" -"@rollup/plugin-json@4.1.0": +"@rollup/plugin-json@^4.1.0": version "4.1.0" resolved "https://registry.yarnpkg.com/@rollup/plugin-json/-/plugin-json-4.1.0.tgz#54e09867ae6963c593844d8bd7a9c718294496f3" integrity sha512-yfLbTdNS6amI/2OpmbiBoW12vngr5NW2jCJVZSBEz+H5KfUJZ2M7sDjk0U6GOOdCWFVScShte29o9NezJ53TPw== dependencies: "@rollup/pluginutils" "^3.0.8" -"@rollup/plugin-node-resolve@7.1.1": - version "7.1.1" - resolved "https://registry.yarnpkg.com/@rollup/plugin-node-resolve/-/plugin-node-resolve-7.1.1.tgz#8c6e59c4b28baf9d223028d0e450e06a485bb2b7" - integrity sha512-14ddhD7TnemeHE97a4rLOhobfYvUVcaYuqTnL8Ti7Jxi9V9Jr5LY7Gko4HZ5k4h4vqQM0gBQt6tsp9xXW94WPA== - dependencies: - "@rollup/pluginutils" "^3.0.6" - "@types/resolve" "0.0.8" - builtin-modules "^3.1.0" - is-module "^1.0.0" - resolve "^1.14.2" - "@rollup/plugin-node-resolve@^11.2.1": version "11.2.1" resolved "https://registry.yarnpkg.com/@rollup/plugin-node-resolve/-/plugin-node-resolve-11.2.1.tgz#82aa59397a29cd4e13248b106e6a4a1880362a60" @@ -4779,6 +4768,18 @@ is-module "^1.0.0" resolve "^1.19.0" +"@rollup/plugin-node-resolve@^13.3.0": + version "13.3.0" + resolved "https://registry.yarnpkg.com/@rollup/plugin-node-resolve/-/plugin-node-resolve-13.3.0.tgz#da1c5c5ce8316cef96a2f823d111c1e4e498801c" + integrity sha512-Lus8rbUo1eEcnS4yTFKLZrVumLPY+YayBdWXgFSHYhTT2iJbMhoaaBL3xl5NCdeRytErGr8tZ0L71BMRmnlwSw== + dependencies: + "@rollup/pluginutils" "^3.1.0" + "@types/resolve" "1.17.1" + deepmerge "^4.2.2" + is-builtin-module "^3.1.0" + is-module "^1.0.0" + resolve "^1.19.0" + "@rollup/plugin-replace@^2.4.1": version "2.4.2" resolved "https://registry.yarnpkg.com/@rollup/plugin-replace/-/plugin-replace-2.4.2.tgz#a2d539314fbc77c244858faa523012825068510a" @@ -4787,7 +4788,7 @@ "@rollup/pluginutils" "^3.1.0" magic-string "^0.25.7" -"@rollup/pluginutils@^3.0.6", "@rollup/pluginutils@^3.0.8", "@rollup/pluginutils@^3.1.0": +"@rollup/pluginutils@^3.0.8", "@rollup/pluginutils@^3.1.0": version "3.1.0" resolved "https://registry.yarnpkg.com/@rollup/pluginutils/-/pluginutils-3.1.0.tgz#706b4524ee6dc8b103b3c995533e5ad680c02b9b" integrity sha512-GksZ6pr6TpIjHm8h9lSQ8pi8BE9VeubNT0OMJ3B5uZJ8pz73NPiqOtCog/x2/QzM1ENChPKxMDhiQuRHsqc+lg== @@ -4796,6 +4797,14 @@ estree-walker "^1.0.1" picomatch "^2.2.2" +"@rollup/pluginutils@^4.1.2": + version "4.2.1" + resolved "https://registry.yarnpkg.com/@rollup/pluginutils/-/pluginutils-4.2.1.tgz#e6c6c3aba0744edce3fb2074922d3776c0af2a6d" + integrity sha512-iKnFXr7NkdZAIHiIWE+BX5ULi/ucVFYWD6TbAV+rZctiRTY2PL6tsIKhoIOaoskiWAkgu+VsbXgUVDNLHf+InQ== + dependencies: + estree-walker "^2.0.1" + picomatch "^2.2.2" + "@rushstack/eslint-patch@^1.1.0", "@rushstack/eslint-patch@^1.1.3": version "1.1.4" resolved "https://registry.yarnpkg.com/@rushstack/eslint-patch/-/eslint-patch-1.1.4.tgz#0c8b74c50f29ee44f423f7416829c0bf8bb5eb27" @@ -5370,6 +5379,13 @@ resolved "https://registry.yarnpkg.com/@types/http-string-parser/-/http-string-parser-0.0.30.tgz#a2ec779b2918afb818351342805f2283e8fb2a25" integrity sha512-YeB/nirRo6eCsT2QNxwsEhzy2J2k6bA0SQBheTs+9sS5UMtKWsiCaCnckSI1Fm1RAKsk5fKN+XBHfivzTH+z3g== +"@types/ioredis-mock@8.2.0": + version "8.2.0" + resolved "https://registry.yarnpkg.com/@types/ioredis-mock/-/ioredis-mock-8.2.0.tgz#a249bf30736381b2bf9843b8f295955324516c0a" + integrity sha512-6t7PNRw2TY5nizHaU0uTRq9w521XsgjjapRTTbFzk7gtReWnhLWaFfrP5g7wWBlvniCxhC6H/OUCH3+eV4gMpg== + dependencies: + ioredis ">=5" + "@types/is-ci@^3.0.0": version "3.0.0" resolved "https://registry.yarnpkg.com/@types/is-ci/-/is-ci-3.0.0.tgz#7e8910af6857601315592436f030aaa3ed9783c3" @@ -5668,13 +5684,6 @@ "@types/scheduler" "*" csstype "^3.0.2" -"@types/resolve@0.0.8": - version "0.0.8" - resolved "https://registry.yarnpkg.com/@types/resolve/-/resolve-0.0.8.tgz#f26074d238e02659e323ce1a13d041eee280e194" - integrity sha512-auApPaJf3NPfe18hSoJkp8EbZzer2ISk7o8mCC3M9he/a04+gbMF97NkpD2S8riMGvm4BMRI59/SZQSaLTKpsQ== - dependencies: - "@types/node" "*" - "@types/resolve@1.17.1": version "1.17.1" resolved "https://registry.yarnpkg.com/@types/resolve/-/resolve-1.17.1.tgz#3afd6ad8967c77e4376c598a82ddd58f46ec45d6" @@ -5994,10 +6003,10 @@ "@graphql-typed-document-node/core" "^3.1.1" wonka "^4.0.14" -"@vercel/ncc@0.31.1": - version "0.31.1" - resolved "https://registry.yarnpkg.com/@vercel/ncc/-/ncc-0.31.1.tgz#9346c7e59326f5eeac75c0286e47df94c2d6d8f7" - integrity sha512-g0FAxwdViI6UzsiVz5HssIHqjcPa1EHL6h+2dcJD893SoCJaGdqqgUF09xnMW6goWnnhbLvgiKlgJWrJa+7qYA== +"@vercel/ncc@^0.34.0": + version "0.34.0" + resolved "https://registry.yarnpkg.com/@vercel/ncc/-/ncc-0.34.0.tgz#d0139528320e46670d949c82967044a8f66db054" + integrity sha512-G9h5ZLBJ/V57Ou9vz5hI8pda/YQX5HQszCs3AmIus3XzsmRn/0Ptic5otD3xVST8QLKk7AMk7AqpsyQGN7MZ9A== "@vitejs/plugin-react@2.2.0": version "2.2.0" @@ -7110,32 +7119,33 @@ bluebird@^3.4.0, bluebird@^3.5.0, bluebird@^3.5.5: resolved "https://registry.yarnpkg.com/bluebird/-/bluebird-3.5.5.tgz#a8d0afd73251effbbd5fe384a77d73003c17a71f" integrity sha512-5am6HnnfN+urzt4yfg7IgTbotDjIT/u8AJpEt0sIU9FtXfVeezXAPKswrG+xKUCOYAINpSdgZVDU6QFh+cuH3w== -bob-the-bundler@1.7.3: - version "1.7.3" - resolved "https://registry.yarnpkg.com/bob-the-bundler/-/bob-the-bundler-1.7.3.tgz#d89a341b82747a726c88a9c6afd6e0ebf8cd9fc3" - integrity sha512-cuuizaM1KpJGC5L+3omt51ZYSTtEdjZF+/fO0ATn3FPDWU8j8xecqQCz/NlyIl5ef457eNYwadt+IQkYzmos0g== - dependencies: - "@rollup/plugin-json" "4.1.0" - "@rollup/plugin-node-resolve" "7.1.1" - "@vercel/ncc" "0.31.1" - builtins "4.0.0" - consola "2.11.3" - cosmiconfig "6.0.0" - cross-spawn "7.0.1" - dependency-graph "0.11.0" - 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" - param-case "3.0.4" - rollup "2.3.2" - rollup-plugin-generate-package-json "3.2.0" - rollup-plugin-typescript2 "0.27.0" - tslib "^1.11.1" +bob-the-bundler@4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/bob-the-bundler/-/bob-the-bundler-4.0.0.tgz#b4998b7693cd824ddc63dea251c02e218aebbfeb" + integrity sha512-/DorxQaL3tESxBFfe5cPZbuWRS33EA3oada/7DJ0Be9Ot2GhYfK6BaXBgatEuGI/t0t9rJv6RoR+L/+zUHPllg== + dependencies: + "@rollup/plugin-json" "^4.1.0" + "@rollup/plugin-node-resolve" "^13.3.0" + "@vercel/ncc" "^0.34.0" + builtins "^5.0.1" + consola "^2.15.3" + cross-spawn "^7.0.3" + dependency-graph "^0.11.0" + fs-extra "^10.1.0" + globby "^11.0.0" + lodash.get "^4.4.2" + minimatch "^5.1.0" + mkdirp "^1.0.4" + p-limit "^3.1.0" + param-case "^3.0.4" + resolve.exports "^1.1.0" + rollup "^2.75.6" + rollup-plugin-generate-package-json "^3.2.0" + rollup-plugin-typescript2 "^0.32.1" + tslib "^2.0.0" tsup "^5.11.6" - yargs "15.3.1" + yargs "^17.5.1" + zod "^3.17.3" body-parser@1.20.1, body-parser@^1.15.2, body-parser@^1.18.3, body-parser@^1.19.0: version "1.20.1" @@ -7286,12 +7296,10 @@ builtin-modules@^3.1.0: resolved "https://registry.yarnpkg.com/builtin-modules/-/builtin-modules-3.2.0.tgz#45d5db99e7ee5e6bc4f362e008bf917ab5049887" integrity sha512-lGzLKcioL90C7wMczpkY0n/oART3MbBa8R9OFGE1rJxoVI86u4WAGfEk8Wjv10eKSyTHVGkSo3bvBylCEtk7LA== -builtins@4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/builtins/-/builtins-4.0.0.tgz#a8345420de82068fdc4d6559d0456403a8fb1905" - integrity sha512-qC0E2Dxgou1IHhvJSLwGDSTvokbRovU5zZFuDY6oY8Y2lF3nGt5Ad8YZK7GMtqzY84Wu7pXTPeHQeHcXSXsRhw== - dependencies: - semver "^7.0.0" +builtin-modules@^3.3.0: + version "3.3.0" + resolved "https://registry.yarnpkg.com/builtin-modules/-/builtin-modules-3.3.0.tgz#cae62812b89801e9656336e46223e030386be7b6" + integrity sha512-zhaCDicdLuWN5UbN5IMnFqNMhNfo919sH85y2/ea+5Yg9TsTkeZxpL+JLbp6cgYFS4sRLp3YV4S6yDuqVWHYOw== builtins@^5.0.0, builtins@^5.0.1: version "5.0.1" @@ -7987,10 +7995,10 @@ connect-history-api-fallback@^2.0.0: resolved "https://registry.yarnpkg.com/connect-history-api-fallback/-/connect-history-api-fallback-2.0.0.tgz#647264845251a0daf25b97ce87834cace0f5f1c8" integrity sha512-U73+6lQFmfiNPrYbXqr6kZ1i1wiRqXnp2nhMsINseWXO8lDau0LGEffJ8kQi4EjLZympVgRdvqjAgiZ1tgzDDA== -consola@2.11.3: - version "2.11.3" - resolved "https://registry.yarnpkg.com/consola/-/consola-2.11.3.tgz#f7315836224c143ac5094b47fd4c816c2cd1560e" - integrity sha512-aoW0YIIAmeftGR8GSpw6CGQluNdkWMWh3yEFjH/hmynTYnMtibXszii3lxCXmk8YxJtI3FAK5aTiquA5VH68Gw== +consola@^2.15.3: + version "2.15.3" + resolved "https://registry.yarnpkg.com/consola/-/consola-2.15.3.tgz#2e11f98d6a4be71ff72e0bdf07bd23e12cb61550" + integrity sha512-9vAdYbHj6x2fLKC4+oPH0kFzY/orMZyG2Aj+kNylHxKGJ/Ed4dpNyAQYwJOdqO4zdM7XpVHmyejQDcQHrnuXbw== console-control-strings@^1.0.0, console-control-strings@~1.1.0: version "1.1.0" @@ -8083,17 +8091,6 @@ cors@^2.8.5: object-assign "^4" vary "^1" -cosmiconfig@6.0.0, cosmiconfig@^6.0.0: - version "6.0.0" - resolved "https://registry.yarnpkg.com/cosmiconfig/-/cosmiconfig-6.0.0.tgz#da4fee853c52f6b1e6935f41c1a2fc50bd4a9982" - integrity sha512-xb3ZL6+L8b9JLLCx3ZdoZy4+2ECphCMo2PwqgP1tlfVq6M6YReyzBJtvWWtbDSpNr9hn96pkCiZqUcFEc+54Qg== - dependencies: - "@types/parse-json" "^4.0.0" - import-fresh "^3.1.0" - parse-json "^5.0.0" - path-type "^4.0.0" - yaml "^1.7.2" - cosmiconfig@8.0.0: version "8.0.0" resolved "https://registry.yarnpkg.com/cosmiconfig/-/cosmiconfig-8.0.0.tgz#e9feae014eab580f858f8a0288f38997a7bebe97" @@ -8104,6 +8101,17 @@ cosmiconfig@8.0.0: parse-json "^5.0.0" path-type "^4.0.0" +cosmiconfig@^6.0.0: + version "6.0.0" + resolved "https://registry.yarnpkg.com/cosmiconfig/-/cosmiconfig-6.0.0.tgz#da4fee853c52f6b1e6935f41c1a2fc50bd4a9982" + integrity sha512-xb3ZL6+L8b9JLLCx3ZdoZy4+2ECphCMo2PwqgP1tlfVq6M6YReyzBJtvWWtbDSpNr9hn96pkCiZqUcFEc+54Qg== + dependencies: + "@types/parse-json" "^4.0.0" + import-fresh "^3.1.0" + parse-json "^5.0.0" + path-type "^4.0.0" + yaml "^1.7.2" + cosmiconfig@^7.0.0: version "7.1.0" resolved "https://registry.yarnpkg.com/cosmiconfig/-/cosmiconfig-7.1.0.tgz#1443b9afa596b670082ea46cbd8f6a62b84635f6" @@ -8139,15 +8147,6 @@ cross-fetch@3.0.5, cross-fetch@^3.0.4: dependencies: node-fetch "2.6.0" -cross-spawn@7.0.1: - version "7.0.1" - resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-7.0.1.tgz#0ab56286e0f7c24e153d04cc2aa027e43a9a5d14" - integrity sha512-u7v4o84SwFpD32Z8IIcPZ6z1/ie24O6RU3RbtL5Y316l3KuHVPx9ItBgWQ6VlfAFnRnTtMUrsQ9MUUTuEZjogg== - dependencies: - path-key "^3.1.0" - shebang-command "^2.0.0" - which "^2.0.1" - cross-spawn@^5.0.1, cross-spawn@^5.1.0: version "5.1.0" resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-5.1.0.tgz#e8bd0efee58fcff6f8f94510a0a554bbfa235449" @@ -10304,6 +10303,11 @@ estree-walker@^1.0.1: resolved "https://registry.yarnpkg.com/estree-walker/-/estree-walker-1.0.1.tgz#31bc5d612c96b704106b477e6dd5d8aa138cb700" integrity sha512-1fMXF3YP4pZZVozF8j/ZLfvnR8NSIljt56UhbZ5PeeDmmGHpgpdwQt7ITlGvYaQukCvuBRMLEiKiYC+oeIg4cg== +estree-walker@^2.0.1: + version "2.0.2" + resolved "https://registry.yarnpkg.com/estree-walker/-/estree-walker-2.0.2.tgz#52f010178c2a4c117a7757cfe942adb7d2da4cac" + integrity sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w== + estree-walker@^3.0.0: version "3.0.1" resolved "https://registry.yarnpkg.com/estree-walker/-/estree-walker-3.0.1.tgz#c2a9fb4a30232f5039b7c030b37ead691932debd" @@ -10699,6 +10703,15 @@ find-cache-dir@^3.3.1: make-dir "^3.0.2" pkg-dir "^4.1.0" +find-cache-dir@^3.3.2: + version "3.3.2" + resolved "https://registry.yarnpkg.com/find-cache-dir/-/find-cache-dir-3.3.2.tgz#b30c5b6eff0730731aea9bbd9dbecbd80256d64b" + integrity sha512-wXZV5emFEjrridIgED11OoUKLxiYjAcqot/NJdAkOhlJ+vGzwhOAfcG5OX1jP+S0PcjEn8bdMJv+g2jwQ3Onig== + dependencies: + commondir "^1.0.1" + make-dir "^3.0.2" + pkg-dir "^4.1.0" + find-replace@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/find-replace/-/find-replace-3.0.0.tgz#3e7e23d3b05167a76f770c9fbd5258b0def68c38" @@ -10883,25 +10896,6 @@ fs-extra@10.0.0, fs-extra@^10.0.0: jsonfile "^6.0.1" universalify "^2.0.0" -fs-extra@8.1.0, fs-extra@^8.0.1, fs-extra@^8.1.0: - version "8.1.0" - resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-8.1.0.tgz#49d43c45a88cd9677668cb7be1b46efdb8d2e1c0" - integrity sha512-yhlQgA6mnOJUKOsRUFsgJdQCvkKhcz8tlZG5HBQfReYZy46OwLcY+Zia0mtdHsOo9y/hP+CxMN0TU9QxoOtG4g== - dependencies: - graceful-fs "^4.2.0" - jsonfile "^4.0.0" - universalify "^0.1.0" - -fs-extra@9.0.0: - version "9.0.0" - resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-9.0.0.tgz#b6afc31036e247b2466dc99c29ae797d5d4580a3" - integrity sha512-pmEYSk3vYsG/bF651KPUXZ+hvjpgWYw/Gc7W9NFUe3ZVLczKKWIij3IKpOrQcdw4TILtibFslZ0UmR8Vvzig4g== - dependencies: - at-least-node "^1.0.0" - graceful-fs "^4.2.0" - jsonfile "^6.0.1" - universalify "^1.0.0" - fs-extra@9.0.1, fs-extra@^9.0.0, fs-extra@^9.0.1: version "9.0.1" resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-9.0.1.tgz#910da0062437ba4c39fedd863f1675ccfefcb9fc" @@ -10912,6 +10906,15 @@ fs-extra@9.0.1, fs-extra@^9.0.0, fs-extra@^9.0.1: jsonfile "^6.0.1" universalify "^1.0.0" +fs-extra@^10.1.0: + version "10.1.0" + resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-10.1.0.tgz#02873cfbc4084dde127eaa5f9905eef2325d1abf" + integrity sha512-oRXApq54ETRj4eMiFzGnHWGy+zo5raudjuxN0b8H7s/RU2oW0Wvsx9O0ACRN/kRq9E8Vu/ReskGB5o3ji+FzHQ== + dependencies: + graceful-fs "^4.2.0" + jsonfile "^6.0.1" + universalify "^2.0.0" + fs-extra@^7.0.1: version "7.0.1" resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-7.0.1.tgz#4f189c44aa123b895f722804f55ea23eadc348e9" @@ -10921,6 +10924,15 @@ fs-extra@^7.0.1: jsonfile "^4.0.0" universalify "^0.1.0" +fs-extra@^8.0.1, fs-extra@^8.1.0: + version "8.1.0" + resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-8.1.0.tgz#49d43c45a88cd9677668cb7be1b46efdb8d2e1c0" + integrity sha512-yhlQgA6mnOJUKOsRUFsgJdQCvkKhcz8tlZG5HBQfReYZy46OwLcY+Zia0mtdHsOo9y/hP+CxMN0TU9QxoOtG4g== + dependencies: + graceful-fs "^4.2.0" + jsonfile "^4.0.0" + universalify "^0.1.0" + fs-minipass@^1.2.7: version "1.2.7" resolved "https://registry.yarnpkg.com/fs-minipass/-/fs-minipass-1.2.7.tgz#ccff8570841e7fe4265693da88936c55aed7f7c7" @@ -10950,11 +10962,6 @@ fsevents@^2.3.2, fsevents@~2.3.2: resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-2.3.2.tgz#8a526f78b8fdf4623b709e0b975c52c24c02fd1a" integrity sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA== -fsevents@~2.1.2: - version "2.1.3" - resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-2.1.3.tgz#fb738703ae8d2f9fe900c33836ddebee8b97f23e" - integrity sha512-Auw9a4AxqWpa9GUfj370BMPzzyncfBABW8Mab7BGWBYDj4Isgq+cDKtx0i6u9jcX9pQDnswsaaOTgTmA5pEjuQ== - function-bind@^1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/function-bind/-/function-bind-1.1.1.tgz#a56899d3ea3c9bab874bb9773b7c5ede92f4895d" @@ -11189,18 +11196,6 @@ globalyzer@0.1.0: resolved "https://registry.yarnpkg.com/globalyzer/-/globalyzer-0.1.0.tgz#cb76da79555669a1519d5a8edf093afaa0bf1465" integrity sha512-40oNTM9UfG6aBmuKxk/giHn5nQ8RVz/SS4Ir6zgzOv9/qC3kKZ9v4etGTcJbEl/NyVQH7FGU7d+X1egr57Md2Q== -globby@11.0.0: - version "11.0.0" - resolved "https://registry.yarnpkg.com/globby/-/globby-11.0.0.tgz#56fd0e9f0d4f8fb0c456f1ab0dee96e1380bc154" - integrity sha512-iuehFnR3xu5wBBtm4xi0dMe92Ob87ufyu/dHwpDYfbcpYpIbrO5OnS8M1vWvrBhSGEJ3/Ecj7gnX76P8YxpPEg== - dependencies: - array-union "^2.1.0" - dir-glob "^3.0.1" - fast-glob "^3.1.1" - ignore "^5.1.4" - merge2 "^1.3.0" - slash "^3.0.0" - globby@11.0.1: version "11.0.1" resolved "https://registry.yarnpkg.com/globby/-/globby-11.0.1.tgz#9a2bf107a068f3ffeabc49ad702c79ede8cfd357" @@ -12018,7 +12013,7 @@ ioredis-mock@8.2.2: fengari "^0.1.4" fengari-interop "^0.1.3" -ioredis@5.2.4: +ioredis@5.2.4, ioredis@>=5: version "5.2.4" resolved "https://registry.yarnpkg.com/ioredis/-/ioredis-5.2.4.tgz#9e262a668bc29bae98f2054c1e0d7efd86996b96" integrity sha512-qIpuAEt32lZJQ0XyrloCRdlEdUUNGG9i0UOk6zgzK6igyudNWqEBxfH6OlbnOOoBBvr1WB02mm8fR55CnikRng== @@ -12115,6 +12110,13 @@ is-buffer@^2.0.0: resolved "https://registry.yarnpkg.com/is-buffer/-/is-buffer-2.0.5.tgz#ebc252e400d22ff8d77fa09888821a24a658c191" integrity sha512-i2R6zNFDwgEHJyQUtJEk0XFi1i0dPFn/oqjK3/vPCcDeJvW5NQ83V8QbicfF1SupOaB0h8ntgBC2YiE7dfyctQ== +is-builtin-module@^3.1.0: + version "3.2.0" + resolved "https://registry.yarnpkg.com/is-builtin-module/-/is-builtin-module-3.2.0.tgz#bb0310dfe881f144ca83f30100ceb10cf58835e0" + integrity sha512-phDA4oSGt7vl1n5tJvTWooWWAsXLY+2xCnxNqvKhGEzujg+A43wPlPOyDg3C8XQHN+6k/JTQWJ/j0dQh/qr+Hw== + dependencies: + builtin-modules "^3.3.0" + is-callable@^1.1.4, is-callable@^1.2.4: version "1.2.4" resolved "https://registry.yarnpkg.com/is-callable/-/is-callable-1.2.4.tgz#47301d58dd0259407865547853df6d61fe471945" @@ -15045,7 +15047,7 @@ minimatch@3.0.4: dependencies: brace-expansion "^1.1.7" -minimatch@5.1.1, minimatch@^5.0.1: +minimatch@5.1.1, minimatch@^5.0.1, minimatch@^5.1.0: version "5.1.1" resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-5.1.1.tgz#6c9dffcf9927ff2a31e74b5af11adf8b9604b022" integrity sha512-362NP+zlprccbEt/SkxKfRMHnNY85V74mVnpUpNyr3F35covl09Kec7/sEFLt3RA4oXmewtoaanoIf67SE5Y5g== @@ -15974,13 +15976,6 @@ p-finally@^1.0.0: resolved "https://registry.yarnpkg.com/p-finally/-/p-finally-1.0.0.tgz#3fbcfb15b899a44123b34b6dcc18b724336a2cae" integrity sha1-P7z7FbiZpEEjs0ttzBi3JDNqLK4= -p-limit@2.2.2, p-limit@^2.0.0, p-limit@^2.2.0: - version "2.2.2" - resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-2.2.2.tgz#61279b67721f5287aa1c13a9a7fbbc48c9291b1e" - integrity sha512-WGR+xHecKTr7EbUEhyLSh5Dube9JtdiG78ufaeLxTgpudf/20KqyMioIUZJAezlTIi6evxuoUs9YXc11cU+yzQ== - dependencies: - p-try "^2.0.0" - p-limit@3.0.2: version "3.0.2" resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-3.0.2.tgz#1664e010af3cadc681baafd3e2a437be7b0fb5fe" @@ -16002,6 +15997,13 @@ p-limit@^1.1.0: dependencies: p-try "^1.0.0" +p-limit@^2.0.0, p-limit@^2.2.0: + version "2.2.2" + resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-2.2.2.tgz#61279b67721f5287aa1c13a9a7fbbc48c9291b1e" + integrity sha512-WGR+xHecKTr7EbUEhyLSh5Dube9JtdiG78ufaeLxTgpudf/20KqyMioIUZJAezlTIi6evxuoUs9YXc11cU+yzQ== + dependencies: + p-try "^2.0.0" + p-locate@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/p-locate/-/p-locate-2.0.0.tgz#20a0103b222a70c8fd39cc2e580680f3dde5ec43" @@ -17963,13 +17965,6 @@ resolve.exports@^1.1.0: resolved "https://registry.yarnpkg.com/resolve.exports/-/resolve.exports-1.1.0.tgz#5ce842b94b05146c0e03076985d1d0e7e48c90c9" integrity sha512-J1l+Zxxp4XK3LUDZ9m60LRJF/mAe4z6a4xyabPHk7pvK5t35dACV32iIjJDFeWZFfZlO29w6SZ67knR0tHzJtQ== -resolve@1.15.1: - version "1.15.1" - resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.15.1.tgz#27bdcdeffeaf2d6244b95bb0f9f4b4653451f3e8" - integrity sha512-84oo6ZTtoTUpjgNEr5SJyzQhzL72gaRodsSfyxC/AXRvwu0Yse9H8eF9IpGo7b8YetZhlI6v7ZQ6bKBFV/6S7w== - dependencies: - path-parse "^1.0.6" - resolve@^1.1.7, resolve@^1.10.0, resolve@^1.14.2, resolve@^1.19.0, resolve@^1.20.0, resolve@^1.22.0, resolve@^1.22.1: version "1.22.1" resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.22.1.tgz#27cb2ebb53f91abb49470a928bba7558066ac177" @@ -18053,7 +18048,7 @@ robust-predicates@^3.0.0: resolved "https://registry.yarnpkg.com/robust-predicates/-/robust-predicates-3.0.1.tgz#ecde075044f7f30118682bd9fb3f123109577f9a" integrity sha512-ndEIpszUHiG4HtDsQLeIuMvRsDnn8c8rYStabochtUeCvfuvNptb5TUbVD68LRAILPX7p9nqQGh4xJgn3EHS/g== -rollup-plugin-generate-package-json@3.2.0: +rollup-plugin-generate-package-json@^3.2.0: version "3.2.0" resolved "https://registry.yarnpkg.com/rollup-plugin-generate-package-json/-/rollup-plugin-generate-package-json-3.2.0.tgz#e9c1d358f2be6c58b49853af58205292d45a33ff" integrity sha512-+Kq1kFVr+maxW/mZB+E+XuaieCXVZqjl2tNU9k3TtAMs3NOaeREa5sRHy67qKDmcnFtZZukIQ3dFCcnV+r0xyw== @@ -18087,16 +18082,16 @@ rollup-plugin-terser@^7.0.0: serialize-javascript "^4.0.0" terser "^5.0.0" -rollup-plugin-typescript2@0.27.0: - version "0.27.0" - resolved "https://registry.yarnpkg.com/rollup-plugin-typescript2/-/rollup-plugin-typescript2-0.27.0.tgz#95ff96f9e07d5000a9d2df4d76b548f9a1f83511" - integrity sha512-SRKG/Canve3cxBsqhY1apIBznqnX9X/WU3Lrq3XSwmTmFqccj3+//logLXFEmp+PYFNllSVng+f4zjqRTPKNkA== +rollup-plugin-typescript2@^0.32.1: + version "0.32.1" + resolved "https://registry.yarnpkg.com/rollup-plugin-typescript2/-/rollup-plugin-typescript2-0.32.1.tgz#470ded8e1965efac02043cc0ef4a7fa36bed83b9" + integrity sha512-RanO8bp1WbeMv0bVlgcbsFNCn+Y3rX7wF97SQLDxf0fMLsg0B/QFF005t4AsGUcDgF3aKJHoqt4JF2xVaABeKw== dependencies: - "@rollup/pluginutils" "^3.0.8" - find-cache-dir "^3.3.1" - fs-extra "8.1.0" - resolve "1.15.1" - tslib "1.11.1" + "@rollup/pluginutils" "^4.1.2" + find-cache-dir "^3.3.2" + fs-extra "^10.0.0" + resolve "^1.20.0" + tslib "^2.4.0" rollup-pluginutils@^2.8.1: version "2.8.2" @@ -18105,14 +18100,7 @@ rollup-pluginutils@^2.8.1: dependencies: estree-walker "^0.6.1" -rollup@2.3.2: - version "2.3.2" - resolved "https://registry.yarnpkg.com/rollup/-/rollup-2.3.2.tgz#afa68e4f3325bcef4e150d082056bef450bcac60" - integrity sha512-p66+fbfaUUOGE84sHXAOgfeaYQMslgAazoQMp//nlR519R61213EPFgrMZa48j31jNacJwexSAR1Q8V/BwGKBA== - optionalDependencies: - fsevents "~2.1.2" - -rollup@^2.43.1, rollup@^2.60.0, rollup@^2.79.1: +rollup@^2.43.1, rollup@^2.60.0, rollup@^2.75.6, rollup@^2.79.1: version "2.79.1" resolved "https://registry.yarnpkg.com/rollup/-/rollup-2.79.1.tgz#bedee8faef7c9f93a2647ac0108748f497f081c7" integrity sha512-uKxbd0IhMZOhjAiD5oAFp7BqvkA4Dv47qpOCtaNvng4HBwdbWtdOh8f5nZNuk2rp51PMGk3bzfWu5oayNEuYnw== @@ -19719,11 +19707,6 @@ tsconfig-paths@^3.14.1: minimist "^1.2.6" strip-bom "^3.0.0" -tslib@1.11.1, tslib@^1.10.0, tslib@^1.11.1, tslib@^1.8.1: - version "1.11.1" - resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.11.1.tgz#eb15d128827fbee2841549e171f45ed338ac7e35" - integrity sha512-aZW88SY8kQbU7gpV19lN24LtXh/yD4ZZg6qieAJDDg+YBsJcSmLGK9QpnUjAKVG/xefmvJGd1WUmfpT/g6AJGA== - tslib@2.4.0: version "2.4.0" resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.4.0.tgz#7cecaa7f073ce680a05847aa77be941098f36dc3" @@ -19734,6 +19717,11 @@ tslib@2.4.1, tslib@^2.0.0, tslib@^2.0.1, tslib@^2.0.3, tslib@^2.1.0, tslib@^2.3. resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.4.1.tgz#0d0bfbaac2880b91e22df0768e55be9753a5b17e" integrity sha512-tGyy4dAjRIEwI7BzsB0lynWgOpfqjUdq91XXAlIWD2OwKBH7oCl/GZG/HT4BOHrTlPMOASlMQ7veyTqpmRcrNA== +tslib@^1.10.0, tslib@^1.11.1, tslib@^1.8.1: + version "1.11.1" + resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.11.1.tgz#eb15d128827fbee2841549e171f45ed338ac7e35" + integrity sha512-aZW88SY8kQbU7gpV19lN24LtXh/yD4ZZg6qieAJDDg+YBsJcSmLGK9QpnUjAKVG/xefmvJGd1WUmfpT/g6AJGA== + tslib@~2.0.1: version "2.0.3" resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.0.3.tgz#8e0741ac45fc0c226e58a17bfc3e64b9bc6ca61c" @@ -21191,7 +21179,7 @@ yargs@15.3.1, yargs@^15.1.0, yargs@^15.3.1: y18n "^4.0.0" yargs-parser "^18.1.1" -yargs@17.6.2, yargs@^17.1.1, yargs@^17.3.1: +yargs@17.6.2, yargs@^17.1.1, yargs@^17.3.1, yargs@^17.5.1: version "17.6.2" resolved "https://registry.yarnpkg.com/yargs/-/yargs-17.6.2.tgz#2e23f2944e976339a1ee00f18c77fedee8332541" integrity sha512-1/9UrdHjDZc0eOU0HxOHoS78C69UD3JRMvzlJ7S79S2nTaWRA/whGCTV8o9e/N/1Va9YIV7Q4sOxD8VV4pCWOw== @@ -21279,6 +21267,11 @@ zipkin@^0.15.0: base64-js "^1.1.2" is-promise "^2.1.0" +zod@^3.17.3: + version "3.19.1" + resolved "https://registry.yarnpkg.com/zod/-/zod-3.19.1.tgz#112f074a97b50bfc4772d4ad1576814bd8ac4473" + integrity sha512-LYjZsEDhCdYET9ikFu6dVPGp2YH9DegXjdJToSzD9rO6fy4qiRYFoyEYwps88OseJlPyl2NOe2iJuhEhL7IpEA== + zwitch@^2.0.0: version "2.0.2" resolved "https://registry.yarnpkg.com/zwitch/-/zwitch-2.0.2.tgz#91f8d0e901ffa3d66599756dde7f57b17c95dce1"