fix(storybook): manager.tsx imports relatively (esbuild manager has no aliases)

The prior change aliased manager.tsx to @core, but Storybook's manager bundle
(esbuild) doesn't resolve aliases — only the preview/Vite bundle does — so the
storybook build failed. Revert manager.tsx to a relative import and scope a
one-file no-restricted-imports exemption to .storybook/manager.tsx (the only
file that genuinely can't use an alias). preview.tsx keeps @public (Vite-built).

Verified: eslint clean + storybook build succeeds.
This commit is contained in:
EthanHealy01
2026-07-14 13:35:20 +01:00
parent 86378dbc64
commit bedf797f46
2 changed files with 10 additions and 1 deletions
+1 -1
View File
@@ -11,7 +11,7 @@ import { IconButton, WithTooltip } from "storybook/internal/components";
import {
THEME_ACCENT_PRESETS as PRESETS,
DEFAULT_ACCENT_COLOR,
} from "@core/constants/theme";
} from "../editor/src/core/constants/theme";
function AccentPicker() {
const [globals, updateGlobals] = useGlobals();
+9
View File
@@ -324,4 +324,13 @@ export default defineConfig(
},
},
},
// Storybook's MANAGER is bundled by esbuild with no alias resolution (only the
// preview/Vite bundle resolves @app/@core/etc). manager.tsx must therefore
// import editor code relatively — an alias would fail the manager build.
{
files: [".storybook/manager.tsx"],
rules: {
"no-restricted-imports": "off",
},
},
);