mirror of
https://github.com/Memo-2023/mana-monorepo.git
synced 2026-05-14 22:21:10 +02:00
Following the shared-icons fix (d5cabed14), audit every workspace
package's src/index.ts for top-level side effects and flag the
ones that are safe to tree-shake:
- Pure TS re-export barrels (types, theme, utils, llm, storage):
"sideEffects": false — lets Vite prune entire submodules when a
consumer only imports a subset of named exports. Matters most for
shared-llm where the orchestrator/BYOK branch isn't needed on
every route.
- Packages that ship .svelte components (branding, ui, links):
"sideEffects": ["**/*.svelte", "**/*.css"] — same tree-shaking
benefit for TS modules, but keeps Svelte component CSS injection
intact.
The state-holding submodules (shared-ui drag-state/toast,
shared-llm store, shared-links mutations) are still evaluated
whenever their exports are referenced, so behaviour is unchanged —
the flag only lets the bundler skip modules that aren't in the
dependency graph at all.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
75 lines
1.8 KiB
JSON
75 lines
1.8 KiB
JSON
{
|
|
"name": "@mana/shared-ui",
|
|
"version": "0.1.0",
|
|
"private": true,
|
|
"type": "module",
|
|
"sideEffects": [
|
|
"**/*.svelte",
|
|
"**/*.css"
|
|
],
|
|
"svelte": "./src/index.ts",
|
|
"main": "./src/index.ts",
|
|
"types": "./src/index.ts",
|
|
"exports": {
|
|
".": {
|
|
"svelte": "./src/index.ts",
|
|
"types": "./src/index.ts",
|
|
"default": "./src/index.ts"
|
|
},
|
|
"./atoms": {
|
|
"svelte": "./src/atoms/index.ts",
|
|
"types": "./src/atoms/index.ts",
|
|
"default": "./src/atoms/index.ts"
|
|
},
|
|
"./molecules": {
|
|
"svelte": "./src/molecules/index.ts",
|
|
"types": "./src/molecules/index.ts",
|
|
"default": "./src/molecules/index.ts"
|
|
},
|
|
"./organisms": {
|
|
"svelte": "./src/organisms/index.ts",
|
|
"types": "./src/organisms/index.ts",
|
|
"default": "./src/organisms/index.ts"
|
|
},
|
|
"./dnd": {
|
|
"svelte": "./src/dnd/index.ts",
|
|
"types": "./src/dnd/index.ts",
|
|
"default": "./src/dnd/index.ts"
|
|
},
|
|
"./toast": {
|
|
"svelte": "./src/toast/index.ts",
|
|
"types": "./src/toast/index.ts",
|
|
"default": "./src/toast/index.ts"
|
|
}
|
|
},
|
|
"scripts": {
|
|
"lint": "eslint .",
|
|
"test": "vitest run",
|
|
"test:watch": "vitest"
|
|
},
|
|
"peerDependencies": {
|
|
"svelte": "^5.0.0"
|
|
},
|
|
"dependencies": {
|
|
"@mana/shared-branding": "workspace:*",
|
|
"@mana/shared-icons": "workspace:*",
|
|
"@mana/shared-theme": "workspace:*",
|
|
"@mana/shared-types": "workspace:*",
|
|
"d3-force": "^3.0.0",
|
|
"d3-selection": "^3.0.0",
|
|
"d3-transition": "^3.0.0",
|
|
"d3-zoom": "^3.0.0",
|
|
"date-fns": "^4.1.0"
|
|
},
|
|
"devDependencies": {
|
|
"@sveltejs/vite-plugin-svelte": "^7.0.0",
|
|
"@testing-library/jest-dom": "^6.9.1",
|
|
"@testing-library/svelte": "^5.3.1",
|
|
"@types/d3-force": "^3.0.10",
|
|
"@types/d3-selection": "^3.0.11",
|
|
"@types/d3-transition": "^3.0.9",
|
|
"@types/d3-zoom": "^3.0.8",
|
|
"jsdom": "^29.0.1",
|
|
"vitest": "^4.1.2"
|
|
}
|
|
}
|