From 1fac364ffe7c0471f63438561c877330ba55afed Mon Sep 17 00:00:00 2001 From: Pavel Prichodko <14926950+prichodko@users.noreply.github.com> Date: Tue, 14 Mar 2023 13:48:09 +0100 Subject: [PATCH] fix local development --- apps/web/src/app.tsx | 2 +- apps/web/vite.config.ts | 13 +++++++++++-- packages/components/package.json | 4 +++- packages/components/src/index.tsx | 3 +++ packages/icons/package.json | 2 -- 5 files changed, 18 insertions(+), 6 deletions(-) diff --git a/apps/web/src/app.tsx b/apps/web/src/app.tsx index 955a2b0a..44ad28d0 100644 --- a/apps/web/src/app.tsx +++ b/apps/web/src/app.tsx @@ -1,6 +1,7 @@ import { useMemo, useRef, useState } from 'react' import { + CHANNEL_GROUPS, Composer, Messages, Sidebar, @@ -10,7 +11,6 @@ import { useAppState, } from '@status-im/components' import { useBlur } from '@status-im/components/hooks' -import { CHANNEL_GROUPS } from '@status-im/components/src/sidebar/mock-data' const COMMUNITY = { name: 'Rarible', diff --git a/apps/web/vite.config.ts b/apps/web/vite.config.ts index 1f686c43..c7b1fc16 100644 --- a/apps/web/vite.config.ts +++ b/apps/web/vite.config.ts @@ -1,5 +1,6 @@ import { tamaguiPlugin } from '@tamagui/vite-plugin' import react from '@vitejs/plugin-react-swc' +import path from 'path' import { defineConfig } from 'vite' import type { PluginOption } from 'vite' @@ -13,15 +14,23 @@ const tamaguiConfig = { // useReactNativeWebLite: true, } -// https://vitejs.dev/config +// @see: https://vitejs.dev/config export default defineConfig({ + resolve: { + // mainFields: ['module', 'jsnext:main', 'jsnext'], + alias: { + '@status-im/components/hooks': path.resolve( + '../../packages/components/hooks' + ), + '@status-im/components': path.resolve('../../packages/components/src'), + }, + }, define: { TAMAGUI_TARGET: JSON.stringify('web'), }, plugins: [ react(), tamaguiPlugin(tamaguiConfig) as PluginOption, - // BUG // tamaguiExtractPlugin(tamaguiConfig) ], }) diff --git a/packages/components/package.json b/packages/components/package.json index 788e18f9..98dee10d 100644 --- a/packages/components/package.json +++ b/packages/components/package.json @@ -5,9 +5,11 @@ "*.css" ], "private": true, + "#module": "./src/index.tsx", + "types": "./src/index.tsx", "main": "./dist/index.js", "module": "./dist/index.mjs", - "types": "./dist/types/index.d.ts", + "#types": "./dist/types/index.d.ts", "files": [ "types", "dist" diff --git a/packages/components/src/index.tsx b/packages/components/src/index.tsx index 8296bf9d..4af6b94d 100644 --- a/packages/components/src/index.tsx +++ b/packages/components/src/index.tsx @@ -13,5 +13,8 @@ export * from './topbar' export * from './typography' export * from './user-list' +// MOCK DATA +export { CHANNEL_GROUPS } from './sidebar/mock-data' + // eslint-disable-next-line simple-import-sort/exports export { config } from './tamagui.config' diff --git a/packages/icons/package.json b/packages/icons/package.json index 5ef13864..1294e91d 100644 --- a/packages/icons/package.json +++ b/packages/icons/package.json @@ -1,8 +1,6 @@ { "name": "@status-im/icons", "version": "0.0.1", - "types": "src/index.tsx", - "main": "src/index.tsx", "private": true, "files": [ "types",