From 213fb557c9e468e921d32bab801bcbd9a47b4374 Mon Sep 17 00:00:00 2001 From: Gil Gardosh Date: Thu, 17 Nov 2022 11:12:01 +0200 Subject: [PATCH] Upgrade bob + tests typescript fixes (#4812) * Upgrade bob + tests typescript fixes * prettier * More config + bob bootstrap * update pipeline * example build fix * minor fixes * more fixes * . * . * chore(dependencies): updated changesets for modified dependencies * Update tests.yml * . * . * . * . * . * . * Fix * Fix release * add -esm to cli * changeset Co-authored-by: github-actions[bot] Co-authored-by: Arda TANRIKULU --- .../@graphql-mesh_cli-4812-dependencies.md | 7 + .changeset/few-hats-brake.md | 70 +++ .github/workflows/tests.yml | 6 - .vscode/settings.json | 4 +- bob.config.js | 3 - examples/auth0/public/index.html | 10 +- examples/openapi-javascript-wiki/.meshrc.yaml | 1 - jest.config.js | 3 +- package.json | 34 +- packages/apollo-link/package.json | 34 +- packages/apollo-link/test/apollo-link.test.ts | 4 +- packages/cache/cfw-kv/package.json | 34 +- packages/cache/file/package.json | 34 +- packages/cache/localforage/package.json | 34 +- packages/cache/localforage/src/index.ts | 2 +- packages/cache/redis/package.json | 43 +- packages/cache/redis/test/cache.spec.ts | 2 +- packages/cli/package.json | 48 +- packages/cli/src/bin.ts | 3 +- packages/cli/src/commands/serve/serve.ts | 4 +- packages/cli/src/commands/ts-artifacts.ts | 2 +- packages/cli/src/index.ts | 8 +- packages/config/package.json | 34 +- packages/config/src/index.ts | 4 +- packages/config/src/process.ts | 4 +- packages/container/package.json | 25 + packages/cross-helpers/package.json | 5 + packages/handlers/graphql/package.json | 34 +- .../handlers/graphql/test/handler.spec.ts | 2 +- packages/handlers/grpc/package.json | 34 +- packages/handlers/grpc/src/index.ts | 2 +- packages/handlers/grpc/src/utils.ts | 2 +- packages/handlers/grpc/test/handler.spec.ts | 2 +- packages/handlers/grpc/test/scalars.spec.ts | 2 +- packages/handlers/grpc/test/utils.spec.ts | 2 +- packages/handlers/json-schema/package.json | 34 +- .../handlers/json-schema/test/handler.spec.ts | 2 +- packages/handlers/mongoose/package.json | 34 +- packages/handlers/mysql/package.json | 36 +- packages/handlers/neo4j/package.json | 36 +- packages/handlers/odata/package.json | 34 +- packages/handlers/odata/test/custom-fetch.ts | 7 +- packages/handlers/odata/test/handler.spec.ts | 4 +- packages/handlers/openapi/package.json | 34 +- packages/handlers/postgraphile/package.json | 34 +- packages/handlers/raml/package.json | 34 +- packages/handlers/soap/package.json | 34 +- packages/handlers/thrift/package.json | 34 +- packages/handlers/thrift/test/handler.spec.ts | 2 +- packages/handlers/tuql/package.json | 36 +- packages/http/package.json | 34 +- packages/http/src/index.ts | 2 +- packages/jit-executor/package.json | 34 +- packages/json-machete/package.json | 34 +- .../json-machete/src/compareJSONSchemas.ts | 6 +- .../json-machete/src/dereferenceObject.ts | 2 +- packages/json-machete/src/healJSONSchema.ts | 4 +- packages/json-machete/src/index.ts | 14 +- .../json-machete/src/referenceJSONSchema.ts | 4 +- packages/json-machete/src/visitJSONSchema.ts | 2 +- .../tests/compareJSONSchemas.test.ts | 2 +- .../tests/dereferenceObject.test.ts | 2 +- .../json-machete/tests/healJSONSchema.test.ts | 2 +- .../tests/referenceJSONSchema.test.ts | 2 +- packages/loaders/json-schema/package.json | 34 +- .../src/addExecutionLogicToComposer.ts | 6 +- packages/loaders/json-schema/src/bundle.ts | 6 +- .../src/getComposerFromJSONSchema.ts | 12 +- ...getDereferencedJSONSchemaFromOperations.ts | 4 +- .../json-schema/src/getGenericJSONScalar.ts | 2 +- ...GraphQLSchemaFromDereferencedJSONSchema.ts | 4 +- .../getReferencedJSONSchemaFromOperations.ts | 4 +- .../src/getStringScalarWithMinMaxLength.ts | 2 +- .../src/getTypeResolverFromOutputTCs.ts | 2 +- .../json-schema/src/getUnionTypeComposers.ts | 4 +- packages/loaders/json-schema/src/index.ts | 14 +- .../src/loadGraphQLSchemaFromJSONSchemas.ts | 6 +- packages/loaders/json-schema/src/utils.ts | 2 +- .../json-schema/test/execution.test.ts | 2 +- .../test/getComposerFromSchema.test.ts | 2 +- packages/loaders/openapi/package.json | 34 +- packages/loaders/openapi/src/bundle.ts | 4 +- .../getJSONSchemaOptionsFromOpenAPIOptions.ts | 4 +- packages/loaders/openapi/src/index.ts | 8 +- .../src/loadGraphQLSchemaFromOpenAPI.ts | 2 +- .../openapi/tests/authentication.test.ts | 4 +- packages/loaders/openapi/tests/basket.test.ts | 2 +- .../loaders/openapi/tests/calendly.test.ts | 2 +- .../openapi/tests/cloudfunction.test.ts | 2 +- .../tests/cloudfunction_expanded.test.ts | 2 +- .../loaders/openapi/tests/docusign.test.ts | 2 +- .../loaders/openapi/tests/example_api.test.ts | 6 +- .../openapi/tests/example_api2.test.ts | 4 +- .../openapi/tests/example_api4.test.ts | 2 +- .../openapi/tests/example_api5.test.ts | 4 +- .../openapi/tests/example_api6.test.ts | 6 +- .../openapi/tests/example_api7.test.ts | 4 +- .../openapi/tests/example_api8.test.ts | 4 +- .../tests/example_api_combined.test.ts | 4 +- .../loaders/openapi/tests/explode.test.ts | 2 +- .../loaders/openapi/tests/file-upload.test.ts | 4 +- .../openapi/tests/fixtures/dictionary.json | 8 +- .../tests/government_social_work.test.ts | 2 +- .../tests/multiple-responses-swagger.test.ts | 2 +- .../openapi/tests/nested_objects.test.ts | 4 +- .../openapi/tests/non_string_links.test.ts | 2 +- .../tests/query-params-with-post.test.ts | 2 +- .../loaders/openapi/tests/schemas.test.ts | 2 +- packages/loaders/raml/package.json | 34 +- packages/loaders/raml/src/bundle.ts | 4 +- .../getJSONSchemaOptionsFromRAMLOptions.ts | 4 +- packages/loaders/raml/src/index.ts | 8 +- .../raml/src/loadGraphQLSchemaFromRAML.ts | 4 +- packages/loaders/soap/package.json | 34 +- packages/loaders/soap/src/SOAPLoader.ts | 4 +- packages/loaders/soap/src/executor.ts | 2 +- packages/loaders/soap/src/index.ts | 6 +- packages/loaders/soap/test/examples.test.ts | 2 +- packages/loaders/soap/test/soap.test.ts | 8 +- packages/mergers/bare/package.json | 34 +- packages/mergers/federation/package.json | 34 +- packages/mergers/stitching/package.json | 34 +- .../plugins/deduplicate-request/package.json | 34 +- .../tests/useDeduplicateRequest.test.ts | 4 +- packages/plugins/http-cache/package.json | 34 +- .../http-details-extensions/package.json | 34 +- packages/plugins/live-query/package.json | 34 +- packages/plugins/live-query/src/index.ts | 2 +- packages/plugins/mock/package.json | 34 +- packages/plugins/mock/tests/mocking.spec.ts | 2 +- packages/plugins/newrelic/package.json | 34 +- .../operation-field-permissions/package.json | 34 +- packages/plugins/prometheus/package.json | 34 +- packages/plugins/rate-limit/package.json | 34 +- .../rate-limit/tests/rate-limit.spec.ts | 2 +- packages/plugins/response-cache/package.json | 34 +- packages/plugins/snapshot/package.json | 34 +- packages/plugins/statsd/package.json | 34 +- packages/runtime/package.json | 34 +- packages/runtime/src/get-mesh.ts | 8 +- packages/runtime/src/in-context-sdk.ts | 2 +- packages/runtime/src/index.ts | 6 +- packages/runtime/src/types.ts | 4 +- packages/runtime/test/getMesh.test.ts | 4 +- packages/runtime/test/useSubschema.test.ts | 2 +- packages/store/package.json | 34 +- packages/store/test/mesh-store.spec.ts | 4 +- packages/string-interpolation/package.json | 31 +- packages/string-interpolation/src/index.ts | 4 +- .../src/resolver-data-factory.ts | 2 +- packages/transforms/cache/package.json | 34 +- packages/transforms/cache/src/index.ts | 2 +- packages/transforms/cache/test/cache.spec.ts | 4 +- packages/transforms/encapsulate/package.json | 34 +- .../encapsulate/test/encapsulate.spec.ts | 2 +- packages/transforms/extend/package.json | 34 +- packages/transforms/federation/package.json | 34 +- .../transforms/filter-schema/package.json | 34 +- .../transforms/filter-schema/src/index.ts | 4 +- .../filter-schema/test/transform.spec.ts | 138 +----- packages/transforms/hoist-field/package.json | 34 +- .../hoist-field/test/transform.spec.ts | 2 +- .../transforms/naming-convention/package.json | 34 +- .../src/bareNamingConvention.ts | 2 +- .../transforms/naming-convention/src/index.ts | 4 +- .../src/wrapNamingConvention.ts | 2 +- .../test/bareNamingConvention.spec.ts | 2 +- .../test/wrapNamingConvention.spec.ts | 12 +- packages/transforms/prefix/package.json | 38 +- packages/transforms/prefix/src/barePrefix.ts | 2 +- packages/transforms/prefix/src/index.ts | 4 +- packages/transforms/prefix/src/wrapPrefix.ts | 2 +- .../transforms/prefix/test/barePrefix.spec.ts | 5 +- .../transforms/prefix/test/wrapPrefix.spec.ts | 4 +- packages/transforms/prune/package.json | 34 +- packages/transforms/rate-limit/package.json | 34 +- .../rate-limit/tests/rate-limit.spec.ts | 2 +- packages/transforms/rename/package.json | 34 +- packages/transforms/rename/src/bareRename.ts | 2 +- packages/transforms/rename/src/index.ts | 4 +- packages/transforms/rename/src/wrapRename.ts | 2 +- .../transforms/rename/test/bareRename.spec.ts | 89 +--- .../transforms/rename/test/wrapRename.spec.ts | 103 +---- .../transforms/replace-field/package.json | 34 +- .../replace-field/test/replace-field.spec.ts | 2 +- .../resolvers-composition/package.json | 34 +- .../test/transform.spec.ts | 2 +- packages/transforms/type-merging/package.json | 34 +- packages/types/package.json | 34 +- packages/types/src/index.ts | 2 +- packages/urql/package.json | 34 +- packages/urql/test/urql-exchange.test.ts | 4 +- packages/utils/package.json | 34 +- packages/utils/src/index.ts | 32 +- .../src/load-from-module-export-expression.ts | 2 +- packages/utils/src/parseAndPrintWithCache.ts | 2 +- packages/utils/src/read-file-or-url.ts | 2 +- .../utils/src/resolve-additional-resolvers.ts | 4 +- packages/utils/test/pubsub.spec.ts | 2 +- packages/utils/test/read-file-or-url.spec.ts | 4 +- packages/utils/test/with-filter.spec.ts | 2 +- renovate.json | 4 +- scripts/fix-bin.js | 12 +- tsconfig.build.json | 4 - tsconfig.json | 28 +- website/src/pages/docs/cache/cfwKv.mdx | 2 +- website/src/pages/docs/config-reference.mdx | 17 - .../getting-started/customize-mesh-server.mdx | 1 - .../getting-started/deploy-mesh-gateway.mdx | 16 +- website/src/pages/docs/guides/auth0.mdx | 36 +- website/src/pages/docs/guides/mesh-sdk.mdx | 14 +- .../src/pages/docs/handlers/json-schema.mdx | 4 +- website/src/pages/docs/handlers/openapi.mdx | 7 +- .../docs/migration/new-openapi-to-openapi.mdx | 5 +- .../docs/migration/openapi-0.31-0.32.mdx | 28 +- website/src/pages/docs/plugins/http-cache.mdx | 7 +- .../docs/plugins/http-details-extensions.mdx | 11 +- website/src/pages/docs/plugins/new-relic.mdx | 8 +- website/src/pages/docs/plugins/prometheus.mdx | 1 + website/src/pages/docs/plugins/rate-limit.mdx | 2 +- .../pages/docs/plugins/response-caching.mdx | 12 +- .../src/pages/docs/transforms/federation.mdx | 2 +- .../docs/transforms/naming-convention.mdx | 3 +- website/src/pages/docs/transforms/rename.mdx | 2 +- .../transforms/transforms-introduction.mdx | 4 +- yarn.lock | 433 +++++++++++------- 226 files changed, 2109 insertions(+), 1669 deletions(-) create mode 100644 .changeset/@graphql-mesh_cli-4812-dependencies.md create mode 100644 .changeset/few-hats-brake.md delete mode 100644 bob.config.js delete mode 100644 tsconfig.build.json 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/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 75f1860f21f87..40af2050957c8 100644 --- a/package.json +++ b/package.json @@ -4,15 +4,15 @@ "version": "0.2.15", "private": true, "scripts": { + "clean": "rm -rf packages/**/dist packages/**/**/dist examples/**/node_modules/.bin/*mesh* .bob", "postinstall": "patch-package && husky install", "prebuild:website": "yarn build", "build:website": "cd website && yarn build", - "generate-config-schema": "graphql-to-config-schema --schema ./**/yaml-config.graphql --json ./packages/types/src/config-schema.json --typings ./packages/types/src/config.ts --markdown ./website/src/generated-markdown && prettier --write ./packages/types/src", - "prebuild": "yarn generate-config-schema", - "transpile-ts": "tsc --project tsconfig.build.json", - "build": "yarn transpile-ts && bob build", - "copy-config-schema": "cp ./packages/types/src/config-schema.json ./packages/types/dist/", + "generate-config-schema": "yarn graphql-to-config-schema --schema ./**/yaml-config.graphql --json ./packages/types/src/config-schema.json --typings ./packages/types/src/config.ts --markdown ./website/src/generated-markdown && npx prettier --write ./packages/types/src", + "prebuild": "yarn clean && yarn generate-config-schema", + "build": "bob build", "fix-bin": "node scripts/fix-bin.js", + "copy-config-schema": "cp ./packages/types/src/config-schema.json ./packages/types/dist/esm && cp ./packages/types/src/config-schema.json ./packages/types/dist/cjs", "postbuild": "yarn copy-config-schema && yarn fix-bin", "lint": "eslint --ext .ts \"./packages/**/src/**/*.ts\"", "ci:lint": "eslint --output-file eslint_report.json --ext .ts --format json \"./packages/**/src/**/*.ts\"", @@ -38,7 +38,7 @@ "@typescript-eslint/eslint-plugin": "5.43.0", "@typescript-eslint/parser": "5.43.0", "babel-jest": "29.3.1", - "bob-the-bundler": "1.7.3", + "bob-the-bundler": "4.0.0", "eslint": "8.28.0", "eslint-config-prettier": "8.5.0", "eslint-config-standard": "17.0.0", @@ -71,17 +71,17 @@ }, "workspaces": { "packages": [ - "./website", - "./packages/*", - "./packages/cache/*", - "./packages/handlers/*", - "./packages/transforms/*", - "./packages/mergers/*", - "./packages/plugins/*", - "./examples/*", - "./examples/federation-example/*", - "./examples/graphql-file-upload-example/frontend", - "./packages/loaders/*" + "website", + "packages/*", + "packages/cache/*", + "packages/handlers/*", + "packages/transforms/*", + "packages/mergers/*", + "packages/plugins/*", + "examples/*", + "examples/federation-example/*", + "examples/graphql-file-upload-example/frontend", + "packages/loaders/*" ] }, "resolutions": { diff --git a/packages/apollo-link/package.json b/packages/apollo-link/package.json index d5a1de67b098b..eb7e9398d2c42 100644 --- a/packages/apollo-link/package.json +++ b/packages/apollo-link/package.json @@ -8,21 +8,28 @@ "directory": "packages/apollo-link" }, "sideEffects": false, - "main": "dist/index.js", - "module": "dist/index.mjs", - "typings": "dist/index.d.ts", + "main": "dist/cjs/index.js", + "module": "dist/esm/index.js", + "typings": "dist/typings/index.d.ts", "typescript": { - "definition": "dist/index.d.ts" + "definition": "dist/typings/index.d.ts" }, "exports": { ".": { - "require": "./dist/index.js", - "import": "./dist/index.mjs" + "require": { + "types": "./dist/typings/index.d.cts", + "default": "./dist/cjs/index.js" + }, + "import": { + "types": "./dist/typings/index.d.ts", + "default": "./dist/esm/index.js" + }, + "default": { + "types": "./dist/typings/index.d.ts", + "default": "./dist/esm/index.js" + } }, - "./*": { - "require": "./dist/*.js", - "import": "./dist/*.mjs" - } + "./package.json": "./package.json" }, "dependencies": { "@graphql-tools/utils": "9.1.1", @@ -37,7 +44,8 @@ "@apollo/client": "^3.5.9" }, "publishConfig": { - "access": "public", - "directory": "dist" - } + "directory": "dist", + "access": "public" + }, + "type": "module" } 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 12effd22bf85f..e6852d44e18db 100644 --- a/packages/cache/cfw-kv/package.json +++ b/packages/cache/cfw-kv/package.json @@ -11,21 +11,28 @@ "graphql": "*" }, "sideEffects": false, - "main": "dist/index.js", - "module": "dist/index.mjs", - "typings": "dist/index.d.ts", + "main": "dist/cjs/index.js", + "module": "dist/esm/index.js", + "typings": "dist/typings/index.d.ts", "typescript": { - "definition": "dist/index.d.ts" + "definition": "dist/typings/index.d.ts" }, "exports": { ".": { - "require": "./dist/index.js", - "import": "./dist/index.mjs" + "require": { + "types": "./dist/typings/index.d.cts", + "default": "./dist/cjs/index.js" + }, + "import": { + "types": "./dist/typings/index.d.ts", + "default": "./dist/esm/index.js" + }, + "default": { + "types": "./dist/typings/index.d.ts", + "default": "./dist/esm/index.js" + } }, - "./*": { - "require": "./dist/*.js", - "import": "./dist/*.mjs" - } + "./package.json": "./package.json" }, "dependencies": { "@graphql-mesh/types": "0.86.0", @@ -36,7 +43,8 @@ "@cloudflare/workers-types": "4.20221111.1" }, "publishConfig": { - "access": "public", - "directory": "dist" - } + "directory": "dist", + "access": "public" + }, + "type": "module" } diff --git a/packages/cache/file/package.json b/packages/cache/file/package.json index a5120a0684a11..611b6d4da7841 100644 --- a/packages/cache/file/package.json +++ b/packages/cache/file/package.json @@ -11,21 +11,28 @@ "graphql": "*" }, "sideEffects": false, - "main": "dist/index.js", - "module": "dist/index.mjs", - "typings": "dist/index.d.ts", + "main": "dist/cjs/index.js", + "module": "dist/esm/index.js", + "typings": "dist/typings/index.d.ts", "typescript": { - "definition": "dist/index.d.ts" + "definition": "dist/typings/index.d.ts" }, "exports": { ".": { - "require": "./dist/index.js", - "import": "./dist/index.mjs" + "require": { + "types": "./dist/typings/index.d.cts", + "default": "./dist/cjs/index.js" + }, + "import": { + "types": "./dist/typings/index.d.ts", + "default": "./dist/esm/index.js" + }, + "default": { + "types": "./dist/typings/index.d.ts", + "default": "./dist/esm/index.js" + } }, - "./*": { - "require": "./dist/*.js", - "import": "./dist/*.mjs" - } + "./package.json": "./package.json" }, "dependencies": { "@graphql-mesh/types": "0.86.0", @@ -35,7 +42,8 @@ "tslib": "^2.4.0" }, "publishConfig": { - "access": "public", - "directory": "dist" - } + "directory": "dist", + "access": "public" + }, + "type": "module" } diff --git a/packages/cache/localforage/package.json b/packages/cache/localforage/package.json index d15bd03f35f36..919d3ed593d2d 100644 --- a/packages/cache/localforage/package.json +++ b/packages/cache/localforage/package.json @@ -11,21 +11,28 @@ "graphql": "*" }, "sideEffects": false, - "main": "dist/index.js", - "module": "dist/index.mjs", - "typings": "dist/index.d.ts", + "main": "dist/cjs/index.js", + "module": "dist/esm/index.js", + "typings": "dist/typings/index.d.ts", "typescript": { - "definition": "dist/index.d.ts" + "definition": "dist/typings/index.d.ts" }, "exports": { ".": { - "require": "./dist/index.js", - "import": "./dist/index.mjs" + "require": { + "types": "./dist/typings/index.d.cts", + "default": "./dist/cjs/index.js" + }, + "import": { + "types": "./dist/typings/index.d.ts", + "default": "./dist/esm/index.js" + }, + "default": { + "types": "./dist/typings/index.d.ts", + "default": "./dist/esm/index.js" + } }, - "./*": { - "require": "./dist/*.js", - "import": "./dist/*.mjs" - } + "./package.json": "./package.json" }, "dependencies": { "@graphql-mesh/types": "0.86.0", @@ -34,7 +41,8 @@ "tslib": "^2.4.0" }, "publishConfig": { - "access": "public", - "directory": "dist" - } + "directory": "dist", + "access": "public" + }, + "type": "module" } 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 8d0ff0918f644..ce5f5a9f3f84b 100644 --- a/packages/cache/redis/package.json +++ b/packages/cache/redis/package.json @@ -11,33 +11,44 @@ "graphql": "*" }, "sideEffects": false, - "main": "dist/index.js", - "module": "dist/index.mjs", - "typings": "dist/index.d.ts", + "main": "dist/cjs/index.js", + "module": "dist/esm/index.js", + "typings": "dist/typings/index.d.ts", "typescript": { - "definition": "dist/index.d.ts" + "definition": "dist/typings/index.d.ts" }, "exports": { ".": { - "require": "./dist/index.js", - "import": "./dist/index.mjs" + "require": { + "types": "./dist/typings/index.d.cts", + "default": "./dist/cjs/index.js" + }, + "import": { + "types": "./dist/typings/index.d.ts", + "default": "./dist/esm/index.js" + }, + "default": { + "types": "./dist/typings/index.d.ts", + "default": "./dist/esm/index.js" + } }, - "./*": { - "require": "./dist/*.js", - "import": "./dist/*.mjs" - } + "./package.json": "./package.json" }, "dependencies": { - "@graphql-mesh/types": "0.86.0", - "@graphql-mesh/utils": "0.42.7", "@graphql-mesh/cross-helpers": "0.2.10", "@graphql-mesh/string-interpolation": "0.3.3", - "ioredis-mock": "8.2.2", + "@graphql-mesh/types": "0.86.0", + "@graphql-mesh/utils": "0.42.7", "ioredis": "5.2.4", + "ioredis-mock": "8.2.2", "tslib": "^2.4.0" }, + "devDependencies": { + "@types/ioredis-mock": "8.2.0" + }, "publishConfig": { - "access": "public", - "directory": "dist" - } + "directory": "dist", + "access": "public" + }, + "type": "module" } 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 392ca4f9f8016..3ad02e7e28b78 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -11,33 +11,34 @@ "graphql": "*" }, "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" }, "sideEffects": false, - "main": "dist/index.js", - "module": "dist/index.mjs", - "typings": "dist/index.d.ts", + "main": "dist/cjs/index.js", + "module": "dist/esm/index.js", + "typings": "dist/typings/index.d.ts", "typescript": { - "definition": "dist/index.d.ts" + "definition": "dist/typings/index.d.ts" }, "exports": { ".": { - "require": "./dist/index.js", - "import": "./dist/index.mjs" - }, - "./*": { - "require": "./dist/*.js", - "import": "./dist/*.mjs" - } - }, - "buildOptions": { - "bin": { - "graphql-mesh": { - "input": "src/bin.ts" + "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" }, "dependencies": { "ajv": "8.11.2", @@ -82,7 +83,8 @@ "@types/lodash.get": "4.4.7" }, "publishConfig": { - "access": "public", - "directory": "dist" - } + "directory": "dist", + "access": "public" + }, + "type": "module" } 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 96067275032a6..e719beaa9e1f2 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 ac3ba0130b342..effa8a768b0bf 100644 --- a/packages/cli/src/index.ts +++ b/packages/cli/src/index.ts @@ -1,7 +1,7 @@ -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 { @@ -12,7 +12,7 @@ import { loadFromModuleExportExpression, 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 a3d7c11f24545..dd30456e09625 100644 --- a/packages/config/package.json +++ b/packages/config/package.json @@ -12,21 +12,28 @@ "graphql": "*" }, "sideEffects": false, - "main": "dist/index.js", - "module": "dist/index.mjs", - "typings": "dist/index.d.ts", + "main": "dist/cjs/index.js", + "module": "dist/esm/index.js", + "typings": "dist/typings/index.d.ts", "typescript": { - "definition": "dist/index.d.ts" + "definition": "dist/typings/index.d.ts" }, "exports": { ".": { - "require": "./dist/index.js", - "import": "./dist/index.mjs" + "require": { + "types": "./dist/typings/index.d.cts", + "default": "./dist/cjs/index.js" + }, + "import": { + "types": "./dist/typings/index.d.ts", + "default": "./dist/esm/index.js" + }, + "default": { + "types": "./dist/typings/index.d.ts", + "default": "./dist/esm/index.js" + } }, - "./*": { - "require": "./dist/*.js", - "import": "./dist/*.mjs" - } + "./package.json": "./package.json" }, "dependencies": { "@graphql-mesh/cross-helpers": "0.2.10", @@ -48,7 +55,8 @@ "camel-case": "4.1.2" }, "publishConfig": { - "access": "public", - "directory": "dist" - } + "directory": "dist", + "access": "public" + }, + "type": "module" } 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 7dd97e6170cbb..9ebf8c44ebc0d 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/container/package.json b/packages/container/package.json index dcabc3c84b5da..34f0affa3967b 100644 --- a/packages/container/package.json +++ b/packages/container/package.json @@ -33,6 +33,31 @@ "tslib": "2.4.1" }, "publishConfig": { + "directory": "dist", "access": "public" + }, + "type": "module", + "main": "dist/cjs/index.js", + "module": "dist/esm/index.js", + "typings": "dist/typings/index.d.ts", + "typescript": { + "definition": "dist/typings/index.d.ts" + }, + "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" } } diff --git a/packages/cross-helpers/package.json b/packages/cross-helpers/package.json index da17628e64523..44f6da4468281 100644 --- a/packages/cross-helpers/package.json +++ b/packages/cross-helpers/package.json @@ -1,6 +1,7 @@ { "name": "@graphql-mesh/cross-helpers", "version": "0.2.10", + "bob": false, "description": "Cross Platform Helpers for GraphQL Mesh", "author": "Arda TANRIKULU ", "repository": { @@ -22,5 +23,9 @@ }, "publishConfig": { "access": "public" + }, + "typings": "./index.d.ts", + "typescript": { + "definition": "./index.d.ts" } } diff --git a/packages/handlers/graphql/package.json b/packages/handlers/graphql/package.json index bd51bd1ea2492..7c33440197043 100644 --- a/packages/handlers/graphql/package.json +++ b/packages/handlers/graphql/package.json @@ -2,21 +2,28 @@ "name": "@graphql-mesh/graphql", "version": "0.32.0", "sideEffects": false, - "main": "dist/index.js", - "module": "dist/index.mjs", - "typings": "dist/index.d.ts", + "main": "dist/cjs/index.js", + "module": "dist/esm/index.js", + "typings": "dist/typings/index.d.ts", "typescript": { - "definition": "dist/index.d.ts" + "definition": "dist/typings/index.d.ts" }, "exports": { ".": { - "require": "./dist/index.js", - "import": "./dist/index.mjs" + "require": { + "types": "./dist/typings/index.d.cts", + "default": "./dist/cjs/index.js" + }, + "import": { + "types": "./dist/typings/index.d.ts", + "default": "./dist/esm/index.js" + }, + "default": { + "types": "./dist/typings/index.d.ts", + "default": "./dist/esm/index.js" + } }, - "./*": { - "require": "./dist/*.js", - "import": "./dist/*.mjs" - } + "./package.json": "./package.json" }, "license": "MIT", "repository": { @@ -41,7 +48,8 @@ "tslib": "^2.4.0" }, "publishConfig": { - "access": "public", - "directory": "dist" - } + "directory": "dist", + "access": "public" + }, + "type": "module" } 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 a6f6add5bd29e..71c070f9220a0 100644 --- a/packages/handlers/grpc/package.json +++ b/packages/handlers/grpc/package.json @@ -2,21 +2,28 @@ "name": "@graphql-mesh/grpc", "version": "0.25.33", "sideEffects": false, - "main": "dist/index.js", - "module": "dist/index.mjs", - "typings": "dist/index.d.ts", + "main": "dist/cjs/index.js", + "module": "dist/esm/index.js", + "typings": "dist/typings/index.d.ts", "typescript": { - "definition": "dist/index.d.ts" + "definition": "dist/typings/index.d.ts" }, "exports": { ".": { - "require": "./dist/index.js", - "import": "./dist/index.mjs" + "require": { + "types": "./dist/typings/index.d.cts", + "default": "./dist/cjs/index.js" + }, + "import": { + "types": "./dist/typings/index.d.ts", + "default": "./dist/esm/index.js" + }, + "default": { + "types": "./dist/typings/index.d.ts", + "default": "./dist/esm/index.js" + } }, - "./*": { - "require": "./dist/*.js", - "import": "./dist/*.mjs" - } + "./package.json": "./package.json" }, "license": "MIT", "repository": { @@ -49,7 +56,8 @@ "@types/lodash.has": "4.5.7" }, "publishConfig": { - "access": "public", - "directory": "dist" - } + "directory": "dist", + "access": "public" + }, + "type": "module" } diff --git a/packages/handlers/grpc/src/index.ts b/packages/handlers/grpc/src/index.ts index adfed2046757f..dba9f98f62bab 100644 --- a/packages/handlers/grpc/src/index.ts +++ b/packages/handlers/grpc/src/index.ts @@ -15,7 +15,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, 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 0b0e6f011b71f..a9efe99947791 100644 --- a/packages/handlers/grpc/src/utils.ts +++ b/packages/handlers/grpc/src/utils.ts @@ -6,7 +6,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, pathWithName: string[] | undefined, isInput: boolean) { if (pathWithName?.length) { diff --git a/packages/handlers/grpc/test/handler.spec.ts b/packages/handlers/grpc/test/handler.spec.ts index 89ec21b93d384..63eb15d8875a5 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 b2135dcb87c7e..cf35d65dd3724 100644 --- a/packages/handlers/grpc/test/utils.spec.ts +++ b/packages/handlers/grpc/test/utils.spec.ts @@ -1,7 +1,7 @@ /* eslint-disable @typescript-eslint/no-floating-promises */ 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 23a0dc4b9f1b8..8a258c29a6e8d 100644 --- a/packages/handlers/json-schema/package.json +++ b/packages/handlers/json-schema/package.json @@ -2,21 +2,28 @@ "name": "@graphql-mesh/json-schema", "version": "0.35.35", "sideEffects": false, - "main": "dist/index.js", - "module": "dist/index.mjs", - "typings": "dist/index.d.ts", + "main": "dist/cjs/index.js", + "module": "dist/esm/index.js", + "typings": "dist/typings/index.d.ts", "typescript": { - "definition": "dist/index.d.ts" + "definition": "dist/typings/index.d.ts" }, "exports": { ".": { - "require": "./dist/index.js", - "import": "./dist/index.mjs" + "require": { + "types": "./dist/typings/index.d.cts", + "default": "./dist/cjs/index.js" + }, + "import": { + "types": "./dist/typings/index.d.ts", + "default": "./dist/esm/index.js" + }, + "default": { + "types": "./dist/typings/index.d.ts", + "default": "./dist/esm/index.js" + } }, - "./*": { - "require": "./dist/*.js", - "import": "./dist/*.mjs" - } + "./package.json": "./package.json" }, "license": "MIT", "repository": { @@ -41,7 +48,8 @@ "@json-schema-tools/meta-schema": "1.7.0" }, "publishConfig": { - "access": "public", - "directory": "dist" - } + "directory": "dist", + "access": "public" + }, + "type": "module" } 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 af45311dbcd68..2ad46e1a34a05 100644 --- a/packages/handlers/mongoose/package.json +++ b/packages/handlers/mongoose/package.json @@ -2,21 +2,28 @@ "name": "@graphql-mesh/mongoose", "version": "0.11.30", "sideEffects": false, - "main": "dist/index.js", - "module": "dist/index.mjs", - "typings": "dist/index.d.ts", + "main": "dist/cjs/index.js", + "module": "dist/esm/index.js", + "typings": "dist/typings/index.d.ts", "typescript": { - "definition": "dist/index.d.ts" + "definition": "dist/typings/index.d.ts" }, "exports": { ".": { - "require": "./dist/index.js", - "import": "./dist/index.mjs" + "require": { + "types": "./dist/typings/index.d.cts", + "default": "./dist/cjs/index.js" + }, + "import": { + "types": "./dist/typings/index.d.ts", + "default": "./dist/esm/index.js" + }, + "default": { + "types": "./dist/typings/index.d.ts", + "default": "./dist/esm/index.js" + } }, - "./*": { - "require": "./dist/*.js", - "import": "./dist/*.mjs" - } + "./package.json": "./package.json" }, "license": "MIT", "repository": { @@ -41,7 +48,8 @@ "tslib": "^2.4.0" }, "publishConfig": { - "access": "public", - "directory": "dist" - } + "directory": "dist", + "access": "public" + }, + "type": "module" } diff --git a/packages/handlers/mysql/package.json b/packages/handlers/mysql/package.json index 8279ba59b9a08..6dd26904fa2b9 100644 --- a/packages/handlers/mysql/package.json +++ b/packages/handlers/mysql/package.json @@ -2,24 +2,31 @@ "name": "@graphql-mesh/mysql", "version": "0.17.31", "sideEffects": false, - "main": "dist/index.js", - "module": "dist/index.mjs", - "typings": "dist/index.d.ts", + "main": "dist/cjs/index.js", + "module": "dist/esm/index.js", + "typings": "dist/typings/index.d.ts", "typescript": { - "definition": "dist/index.d.ts" + "definition": "dist/typings/index.d.ts" }, "exports": { ".": { - "require": "./dist/index.js", - "import": "./dist/index.mjs" + "require": { + "types": "./dist/typings/index.d.cts", + "default": "./dist/cjs/index.js" + }, + "import": { + "types": "./dist/typings/index.d.ts", + "default": "./dist/esm/index.js" + }, + "default": { + "types": "./dist/typings/index.d.ts", + "default": "./dist/esm/index.js" + } }, - "./*": { - "require": "./dist/*.js", - "import": "./dist/*.mjs" - } + "./package.json": "./package.json" }, "buildOptions": { - "input": "./src/index.ts" + "input": "./src/index.js" }, "license": "MIT", "repository": { @@ -50,7 +57,8 @@ "@types/mysql": "2.15.21" }, "publishConfig": { - "access": "public", - "directory": "dist" - } + "directory": "dist", + "access": "public" + }, + "type": "module" } diff --git a/packages/handlers/neo4j/package.json b/packages/handlers/neo4j/package.json index e70c5415b2a00..a7ba3aa90b359 100644 --- a/packages/handlers/neo4j/package.json +++ b/packages/handlers/neo4j/package.json @@ -2,24 +2,31 @@ "name": "@graphql-mesh/neo4j", "version": "0.20.36", "sideEffects": false, - "main": "dist/index.js", - "module": "dist/index.mjs", - "typings": "dist/index.d.ts", + "main": "dist/cjs/index.js", + "module": "dist/esm/index.js", + "typings": "dist/typings/index.d.ts", "typescript": { - "definition": "dist/index.d.ts" + "definition": "dist/typings/index.d.ts" }, "exports": { ".": { - "require": "./dist/index.js", - "import": "./dist/index.mjs" + "require": { + "types": "./dist/typings/index.d.cts", + "default": "./dist/cjs/index.js" + }, + "import": { + "types": "./dist/typings/index.d.ts", + "default": "./dist/esm/index.js" + }, + "default": { + "types": "./dist/typings/index.d.ts", + "default": "./dist/esm/index.js" + } }, - "./*": { - "require": "./dist/*.js", - "import": "./dist/*.mjs" - } + "./package.json": "./package.json" }, "buildOptions": { - "input": "./src/index.ts" + "input": "./src/index.js" }, "license": "MIT", "repository": { @@ -43,7 +50,8 @@ "@graphql-tools/utils": "9.1.1" }, "publishConfig": { - "access": "public", - "directory": "dist" - } + "directory": "dist", + "access": "public" + }, + "type": "module" } diff --git a/packages/handlers/odata/package.json b/packages/handlers/odata/package.json index 427b1ae140480..4ef5091370608 100644 --- a/packages/handlers/odata/package.json +++ b/packages/handlers/odata/package.json @@ -2,21 +2,28 @@ "name": "@graphql-mesh/odata", "version": "0.20.33", "sideEffects": false, - "main": "dist/index.js", - "module": "dist/index.mjs", - "typings": "dist/index.d.ts", + "main": "dist/cjs/index.js", + "module": "dist/esm/index.js", + "typings": "dist/typings/index.d.ts", "typescript": { - "definition": "dist/index.d.ts" + "definition": "dist/typings/index.d.ts" }, "exports": { ".": { - "require": "./dist/index.js", - "import": "./dist/index.mjs" + "require": { + "types": "./dist/typings/index.d.cts", + "default": "./dist/cjs/index.js" + }, + "import": { + "types": "./dist/typings/index.d.ts", + "default": "./dist/esm/index.js" + }, + "default": { + "types": "./dist/typings/index.d.ts", + "default": "./dist/esm/index.js" + } }, - "./*": { - "require": "./dist/*.js", - "import": "./dist/*.mjs" - } + "./package.json": "./package.json" }, "license": "MIT", "repository": { @@ -51,7 +58,8 @@ "@graphql-tools/delegate": "9.0.17" }, "publishConfig": { - "access": "public", - "directory": "dist" - } + "directory": "dist", + "access": "public" + }, + "type": "module" } 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 9929aa8b4cddf..bd51b8299bad8 100644 --- a/packages/jit-executor/package.json +++ b/packages/jit-executor/package.json @@ -11,21 +11,28 @@ "graphql": "*" }, "sideEffects": false, - "main": "dist/index.js", - "module": "dist/index.mjs", - "typings": "dist/index.d.ts", + "main": "dist/cjs/index.js", + "module": "dist/esm/index.js", + "typings": "dist/typings/index.d.ts", "typescript": { - "definition": "dist/index.d.ts" + "definition": "dist/typings/index.d.ts" }, "exports": { ".": { - "require": "./dist/index.js", - "import": "./dist/index.mjs" + "require": { + "types": "./dist/typings/index.d.cts", + "default": "./dist/cjs/index.js" + }, + "import": { + "types": "./dist/typings/index.d.ts", + "default": "./dist/esm/index.js" + }, + "default": { + "types": "./dist/typings/index.d.ts", + "default": "./dist/esm/index.js" + } }, - "./*": { - "require": "./dist/*.js", - "import": "./dist/*.mjs" - } + "./package.json": "./package.json" }, "dependencies": { "@graphql-tools/utils": "9.1.1", @@ -35,7 +42,8 @@ "tslib": "^2.4.0" }, "publishConfig": { - "access": "public", - "directory": "dist" - } + "directory": "dist", + "access": "public" + }, + "type": "module" } diff --git a/packages/json-machete/package.json b/packages/json-machete/package.json index b605fa148da14..e35cfe38ba979 100644 --- a/packages/json-machete/package.json +++ b/packages/json-machete/package.json @@ -8,21 +8,28 @@ "directory": "packages/json-machete" }, "sideEffects": false, - "main": "dist/index.js", - "module": "dist/index.mjs", - "typings": "dist/index.d.ts", + "main": "dist/cjs/index.js", + "module": "dist/esm/index.js", + "typings": "dist/typings/index.d.ts", "typescript": { - "definition": "dist/index.d.ts" + "definition": "dist/typings/index.d.ts" }, "exports": { ".": { - "require": "./dist/index.js", - "import": "./dist/index.mjs" + "require": { + "types": "./dist/typings/index.d.cts", + "default": "./dist/cjs/index.js" + }, + "import": { + "types": "./dist/typings/index.d.ts", + "default": "./dist/esm/index.js" + }, + "default": { + "types": "./dist/typings/index.d.ts", + "default": "./dist/esm/index.js" + } }, - "./*": { - "require": "./dist/*.js", - "import": "./dist/*.mjs" - } + "./package.json": "./package.json" }, "dependencies": { "@json-schema-tools/meta-schema": "1.7.0", @@ -40,7 +47,8 @@ "@types/json-pointer": "1.0.31" }, "publishConfig": { - "access": "public", - "directory": "dist" - } + "directory": "dist", + "access": "public" + }, + "type": "module" } 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 0f9dd82ba22eb..6baea07340bc6 100644 --- a/packages/loaders/json-schema/package.json +++ b/packages/loaders/json-schema/package.json @@ -2,21 +2,28 @@ "name": "@omnigraph/json-schema", "version": "0.36.8", "sideEffects": false, - "main": "dist/index.js", - "module": "dist/index.mjs", - "typings": "dist/index.d.ts", + "main": "dist/cjs/index.js", + "module": "dist/esm/index.js", + "typings": "dist/typings/index.d.ts", "typescript": { - "definition": "dist/index.d.ts" + "definition": "dist/typings/index.d.ts" }, "exports": { ".": { - "require": "./dist/index.js", - "import": "./dist/index.mjs" + "require": { + "types": "./dist/typings/index.d.cts", + "default": "./dist/cjs/index.js" + }, + "import": { + "types": "./dist/typings/index.d.ts", + "default": "./dist/esm/index.js" + }, + "default": { + "types": "./dist/typings/index.d.ts", + "default": "./dist/esm/index.js" + } }, - "./*": { - "require": "./dist/*.js", - "import": "./dist/*.mjs" - } + "./package.json": "./package.json" }, "license": "MIT", "repository": { @@ -53,7 +60,8 @@ "@json-schema-tools/meta-schema": "1.7.0" }, "publishConfig": { - "access": "public", - "directory": "dist" - } + "directory": "dist", + "access": "public" + }, + "type": "module" } 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 a9613827b2684..f93bd1b6d6bbf 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 3951677571f99..d81070edb86d6 100644 --- a/packages/loaders/openapi/package.json +++ b/packages/loaders/openapi/package.json @@ -2,21 +2,28 @@ "name": "@omnigraph/openapi", "version": "0.17.8", "sideEffects": false, - "main": "dist/index.js", - "module": "dist/index.mjs", - "typings": "dist/index.d.ts", + "main": "dist/cjs/index.js", + "module": "dist/esm/index.js", + "typings": "dist/typings/index.d.ts", "typescript": { - "definition": "dist/index.d.ts" + "definition": "dist/typings/index.d.ts" }, "exports": { ".": { - "require": "./dist/index.js", - "import": "./dist/index.mjs" + "require": { + "types": "./dist/typings/index.d.cts", + "default": "./dist/cjs/index.js" + }, + "import": { + "types": "./dist/typings/index.d.ts", + "default": "./dist/esm/index.js" + }, + "default": { + "types": "./dist/typings/index.d.ts", + "default": "./dist/esm/index.js" + } }, - "./*": { - "require": "./dist/*.js", - "import": "./dist/*.mjs" - } + "./package.json": "./package.json" }, "license": "MIT", "repository": { @@ -55,7 +62,8 @@ "multer": "1.4.5-lts.1" }, "publishConfig": { - "access": "public", - "directory": "dist" - } + "directory": "dist", + "access": "public" + }, + "type": "module" } 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/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-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 56b3f4c888389..cee7e144ecee9 100644 --- a/packages/loaders/raml/package.json +++ b/packages/loaders/raml/package.json @@ -2,21 +2,28 @@ "name": "@omnigraph/raml", "version": "0.7.41", "sideEffects": false, - "main": "dist/index.js", - "module": "dist/index.mjs", - "typings": "dist/index.d.ts", + "main": "dist/cjs/index.js", + "module": "dist/esm/index.js", + "typings": "dist/typings/index.d.ts", "typescript": { - "definition": "dist/index.d.ts" + "definition": "dist/typings/index.d.ts" }, "exports": { ".": { - "require": "./dist/index.js", - "import": "./dist/index.mjs" + "require": { + "types": "./dist/typings/index.d.cts", + "default": "./dist/cjs/index.js" + }, + "import": { + "types": "./dist/typings/index.d.ts", + "default": "./dist/esm/index.js" + }, + "default": { + "types": "./dist/typings/index.d.ts", + "default": "./dist/esm/index.js" + } }, - "./*": { - "require": "./dist/*.js", - "import": "./dist/*.mjs" - } + "./package.json": "./package.json" }, "license": "MIT", "repository": { @@ -41,7 +48,8 @@ "change-case": "4.1.2" }, "publishConfig": { - "access": "public", - "directory": "dist" - } + "directory": "dist", + "access": "public" + }, + "type": "module" } 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 2351194c6cefc..a7ce5f55d3869 100644 --- a/packages/loaders/soap/package.json +++ b/packages/loaders/soap/package.json @@ -2,21 +2,28 @@ "name": "@omnigraph/soap", "version": "0.2.1", "sideEffects": false, - "main": "dist/index.js", - "module": "dist/index.mjs", - "typings": "dist/index.d.ts", + "main": "dist/cjs/index.js", + "module": "dist/esm/index.js", + "typings": "dist/typings/index.d.ts", "typescript": { - "definition": "dist/index.d.ts" + "definition": "dist/typings/index.d.ts" }, "exports": { ".": { - "require": "./dist/index.js", - "import": "./dist/index.mjs" + "require": { + "types": "./dist/typings/index.d.cts", + "default": "./dist/cjs/index.js" + }, + "import": { + "types": "./dist/typings/index.d.ts", + "default": "./dist/esm/index.js" + }, + "default": { + "types": "./dist/typings/index.d.ts", + "default": "./dist/esm/index.js" + } }, - "./*": { - "require": "./dist/*.js", - "import": "./dist/*.mjs" - } + "./package.json": "./package.json" }, "license": "MIT", "peerDependencies": { @@ -34,7 +41,8 @@ "@whatwg-node/fetch": "0.5.3" }, "publishConfig": { - "access": "public", - "directory": "dist" - } + "directory": "dist", + "access": "public" + }, + "type": "module" } 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 6c9412257d122..88b8eed8cd5b2 100644 --- a/packages/mergers/bare/package.json +++ b/packages/mergers/bare/package.json @@ -2,21 +2,28 @@ "name": "@graphql-mesh/merger-bare", "version": "0.15.47", "sideEffects": false, - "main": "dist/index.js", - "module": "dist/index.mjs", - "typings": "dist/index.d.ts", + "main": "dist/cjs/index.js", + "module": "dist/esm/index.js", + "typings": "dist/typings/index.d.ts", "typescript": { - "definition": "dist/index.d.ts" + "definition": "dist/typings/index.d.ts" }, "exports": { ".": { - "require": "./dist/index.js", - "import": "./dist/index.mjs" + "require": { + "types": "./dist/typings/index.d.cts", + "default": "./dist/cjs/index.js" + }, + "import": { + "types": "./dist/typings/index.d.ts", + "default": "./dist/esm/index.js" + }, + "default": { + "types": "./dist/typings/index.d.ts", + "default": "./dist/esm/index.js" + } }, - "./*": { - "require": "./dist/*.js", - "import": "./dist/*.mjs" - } + "./package.json": "./package.json" }, "license": "MIT", "repository": { @@ -36,7 +43,8 @@ "tslib": "^2.4.0" }, "publishConfig": { - "access": "public", - "directory": "dist" - } + "directory": "dist", + "access": "public" + }, + "type": "module" } diff --git a/packages/mergers/federation/package.json b/packages/mergers/federation/package.json index 38ccd884c8685..f7a7424ade5e7 100644 --- a/packages/mergers/federation/package.json +++ b/packages/mergers/federation/package.json @@ -2,21 +2,28 @@ "name": "@graphql-mesh/merger-federation", "version": "0.12.45", "sideEffects": false, - "main": "dist/index.js", - "module": "dist/index.mjs", - "typings": "dist/index.d.ts", + "main": "dist/cjs/index.js", + "module": "dist/esm/index.js", + "typings": "dist/typings/index.d.ts", "typescript": { - "definition": "dist/index.d.ts" + "definition": "dist/typings/index.d.ts" }, "exports": { ".": { - "require": "./dist/index.js", - "import": "./dist/index.mjs" + "require": { + "types": "./dist/typings/index.d.cts", + "default": "./dist/cjs/index.js" + }, + "import": { + "types": "./dist/typings/index.d.ts", + "default": "./dist/esm/index.js" + }, + "default": { + "types": "./dist/typings/index.d.ts", + "default": "./dist/esm/index.js" + } }, - "./*": { - "require": "./dist/*.js", - "import": "./dist/*.mjs" - } + "./package.json": "./package.json" }, "license": "MIT", "repository": { @@ -39,7 +46,8 @@ "tslib": "^2.4.0" }, "publishConfig": { - "access": "public", - "directory": "dist" - } + "directory": "dist", + "access": "public" + }, + "type": "module" } diff --git a/packages/mergers/stitching/package.json b/packages/mergers/stitching/package.json index 1e2fb1721054f..b8145a04c9406 100644 --- a/packages/mergers/stitching/package.json +++ b/packages/mergers/stitching/package.json @@ -2,21 +2,28 @@ "name": "@graphql-mesh/merger-stitching", "version": "0.17.7", "sideEffects": false, - "main": "dist/index.js", - "module": "dist/index.mjs", - "typings": "dist/index.d.ts", + "main": "dist/cjs/index.js", + "module": "dist/esm/index.js", + "typings": "dist/typings/index.d.ts", "typescript": { - "definition": "dist/index.d.ts" + "definition": "dist/typings/index.d.ts" }, "exports": { ".": { - "require": "./dist/index.js", - "import": "./dist/index.mjs" + "require": { + "types": "./dist/typings/index.d.cts", + "default": "./dist/cjs/index.js" + }, + "import": { + "types": "./dist/typings/index.d.ts", + "default": "./dist/esm/index.js" + }, + "default": { + "types": "./dist/typings/index.d.ts", + "default": "./dist/esm/index.js" + } }, - "./*": { - "require": "./dist/*.js", - "import": "./dist/*.mjs" - } + "./package.json": "./package.json" }, "license": "MIT", "repository": { @@ -39,7 +46,8 @@ "tslib": "^2.4.0" }, "publishConfig": { - "access": "public", - "directory": "dist" - } + "directory": "dist", + "access": "public" + }, + "type": "module" } diff --git a/packages/plugins/deduplicate-request/package.json b/packages/plugins/deduplicate-request/package.json index 071e23232787b..04d9b5e7198d9 100644 --- a/packages/plugins/deduplicate-request/package.json +++ b/packages/plugins/deduplicate-request/package.json @@ -2,21 +2,28 @@ "name": "@graphql-mesh/plugin-deduplicate-request", "version": "0.0.11", "sideEffects": false, - "main": "dist/index.js", - "module": "dist/index.mjs", - "typings": "dist/index.d.ts", + "main": "dist/cjs/index.js", + "module": "dist/esm/index.js", + "typings": "dist/typings/index.d.ts", "typescript": { - "definition": "dist/index.d.ts" + "definition": "dist/typings/index.d.ts" }, "exports": { ".": { - "require": "./dist/index.js", - "import": "./dist/index.mjs" + "require": { + "types": "./dist/typings/index.d.cts", + "default": "./dist/cjs/index.js" + }, + "import": { + "types": "./dist/typings/index.d.ts", + "default": "./dist/esm/index.js" + }, + "default": { + "types": "./dist/typings/index.d.ts", + "default": "./dist/esm/index.js" + } }, - "./*": { - "require": "./dist/*.js", - "import": "./dist/*.mjs" - } + "./package.json": "./package.json" }, "license": "MIT", "repository": { @@ -34,7 +41,8 @@ "tslib": "^2.4.0" }, "publishConfig": { - "access": "public", - "directory": "dist" - } + "directory": "dist", + "access": "public" + }, + "type": "module" } 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/http-cache/package.json b/packages/plugins/http-cache/package.json index a885354f6fb51..59c1e26fc7936 100644 --- a/packages/plugins/http-cache/package.json +++ b/packages/plugins/http-cache/package.json @@ -2,21 +2,28 @@ "name": "@graphql-mesh/plugin-http-cache", "version": "0.0.9", "sideEffects": false, - "main": "dist/index.js", - "module": "dist/index.mjs", - "typings": "dist/index.d.ts", + "main": "dist/cjs/index.js", + "module": "dist/esm/index.js", + "typings": "dist/typings/index.d.ts", "typescript": { - "definition": "dist/index.d.ts" + "definition": "dist/typings/index.d.ts" }, "exports": { ".": { - "require": "./dist/index.js", - "import": "./dist/index.mjs" + "require": { + "types": "./dist/typings/index.d.cts", + "default": "./dist/cjs/index.js" + }, + "import": { + "types": "./dist/typings/index.d.ts", + "default": "./dist/esm/index.js" + }, + "default": { + "types": "./dist/typings/index.d.ts", + "default": "./dist/esm/index.js" + } }, - "./*": { - "require": "./dist/*.js", - "import": "./dist/*.mjs" - } + "./package.json": "./package.json" }, "license": "MIT", "repository": { @@ -38,7 +45,8 @@ "@types/http-cache-semantics": "4.0.1" }, "publishConfig": { - "access": "public", - "directory": "dist" - } + "directory": "dist", + "access": "public" + }, + "type": "module" } diff --git a/packages/plugins/http-details-extensions/package.json b/packages/plugins/http-details-extensions/package.json index 183ec6ccfd473..ef67612542a85 100644 --- a/packages/plugins/http-details-extensions/package.json +++ b/packages/plugins/http-details-extensions/package.json @@ -2,21 +2,28 @@ "name": "@graphql-mesh/plugin-http-details-extensions", "version": "0.0.9", "sideEffects": false, - "main": "dist/index.js", - "module": "dist/index.mjs", - "typings": "dist/index.d.ts", + "main": "dist/cjs/index.js", + "module": "dist/esm/index.js", + "typings": "dist/typings/index.d.ts", "typescript": { - "definition": "dist/index.d.ts" + "definition": "dist/typings/index.d.ts" }, "exports": { ".": { - "require": "./dist/index.js", - "import": "./dist/index.mjs" + "require": { + "types": "./dist/typings/index.d.cts", + "default": "./dist/cjs/index.js" + }, + "import": { + "types": "./dist/typings/index.d.ts", + "default": "./dist/esm/index.js" + }, + "default": { + "types": "./dist/typings/index.d.ts", + "default": "./dist/esm/index.js" + } }, - "./*": { - "require": "./dist/*.js", - "import": "./dist/*.mjs" - } + "./package.json": "./package.json" }, "license": "MIT", "repository": { @@ -35,7 +42,8 @@ "tslib": "^2.4.0" }, "publishConfig": { - "access": "public", - "directory": "dist" - } + "directory": "dist", + "access": "public" + }, + "type": "module" } diff --git a/packages/plugins/live-query/package.json b/packages/plugins/live-query/package.json index 0aebc9ee2724d..880d760d3a1eb 100644 --- a/packages/plugins/live-query/package.json +++ b/packages/plugins/live-query/package.json @@ -2,21 +2,28 @@ "name": "@graphql-mesh/plugin-live-query", "version": "0.1.46", "sideEffects": false, - "main": "dist/index.js", - "module": "dist/index.mjs", - "typings": "dist/index.d.ts", + "main": "dist/cjs/index.js", + "module": "dist/esm/index.js", + "typings": "dist/typings/index.d.ts", "typescript": { - "definition": "dist/index.d.ts" + "definition": "dist/typings/index.d.ts" }, "exports": { ".": { - "require": "./dist/index.js", - "import": "./dist/index.mjs" + "require": { + "types": "./dist/typings/index.d.cts", + "default": "./dist/cjs/index.js" + }, + "import": { + "types": "./dist/typings/index.d.ts", + "default": "./dist/esm/index.js" + }, + "default": { + "types": "./dist/typings/index.d.ts", + "default": "./dist/esm/index.js" + } }, - "./*": { - "require": "./dist/*.js", - "import": "./dist/*.mjs" - } + "./package.json": "./package.json" }, "license": "MIT", "repository": { @@ -37,7 +44,8 @@ "tslib": "^2.4.0" }, "publishConfig": { - "access": "public", - "directory": "dist" - } + "directory": "dist", + "access": "public" + }, + "type": "module" } 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 8ed6d27fbb002..c30d97cf9fef0 100644 --- a/packages/plugins/mock/package.json +++ b/packages/plugins/mock/package.json @@ -2,21 +2,28 @@ "name": "@graphql-mesh/plugin-mock", "version": "0.0.38", "sideEffects": false, - "main": "dist/index.js", - "module": "dist/index.mjs", - "typings": "dist/index.d.ts", + "main": "dist/cjs/index.js", + "module": "dist/esm/index.js", + "typings": "dist/typings/index.d.ts", "typescript": { - "definition": "dist/index.d.ts" + "definition": "dist/typings/index.d.ts" }, "exports": { ".": { - "require": "./dist/index.js", - "import": "./dist/index.mjs" + "require": { + "types": "./dist/typings/index.d.cts", + "default": "./dist/cjs/index.js" + }, + "import": { + "types": "./dist/typings/index.d.ts", + "default": "./dist/esm/index.js" + }, + "default": { + "types": "./dist/typings/index.d.ts", + "default": "./dist/esm/index.js" + } }, - "./*": { - "require": "./dist/*.js", - "import": "./dist/*.mjs" - } + "./package.json": "./package.json" }, "license": "MIT", "repository": { @@ -45,7 +52,8 @@ "@graphql-mesh/cache-localforage": "0.6.61" }, "publishConfig": { - "access": "public", - "directory": "dist" - } + "directory": "dist", + "access": "public" + }, + "type": "module" } 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 5c4c31fe0dc99..a06673fdaf3d0 100644 --- a/packages/plugins/newrelic/package.json +++ b/packages/plugins/newrelic/package.json @@ -2,21 +2,28 @@ "name": "@graphql-mesh/plugin-newrelic", "version": "0.2.29", "sideEffects": false, - "main": "dist/index.js", - "module": "dist/index.mjs", - "typings": "dist/index.d.ts", + "main": "dist/cjs/index.js", + "module": "dist/esm/index.js", + "typings": "dist/typings/index.d.ts", "typescript": { - "definition": "dist/index.d.ts" + "definition": "dist/typings/index.d.ts" }, "exports": { ".": { - "require": "./dist/index.js", - "import": "./dist/index.mjs" + "require": { + "types": "./dist/typings/index.d.cts", + "default": "./dist/cjs/index.js" + }, + "import": { + "types": "./dist/typings/index.d.ts", + "default": "./dist/esm/index.js" + }, + "default": { + "types": "./dist/typings/index.d.ts", + "default": "./dist/esm/index.js" + } }, - "./*": { - "require": "./dist/*.js", - "import": "./dist/*.mjs" - } + "./package.json": "./package.json" }, "license": "MIT", "repository": { @@ -42,7 +49,8 @@ "newrelic": "8.17.1" }, "publishConfig": { - "access": "public", - "directory": "dist" - } + "directory": "dist", + "access": "public" + }, + "type": "module" } diff --git a/packages/plugins/operation-field-permissions/package.json b/packages/plugins/operation-field-permissions/package.json index 154b7d51221ec..293ba1311d097 100644 --- a/packages/plugins/operation-field-permissions/package.json +++ b/packages/plugins/operation-field-permissions/package.json @@ -2,21 +2,28 @@ "name": "@graphql-mesh/plugin-operation-field-permissions", "version": "0.0.21", "sideEffects": false, - "main": "dist/index.js", - "module": "dist/index.mjs", - "typings": "dist/index.d.ts", + "main": "dist/cjs/index.js", + "module": "dist/esm/index.js", + "typings": "dist/typings/index.d.ts", "typescript": { - "definition": "dist/index.d.ts" + "definition": "dist/typings/index.d.ts" }, "exports": { ".": { - "require": "./dist/index.js", - "import": "./dist/index.mjs" + "require": { + "types": "./dist/typings/index.d.cts", + "default": "./dist/cjs/index.js" + }, + "import": { + "types": "./dist/typings/index.d.ts", + "default": "./dist/esm/index.js" + }, + "default": { + "types": "./dist/typings/index.d.ts", + "default": "./dist/esm/index.js" + } }, - "./*": { - "require": "./dist/*.js", - "import": "./dist/*.mjs" - } + "./package.json": "./package.json" }, "license": "MIT", "repository": { @@ -34,7 +41,8 @@ "tslib": "^2.4.0" }, "publishConfig": { - "access": "public", - "directory": "dist" - } + "directory": "dist", + "access": "public" + }, + "type": "module" } diff --git a/packages/plugins/prometheus/package.json b/packages/plugins/prometheus/package.json index d2bc12a316eba..3ff7ec633507c 100644 --- a/packages/plugins/prometheus/package.json +++ b/packages/plugins/prometheus/package.json @@ -2,21 +2,28 @@ "name": "@graphql-mesh/plugin-prometheus", "version": "0.2.10", "sideEffects": false, - "main": "dist/index.js", - "module": "dist/index.mjs", - "typings": "dist/index.d.ts", + "main": "dist/cjs/index.js", + "module": "dist/esm/index.js", + "typings": "dist/typings/index.d.ts", "typescript": { - "definition": "dist/index.d.ts" + "definition": "dist/typings/index.d.ts" }, "exports": { ".": { - "require": "./dist/index.js", - "import": "./dist/index.mjs" + "require": { + "types": "./dist/typings/index.d.cts", + "default": "./dist/cjs/index.js" + }, + "import": { + "types": "./dist/typings/index.d.ts", + "default": "./dist/esm/index.js" + }, + "default": { + "types": "./dist/typings/index.d.ts", + "default": "./dist/esm/index.js" + } }, - "./*": { - "require": "./dist/*.js", - "import": "./dist/*.mjs" - } + "./package.json": "./package.json" }, "license": "MIT", "repository": { @@ -39,7 +46,8 @@ "prom-client": "14.1.0" }, "publishConfig": { - "access": "public", - "directory": "dist" - } + "directory": "dist", + "access": "public" + }, + "type": "module" } diff --git a/packages/plugins/rate-limit/package.json b/packages/plugins/rate-limit/package.json index 7b5ef1e7df17d..06ef80b96b3ed 100644 --- a/packages/plugins/rate-limit/package.json +++ b/packages/plugins/rate-limit/package.json @@ -2,21 +2,28 @@ "name": "@graphql-mesh/plugin-rate-limit", "version": "0.0.47", "sideEffects": false, - "main": "dist/index.js", - "module": "dist/index.mjs", - "typings": "dist/index.d.ts", + "main": "dist/cjs/index.js", + "module": "dist/esm/index.js", + "typings": "dist/typings/index.d.ts", "typescript": { - "definition": "dist/index.d.ts" + "definition": "dist/typings/index.d.ts" }, "exports": { ".": { - "require": "./dist/index.js", - "import": "./dist/index.mjs" + "require": { + "types": "./dist/typings/index.d.cts", + "default": "./dist/cjs/index.js" + }, + "import": { + "types": "./dist/typings/index.d.ts", + "default": "./dist/esm/index.js" + }, + "default": { + "types": "./dist/typings/index.d.ts", + "default": "./dist/esm/index.js" + } }, - "./*": { - "require": "./dist/*.js", - "import": "./dist/*.mjs" - } + "./package.json": "./package.json" }, "license": "MIT", "repository": { @@ -39,7 +46,8 @@ "@envelop/core": "3.0.3" }, "publishConfig": { - "access": "public", - "directory": "dist" - } + "directory": "dist", + "access": "public" + }, + "type": "module" } 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 182a0e710a41f..45da13e2b57ae 100644 --- a/packages/plugins/response-cache/package.json +++ b/packages/plugins/response-cache/package.json @@ -2,21 +2,28 @@ "name": "@graphql-mesh/plugin-response-cache", "version": "0.1.49", "sideEffects": false, - "main": "dist/index.js", - "module": "dist/index.mjs", - "typings": "dist/index.d.ts", + "main": "dist/cjs/index.js", + "module": "dist/esm/index.js", + "typings": "dist/typings/index.d.ts", "typescript": { - "definition": "dist/index.d.ts" + "definition": "dist/typings/index.d.ts" }, "exports": { ".": { - "require": "./dist/index.js", - "import": "./dist/index.mjs" + "require": { + "types": "./dist/typings/index.d.cts", + "default": "./dist/cjs/index.js" + }, + "import": { + "types": "./dist/typings/index.d.ts", + "default": "./dist/esm/index.js" + }, + "default": { + "types": "./dist/typings/index.d.ts", + "default": "./dist/esm/index.js" + } }, - "./*": { - "require": "./dist/*.js", - "import": "./dist/*.mjs" - } + "./package.json": "./package.json" }, "license": "MIT", "repository": { @@ -37,7 +44,8 @@ "tslib": "^2.4.0" }, "publishConfig": { - "access": "public", - "directory": "dist" - } + "directory": "dist", + "access": "public" + }, + "type": "module" } diff --git a/packages/plugins/snapshot/package.json b/packages/plugins/snapshot/package.json index 2327227bb6829..0fbece85a61de 100644 --- a/packages/plugins/snapshot/package.json +++ b/packages/plugins/snapshot/package.json @@ -2,21 +2,28 @@ "name": "@graphql-mesh/plugin-snapshot", "version": "0.0.11", "sideEffects": false, - "main": "dist/index.js", - "module": "dist/index.mjs", - "typings": "dist/index.d.ts", + "main": "dist/cjs/index.js", + "module": "dist/esm/index.js", + "typings": "dist/typings/index.d.ts", "typescript": { - "definition": "dist/index.d.ts" + "definition": "dist/typings/index.d.ts" }, "exports": { ".": { - "require": "./dist/index.js", - "import": "./dist/index.mjs" + "require": { + "types": "./dist/typings/index.d.cts", + "default": "./dist/cjs/index.js" + }, + "import": { + "types": "./dist/typings/index.d.ts", + "default": "./dist/esm/index.js" + }, + "default": { + "types": "./dist/typings/index.d.ts", + "default": "./dist/esm/index.js" + } }, - "./*": { - "require": "./dist/*.js", - "import": "./dist/*.mjs" - } + "./package.json": "./package.json" }, "license": "MIT", "repository": { @@ -37,7 +44,8 @@ "tslib": "^2.4.0" }, "publishConfig": { - "access": "public", - "directory": "dist" - } + "directory": "dist", + "access": "public" + }, + "type": "module" } diff --git a/packages/plugins/statsd/package.json b/packages/plugins/statsd/package.json index b215debec9df4..42f4f2fc2b2b4 100644 --- a/packages/plugins/statsd/package.json +++ b/packages/plugins/statsd/package.json @@ -2,21 +2,28 @@ "name": "@graphql-mesh/plugin-statsd", "version": "0.0.30", "sideEffects": false, - "main": "dist/index.js", - "module": "dist/index.mjs", - "typings": "dist/index.d.ts", + "main": "dist/cjs/index.js", + "module": "dist/esm/index.js", + "typings": "dist/typings/index.d.ts", "typescript": { - "definition": "dist/index.d.ts" + "definition": "dist/typings/index.d.ts" }, "exports": { ".": { - "require": "./dist/index.js", - "import": "./dist/index.mjs" + "require": { + "types": "./dist/typings/index.d.cts", + "default": "./dist/cjs/index.js" + }, + "import": { + "types": "./dist/typings/index.d.ts", + "default": "./dist/esm/index.js" + }, + "default": { + "types": "./dist/typings/index.d.ts", + "default": "./dist/esm/index.js" + } }, - "./*": { - "require": "./dist/*.js", - "import": "./dist/*.mjs" - } + "./package.json": "./package.json" }, "license": "MIT", "repository": { @@ -38,7 +45,8 @@ "hot-shots": "9.3.0" }, "publishConfig": { - "access": "public", - "directory": "dist" - } + "directory": "dist", + "access": "public" + }, + "type": "module" } diff --git a/packages/runtime/package.json b/packages/runtime/package.json index 78fa77a93a767..8603f329635b0 100644 --- a/packages/runtime/package.json +++ b/packages/runtime/package.json @@ -11,21 +11,28 @@ "graphql": "*" }, "sideEffects": false, - "main": "dist/index.js", - "module": "dist/index.mjs", - "typings": "dist/index.d.ts", + "main": "dist/cjs/index.js", + "module": "dist/esm/index.js", + "typings": "dist/typings/index.d.ts", "typescript": { - "definition": "dist/index.d.ts" + "definition": "dist/typings/index.d.ts" }, "exports": { ".": { - "require": "./dist/index.js", - "import": "./dist/index.mjs" + "require": { + "types": "./dist/typings/index.d.cts", + "default": "./dist/cjs/index.js" + }, + "import": { + "types": "./dist/typings/index.d.ts", + "default": "./dist/esm/index.js" + }, + "default": { + "types": "./dist/typings/index.d.ts", + "default": "./dist/esm/index.js" + } }, - "./*": { - "require": "./dist/*.js", - "import": "./dist/*.mjs" - } + "./package.json": "./package.json" }, "dependencies": { "@graphql-mesh/cross-helpers": "0.2.10", @@ -46,7 +53,8 @@ "@graphql-tools/schema": "9.0.10" }, "publishConfig": { - "access": "public", - "directory": "dist" - } + "directory": "dist", + "access": "public" + }, + "type": "module" } 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 76706277c1f4d..f35aad51b9425 100644 --- a/packages/runtime/src/in-context-sdk.ts +++ b/packages/runtime/src/in-context-sdk.ts @@ -23,7 +23,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 42b5aca2c3ff0..98e7ada0c5297 100644 --- a/packages/store/package.json +++ b/packages/store/package.json @@ -14,21 +14,28 @@ "graphql": "16.6.0" }, "sideEffects": false, - "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", "typescript": { - "definition": "dist/index.d.ts" + "definition": "dist/typings/index.d.ts" }, "dependencies": { "@graphql-inspector/core": "3.3.0", @@ -39,7 +46,8 @@ "tslib": "^2.4.0" }, "publishConfig": { - "access": "public", - "directory": "dist" - } + "directory": "dist", + "access": "public" + }, + "type": "module" } 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..627d2230bc702 100644 --- a/packages/string-interpolation/package.json +++ b/packages/string-interpolation/package.json @@ -4,21 +4,28 @@ "license": "MIT", "description": "Dynamic string manipulation", "sideEffects": false, - "main": "dist/index.js", - "module": "dist/index.mjs", - "typings": "dist/index.d.ts", + "main": "dist/cjs/index.js", + "module": "dist/esm/index.js", + "typings": "dist/typings/index.d.ts", "typescript": { - "definition": "dist/index.d.ts" + "definition": "dist/typings/index.d.ts" }, "exports": { ".": { - "require": "./dist/index.js", - "import": "./dist/index.mjs" + "require": { + "types": "./dist/typings/index.d.cts", + "default": "./dist/cjs/index.js" + }, + "import": { + "types": "./dist/typings/index.d.ts", + "default": "./dist/esm/index.js" + }, + "default": { + "types": "./dist/typings/index.d.ts", + "default": "./dist/esm/index.js" + } }, - "./*": { - "require": "./dist/*.js", - "import": "./dist/*.mjs" - } + "./package.json": "./package.json" }, "peerDependencies": { "graphql": "*" @@ -35,6 +42,8 @@ "directory": "packages/string-interpolation" }, "publishConfig": { + "directory": "dist", "access": "public" - } + }, + "type": "module" } 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 40c3b0143e3a9..607ba88d93d34 100644 --- a/packages/transforms/cache/package.json +++ b/packages/transforms/cache/package.json @@ -2,21 +2,28 @@ "name": "@graphql-mesh/transform-cache", "version": "0.12.65", "sideEffects": false, - "main": "dist/index.js", - "module": "dist/index.mjs", - "typings": "dist/index.d.ts", + "main": "dist/cjs/index.js", + "module": "dist/esm/index.js", + "typings": "dist/typings/index.d.ts", "typescript": { - "definition": "dist/index.d.ts" + "definition": "dist/typings/index.d.ts" }, "exports": { ".": { - "require": "./dist/index.js", - "import": "./dist/index.mjs" + "require": { + "types": "./dist/typings/index.d.cts", + "default": "./dist/cjs/index.js" + }, + "import": { + "types": "./dist/typings/index.d.ts", + "default": "./dist/esm/index.js" + }, + "default": { + "types": "./dist/typings/index.d.ts", + "default": "./dist/esm/index.js" + } }, - "./*": { - "require": "./dist/*.js", - "import": "./dist/*.mjs" - } + "./package.json": "./package.json" }, "license": "MIT", "repository": { @@ -42,7 +49,8 @@ "@graphql-mesh/cache-localforage": "0.6.61" }, "publishConfig": { - "access": "public", - "directory": "dist" - } + "directory": "dist", + "access": "public" + }, + "type": "module" } 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..130248fdff5e3 100644 --- a/packages/transforms/cache/test/cache.spec.ts +++ b/packages/transforms/cache/test/cache.spec.ts @@ -11,8 +11,8 @@ import { OperationDefinitionNode, FieldNode, } from 'graphql'; -import CacheTransform from '../src'; -import { computeCacheKey } from '../src/compute-cache-key'; +import CacheTransform from '../src/index.js'; +import { computeCacheKey } from '../src/compute-cache-key.js'; import { PubSub } from '@graphql-mesh/utils'; import dayjs from 'dayjs'; import { hashObject } from '@graphql-mesh/string-interpolation'; diff --git a/packages/transforms/encapsulate/package.json b/packages/transforms/encapsulate/package.json index 96c1101b22a94..8abc90cd6c89c 100644 --- a/packages/transforms/encapsulate/package.json +++ b/packages/transforms/encapsulate/package.json @@ -2,21 +2,28 @@ "name": "@graphql-mesh/transform-encapsulate", "version": "0.3.112", "sideEffects": false, - "main": "dist/index.js", - "module": "dist/index.mjs", - "typings": "dist/index.d.ts", + "main": "dist/cjs/index.js", + "module": "dist/esm/index.js", + "typings": "dist/typings/index.d.ts", "typescript": { - "definition": "dist/index.d.ts" + "definition": "dist/typings/index.d.ts" }, "exports": { ".": { - "require": "./dist/index.js", - "import": "./dist/index.mjs" + "require": { + "types": "./dist/typings/index.d.cts", + "default": "./dist/cjs/index.js" + }, + "import": { + "types": "./dist/typings/index.d.ts", + "default": "./dist/esm/index.js" + }, + "default": { + "types": "./dist/typings/index.d.ts", + "default": "./dist/esm/index.js" + } }, - "./*": { - "require": "./dist/*.js", - "import": "./dist/*.mjs" - } + "./package.json": "./package.json" }, "license": "MIT", "repository": { @@ -36,7 +43,8 @@ "tslib": "^2.4.0" }, "publishConfig": { - "access": "public", - "directory": "dist" - } + "directory": "dist", + "access": "public" + }, + "type": "module" } diff --git a/packages/transforms/encapsulate/test/encapsulate.spec.ts b/packages/transforms/encapsulate/test/encapsulate.spec.ts index 6e25f069b4a9f..daae3d85e705a 100644 --- a/packages/transforms/encapsulate/test/encapsulate.spec.ts +++ b/packages/transforms/encapsulate/test/encapsulate.spec.ts @@ -1,4 +1,4 @@ -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'; diff --git a/packages/transforms/extend/package.json b/packages/transforms/extend/package.json index 6ab19d8b9ac10..5a25dd0635f44 100644 --- a/packages/transforms/extend/package.json +++ b/packages/transforms/extend/package.json @@ -2,21 +2,28 @@ "name": "@graphql-mesh/transform-extend", "version": "0.10.75", "sideEffects": false, - "main": "dist/index.js", - "module": "dist/index.mjs", - "typings": "dist/index.d.ts", + "main": "dist/cjs/index.js", + "module": "dist/esm/index.js", + "typings": "dist/typings/index.d.ts", "typescript": { - "definition": "dist/index.d.ts" + "definition": "dist/typings/index.d.ts" }, "exports": { ".": { - "require": "./dist/index.js", - "import": "./dist/index.mjs" + "require": { + "types": "./dist/typings/index.d.cts", + "default": "./dist/cjs/index.js" + }, + "import": { + "types": "./dist/typings/index.d.ts", + "default": "./dist/esm/index.js" + }, + "default": { + "types": "./dist/typings/index.d.ts", + "default": "./dist/esm/index.js" + } }, - "./*": { - "require": "./dist/*.js", - "import": "./dist/*.mjs" - } + "./package.json": "./package.json" }, "license": "MIT", "repository": { @@ -39,7 +46,8 @@ "tslib": "^2.4.0" }, "publishConfig": { - "access": "public", - "directory": "dist" - } + "directory": "dist", + "access": "public" + }, + "type": "module" } diff --git a/packages/transforms/federation/package.json b/packages/transforms/federation/package.json index b75e4d4a4d7eb..848e05e03ef90 100644 --- a/packages/transforms/federation/package.json +++ b/packages/transforms/federation/package.json @@ -2,21 +2,28 @@ "name": "@graphql-mesh/transform-federation", "version": "0.9.57", "sideEffects": false, - "main": "dist/index.js", - "module": "dist/index.mjs", - "typings": "dist/index.d.ts", + "main": "dist/cjs/index.js", + "module": "dist/esm/index.js", + "typings": "dist/typings/index.d.ts", "typescript": { - "definition": "dist/index.d.ts" + "definition": "dist/typings/index.d.ts" }, "exports": { ".": { - "require": "./dist/index.js", - "import": "./dist/index.mjs" + "require": { + "types": "./dist/typings/index.d.cts", + "default": "./dist/cjs/index.js" + }, + "import": { + "types": "./dist/typings/index.d.ts", + "default": "./dist/esm/index.js" + }, + "default": { + "types": "./dist/typings/index.d.ts", + "default": "./dist/esm/index.js" + } }, - "./*": { - "require": "./dist/*.js", - "import": "./dist/*.mjs" - } + "./package.json": "./package.json" }, "license": "MIT", "repository": { @@ -40,7 +47,8 @@ "lodash.set": "4.3.2" }, "publishConfig": { - "access": "public", - "directory": "dist" - } + "directory": "dist", + "access": "public" + }, + "type": "module" } diff --git a/packages/transforms/filter-schema/package.json b/packages/transforms/filter-schema/package.json index 5517133cd8463..88f1560b10fcb 100644 --- a/packages/transforms/filter-schema/package.json +++ b/packages/transforms/filter-schema/package.json @@ -2,21 +2,28 @@ "name": "@graphql-mesh/transform-filter-schema", "version": "0.14.111", "sideEffects": false, - "main": "dist/index.js", - "module": "dist/index.mjs", - "typings": "dist/index.d.ts", + "main": "dist/cjs/index.js", + "module": "dist/esm/index.js", + "typings": "dist/typings/index.d.ts", "typescript": { - "definition": "dist/index.d.ts" + "definition": "dist/typings/index.d.ts" }, "exports": { ".": { - "require": "./dist/index.js", - "import": "./dist/index.mjs" + "require": { + "types": "./dist/typings/index.d.cts", + "default": "./dist/cjs/index.js" + }, + "import": { + "types": "./dist/typings/index.d.ts", + "default": "./dist/esm/index.js" + }, + "default": { + "types": "./dist/typings/index.d.ts", + "default": "./dist/esm/index.js" + } }, - "./*": { - "require": "./dist/*.js", - "import": "./dist/*.mjs" - } + "./package.json": "./package.json" }, "license": "MIT", "repository": { @@ -40,7 +47,8 @@ "tslib": "^2.4.0" }, "publishConfig": { - "access": "public", - "directory": "dist" - } + "directory": "dist", + "access": "public" + }, + "type": "module" } 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/hoist-field/package.json b/packages/transforms/hoist-field/package.json index 1e7eee7b8c38f..c3a049c41551a 100644 --- a/packages/transforms/hoist-field/package.json +++ b/packages/transforms/hoist-field/package.json @@ -2,21 +2,28 @@ "name": "@graphql-mesh/transform-hoist-field", "version": "0.1.76", "sideEffects": false, - "main": "dist/index.js", - "module": "dist/index.mjs", - "typings": "dist/index.d.ts", + "main": "dist/cjs/index.js", + "module": "dist/esm/index.js", + "typings": "dist/typings/index.d.ts", "typescript": { - "definition": "dist/index.d.ts" + "definition": "dist/typings/index.d.ts" }, "exports": { ".": { - "require": "./dist/index.js", - "import": "./dist/index.mjs" + "require": { + "types": "./dist/typings/index.d.cts", + "default": "./dist/cjs/index.js" + }, + "import": { + "types": "./dist/typings/index.d.ts", + "default": "./dist/esm/index.js" + }, + "default": { + "types": "./dist/typings/index.d.ts", + "default": "./dist/esm/index.js" + } }, - "./*": { - "require": "./dist/*.js", - "import": "./dist/*.mjs" - } + "./package.json": "./package.json" }, "license": "MIT", "repository": { @@ -38,7 +45,8 @@ "@graphql-mesh/cache-localforage": "0.6.61" }, "publishConfig": { - "access": "public", - "directory": "dist" - } + "directory": "dist", + "access": "public" + }, + "type": "module" } diff --git a/packages/transforms/hoist-field/test/transform.spec.ts b/packages/transforms/hoist-field/test/transform.spec.ts index 0e1ceeb4796a6..068a59f2b316f 100644 --- a/packages/transforms/hoist-field/test/transform.spec.ts +++ b/packages/transforms/hoist-field/test/transform.spec.ts @@ -4,7 +4,7 @@ import { wrapSchema } from '@graphql-tools/wrap'; import { buildSchema, GraphQLField, GraphQLObjectType, printSchema } from 'graphql'; import { defaultImportFn, PubSub } from '@graphql-mesh/utils'; -import HoistFieldTransform from '../src'; +import HoistFieldTransform from '../src/index.js'; describe('hoist', () => { const importFn = defaultImportFn; diff --git a/packages/transforms/naming-convention/package.json b/packages/transforms/naming-convention/package.json index a52853da38e76..cc29b31bd3668 100644 --- a/packages/transforms/naming-convention/package.json +++ b/packages/transforms/naming-convention/package.json @@ -2,21 +2,28 @@ "name": "@graphql-mesh/transform-naming-convention", "version": "0.12.1", "sideEffects": false, - "main": "dist/index.js", - "module": "dist/index.mjs", - "typings": "dist/index.d.ts", + "main": "dist/cjs/index.js", + "module": "dist/esm/index.js", + "typings": "dist/typings/index.d.ts", "typescript": { - "definition": "dist/index.d.ts" + "definition": "dist/typings/index.d.ts" }, "exports": { ".": { - "require": "./dist/index.js", - "import": "./dist/index.mjs" + "require": { + "types": "./dist/typings/index.d.cts", + "default": "./dist/cjs/index.js" + }, + "import": { + "types": "./dist/typings/index.d.ts", + "default": "./dist/esm/index.js" + }, + "default": { + "types": "./dist/typings/index.d.ts", + "default": "./dist/esm/index.js" + } }, - "./*": { - "require": "./dist/*.js", - "import": "./dist/*.mjs" - } + "./package.json": "./package.json" }, "license": "MIT", "repository": { @@ -44,7 +51,8 @@ "upper-case": "2.0.2" }, "publishConfig": { - "access": "public", - "directory": "dist" - } + "directory": "dist", + "access": "public" + }, + "type": "module" } 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..542da9b6a1598 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, diff --git a/packages/transforms/naming-convention/test/wrapNamingConvention.spec.ts b/packages/transforms/naming-convention/test/wrapNamingConvention.spec.ts index c3fe95c6d8730..c97484c523c50 100644 --- a/packages/transforms/naming-convention/test/wrapNamingConvention.spec.ts +++ b/packages/transforms/naming-convention/test/wrapNamingConvention.spec.ts @@ -1,5 +1,13 @@ -import NamingConventionTransform from '../src/index'; -import { buildSchema, GraphQLObjectType, GraphQLEnumType, execute, parse, GraphQLUnionType } from 'graphql'; +import NamingConventionTransform from '../src/index.js'; +import { + buildSchema, + printSchema, + 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'; diff --git a/packages/transforms/prefix/package.json b/packages/transforms/prefix/package.json index f4d55f088f60a..a407238a5cfa3 100644 --- a/packages/transforms/prefix/package.json +++ b/packages/transforms/prefix/package.json @@ -2,21 +2,28 @@ "name": "@graphql-mesh/transform-prefix", "version": "0.11.101", "sideEffects": false, - "main": "dist/index.js", - "module": "dist/index.mjs", - "typings": "dist/index.d.ts", + "main": "dist/cjs/index.js", + "module": "dist/esm/index.js", + "typings": "dist/typings/index.d.ts", "typescript": { - "definition": "dist/index.d.ts" + "definition": "dist/typings/index.d.ts" }, "exports": { ".": { - "require": "./dist/index.js", - "import": "./dist/index.mjs" + "require": { + "types": "./dist/typings/index.d.cts", + "default": "./dist/cjs/index.js" + }, + "import": { + "types": "./dist/typings/index.d.ts", + "default": "./dist/esm/index.js" + }, + "default": { + "types": "./dist/typings/index.d.ts", + "default": "./dist/esm/index.js" + } }, - "./*": { - "require": "./dist/*.js", - "import": "./dist/*.mjs" - } + "./package.json": "./package.json" }, "license": "MIT", "repository": { @@ -36,8 +43,13 @@ "graphql-scalars": "1.20.1", "tslib": "^2.4.0" }, + "devDependencies": { + "@graphql-mesh/cache-localforage": "0.6.60", + "@graphql-tools/schema": "9.0.10" + }, "publishConfig": { - "access": "public", - "directory": "dist" - } + "directory": "dist", + "access": "public" + }, + "type": "module" } diff --git a/packages/transforms/prefix/src/barePrefix.ts b/packages/transforms/prefix/src/barePrefix.ts index 8674fc6f63df6..774ee00c556c2 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 6d16158f023a6..b43ac96d33df2 100644 --- a/packages/transforms/prefix/test/barePrefix.spec.ts +++ b/packages/transforms/prefix/test/barePrefix.spec.ts @@ -1,9 +1,8 @@ -import PrefixTransform from '../src'; -import { buildSchema, printSchema, GraphQLSchema, GraphQLObjectType, execute, parse } from 'graphql'; +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 { wrapSchema } from '@graphql-tools/wrap'; import { makeExecutableSchema } from '@graphql-tools/schema'; describe('barePrefix', () => { diff --git a/packages/transforms/prefix/test/wrapPrefix.spec.ts b/packages/transforms/prefix/test/wrapPrefix.spec.ts index 2395d64d58e4b..38221a712a160 100644 --- a/packages/transforms/prefix/test/wrapPrefix.spec.ts +++ b/packages/transforms/prefix/test/wrapPrefix.spec.ts @@ -1,5 +1,5 @@ -import PrefixTransform from '../src'; -import { buildSchema, printSchema, GraphQLSchema, GraphQLObjectType, execute, parse } from 'graphql'; +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'; diff --git a/packages/transforms/prune/package.json b/packages/transforms/prune/package.json index ac76e595f7df2..327ae87a2012a 100644 --- a/packages/transforms/prune/package.json +++ b/packages/transforms/prune/package.json @@ -2,21 +2,28 @@ "name": "@graphql-mesh/transform-prune", "version": "0.0.86", "sideEffects": false, - "main": "dist/index.js", - "module": "dist/index.mjs", - "typings": "dist/index.d.ts", + "main": "dist/cjs/index.js", + "module": "dist/esm/index.js", + "typings": "dist/typings/index.d.ts", "typescript": { - "definition": "dist/index.d.ts" + "definition": "dist/typings/index.d.ts" }, "exports": { ".": { - "require": "./dist/index.js", - "import": "./dist/index.mjs" + "require": { + "types": "./dist/typings/index.d.cts", + "default": "./dist/cjs/index.js" + }, + "import": { + "types": "./dist/typings/index.d.ts", + "default": "./dist/esm/index.js" + }, + "default": { + "types": "./dist/typings/index.d.ts", + "default": "./dist/esm/index.js" + } }, - "./*": { - "require": "./dist/*.js", - "import": "./dist/*.mjs" - } + "./package.json": "./package.json" }, "license": "MIT", "repository": { @@ -33,7 +40,8 @@ "tslib": "^2.4.0" }, "publishConfig": { - "access": "public", - "directory": "dist" - } + "directory": "dist", + "access": "public" + }, + "type": "module" } diff --git a/packages/transforms/rate-limit/package.json b/packages/transforms/rate-limit/package.json index 81634f6a31fdf..de21bf2d7ac9a 100644 --- a/packages/transforms/rate-limit/package.json +++ b/packages/transforms/rate-limit/package.json @@ -2,21 +2,28 @@ "name": "@graphql-mesh/transform-rate-limit", "version": "0.1.78", "sideEffects": false, - "main": "dist/index.js", - "module": "dist/index.mjs", - "typings": "dist/index.d.ts", + "main": "dist/cjs/index.js", + "module": "dist/esm/index.js", + "typings": "dist/typings/index.d.ts", "typescript": { - "definition": "dist/index.d.ts" + "definition": "dist/typings/index.d.ts" }, "exports": { ".": { - "require": "./dist/index.js", - "import": "./dist/index.mjs" + "require": { + "types": "./dist/typings/index.d.cts", + "default": "./dist/cjs/index.js" + }, + "import": { + "types": "./dist/typings/index.d.ts", + "default": "./dist/esm/index.js" + }, + "default": { + "types": "./dist/typings/index.d.ts", + "default": "./dist/esm/index.js" + } }, - "./*": { - "require": "./dist/*.js", - "import": "./dist/*.mjs" - } + "./package.json": "./package.json" }, "license": "MIT", "repository": { @@ -41,7 +48,8 @@ "@graphql-tools/wrap": "9.2.16" }, "publishConfig": { - "access": "public", - "directory": "dist" - } + "directory": "dist", + "access": "public" + }, + "type": "module" } diff --git a/packages/transforms/rate-limit/tests/rate-limit.spec.ts b/packages/transforms/rate-limit/tests/rate-limit.spec.ts index 928f7905115aa..cc89b840a2e73 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, 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 15553813cfab2..f0dc9cb3d9d3f 100644 --- a/packages/transforms/rename/package.json +++ b/packages/transforms/rename/package.json @@ -2,21 +2,28 @@ "name": "@graphql-mesh/transform-rename", "version": "0.12.102", "sideEffects": false, - "main": "dist/index.js", - "module": "dist/index.mjs", - "typings": "dist/index.d.ts", + "main": "dist/cjs/index.js", + "module": "dist/esm/index.js", + "typings": "dist/typings/index.d.ts", "typescript": { - "definition": "dist/index.d.ts" + "definition": "dist/typings/index.d.ts" }, "exports": { ".": { - "require": "./dist/index.js", - "import": "./dist/index.mjs" + "require": { + "types": "./dist/typings/index.d.cts", + "default": "./dist/cjs/index.js" + }, + "import": { + "types": "./dist/typings/index.d.ts", + "default": "./dist/esm/index.js" + }, + "default": { + "types": "./dist/typings/index.d.ts", + "default": "./dist/esm/index.js" + } }, - "./*": { - "require": "./dist/*.js", - "import": "./dist/*.mjs" - } + "./package.json": "./package.json" }, "license": "MIT", "repository": { @@ -41,7 +48,8 @@ "tslib": "^2.4.0" }, "publishConfig": { - "access": "public", - "directory": "dist" - } + "directory": "dist", + "access": "public" + }, + "type": "module" } diff --git a/packages/transforms/rename/src/bareRename.ts b/packages/transforms/rename/src/bareRename.ts index bc52a9c6a3bd6..5dea6b5a21462 100644 --- a/packages/transforms/rename/src/bareRename.ts +++ b/packages/transforms/rename/src/bareRename.ts @@ -1,7 +1,7 @@ import { GraphQLSchema, defaultFieldResolver, GraphQLFieldConfig } 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 0699744939bc4..ffc9883838349 100644 --- a/packages/transforms/rename/test/bareRename.spec.ts +++ b/packages/transforms/rename/test/bareRename.spec.ts @@ -1,9 +1,6 @@ -import RenameTransform from './../src/index'; +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({ @@ -33,15 +30,6 @@ describe('rename', () => { Query: { my_user: () => ({ id: 'userId' }), profile: (_, args) => ({ id: `profile_${args.profile_id}` }) }, }, }); - 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({ @@ -58,11 +46,6 @@ describe('rename', () => { }, ], }, - apiName: '', - cache, - pubsub, - baseDir, - importFn, }); const newSchema = transform.transformSchema(schema, {} as any); @@ -88,11 +71,6 @@ describe('rename', () => { }, ], }, - apiName: '', - cache, - pubsub, - baseDir, - importFn, }); const newSchema = transform.transformSchema(schema, {} as any); @@ -120,11 +98,6 @@ describe('rename', () => { }, ], }, - apiName: '', - cache, - pubsub, - baseDir, - importFn, }); const transformedSchema = transform.transformSchema(schema, {} as any); @@ -158,11 +131,6 @@ describe('rename', () => { }, ], }, - apiName: '', - cache, - pubsub, - baseDir, - importFn, }); const newSchema = transform.transformSchema(schema, {} as any); @@ -189,11 +157,6 @@ describe('rename', () => { }, ], }, - apiName: '', - cache, - pubsub, - baseDir, - importFn, }); const newSchema = transform.transformSchema(schema, {} as any); @@ -229,11 +192,6 @@ describe('rename', () => { }, ], }, - apiName: '', - cache, - pubsub, - baseDir, - importFn, }); const newSchema = transform.transformSchema(schema, {} as any); @@ -264,11 +222,6 @@ describe('rename', () => { }, ], }, - apiName: '', - cache, - pubsub, - baseDir, - importFn, }); const newSchema = transform.transformSchema(schema, {} as any); @@ -306,11 +259,6 @@ describe('rename', () => { }, ], }, - apiName: '', - cache, - pubsub, - baseDir, - importFn, }); const newSchema = transform.transformSchema(schema, {} as any); @@ -345,11 +293,6 @@ describe('rename', () => { }, ], }, - apiName: '', - cache, - pubsub, - baseDir, - importFn, }); const newSchema = transform.transformSchema(schema, {} as any); @@ -386,11 +329,6 @@ describe('rename', () => { }, ], }, - apiName: '', - cache, - pubsub, - baseDir, - importFn, }); const newSchema = transform.transformSchema(schema, {} as any); @@ -430,11 +368,6 @@ describe('rename', () => { }, ], }, - apiName: '', - cache, - pubsub, - baseDir, - importFn, }); const newSchema = transform.transformSchema(schema, {} as any); @@ -463,11 +396,6 @@ describe('rename', () => { }, ], }, - apiName: '', - cache, - pubsub, - baseDir, - importFn, }); const newSchema = transform.transformSchema(schema, {} as any); @@ -507,11 +435,6 @@ describe('rename', () => { }, ], }, - apiName: '', - cache, - pubsub, - baseDir, - importFn, }); const newSchema = transform.transformSchema(schema, {} as any); @@ -542,11 +465,6 @@ describe('rename', () => { }, ], }, - apiName: '', - cache, - pubsub, - baseDir, - importFn, }); const transformedSchema = transform.transformSchema(schema, {} as any); @@ -579,11 +497,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 78ec0a79f704b..e0c2f1da6b893 100644 --- a/packages/transforms/rename/test/wrapRename.spec.ts +++ b/packages/transforms/rename/test/wrapRename.spec.ts @@ -1,9 +1,6 @@ -import RenameTransform from './../src/index'; +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', () => { @@ -34,22 +31,12 @@ describe('rename', () => { Query: { my_user: () => ({ id: 'userId' }), profile: (_, args) => ({ id: `profile_${args.profile_id}` }) }, }, }); - 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: [ { @@ -62,9 +49,6 @@ describe('rename', () => { }, ], }, - cache, - pubsub, - baseDir, }), ], }); @@ -79,8 +63,6 @@ describe('rename', () => { schema, transforms: [ new RenameTransform({ - apiName: '', - importFn: m => import(m), config: { mode: 'wrap', renames: [ @@ -96,9 +78,6 @@ describe('rename', () => { }, ], }, - cache, - pubsub, - baseDir, }), ], }); @@ -131,11 +110,6 @@ describe('rename', () => { }, ], }, - apiName: '', - cache, - pubsub, - baseDir, - importFn: m => import(m), }), ], }); @@ -159,8 +133,6 @@ describe('rename', () => { schema, transforms: [ new RenameTransform({ - apiName: '', - importFn: m => import(m), config: { mode: 'wrap', renames: [ @@ -175,9 +147,6 @@ describe('rename', () => { }, ], }, - cache, - pubsub, - baseDir, }), ], }); @@ -194,8 +163,6 @@ describe('rename', () => { schema, transforms: [ new RenameTransform({ - apiName: '', - importFn: m => import(m), config: { mode: 'wrap', renames: [ @@ -210,9 +177,6 @@ describe('rename', () => { }, ], }, - cache, - pubsub, - baseDir, }), ], }); @@ -236,8 +200,6 @@ describe('rename', () => { schema, transforms: [ new RenameTransform({ - apiName: '', - importFn: m => import(m), config: { renames: [ { @@ -253,9 +215,6 @@ describe('rename', () => { }, ], }, - cache, - pubsub, - baseDir, }), ], }); @@ -275,8 +234,6 @@ describe('rename', () => { schema, transforms: [ new RenameTransform({ - apiName: '', - importFn: m => import(m), config: { mode: 'wrap', renames: [ @@ -293,9 +250,6 @@ describe('rename', () => { }, ], }, - cache, - pubsub, - baseDir, }), ], }); @@ -323,8 +277,6 @@ describe('rename', () => { schema, transforms: [ new RenameTransform({ - apiName: '', - importFn: m => import(m), config: { renames: [ { @@ -339,9 +291,6 @@ describe('rename', () => { }, ], }, - cache, - pubsub, - baseDir, }), ], }); @@ -366,8 +315,6 @@ describe('rename', () => { schema, transforms: [ new RenameTransform({ - apiName: '', - importFn: m => import(m), config: { renames: [ { @@ -382,9 +329,6 @@ describe('rename', () => { }, ], }, - cache, - pubsub, - baseDir, }), ], }); @@ -409,8 +353,6 @@ describe('rename', () => { schema, transforms: [ new RenameTransform({ - apiName: '', - importFn: m => import(m), config: { renames: [ { @@ -427,9 +369,6 @@ describe('rename', () => { }, ], }, - cache, - pubsub, - baseDir, }), ], }); @@ -457,8 +396,6 @@ describe('rename', () => { schema, transforms: [ new RenameTransform({ - apiName: '', - importFn: m => import(m), config: { renames: [ { @@ -475,9 +412,6 @@ describe('rename', () => { }, ], }, - cache, - pubsub, - baseDir, }), ], }); @@ -495,8 +429,6 @@ describe('rename', () => { schema, transforms: [ new RenameTransform({ - apiName: '', - importFn: m => import(m), config: { mode: 'wrap', renames: [ @@ -513,9 +445,6 @@ describe('rename', () => { }, ], }, - cache, - pubsub, - baseDir, }), ], }); @@ -544,8 +473,6 @@ describe('rename', () => { schema, transforms: [ new RenameTransform({ - apiName: '', - importFn: m => import(m), config: { mode: 'wrap', renames: [ @@ -563,9 +490,6 @@ describe('rename', () => { }, ], }, - cache, - pubsub, - baseDir, }), ], }); @@ -589,8 +513,6 @@ describe('rename', () => { schema, transforms: [ new RenameTransform({ - apiName: '', - importFn: m => import(m), config: { mode: 'wrap', renames: [ @@ -609,9 +531,6 @@ describe('rename', () => { }, ], }, - cache, - pubsub, - baseDir, }), ], }); @@ -635,8 +554,6 @@ describe('rename', () => { schema, transforms: [ new RenameTransform({ - apiName: '', - importFn: m => import(m), config: { mode: 'wrap', renames: [ @@ -656,9 +573,6 @@ describe('rename', () => { }, ], }, - cache, - pubsub, - baseDir, }), ], }); @@ -699,11 +613,6 @@ describe('rename', () => { }, ], }, - apiName: '', - cache, - pubsub, - baseDir, - importFn: m => import(m), }), ], }); @@ -727,8 +636,6 @@ describe('rename', () => { schema, transforms: [ new RenameTransform({ - apiName: '', - importFn: m => import(m), config: { mode: 'wrap', renames: [ @@ -742,9 +649,6 @@ describe('rename', () => { }, ], }, - cache, - pubsub, - baseDir, }), ], }); @@ -772,8 +676,6 @@ describe('rename', () => { `); const transform = new RenameTransform({ - apiName: '', - importFn: m => import(m), config: { mode: 'bare', renames: [ @@ -789,9 +691,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 18b5f5ee4830f..3b1214263126c 100644 --- a/packages/transforms/replace-field/package.json +++ b/packages/transforms/replace-field/package.json @@ -2,21 +2,28 @@ "name": "@graphql-mesh/transform-replace-field", "version": "0.3.109", "sideEffects": false, - "main": "dist/index.js", - "module": "dist/index.mjs", - "typings": "dist/index.d.ts", + "main": "dist/cjs/index.js", + "module": "dist/esm/index.js", + "typings": "dist/typings/index.d.ts", "typescript": { - "definition": "dist/index.d.ts" + "definition": "dist/typings/index.d.ts" }, "exports": { ".": { - "require": "./dist/index.js", - "import": "./dist/index.mjs" + "require": { + "types": "./dist/typings/index.d.cts", + "default": "./dist/cjs/index.js" + }, + "import": { + "types": "./dist/typings/index.d.ts", + "default": "./dist/esm/index.js" + }, + "default": { + "types": "./dist/typings/index.d.ts", + "default": "./dist/esm/index.js" + } }, - "./*": { - "require": "./dist/*.js", - "import": "./dist/*.mjs" - } + "./package.json": "./package.json" }, "license": "MIT", "repository": { @@ -37,11 +44,12 @@ "tslib": "^2.4.0" }, "publishConfig": { - "access": "public", - "directory": "dist" + "directory": "dist", + "access": "public" }, "devDependencies": { "@graphql-mesh/cache-localforage": "0.6.61", "@graphql-tools/schema": "9.0.10" - } + }, + "type": "module" } diff --git a/packages/transforms/replace-field/test/replace-field.spec.ts b/packages/transforms/replace-field/test/replace-field.spec.ts index b985086c0d4b5..f8762c53b3427 100644 --- a/packages/transforms/replace-field/test/replace-field.spec.ts +++ b/packages/transforms/replace-field/test/replace-field.spec.ts @@ -5,7 +5,7 @@ import { ImportFn, MeshPubSub } from '@graphql-mesh/types'; import { makeExecutableSchema } from '@graphql-tools/schema'; import { 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 => diff --git a/packages/transforms/resolvers-composition/package.json b/packages/transforms/resolvers-composition/package.json index 2dd7f4a278cdf..1ed35c4da818f 100644 --- a/packages/transforms/resolvers-composition/package.json +++ b/packages/transforms/resolvers-composition/package.json @@ -2,21 +2,28 @@ "name": "@graphql-mesh/transform-resolvers-composition", "version": "0.12.109", "sideEffects": false, - "main": "dist/index.js", - "module": "dist/index.mjs", - "typings": "dist/index.d.ts", + "main": "dist/cjs/index.js", + "module": "dist/esm/index.js", + "typings": "dist/typings/index.d.ts", "typescript": { - "definition": "dist/index.d.ts" + "definition": "dist/typings/index.d.ts" }, "exports": { ".": { - "require": "./dist/index.js", - "import": "./dist/index.mjs" + "require": { + "types": "./dist/typings/index.d.cts", + "default": "./dist/cjs/index.js" + }, + "import": { + "types": "./dist/typings/index.d.ts", + "default": "./dist/esm/index.js" + }, + "default": { + "types": "./dist/typings/index.d.ts", + "default": "./dist/esm/index.js" + } }, - "./*": { - "require": "./dist/*.js", - "import": "./dist/*.mjs" - } + "./package.json": "./package.json" }, "license": "MIT", "repository": { @@ -35,7 +42,8 @@ "tslib": "^2.4.0" }, "publishConfig": { - "access": "public", - "directory": "dist" - } + "directory": "dist", + "access": "public" + }, + "type": "module" } diff --git a/packages/transforms/resolvers-composition/test/transform.spec.ts b/packages/transforms/resolvers-composition/test/transform.spec.ts index 4e124dd73fe24..bea8b9ca09b0b 100644 --- a/packages/transforms/resolvers-composition/test/transform.spec.ts +++ b/packages/transforms/resolvers-composition/test/transform.spec.ts @@ -2,7 +2,7 @@ import InMemoryLRUCache from '@graphql-mesh/cache-localforage'; import { makeExecutableSchema } from '@graphql-tools/schema'; import { 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', () => { diff --git a/packages/transforms/type-merging/package.json b/packages/transforms/type-merging/package.json index c8e3183a1d4f1..064f607921a9c 100644 --- a/packages/transforms/type-merging/package.json +++ b/packages/transforms/type-merging/package.json @@ -2,21 +2,28 @@ "name": "@graphql-mesh/transform-type-merging", "version": "0.4.54", "sideEffects": false, - "main": "dist/index.js", - "module": "dist/index.mjs", - "typings": "dist/index.d.ts", + "main": "dist/cjs/index.js", + "module": "dist/esm/index.js", + "typings": "dist/typings/index.d.ts", "typescript": { - "definition": "dist/index.d.ts" + "definition": "dist/typings/index.d.ts" }, "exports": { ".": { - "require": "./dist/index.js", - "import": "./dist/index.mjs" + "require": { + "types": "./dist/typings/index.d.cts", + "default": "./dist/cjs/index.js" + }, + "import": { + "types": "./dist/typings/index.d.ts", + "default": "./dist/esm/index.js" + }, + "default": { + "types": "./dist/typings/index.d.ts", + "default": "./dist/esm/index.js" + } }, - "./*": { - "require": "./dist/*.js", - "import": "./dist/*.mjs" - } + "./package.json": "./package.json" }, "license": "MIT", "repository": { @@ -35,7 +42,8 @@ "tslib": "^2.4.0" }, "publishConfig": { - "access": "public", - "directory": "dist" - } + "directory": "dist", + "access": "public" + }, + "type": "module" } diff --git a/packages/types/package.json b/packages/types/package.json index cbffbdc15770b..ecf6465cc7499 100644 --- a/packages/types/package.json +++ b/packages/types/package.json @@ -2,21 +2,28 @@ "name": "@graphql-mesh/types", "version": "0.86.0", "sideEffects": false, - "main": "dist/index.js", - "module": "dist/index.mjs", - "typings": "dist/index.d.ts", + "main": "dist/cjs/index.js", + "module": "dist/esm/index.js", + "typings": "dist/typings/index.d.ts", "typescript": { - "definition": "dist/index.d.ts" + "definition": "dist/typings/index.d.ts" }, "exports": { ".": { - "require": "./dist/index.js", - "import": "./dist/index.mjs" + "require": { + "types": "./dist/typings/index.d.cts", + "default": "./dist/cjs/index.js" + }, + "import": { + "types": "./dist/typings/index.d.ts", + "default": "./dist/esm/index.js" + }, + "default": { + "types": "./dist/typings/index.d.ts", + "default": "./dist/esm/index.js" + } }, - "./*": { - "require": "./dist/*.js", - "import": "./dist/*.mjs" - } + "./package.json": "./package.json" }, "license": "MIT", "repository": { @@ -36,7 +43,8 @@ "tslib": "^2.4.0" }, "publishConfig": { - "access": "public", - "directory": "dist" - } + "directory": "dist", + "access": "public" + }, + "type": "module" } diff --git a/packages/types/src/index.ts b/packages/types/src/index.ts index 53b4462f79451..e8bbea4cf97d4 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..54061d02879da 100644 --- a/packages/urql/package.json +++ b/packages/urql/package.json @@ -8,21 +8,28 @@ "directory": "packages/urql" }, "sideEffects": false, - "main": "dist/index.js", - "module": "dist/index.mjs", - "typings": "dist/index.d.ts", + "main": "dist/cjs/index.js", + "module": "dist/esm/index.js", + "typings": "dist/typings/index.d.ts", "typescript": { - "definition": "dist/index.d.ts" + "definition": "dist/typings/index.d.ts" }, "exports": { ".": { - "require": "./dist/index.js", - "import": "./dist/index.mjs" + "require": { + "types": "./dist/typings/index.d.cts", + "default": "./dist/cjs/index.js" + }, + "import": { + "types": "./dist/typings/index.d.ts", + "default": "./dist/esm/index.js" + }, + "default": { + "types": "./dist/typings/index.d.ts", + "default": "./dist/esm/index.js" + } }, - "./*": { - "require": "./dist/*.js", - "import": "./dist/*.mjs" - } + "./package.json": "./package.json" }, "dependencies": { "@graphql-tools/utils": "9.1.1", @@ -39,7 +46,8 @@ "wonka": "^4.0.15" }, "publishConfig": { - "access": "public", - "directory": "dist" - } + "directory": "dist", + "access": "public" + }, + "type": "module" } 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 569dde42fe5f5..c4baf38cd11db 100644 --- a/packages/utils/package.json +++ b/packages/utils/package.json @@ -17,21 +17,28 @@ "@types/js-yaml": "4.0.5" }, "sideEffects": false, - "main": "dist/index.js", - "module": "dist/index.mjs", - "typings": "dist/index.d.ts", + "main": "dist/cjs/index.js", + "module": "dist/esm/index.js", + "typings": "dist/typings/index.d.ts", "typescript": { - "definition": "dist/index.d.ts" + "definition": "dist/typings/index.d.ts" }, "exports": { ".": { - "require": "./dist/index.js", - "import": "./dist/index.mjs" + "require": { + "types": "./dist/typings/index.d.cts", + "default": "./dist/cjs/index.js" + }, + "import": { + "types": "./dist/typings/index.d.ts", + "default": "./dist/esm/index.js" + }, + "default": { + "types": "./dist/typings/index.d.ts", + "default": "./dist/esm/index.js" + } }, - "./*": { - "require": "./dist/*.js", - "import": "./dist/*.mjs" - } + "./package.json": "./package.json" }, "dependencies": { "@graphql-mesh/string-interpolation": "0.3.3", @@ -47,7 +54,8 @@ "tslib": "^2.4.0" }, "publishConfig": { - "access": "public", - "directory": "dist" - } + "directory": "dist", + "access": "public" + }, + "type": "module" } 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/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/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/customize-mesh-server.mdx b/website/src/pages/docs/getting-started/customize-mesh-server.mdx index c34d5c62c9dfd..f3c8d121ac5de 100644 --- a/website/src/pages/docs/getting-started/customize-mesh-server.mdx +++ b/website/src/pages/docs/getting-started/customize-mesh-server.mdx @@ -47,7 +47,6 @@ Aided by the capabilities of [Envelop](https://envelop.dev), you can easily add For full list of available plugins, please refer to the [plugins section](/docs/plugins/plugins-introduction). - ## Provide a standalone server implementation > **Disclaimer:** This section explains how to provide a custom server implementation used by `mesh serve` and `mesh dev`. If you are looking for solutions to **deploy Mesh to Serverless environments** or **not rely on `mesh serve`**, please refer to the ["How to: Deploy a Mesh Gateway"](/docs/getting-started/deploy-mesh-gateway) guide. 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 3a3a5f7c57954..1d1a3671877f9 100644 --- a/website/src/pages/docs/getting-started/deploy-mesh-gateway.mdx +++ b/website/src/pages/docs/getting-started/deploy-mesh-gateway.mdx @@ -79,7 +79,7 @@ const app = createBuiltMeshHTTPHandler() export const handler: Handler = configure({ // Pass Mesh HTTP handler as app - app, + app }) ``` @@ -97,10 +97,11 @@ 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) -Also you can see how to setup *KV* as a cache storage in GraphQL Mesh [here](/docs/cache/cfwkv). +Also you can see how to setup _KV_ as a cache storage in GraphQL Mesh [here](/docs/cache/cfwkv). ### Deploy Mesh on Apache OpenWhisk @@ -138,7 +139,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) @@ -149,7 +150,7 @@ app.route({ reply.send(response.body) return reply - }, + } }) ``` @@ -175,7 +176,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) @@ -201,10 +202,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 be1e2a5ffd0d7..16d1d91a403fd 100644 --- a/website/src/pages/docs/handlers/json-schema.mdx +++ b/website/src/pages/docs/handlers/json-schema.mdx @@ -215,8 +215,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 e12886b6740bd..eec0cbeebd1bd 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 @@ -146,8 +143,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 bb4422a2281d4..3288441da8098 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2920,6 +2920,67 @@ object-inspect "1.10.3" tslib "^2.0.0" +"@graphql-mesh/cache-localforage@0.6.60": + version "0.6.60" + resolved "https://registry.yarnpkg.com/@graphql-mesh/cache-localforage/-/cache-localforage-0.6.60.tgz#dd351a5f968e6b41b2859fc1b1f5f04612dd7ec9" + integrity sha512-okbmbNiNdZk+cYLM0COLMhIpjNZKBcZamZ4a1pMbghwPRWZvIJ+p7tJLurjwB7seyYkuxz/RE7E0YIUfMXvTyA== + dependencies: + "@graphql-mesh/types" "0.85.7" + "@graphql-mesh/utils" "0.42.6" + localforage "1.10.0" + tslib "^2.4.0" + +"@graphql-mesh/cross-helpers@0.2.9": + version "0.2.9" + resolved "https://registry.yarnpkg.com/@graphql-mesh/cross-helpers/-/cross-helpers-0.2.9.tgz#38520d9fcf8a2d9b2e4430555279b4815505a21e" + integrity sha512-yLULnq6crWQebELbdTHPprbue6+NAWdv41omcUx/mKiBaTVpfU2VAVkHeJqEXE3If/5ex0sD3rnPs4ZDvSlG+A== + dependencies: + "@graphql-tools/utils" "9.0.1" + path-browserify "1.0.1" + react-native-fs "2.20.0" + react-native-path "0.0.5" + +"@graphql-mesh/store@0.8.62": + version "0.8.62" + resolved "https://registry.yarnpkg.com/@graphql-mesh/store/-/store-0.8.62.tgz#0a156556864e0a47824b4cc937445cc01180d32d" + integrity sha512-Ydj+Z+pqAhSiVAvpwPRKDLrGEOrHtaL5XKTnT49C+gUSz4MSycQNAKGR+FbZ9ImMJwkDWJ+xntVR1mjXgTvHSg== + dependencies: + "@graphql-inspector/core" "3.3.0" + "@graphql-mesh/cross-helpers" "0.2.9" + "@graphql-mesh/types" "0.85.7" + "@graphql-mesh/utils" "0.42.6" + "@graphql-tools/utils" "9.0.1" + tslib "^2.4.0" + +"@graphql-mesh/types@0.85.7": + version "0.85.7" + resolved "https://registry.yarnpkg.com/@graphql-mesh/types/-/types-0.85.7.tgz#82d08f5e0cf586002eed5b039ac9b25e53f063d6" + integrity sha512-4hoeTlocVHacyWMZO/zeDmlfcbkmC8DSRCqNaX8H5HX8+gJ7cTRa51Lw+6U4FNzcCVDQbjjyV5fR8WYgHlZe7A== + dependencies: + "@graphql-mesh/store" "0.8.62" + "@graphql-tools/batch-delegate" "8.4.7" + "@graphql-tools/delegate" "9.0.14" + "@graphql-tools/utils" "9.0.1" + "@graphql-typed-document-node/core" "3.1.1" + tslib "^2.4.0" + +"@graphql-mesh/utils@0.42.6": + version "0.42.6" + resolved "https://registry.yarnpkg.com/@graphql-mesh/utils/-/utils-0.42.6.tgz#0588125bbee59d025da44704991ae6175f094669" + integrity sha512-/JH5QYnJ6NLWzBSZPrFYMSeFvf9+ZN7wQ4XLIMNV19iWzFFkDFaQJWzsvlVRC6bFlGBJ/ZPZLMzBFCUEFyxAuw== + dependencies: + "@graphql-mesh/cross-helpers" "0.2.9" + "@graphql-mesh/string-interpolation" "0.3.3" + "@graphql-mesh/types" "0.85.7" + "@graphql-tools/delegate" "9.0.14" + "@graphql-tools/utils" "9.0.1" + js-yaml "4.1.0" + lodash.get "4.4.2" + lodash.set "4.3.2" + lodash.topath "4.5.2" + tiny-lru "8.0.2" + tslib "^2.4.0" + "@graphql-tools/batch-delegate@8.4.10": version "8.4.10" resolved "https://registry.yarnpkg.com/@graphql-tools/batch-delegate/-/batch-delegate-8.4.10.tgz#efbc1222d72a26cf6eb3d24e5aafb88beb12c0b0" @@ -2930,6 +2991,26 @@ dataloader "2.1.0" tslib "^2.4.0" +"@graphql-tools/batch-delegate@8.4.7": + version "8.4.7" + resolved "https://registry.yarnpkg.com/@graphql-tools/batch-delegate/-/batch-delegate-8.4.7.tgz#5d7be1b43a4691fab5ded072f20eacf1fe81ed3b" + integrity sha512-FB/HMPihd3AdImAPBJARzGkkC+ha/5AGz3FsXSHtsIzDR89aqCzvom0eYzpQ30D3NP1P4qqbv7O5T6x/wFg/Kg== + dependencies: + "@graphql-tools/delegate" "9.0.14" + "@graphql-tools/utils" "9.0.1" + dataloader "2.1.0" + tslib "^2.4.0" + +"@graphql-tools/batch-execute@8.5.10": + version "8.5.10" + resolved "https://registry.yarnpkg.com/@graphql-tools/batch-execute/-/batch-execute-8.5.10.tgz#ec0a300ec0646aba3d52a5b4ad378da7531703de" + integrity sha512-f3b/UPvscQ4NaSmSQIeZPNFhpZ9xb3AftKKSn9NzsUp3vxz0d8tymBVn28f51oqiqN9BMDpCH9P8TZrKpH1//Q== + dependencies: + "@graphql-tools/utils" "9.0.1" + dataloader "2.1.0" + tslib "^2.4.0" + value-or-promise "1.0.11" + "@graphql-tools/batch-execute@8.5.12": version "8.5.12" resolved "https://registry.yarnpkg.com/@graphql-tools/batch-execute/-/batch-execute-8.5.12.tgz#3059646b87e4ea3a196a6c8cbc3faf9b7c410d52" @@ -2962,6 +3043,19 @@ is-promise "4.0.0" tslib "~2.0.1" +"@graphql-tools/delegate@9.0.14": + version "9.0.14" + resolved "https://registry.yarnpkg.com/@graphql-tools/delegate/-/delegate-9.0.14.tgz#0636668c0d76c8aa0bdb419796669465273ad8fb" + integrity sha512-yKwNQl10fOdKxSk5yBoKnSjq1oumf4QYVinV9niD9KVow6j0dONtaiAYvhzaQwN/Xwwi7oADFACmKRtphlhFTw== + dependencies: + "@graphql-tools/batch-execute" "8.5.10" + "@graphql-tools/executor" "0.0.6" + "@graphql-tools/schema" "9.0.8" + "@graphql-tools/utils" "9.0.1" + dataloader "2.1.0" + tslib "~2.4.0" + value-or-promise "1.0.11" + "@graphql-tools/delegate@9.0.17": version "9.0.17" resolved "https://registry.yarnpkg.com/@graphql-tools/delegate/-/delegate-9.0.17.tgz#8f509a046cee7b37c0cae33a526e4aea903539ab" @@ -3013,6 +3107,17 @@ tslib "^2.4.0" ws "8.11.0" +"@graphql-tools/executor@0.0.6": + version "0.0.6" + resolved "https://registry.yarnpkg.com/@graphql-tools/executor/-/executor-0.0.6.tgz#e980e3b148b3093091648113bfd14efac5d90c8f" + integrity sha512-2KIj1grRb1Lni97xgX1ryekcjU/WTMC1ZdPpnd0nYrBWs/C4Nv4UMNP7E/Tr8za8zlrsESvEUbpLHsBRiQsGxA== + dependencies: + "@graphql-tools/utils" "9.0.1" + "@graphql-typed-document-node/core" "3.1.1" + "@repeaterjs/repeater" "3.0.4" + tslib "^2.4.0" + value-or-promise "1.0.11" + "@graphql-tools/executor@0.0.9": version "0.0.9" resolved "https://registry.yarnpkg.com/@graphql-tools/executor/-/executor-0.0.9.tgz#f55f8cbe12d7989b0ff58cca9a041fbdde3dbd40" @@ -3124,6 +3229,14 @@ "@graphql-tools/utils" "8.9.0" tslib "^2.4.0" +"@graphql-tools/merge@8.3.10": + version "8.3.10" + resolved "https://registry.yarnpkg.com/@graphql-tools/merge/-/merge-8.3.10.tgz#81f374bc1e8c81d45cb1003d8ed05f181b7e6bd5" + integrity sha512-/hSg69JwqEA+t01wQmMGKPuaJ9VJBSz6uAXhbNNrTBJu8bmXljw305NVXM49pCwDKFVUGtbTqYrBeLcfT3RoYw== + dependencies: + "@graphql-tools/utils" "9.0.1" + tslib "^2.4.0" + "@graphql-tools/merge@8.3.12", "@graphql-tools/merge@^8.3.3": version "8.3.12" resolved "https://registry.yarnpkg.com/@graphql-tools/merge/-/merge-8.3.12.tgz#e3f2e5d8a7b34fb689cda66799d845cbc919e464" @@ -3186,6 +3299,16 @@ tslib "^2.4.0" value-or-promise "1.0.11" +"@graphql-tools/schema@9.0.8": + version "9.0.8" + resolved "https://registry.yarnpkg.com/@graphql-tools/schema/-/schema-9.0.8.tgz#df3119c8543e6dacf425998f83aa714e2ee86eb0" + integrity sha512-PnES7sNkhQ/FdPQhP7cup0OIzwzQh+nfjklilU7YJzE209ACIyEQtxoNCfvPW5eV6hc9bWsBQeI3Jm4mMtwxNA== + dependencies: + "@graphql-tools/merge" "8.3.10" + "@graphql-tools/utils" "9.0.1" + tslib "^2.4.0" + value-or-promise "1.0.11" + "@graphql-tools/schema@^8.0.0": version "8.5.1" resolved "https://registry.yarnpkg.com/@graphql-tools/schema/-/schema-8.5.1.tgz#c2f2ff1448380919a330312399c9471db2580b58" @@ -3275,6 +3398,13 @@ dependencies: tslib "^2.4.0" +"@graphql-tools/utils@9.0.1": + version "9.0.1" + resolved "https://registry.yarnpkg.com/@graphql-tools/utils/-/utils-9.0.1.tgz#04933b34c3435ef9add4f8bdfdf452040376f9d0" + integrity sha512-z6FimVa5E44bHKmqK0/uMp9hHvHo2Tkt9A5rlLb40ReD/8IFKehSXLzM4b2N1vcP7mSsbXIdDK9Aoc8jT/he1Q== + dependencies: + tslib "^2.4.0" + "@graphql-tools/utils@9.1.1", "@graphql-tools/utils@^9.0.1", "@graphql-tools/utils@^9.1.1": version "9.1.1" resolved "https://registry.yarnpkg.com/@graphql-tools/utils/-/utils-9.1.1.tgz#b47ea8f0d18c038c5c1c429e72caa5c25039fbab" @@ -4721,24 +4851,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" @@ -4751,6 +4870,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" @@ -4759,7 +4890,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== @@ -4768,6 +4899,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" @@ -5331,6 +5470,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" @@ -5629,13 +5775,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" @@ -5955,10 +6094,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" @@ -7077,32 +7216,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.19.0: version "1.20.1" @@ -7253,12 +7393,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" @@ -7949,10 +8087,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" @@ -8045,17 +8183,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@7.1.0, cosmiconfig@^7.0.0: version "7.1.0" resolved "https://registry.yarnpkg.com/cosmiconfig/-/cosmiconfig-7.1.0.tgz#1443b9afa596b670082ea46cbd8f6a62b84635f6" @@ -8067,6 +8194,17 @@ cosmiconfig@7.1.0, cosmiconfig@^7.0.0: path-type "^4.0.0" yaml "^1.10.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" + create-require@^1.1.0: version "1.1.1" resolved "https://registry.yarnpkg.com/create-require/-/create-require-1.1.1.tgz#c1d7e8f1e5f6cfc9ff65f9cd352d37348756c333" @@ -8091,15 +8229,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" @@ -10254,6 +10383,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" @@ -10644,6 +10778,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" @@ -10819,25 +10962,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" @@ -10848,6 +10972,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" @@ -10857,6 +10990,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" @@ -10886,11 +11028,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" @@ -11127,18 +11264,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" @@ -11945,7 +12070,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== @@ -12042,6 +12167,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" @@ -14973,7 +15105,7 @@ minimatch@3.0.4: dependencies: brace-expansion "^1.1.7" -minimatch@5.1.0, minimatch@^5.0.1: +minimatch@5.1.0, minimatch@^5.0.1, minimatch@^5.1.0: version "5.1.0" resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-5.1.0.tgz#1717b464f4971b144f6aabe8f2d0b8e4511e09c7" integrity sha512-9TPBGGak4nHfGZsPBohm9AWg6NoT7QTCehS3BIJABslyZbzxfV78QM2Y6+i741OPZIafFAaiiEMh5OyIrJPgtg== @@ -15899,13 +16031,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" @@ -15927,6 +16052,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" @@ -17883,13 +18015,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" @@ -17973,7 +18098,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== @@ -18007,16 +18132,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" @@ -18025,14 +18150,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== @@ -19637,11 +19755,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" @@ -19652,6 +19765,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" @@ -21103,7 +21221,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== @@ -21191,6 +21309,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"