chore: detect changes manually
This commit is contained in:
24
packages/frontend/.storybook/changes.ts
Normal file
24
packages/frontend/.storybook/changes.ts
Normal file
@@ -0,0 +1,24 @@
|
||||
import fs from 'node:fs/promises';
|
||||
import path from 'node:path';
|
||||
|
||||
fs.readFile(path.resolve(__dirname, '../storybook-static/preview-stats.json'))
|
||||
.then((buffer) => {
|
||||
const stats = JSON.parse(buffer.toString());
|
||||
const modules = new Set(process.argv.slice(2).map((arg) => path.resolve(__dirname, '..', arg)));
|
||||
for (;;) {
|
||||
const oldSize = modules.size;
|
||||
for (const module of Array.from(modules)) {
|
||||
if (stats.modules[module]) {
|
||||
for (const reason of stats.modules[module].reasons) {
|
||||
modules.add(reason.moduleName);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (modules.size === oldSize) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
for (const file of Array.from(modules)) {
|
||||
process.stdout.write(`--only-story-files ${file}`);
|
||||
}
|
||||
})
|
@@ -18,5 +18,10 @@
|
||||
"jsx": "react",
|
||||
"jsxFactory": "h"
|
||||
},
|
||||
"files": ["./generate.tsx", "./preload-locale.ts", "./preload-theme.ts"]
|
||||
"files": [
|
||||
"./changes.ts",
|
||||
"./generate.tsx",
|
||||
"./preload-locale.ts",
|
||||
"./preload-theme.ts"
|
||||
]
|
||||
}
|
||||
|
Reference in New Issue
Block a user