Skip to content

Commit 9054b08

Browse files
committed
Upgrade UI to use Typescript, Node v20 details below
This is a breakdown that I wrote down on another PR xola#379
1 parent d3c4ec0 commit 9054b08

File tree

397 files changed

+27584
-45332
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

397 files changed

+27584
-45332
lines changed

.storybook/main.js

Lines changed: 31 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,45 @@
11
module.exports = {
2-
stories: ["../src/**/*.stories.@(js|jsx|mdx)"],
2+
// Story files: .jsx/.tsx for components with JSX, .js/.ts for pure JS/TS
3+
stories: ["../src/**/*.stories.@(js|jsx|ts|tsx)"],
4+
5+
// Framework: Vite-based React for Storybook 8
6+
framework: {
7+
name: "@storybook/react-vite",
8+
options: {},
9+
},
10+
311
core: {
412
disableTelemetry: true,
5-
builder: 'webpack5',
613
},
14+
715
addons: [
8-
"@storybook/addon-postcss",
916
"@storybook/addon-links",
10-
"storybook-css-modules-preset",
11-
"storybook-addon-designs",
17+
// "storybook-addon-designs", // Temporarily disabled - incompatible with Storybook 8
1218
{
1319
name: "@storybook/addon-essentials",
1420
options: {
1521
backgrounds: false,
1622
},
1723
},
1824
],
25+
26+
// TypeScript configuration for Storybook
27+
typescript: {
28+
check: false, // We'll use tsc separately for type checking
29+
reactDocgen: false, // Disabled - causes issues with .jsx files
30+
},
31+
32+
// Static files directory
33+
staticDirs: ["../public"],
34+
35+
// Vite configuration
36+
async viteFinal(config) {
37+
// Vite automatically handles:
38+
// - Modern JS syntax
39+
// - JSX in .jsx and .tsx files
40+
// - PostCSS via postcss.config.mjs
41+
// - CSS Modules out of the box
42+
43+
return config;
44+
},
1945
};

.storybook/manager.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { addons } from "@storybook/addons";
1+
import { addons } from "@storybook/manager-api";
22
import xola from "./xola";
33

44
addons.setConfig({

.storybook/preview.js

Lines changed: 0 additions & 26 deletions
This file was deleted.

.storybook/preview.tsx

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
import React from "react";
2+
import type { Preview } from "@storybook/react";
3+
import { Provider } from "../src";
4+
import xola from "./xola";
5+
import "../index.css";
6+
7+
const preview: Preview = {
8+
parameters: {
9+
actions: { argTypesRegex: "^on[A-Z].*" },
10+
docs: {
11+
theme: xola,
12+
},
13+
options: {
14+
storySort: {
15+
method: "alphabetical",
16+
order: ["Introduction", "Components"],
17+
includeName: true,
18+
},
19+
},
20+
},
21+
decorators: [
22+
(Story) => (
23+
<Provider>
24+
<Story />
25+
</Provider>
26+
),
27+
],
28+
};
29+
30+
export default preview;

0 commit comments

Comments
 (0)