Some checks failed
DSS Project Analysis / dss-context-update (push) Has been cancelled
- Add verify=False to httpx.AsyncClient in figma_tools.py - Add verify=False to requests.request in project/figma.py - Replace .storybook/main.ts with main.cjs (CommonJS) to fix ESM loading error - Add package.json with Storybook dependencies 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
59 lines
1.5 KiB
JavaScript
59 lines
1.5 KiB
JavaScript
const path = require('path');
|
|
const fs = require('fs');
|
|
|
|
function getActiveProject() {
|
|
if (process.env.STORYBOOK_PROJECT) {
|
|
return process.env.STORYBOOK_PROJECT;
|
|
}
|
|
const statePath = path.join(__dirname, '../.dss/state.json');
|
|
if (fs.existsSync(statePath)) {
|
|
try {
|
|
const state = JSON.parse(fs.readFileSync(statePath, 'utf-8'));
|
|
if (state.activeProject) {
|
|
return state.activeProject;
|
|
}
|
|
} catch (e) {
|
|
console.warn('Failed to read DSS state, using default project');
|
|
}
|
|
}
|
|
return 'admin-ui';
|
|
}
|
|
|
|
const activeProject = getActiveProject();
|
|
console.log(`[DSS] Active project: ${activeProject}`);
|
|
|
|
/** @type { import('@storybook/preact-vite').StorybookConfig } */
|
|
module.exports = {
|
|
stories: [
|
|
'../packages/dss-ui/stories/**/*.stories.@(js|jsx|ts|tsx)',
|
|
'../packages/dss-ui/stories/**/*.mdx',
|
|
`../${activeProject}/src/**/*.stories.@(js|jsx|ts|tsx)`,
|
|
`../${activeProject}/src/**/*.mdx`,
|
|
],
|
|
addons: [
|
|
'@storybook/addon-docs',
|
|
'@storybook/addon-a11y',
|
|
],
|
|
framework: {
|
|
name: '@storybook/preact-vite',
|
|
options: {},
|
|
},
|
|
docs: {
|
|
autodocs: 'tag',
|
|
},
|
|
viteFinal: async (config) => {
|
|
config.server = config.server || {};
|
|
config.server.allowedHosts = [
|
|
'localhost',
|
|
'storybook.dss.overbits.luz.uy'
|
|
];
|
|
config.server.hmr = false;
|
|
config.resolve = config.resolve || {};
|
|
config.resolve.alias = {
|
|
...config.resolve.alias,
|
|
'@dss/ui': path.join(__dirname, '../packages/dss-ui/src'),
|
|
};
|
|
return config;
|
|
},
|
|
};
|