Преглед изворни кода

chore: package tweaks for component library

benduran пре 3 недеља
родитељ
комит
fa412bc1be

+ 1 - 1
apps/price_pusher/package.json

@@ -80,7 +80,7 @@
     "@types/pino": "^7.0.5",
     "aptos": "^1.8.5",
     "express": "^4.18.2",
-    "fuels": "^0.94.5",
+    "fuels": "catalog:",
     "jito-ts": "^3.0.1",
     "joi": "^17.6.0",
     "near-api-js": "^3.0.2",

+ 1 - 1
contract_manager/package.json

@@ -80,7 +80,7 @@
     "axios": "^0.24.0",
     "bs58": "^5.0.0",
     "extract-files": "^13.0.0",
-    "fuels": "^0.94.0",
+    "fuels": "catalog:",
     "near-api-js": "^3.0.2",
     "ramda": "^0.30.1",
     "starknet": "^6.9.0",

+ 1 - 2
lazer/contracts/sui/sdk/js/package.json

@@ -25,8 +25,7 @@
   },
   "sideEffects": false,
   "scripts": {
-    "build:cjs": "tsc --project tsconfig.build.json --verbatimModuleSyntax false --module commonjs --outDir ./dist/cjs && echo '{\"type\":\"commonjs\"}' > dist/cjs/package.json",
-    "build:esm": "tsc --project tsconfig.build.json --outDir ./dist/esm && echo '{\"type\":\"module\"}' > dist/esm/package.json",
+    "build": "ts-duality --clean",
     "fix:format": "prettier --write .",
     "fix:lint": "eslint --fix .",
     "test:format": "prettier --check .",

+ 1 - 5
lazer/sdk/js-solana/package.json

@@ -22,9 +22,7 @@
   },
   "scripts": {
     "update-idl": "cd ../../contracts/solana && RUSTUP_TOOLCHAIN=nightly-2025-04-15 anchor build && cp target/types/pyth_lazer_solana_contract.ts ../../sdk/js-solana/src/idl/pyth-lazer-solana-contract.ts && cp target/idl/pyth_lazer_solana_contract.json ../../sdk/js-solana/src/idl/pyth-lazer-solana-contract.json",
-    "build:cjs": "swc src -d dist/cjs --strip-leading-paths --copy-files -C module.type=commonjs && echo '{\"type\":\"commonjs\"}' > dist/cjs/package.json",
-    "build:esm": "swc src -d dist/esm --strip-leading-paths --copy-files -C jsc.experimental.keepImportAttributes=true && echo '{\"type\":\"module\"}' > dist/esm/package.json",
-    "build:types": "tsc --project tsconfig.build.json",
+    "build": "ts-duality",
     "fix:lint": "eslint --fix . --max-warnings 0",
     "test:lint": "eslint . --max-warnings 0",
     "test:types": "tsc",
@@ -35,8 +33,6 @@
   "devDependencies": {
     "@cprussin/eslint-config": "catalog:",
     "@cprussin/tsconfig": "catalog:",
-    "@swc/cli": "catalog:",
-    "@swc/core": "catalog:",
     "@types/node": "catalog:",
     "eslint": "catalog:",
     "prettier": "catalog:",

+ 0 - 13
lazer/sdk/js-solana/turbo.json

@@ -1,13 +0,0 @@
-{
-  "$schema": "https://turbo.build/schema.json",
-  "extends": ["//"],
-  "tasks": {
-    "build:types": {
-      "dependsOn": ["//#install:modules"],
-      "outputs": ["dist/types/**"]
-    },
-    "build": {
-      "dependsOn": ["build:types", "build:cjs", "build:esm"]
-    }
-  }
-}

+ 1 - 2
lazer/sdk/js/package.json

@@ -25,8 +25,7 @@
     }
   },
   "scripts": {
-    "build:cjs": "tsc --project tsconfig.build.json --verbatimModuleSyntax false --module commonjs --outDir ./dist/cjs && echo '{\"type\":\"commonjs\"}' > dist/cjs/package.json",
-    "build:esm": "tsc --project tsconfig.build.json --outDir ./dist/esm && echo '{\"type\":\"module\"}' > dist/esm/package.json",
+    "build": "ts-duality --clean",
     "fix:lint": "eslint --fix . --max-warnings 0",
     "test:lint": "eslint . --max-warnings 0",
     "test:types": "tsc",

+ 292 - 12
packages/component-library/package.json

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

+ 2 - 0
packages/component-library/tsconfig.build.json

@@ -7,9 +7,11 @@
     "emitDeclarationOnly": true
   },
   "exclude": [
+    ".storybook",
     "node_modules",
     "dist",
     "examples/",
+    "**/*.stories.*",
     "**/__tests__/*"
   ]
 }

