Jelajahi Sumber

chore: attempt to not link components in devmode

benduran 4 minggu lalu
induk
melakukan
a94f0189b1

+ 7 - 1
packages/build-ts-package/src/build-ts-package.js

@@ -51,6 +51,7 @@ export async function buildTsPackage(argv = process.argv) {
     cwd,
     exclude,
     noCjs,
+    noDevExports,
     noDts,
     noEsm,
     outDir,
@@ -81,6 +82,11 @@ export async function buildTsPackage(argv = process.argv) {
         "if true, will not build the CommonJS variant of this package",
       type: "boolean",
     })
+    .option('noDevExports', {
+      default: false,
+      description: 'if set, will not symlink the uncompiled typescript files during local development. compiled versions will be used, instead.',
+      type: 'boolean',
+    })
     .option("noDts", {
       default: false,
       description: "if set, will not write typescript typings",
@@ -149,7 +155,7 @@ export async function buildTsPackage(argv = process.argv) {
         ...exclude.map((ex) => String(ex)),
       ],
       exports:
-        format === "esm" || numFormats <= 1 ? { all, devExports: true } : false,
+        format === "esm" || numFormats <= 1 ? { all, devExports: !noDevExports } : false,
       // do not attempt to resolve or import CSS, SCSS or SVG files
       external: [/\.s?css$/, /\.svg$/],
       format,

+ 74 - 74
packages/component-library/package.json

@@ -8,83 +8,83 @@
     "pnpm": ">=10.19.0"
   },
   "exports": {
-    "./AppShell": "./src/AppShell/index.tsx",
-    "./AppShell/amplitude": "./src/AppShell/amplitude.tsx",
-    "./AppShell/body-providers": "./src/AppShell/body-providers.tsx",
-    "./AppShell/fonts": "./src/AppShell/fonts.ts",
-    "./AppShell/html-with-lang": "./src/AppShell/html-with-lang.tsx",
-    "./AppShell/i18n-provider": "./src/AppShell/i18n-provider.tsx",
-    "./AppShell/report-accessibility": "./src/AppShell/report-accessibility.ts",
-    "./AppShell/router-provider": "./src/AppShell/router-provider.tsx",
-    "./AppShell/tabs": "./src/AppShell/tabs.tsx",
-    "./Badge": "./src/Badge/index.tsx",
-    "./Breadcrumbs": "./src/Breadcrumbs/index.tsx",
-    "./Button": "./src/Button/index.tsx",
-    "./Card": "./src/Card/index.tsx",
-    "./compose-providers": "./src/compose-providers.tsx",
-    "./CopyButton": "./src/CopyButton/index.tsx",
-    "./CrossfadeTabPanels": "./src/CrossfadeTabPanels/index.tsx",
-    "./DropdownCaretDown": "./src/DropdownCaretDown/index.tsx",
-    "./EntityList": "./src/EntityList/index.tsx",
-    "./ErrorPage": "./src/ErrorPage/index.tsx",
-    "./Footer": "./src/Footer/index.tsx",
-    "./Header": "./src/Header/index.tsx",
-    "./Header/theme-switch": "./src/Header/theme-switch.tsx",
-    "./InfoBox": "./src/InfoBox/index.tsx",
-    "./Link": "./src/Link/index.tsx",
-    "./MainNavTabs": "./src/MainNavTabs/index.tsx",
-    "./Meter": "./src/Meter/index.tsx",
-    "./MobileNavTabs": "./src/MobileNavTabs/index.tsx",
-    "./ModalDialog": "./src/ModalDialog/index.tsx",
-    "./NoResults": "./src/NoResults/index.tsx",
-    "./NotFoundPage": "./src/NotFoundPage/index.tsx",
-    "./omit-keys": "./src/omit-keys.ts",
-    "./overlay-visible-context": "./src/overlay-visible-context.tsx",
-    "./Paginator": "./src/Paginator/index.tsx",
-    "./SearchButton": "./src/SearchButton/index.tsx",
-    "./SearchInput": "./src/SearchInput/index.tsx",
-    "./Select": "./src/Select/index.tsx",
-    "./SingleToggleGroup": "./src/SingleToggleGroup/index.tsx",
-    "./Skeleton": "./src/Skeleton/index.tsx",
-    "./social-links": "./src/social-links.tsx",
-    "./Spinner": "./src/Spinner/index.tsx",
-    "./StatCard": "./src/StatCard/index.tsx",
-    "./Status": "./src/Status/index.tsx",
-    "./Switch": "./src/Switch/index.tsx",
-    "./SymbolPairTag": "./src/SymbolPairTag/index.tsx",
-    "./Table": "./src/Table/index.tsx",
-    "./TableGrid": "./src/TableGrid/index.tsx",
-    "./TableGrid/dummy-row-data": "./src/TableGrid/dummy-row-data.ts",
-    "./TableGrid/table-grid-props": "./src/TableGrid/table-grid-props.ts",
-    "./TabList": "./src/TabList/index.tsx",
-    "./Term": "./src/Term/index.tsx",
-    "./unstyled/Breadcrumbs": "./src/unstyled/Breadcrumbs/index.tsx",
-    "./unstyled/Button": "./src/unstyled/Button/index.tsx",
-    "./unstyled/Dialog": "./src/unstyled/Dialog/index.tsx",
-    "./unstyled/GridList": "./src/unstyled/GridList/index.tsx",
-    "./unstyled/Label": "./src/unstyled/Label/index.tsx",
-    "./unstyled/Link": "./src/unstyled/Link/index.tsx",
-    "./unstyled/ListBox": "./src/unstyled/ListBox/index.tsx",
-    "./unstyled/Meter": "./src/unstyled/Meter/index.tsx",
-    "./unstyled/Popover": "./src/unstyled/Popover/index.tsx",
-    "./unstyled/SearchField": "./src/unstyled/SearchField/index.tsx",
-    "./unstyled/Select": "./src/unstyled/Select/index.tsx",
-    "./unstyled/Switch": "./src/unstyled/Switch/index.tsx",
-    "./unstyled/Table": "./src/unstyled/Table/index.tsx",
-    "./unstyled/Tabs": "./src/unstyled/Tabs/index.tsx",
-    "./unstyled/TextField": "./src/unstyled/TextField/index.tsx",
-    "./unstyled/Toolbar": "./src/unstyled/Toolbar/index.tsx",
-    "./use-prefetch": "./src/use-prefetch.ts",
-    "./useAlert": "./src/useAlert/index.tsx",
-    "./useData": "./src/useData/index.ts",
-    "./useDrawer": "./src/useDrawer/index.tsx",
-    "./useLogger": "./src/useLogger/index.tsx",
-    "./useQueryParamsPagination": "./src/useQueryParamsPagination/index.ts",
-    "./Virtualizer": "./src/Virtualizer/index.tsx",
+    "./AppShell": "./dist/esm/AppShell/index.js",
+    "./AppShell/amplitude": "./dist/esm/AppShell/amplitude.js",
+    "./AppShell/body-providers": "./dist/esm/AppShell/body-providers.js",
+    "./AppShell/fonts": "./dist/esm/AppShell/fonts.js",
+    "./AppShell/html-with-lang": "./dist/esm/AppShell/html-with-lang.js",
+    "./AppShell/i18n-provider": "./dist/esm/AppShell/i18n-provider.js",
+    "./AppShell/report-accessibility": "./dist/esm/AppShell/report-accessibility.js",
+    "./AppShell/router-provider": "./dist/esm/AppShell/router-provider.js",
+    "./AppShell/tabs": "./dist/esm/AppShell/tabs.js",
+    "./Badge": "./dist/esm/Badge/index.js",
+    "./Breadcrumbs": "./dist/esm/Breadcrumbs/index.js",
+    "./Button": "./dist/esm/Button/index.js",
+    "./Card": "./dist/esm/Card/index.js",
+    "./compose-providers": "./dist/esm/compose-providers.js",
+    "./CopyButton": "./dist/esm/CopyButton/index.js",
+    "./CrossfadeTabPanels": "./dist/esm/CrossfadeTabPanels/index.js",
+    "./DropdownCaretDown": "./dist/esm/DropdownCaretDown/index.js",
+    "./EntityList": "./dist/esm/EntityList/index.js",
+    "./ErrorPage": "./dist/esm/ErrorPage/index.js",
+    "./Footer": "./dist/esm/Footer/index.js",
+    "./Header": "./dist/esm/Header/index.js",
+    "./Header/theme-switch": "./dist/esm/Header/theme-switch.js",
+    "./InfoBox": "./dist/esm/InfoBox/index.js",
+    "./Link": "./dist/esm/Link/index.js",
+    "./MainNavTabs": "./dist/esm/MainNavTabs/index.js",
+    "./Meter": "./dist/esm/Meter/index.js",
+    "./MobileNavTabs": "./dist/esm/MobileNavTabs/index.js",
+    "./ModalDialog": "./dist/esm/ModalDialog/index.js",
+    "./NoResults": "./dist/esm/NoResults/index.js",
+    "./NotFoundPage": "./dist/esm/NotFoundPage/index.js",
+    "./omit-keys": "./dist/esm/omit-keys.js",
+    "./overlay-visible-context": "./dist/esm/overlay-visible-context.js",
+    "./Paginator": "./dist/esm/Paginator/index.js",
+    "./SearchButton": "./dist/esm/SearchButton/index.js",
+    "./SearchInput": "./dist/esm/SearchInput/index.js",
+    "./Select": "./dist/esm/Select/index.js",
+    "./SingleToggleGroup": "./dist/esm/SingleToggleGroup/index.js",
+    "./Skeleton": "./dist/esm/Skeleton/index.js",
+    "./social-links": "./dist/esm/social-links.js",
+    "./Spinner": "./dist/esm/Spinner/index.js",
+    "./StatCard": "./dist/esm/StatCard/index.js",
+    "./Status": "./dist/esm/Status/index.js",
+    "./Switch": "./dist/esm/Switch/index.js",
+    "./SymbolPairTag": "./dist/esm/SymbolPairTag/index.js",
+    "./Table": "./dist/esm/Table/index.js",
+    "./TableGrid": "./dist/esm/TableGrid/index.js",
+    "./TableGrid/dummy-row-data": "./dist/esm/TableGrid/dummy-row-data.js",
+    "./TableGrid/table-grid-props": "./dist/esm/TableGrid/table-grid-props.js",
+    "./TabList": "./dist/esm/TabList/index.js",
+    "./Term": "./dist/esm/Term/index.js",
+    "./unstyled/Breadcrumbs": "./dist/esm/unstyled/Breadcrumbs/index.js",
+    "./unstyled/Button": "./dist/esm/unstyled/Button/index.js",
+    "./unstyled/Dialog": "./dist/esm/unstyled/Dialog/index.js",
+    "./unstyled/GridList": "./dist/esm/unstyled/GridList/index.js",
+    "./unstyled/Label": "./dist/esm/unstyled/Label/index.js",
+    "./unstyled/Link": "./dist/esm/unstyled/Link/index.js",
+    "./unstyled/ListBox": "./dist/esm/unstyled/ListBox/index.js",
+    "./unstyled/Meter": "./dist/esm/unstyled/Meter/index.js",
+    "./unstyled/Popover": "./dist/esm/unstyled/Popover/index.js",
+    "./unstyled/SearchField": "./dist/esm/unstyled/SearchField/index.js",
+    "./unstyled/Select": "./dist/esm/unstyled/Select/index.js",
+    "./unstyled/Switch": "./dist/esm/unstyled/Switch/index.js",
+    "./unstyled/Table": "./dist/esm/unstyled/Table/index.js",
+    "./unstyled/Tabs": "./dist/esm/unstyled/Tabs/index.js",
+    "./unstyled/TextField": "./dist/esm/unstyled/TextField/index.js",
+    "./unstyled/Toolbar": "./dist/esm/unstyled/Toolbar/index.js",
+    "./use-prefetch": "./dist/esm/use-prefetch.js",
+    "./useAlert": "./dist/esm/useAlert/index.js",
+    "./useData": "./dist/esm/useData/index.js",
+    "./useDrawer": "./dist/esm/useDrawer/index.js",
+    "./useLogger": "./dist/esm/useLogger/index.js",
+    "./useQueryParamsPagination": "./dist/esm/useQueryParamsPagination/index.js",
+    "./Virtualizer": "./dist/esm/Virtualizer/index.js",
     "./package.json": "./package.json"
   },
   "scripts": {
-    "build": "build-ts-package --noCjs",
+    "build": "build-ts-package --noCjs --noDevExports",
     "build:scss": "copyfiles -u 1 \"src/**/*.scss\" dist/esm",
     "build:storybook": "storybook build",
     "build:svg": "copyfiles -u 1 \"src/**/*.svg\" dist/esm",

+ 1 - 1
turbo.json

@@ -114,7 +114,7 @@
       "cache": false
     },
     "start:dev": {
-      "dependsOn": ["//#install:modules", "pull:env", "^build", "^start:dev"],
+      "dependsOn": ["//#install:modules", "pull:env", "^build"],
       "persistent": true,
       "cache": false
     },