From f0617b08c7739e48d2d1f4696d8bb5573f2ab2cd Mon Sep 17 00:00:00 2001 From: gilgardosh Date: Tue, 6 Dec 2022 11:38:38 +0200 Subject: [PATCH] fixes --- packages/cli/package.json | 7 +++-- packages/handlers/neo4j/package.json | 6 ++-- packages/handlers/raml/package.json | 8 +++--- .../tests/additionalProperties.test.ts | 2 +- .../openapi/tests/query-arguments.test.ts | 4 +-- packages/plugins/hive/package.json | 28 ++++++++++++------- packages/transforms/hive/package.json | 28 ++++++++++++------- .../test/sanitize-name-for-graphql.test.ts | 2 +- 8 files changed, 51 insertions(+), 34 deletions(-) diff --git a/packages/cli/package.json b/packages/cli/package.json index e0383a57fc543..65a8ea9628084 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -1,6 +1,7 @@ { "name": "@graphql-mesh/cli", "version": "0.80.4", + "type": "module", "repository": { "type": "git", "url": "Urigo/graphql-mesh", @@ -29,7 +30,8 @@ "types": "./dist/typings/index.d.ts", "default": "./dist/esm/index.js" } - } + }, + "./package.json": "./package.json" }, "typings": "dist/typings/index.d.ts", "peerDependencies": { @@ -92,6 +94,5 @@ }, "typescript": { "definition": "dist/typings/index.d.ts" - }, - "type": "module" + } } diff --git a/packages/handlers/neo4j/package.json b/packages/handlers/neo4j/package.json index 94fe9849be519..38966756e2b0d 100644 --- a/packages/handlers/neo4j/package.json +++ b/packages/handlers/neo4j/package.json @@ -1,6 +1,7 @@ { "name": "@graphql-mesh/neo4j", "version": "0.20.40", + "type": "module", "repository": { "type": "git", "url": "Urigo/graphql-mesh", @@ -26,7 +27,7 @@ }, "./package.json": "./package.json" }, -"typings": "dist/typings/index.d.ts", + "typings": "dist/typings/index.d.ts", "peerDependencies": { "graphql": "*" }, @@ -52,6 +53,5 @@ }, "typescript": { "definition": "dist/typings/index.d.ts" - }, - "type": "module" + } } diff --git a/packages/handlers/raml/package.json b/packages/handlers/raml/package.json index 43e7b34a6c89e..b50bf2ad45829 100644 --- a/packages/handlers/raml/package.json +++ b/packages/handlers/raml/package.json @@ -1,6 +1,7 @@ { "name": "@graphql-mesh/raml", "version": "0.8.38", + "type": "module", "repository": { "type": "git", "url": "Urigo/graphql-mesh", @@ -47,8 +48,7 @@ "cross-fetch" ] }, -"typescript": { - "definition": "dist/typings/index.d.ts" -}, - "type": "module" + "typescript": { + "definition": "dist/typings/index.d.ts" + } } diff --git a/packages/loaders/openapi/tests/additionalProperties.test.ts b/packages/loaders/openapi/tests/additionalProperties.test.ts index 093de388fda78..cb173d1074ac6 100644 --- a/packages/loaders/openapi/tests/additionalProperties.test.ts +++ b/packages/loaders/openapi/tests/additionalProperties.test.ts @@ -2,7 +2,7 @@ import { printSchemaWithDirectives } from '@graphql-tools/utils'; import { Response } from '@whatwg-node/fetch'; import { createServerAdapter } from '@whatwg-node/server'; import { execute, parse } from 'graphql'; -import { loadGraphQLSchemaFromOpenAPI } from '../src/loadGraphQLSchemaFromOpenAPI'; +import { loadGraphQLSchemaFromOpenAPI } from '../src/loadGraphQLSchemaFromOpenAPI.js'; const serverAdapter = createServerAdapter(request => { if (request.url.endsWith('/test')) { diff --git a/packages/loaders/openapi/tests/query-arguments.test.ts b/packages/loaders/openapi/tests/query-arguments.test.ts index dba2dac8afb8b..117b7adc52ce8 100644 --- a/packages/loaders/openapi/tests/query-arguments.test.ts +++ b/packages/loaders/openapi/tests/query-arguments.test.ts @@ -4,8 +4,8 @@ import { graphql, GraphQLSchema } from 'graphql'; import { Server } from 'http'; import { AddressInfo } from 'net'; -import { loadGraphQLSchemaFromOpenAPI } from '../src/loadGraphQLSchemaFromOpenAPI'; -import { getServer } from './query_arguments_server'; +import { loadGraphQLSchemaFromOpenAPI } from '../src/loadGraphQLSchemaFromOpenAPI.js'; +import { getServer } from './query_arguments_server.js'; let server: Server; let createdSchema: GraphQLSchema; diff --git a/packages/plugins/hive/package.json b/packages/plugins/hive/package.json index 395ae3161621f..1639fdf565acc 100644 --- a/packages/plugins/hive/package.json +++ b/packages/plugins/hive/package.json @@ -1,25 +1,33 @@ { "name": "@graphql-mesh/plugin-hive", "version": "0.0.4", + "type": "module", "repository": { "type": "git", "url": "Urigo/graphql-mesh", "directory": "packages/plugins/hive" }, "license": "MIT", - "main": "dist/index.js", - "module": "dist/index.mjs", + "main": "dist/cjs/index.js", + "module": "dist/esm/index.js", "exports": { ".": { - "require": "./dist/index.js", - "import": "./dist/index.mjs" + "require": { + "types": "./dist/typings/index.d.cts", + "default": "./dist/cjs/index.js" + }, + "import": { + "types": "./dist/typings/index.d.ts", + "default": "./dist/esm/index.js" + }, + "default": { + "types": "./dist/typings/index.d.ts", + "default": "./dist/esm/index.js" + } }, - "./*": { - "require": "./dist/*.js", - "import": "./dist/*.mjs" - } + "./package.json": "./package.json" }, - "typings": "dist/index.d.ts", + "typings": "dist/typings/index.d.ts", "peerDependencies": { "graphql": "*" }, @@ -39,6 +47,6 @@ }, "sideEffects": false, "typescript": { - "definition": "dist/index.d.ts" + "definition": "dist/typings/index.d.ts" } } diff --git a/packages/transforms/hive/package.json b/packages/transforms/hive/package.json index a21cfca616242..adba47090dfe2 100644 --- a/packages/transforms/hive/package.json +++ b/packages/transforms/hive/package.json @@ -1,25 +1,33 @@ { "name": "@graphql-mesh/transform-hive", "version": "0.0.4", + "type": "module", "repository": { "type": "git", "url": "Urigo/graphql-mesh", "directory": "packages/transforms/hive" }, "license": "MIT", - "main": "dist/index.js", - "module": "dist/index.mjs", + "main": "dist/cjs/index.js", + "module": "dist/esm/index.js", "exports": { ".": { - "require": "./dist/index.js", - "import": "./dist/index.mjs" + "require": { + "types": "./dist/typings/index.d.cts", + "default": "./dist/cjs/index.js" + }, + "import": { + "types": "./dist/typings/index.d.ts", + "default": "./dist/esm/index.js" + }, + "default": { + "types": "./dist/typings/index.d.ts", + "default": "./dist/esm/index.js" + } }, - "./*": { - "require": "./dist/*.js", - "import": "./dist/*.mjs" - } + "./package.json": "./package.json" }, - "typings": "dist/index.d.ts", + "typings": "dist/typings/index.d.ts", "peerDependencies": { "graphql": "*" }, @@ -38,6 +46,6 @@ }, "sideEffects": false, "typescript": { - "definition": "dist/index.d.ts" + "definition": "dist/typings/index.d.ts" } } diff --git a/packages/utils/test/sanitize-name-for-graphql.test.ts b/packages/utils/test/sanitize-name-for-graphql.test.ts index 5286d58e90bc7..37b828e7af100 100644 --- a/packages/utils/test/sanitize-name-for-graphql.test.ts +++ b/packages/utils/test/sanitize-name-for-graphql.test.ts @@ -1,4 +1,4 @@ -import { removeClosedBrackets } from '../src/sanitize-name-for-graphql'; +import { removeClosedBrackets } from '../src/sanitize-name-for-graphql.js'; it.each([ { input: 'foo(bar)q', output: 'foobarq' },