From f2fcb26ccd97b8a0a57d4fced8c941e770b9a1d9 Mon Sep 17 00:00:00 2001 From: Michael Salim Date: Sat, 9 Nov 2024 22:56:59 +0000 Subject: [PATCH] Chore: Final fix build --- packages/graphql/package.json | 21 ++++++++++++++++----- packages/graphql/tsconfig.json | 2 +- yarn.lock | 2 ++ 3 files changed, 19 insertions(+), 6 deletions(-) diff --git a/packages/graphql/package.json b/packages/graphql/package.json index bc140c6..b308d1b 100644 --- a/packages/graphql/package.json +++ b/packages/graphql/package.json @@ -2,11 +2,21 @@ "name": "@repo/graphql", "private": true, "version": "0.0.0", - "main": "index.js", - "types": "index.d.ts", + "exports": { + ".": { + "import": { + "types": "./dist/index.d.mts", + "default": "./dist/index.mjs" + }, + "require": { + "types": "./dist/index.d.ts", + "default": "./dist/index.js" + } + } + }, "scripts": { - "build": "yarn codegen && tsc -b", - "dev": "concurrently --kill-others --names \"GQL-CodeGen,GQL-Build\" --prefix \"({name})\" --prefix-colors \"magentaBright.bold,greenBright.bold\" \"yarn codegen --watch\" \"tsc -b --watch --preserveWatchOutput\"", + "build": "yarn codegen && pkgroll --src .", + "dev": "concurrently --kill-others --names \"GQL-CodeGen,GQL-Build\" --prefix \"({name})\" --prefix-colors \"magentaBright.bold,greenBright.bold\" \"yarn codegen --watch\" \"pkgroll --src ./ --watch\"", "codegen": "graphql-codegen --config codegen.yml" }, "dependencies": { @@ -21,6 +31,7 @@ "@graphql-codegen/typescript-operations": "^4.3.0", "@graphql-codegen/typescript-react-apollo": "4.3.2", "@parcel/watcher": "^2.4.1", - "@repo/typescript-config": "*" + "@repo/typescript-config": "*", + "pkgroll": "^2.5.1" } } diff --git a/packages/graphql/tsconfig.json b/packages/graphql/tsconfig.json index e748560..dd2f013 100644 --- a/packages/graphql/tsconfig.json +++ b/packages/graphql/tsconfig.json @@ -3,7 +3,7 @@ "compilerOptions": { "noEmit": false, "rootDir": ".", - "outDir": ".", + "outDir": "dist", "tsBuildInfoFile": "tsconfig.tsbuildinfo", "declarationDir": ".", "lib": ["es2018", "esnext.asynciterable"], diff --git a/yarn.lock b/yarn.lock index b268c9c..0a77d76 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5325,6 +5325,7 @@ __metadata: "@graphql-codegen/typescript-react-apollo": "npm:4.3.2" "@parcel/watcher": "npm:^2.4.1" "@repo/typescript-config": "npm:*" + pkgroll: "npm:^2.5.1" react: "npm:rc" use-pubsub-js: "npm:^1.0.7" languageName: unknown @@ -5390,6 +5391,7 @@ __metadata: dependencies: "@apollo/client": "npm:3.11.8" "@hocuspocus/server": "npm:2.13.7" + "@repo/graphql": "npm:*" "@repo/typescript-config": "npm:*" fast-deep-equal: "npm:^3.1.3" graphql: "npm:^15.9.0"