From 774275e6cbf44fcde3c7c3f51a2260bc842d8a11 Mon Sep 17 00:00:00 2001 From: JounQin Date: Mon, 4 Jul 2022 12:26:08 +0800 Subject: [PATCH 1/4] fix: client/theme not exported from exports field close #913 --- package.json | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index 3c499689eef8..3075c0cb9291 100644 --- a/package.json +++ b/package.json @@ -12,7 +12,9 @@ "import": "./dist/node/index.js", "require": "./dist/node-cjs/index.cjs" }, - "./dist/client/*": "./dist/client/*" + "./dist/client/*": "./dist/client/*", + "./client": "./client.d.ts", + "./theme": "./theme.d.ts" }, "bin": { "vitepress": "bin/vitepress.js" From 24b01685cc21073ebad963c82f0b2d531d9c0558 Mon Sep 17 00:00:00 2001 From: JounQin Date: Mon, 4 Jul 2022 14:14:57 +0800 Subject: [PATCH 2/4] fix: exports `client` and `theme` correctly with types and js source --- package.json | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 3075c0cb9291..14d6a50304a1 100644 --- a/package.json +++ b/package.json @@ -13,8 +13,14 @@ "require": "./dist/node-cjs/index.cjs" }, "./dist/client/*": "./dist/client/*", - "./client": "./client.d.ts", - "./theme": "./theme.d.ts" + "./client": { + "types": "./client.d.ts", + "default": "./dist/client/index.js" + }, + "./theme": { + "types": "./theme.d.ts", + "default": "./dist/client/theme-default/index.js" + } }, "bin": { "vitepress": "bin/vitepress.js" From 3bf4af2021adc56e6515ee5ced31d9f4f9d82b04 Mon Sep 17 00:00:00 2001 From: JounQin Date: Mon, 4 Jul 2022 14:34:55 +0800 Subject: [PATCH 3/4] chore: exports types from `./dist/client` for `vitepress/client` --- client.d.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/client.d.ts b/client.d.ts index f206e7303510..9191095e7227 100644 --- a/client.d.ts +++ b/client.d.ts @@ -1,3 +1,5 @@ // re-export vite client types. with strict installers like pnpm, user won't // be able to reference vite/client in project root. /// + +export * from './dist/client'; From 987863002d328266f54c0abc06ee56ffc518f816 Mon Sep 17 00:00:00 2001 From: Divyansh Singh <40380293+brc-dd@users.noreply.github.com> Date: Tue, 2 Aug 2022 12:45:02 +0530 Subject: [PATCH 4/4] Update client.d.ts --- client.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client.d.ts b/client.d.ts index 9191095e7227..7cfa18ffcf08 100644 --- a/client.d.ts +++ b/client.d.ts @@ -2,4 +2,4 @@ // be able to reference vite/client in project root. /// -export * from './dist/client'; +export * from './dist/client'