From 64c6a5b4a156d3928871712405d0541907540b8c Mon Sep 17 00:00:00 2001 From: mrjvs Date: Sun, 17 Mar 2024 19:22:34 +0100 Subject: [PATCH] Fix pnpm specific issues with build --- apps/docs/theme.config.tsx | 3 ++- apps/docs/tsconfig.json | 4 +++- examples/guider/kitchen-sink/theme.config.tsx | 3 ++- examples/guider/kitchen-sink/tsconfig.json | 4 +++- examples/guider/minimal/tsconfig.json | 2 +- packages/guider/src/theme.ts | 2 +- packages/guider/src/theme/index.ts | 2 ++ packages/guider/tsconfig.json | 1 + packages/guider/tsup.config.ts | 3 +++ 9 files changed, 18 insertions(+), 6 deletions(-) diff --git a/apps/docs/theme.config.tsx b/apps/docs/theme.config.tsx index 1d249e3a..cb19a027 100644 --- a/apps/docs/theme.config.tsx +++ b/apps/docs/theme.config.tsx @@ -6,6 +6,7 @@ import { site, siteTemplate, social, + type SiteComponent, } from '@neato/guider/theme'; import { Logo } from 'components/logo'; @@ -266,4 +267,4 @@ export default defineTheme([ }), ], }), -]); +]) satisfies SiteComponent[]; diff --git a/apps/docs/tsconfig.json b/apps/docs/tsconfig.json index 6f0acc80..6b420e28 100644 --- a/apps/docs/tsconfig.json +++ b/apps/docs/tsconfig.json @@ -11,7 +11,9 @@ "noEmit": true, "incremental": true, "resolveJsonModule": true, - "jsx": "preserve" + "jsx": "preserve", + "moduleResolution": "Bundler", + "module": "esnext" }, "include": [ "." diff --git a/examples/guider/kitchen-sink/theme.config.tsx b/examples/guider/kitchen-sink/theme.config.tsx index 49caf621..96c9e1a9 100644 --- a/examples/guider/kitchen-sink/theme.config.tsx +++ b/examples/guider/kitchen-sink/theme.config.tsx @@ -6,6 +6,7 @@ import { link, seperator, site, + type SiteComponent, } from '@neato/guider/theme'; const siteTemplate = site('docs', { @@ -112,4 +113,4 @@ export default defineTheme([ }), ], }), -]); +]) satisfies SiteComponent[]; diff --git a/examples/guider/kitchen-sink/tsconfig.json b/examples/guider/kitchen-sink/tsconfig.json index 6f0acc80..6b420e28 100644 --- a/examples/guider/kitchen-sink/tsconfig.json +++ b/examples/guider/kitchen-sink/tsconfig.json @@ -11,7 +11,9 @@ "noEmit": true, "incremental": true, "resolveJsonModule": true, - "jsx": "preserve" + "jsx": "preserve", + "moduleResolution": "Bundler", + "module": "esnext" }, "include": [ "." diff --git a/examples/guider/minimal/tsconfig.json b/examples/guider/minimal/tsconfig.json index 65348e83..5a975c8b 100644 --- a/examples/guider/minimal/tsconfig.json +++ b/examples/guider/minimal/tsconfig.json @@ -12,7 +12,7 @@ "incremental": true, "esModuleInterop": true, "module": "esnext", - "moduleResolution": "node", + "moduleResolution": "Bundler", "resolveJsonModule": true, "isolatedModules": true, "jsx": "preserve" diff --git a/packages/guider/src/theme.ts b/packages/guider/src/theme.ts index 3d35780d..b241937f 100644 --- a/packages/guider/src/theme.ts +++ b/packages/guider/src/theme.ts @@ -1,3 +1,3 @@ export * from './theme/index'; export * from './theme/components/index'; -export * from './theme/types'; +export type * from './theme/types'; diff --git a/packages/guider/src/theme/index.ts b/packages/guider/src/theme/index.ts index c56367fa..d4da8ab4 100644 --- a/packages/guider/src/theme/index.ts +++ b/packages/guider/src/theme/index.ts @@ -1,6 +1,8 @@ import { site, type SiteComponent } from './components/site'; import type { GuiderConfig } from './types'; +export { type SiteComponent } from './components/site'; + export function defineTheme(obj: GuiderConfig): SiteComponent[] { let sites: SiteComponent[] = []; if (!Array.isArray(obj)) sites = [site('main', obj)]; diff --git a/packages/guider/tsconfig.json b/packages/guider/tsconfig.json index 86cd721a..0fd3f7c3 100644 --- a/packages/guider/tsconfig.json +++ b/packages/guider/tsconfig.json @@ -6,5 +6,6 @@ "jsx": "react-jsx", "module": "ES2022", "moduleResolution": "Bundler", + "baseUrl": "." } } diff --git a/packages/guider/tsup.config.ts b/packages/guider/tsup.config.ts index 88c3da36..a5d1e8a3 100644 --- a/packages/guider/tsup.config.ts +++ b/packages/guider/tsup.config.ts @@ -7,6 +7,7 @@ export default defineConfig([ format: ['esm'], outExtension: () => ({ js: '.js', dts: '.d.ts' }), dts: true, + bundle: true, external: ['@neato/guider', '@neato/guider/shim.guider.virtual'], }, { @@ -14,6 +15,7 @@ export default defineConfig([ entry: ['src/loader.ts'], format: ['esm'], outExtension: () => ({ js: '.js', dts: '.d.ts' }), + bundle: true, dts: true, external: ['@neato/guider', '@neato/guider/shim.guider.virtual'], }, @@ -22,6 +24,7 @@ export default defineConfig([ entry: ['src/client.ts', 'src/theme.ts'], format: ['esm'], outExtension: () => ({ js: '.js', dts: '.d.ts' }), + bundle: true, dts: true, external: ['@neato/guider', '@neato/guider/shim.guider.virtual'], },