+ 1 - 2
packages/component-library/turbo.json

@@ -5,10 +5,9 @@
     "build": {
       "dependsOn": [
         "//#install:modules",
-        "^build",
         "clean",
+        "^build",
         "build:declarations",
-        "build:esm",
         "build:scss",
         "build:svg"
       ]

Разлика између датотеке није приказан због своје велике величине
+ 155 - 149
pnpm-lock.yaml


+ 1 - 2
pnpm-workspace.yaml

@@ -87,8 +87,6 @@ catalog:
   "@storybook/nextjs": ^9.1.8
   "@storybook/react": ^9.1.8
   "@svgr/webpack": ^8.1.0
-  "@swc/cli": ^0.7.8
-  "@swc/core": ^1.13.2
   "@tailwindcss/forms": ^0.5.10
   "@tailwindcss/postcss": ^4.1.6
   "@tanstack/react-query": ^5.71.5
@@ -114,6 +112,7 @@ catalog:
   csv-stringify: ^6.6.0
   dnum: ^2.14.0
   eslint: ^9.23.0
+  fuels: 0.101.3
   framer-motion: ^12.6.3
   fumadocs-core: ^15.7.12
   fumadocs-mdx: ^11.10.0

+ 1 - 1
target_chains/fuel/sdk/js/package.json

@@ -48,7 +48,7 @@
     "typescript": "catalog:"
   },
   "dependencies": {
-    "fuels": "^0.96.1"
+    "fuels": "catalog:"
   },
   "engines": {
     "node": ">=22.16.0",

+ 7 - 32
turbo.json

@@ -55,9 +55,8 @@
       "dependsOn": [
         "//#install:modules",
         "pull:env",
-        "^build",
-        "build:cjs",
-        "build:esm"
+        "clean",
+        "^build"
       ],
       "inputs": [
         "$TURBO_DEFAULT$",
@@ -70,39 +69,11 @@
       ],
       "outputs": ["lib/**", "dist/**", ".next/**", "!.next/cache/**"]
     },
-    "build:cjs": {
-      "dependsOn": ["//#install:modules", "^build"],
-      "inputs": [
-        "$TURBO_DEFAULT$",
-        "!README.md",
-        "!**/*.test.*",
-        "!jest.config.js",
-        "!eslint.config.js",
-        "!prettier.config.js",
-        "!vercel.json"
-      ],
-      "outputs": ["dist/cjs/**"]
-    },
-    "build:esm": {
-      "dependsOn": ["//#install:modules", "^build"],
-      "inputs": [
-        "$TURBO_DEFAULT$",
-        "!README.md",
-        "!**/*.test.*",
-        "!jest.config.js",
-        "!eslint.config.js",
-        "!prettier.config.js",
-        "!vercel.json"
-      ],
-      "outputs": ["dist/esm/**"]
-    },
     "build:vercel": {
       "dependsOn": [
         "//#install:modules",
         "pull:env",
-        "^build",
-        "build:cjs",
-        "build:esm"
+        "^build"
       ],
       "inputs": [
         "$TURBO_DEFAULT$",
@@ -115,6 +86,10 @@
       ],
       "outputs": ["lib/**", "dist/**", ".next/**", "!.next/cache/**"]
     },
+    "clean": {
+      "cache": false,
+      "outputs": []
+    },
     "fix": {
       "dependsOn": ["fix:lint", "fix:format"],
       "cache": false

Неке датотеке нису приказане због велике количине промена