From 9667ee990ca2a02a146e442f2494981df4c88b52 Mon Sep 17 00:00:00 2001 From: Ben Holmes Date: Mon, 11 Mar 2024 15:44:58 -0400 Subject: [PATCH] fix: remove runtime/config suggestion for db config exports (#10391) * chore: remove runtime/config from package json * fix: use relative path to dist * chore: changeset * Revert "fix: use relative path to dist" This reverts commit 16c0cc296ec52be163f0d2c213559ca07008af4b. * Revert "chore: remove runtime/config from package json" This reverts commit c1b46789983384ca66172b404a74440784888514. * refactor: types null * fix: exclude config.ts from tsc * chore: update consts * chore: comment on intellisense --- .changeset/breezy-seals-begin.md | 5 +++++ packages/db/package.json | 6 +----- packages/db/src/core/consts.ts | 4 +++- packages/db/tsconfig.json | 1 + 4 files changed, 10 insertions(+), 6 deletions(-) create mode 100644 .changeset/breezy-seals-begin.md diff --git a/.changeset/breezy-seals-begin.md b/.changeset/breezy-seals-begin.md new file mode 100644 index 000000000000..951f6272be32 --- /dev/null +++ b/.changeset/breezy-seals-begin.md @@ -0,0 +1,5 @@ +--- +"@astrojs/db": patch +--- + +Remove @astrojs/runtime/config suggestion for astro:db configuration helpers. diff --git a/packages/db/package.json b/packages/db/package.json index fa10683d6873..d7f44aa8cc86 100644 --- a/packages/db/package.json +++ b/packages/db/package.json @@ -20,8 +20,7 @@ "types": "./dist/runtime/index.d.ts", "import": "./dist/runtime/index.js" }, - "./runtime/config": { - "types": "./dist/runtime/config.d.ts", + "./dist/runtime/config.js": { "import": "./dist/runtime/config.js" }, "./package.json": "./package.json" @@ -36,9 +35,6 @@ ], "runtime": [ "./dist/runtime/index.d.ts" - ], - "runtime/config": [ - "./dist/runtime/config.d.ts" ] } }, diff --git a/packages/db/src/core/consts.ts b/packages/db/src/core/consts.ts index c0f5e2058274..43279f6aa778 100644 --- a/packages/db/src/core/consts.ts +++ b/packages/db/src/core/consts.ts @@ -5,7 +5,9 @@ export const PACKAGE_NAME = JSON.parse( ).name; export const RUNTIME_IMPORT = JSON.stringify(`${PACKAGE_NAME}/runtime`); -export const RUNTIME_CONFIG_IMPORT = JSON.stringify(`${PACKAGE_NAME}/runtime/config`); +// Exposed without type definitions +// to avoid duplicate suggestions in Intellisense +export const RUNTIME_CONFIG_IMPORT = JSON.stringify(`${PACKAGE_NAME}/dist/runtime/config.js`); export const DB_TYPES_FILE = 'db-types.d.ts'; diff --git a/packages/db/tsconfig.json b/packages/db/tsconfig.json index 18443cddf207..96407d1d114a 100644 --- a/packages/db/tsconfig.json +++ b/packages/db/tsconfig.json @@ -1,6 +1,7 @@ { "extends": "../../tsconfig.base.json", "include": ["src"], + "exclude": ["src/runtime/config.ts"], "compilerOptions": { "outDir": "./dist" }