forked from mirror/misskey
ci: only show story files
This commit is contained in:
parent
cbbca125a2
commit
f655fc2372
1
packages/frontend/.storybook/.gitignore
vendored
1
packages/frontend/.storybook/.gitignore
vendored
@ -2,5 +2,6 @@
|
|||||||
/generate.js
|
/generate.js
|
||||||
/preload-locale.js
|
/preload-locale.js
|
||||||
/locale.ts
|
/locale.ts
|
||||||
|
/main.js
|
||||||
/preload-theme.js
|
/preload-theme.js
|
||||||
/themes.ts
|
/themes.ts
|
||||||
|
@ -1,23 +1,31 @@
|
|||||||
import fs from "node:fs/promises";
|
import fs from 'node:fs/promises';
|
||||||
import path from "node:path";
|
import path from 'node:path';
|
||||||
import micromatch from "micromatch";
|
import micromatch from 'micromatch';
|
||||||
|
import main from './main';
|
||||||
|
|
||||||
fs.readFile(
|
fs.readFile(
|
||||||
path.resolve(__dirname, "../storybook-static/preview-stats.json")
|
path.resolve(__dirname, '../storybook-static/preview-stats.json')
|
||||||
).then((buffer) => {
|
).then((buffer) => {
|
||||||
const stats = JSON.parse(buffer.toString());
|
const stats = JSON.parse(buffer.toString());
|
||||||
const modules = new Set(
|
const modules = new Set(
|
||||||
process.argv.slice(2).map((arg) => path.relative(path.resolve(__dirname, ".."), path.resolve(__dirname, "../../..", arg)))
|
process.argv
|
||||||
|
.slice(2)
|
||||||
|
.map((arg) =>
|
||||||
|
path.relative(
|
||||||
|
path.resolve(__dirname, '..'),
|
||||||
|
path.resolve(__dirname, '../../..', arg)
|
||||||
|
)
|
||||||
|
)
|
||||||
);
|
);
|
||||||
if (
|
if (
|
||||||
micromatch(Array.from(modules), [
|
micromatch(Array.from(modules), [
|
||||||
"../../assets/**",
|
'../../assets/**',
|
||||||
"../../fluent-emojis/**",
|
'../../fluent-emojis/**',
|
||||||
"../../locales/**",
|
'../../locales/**',
|
||||||
"../../misskey-assets/**",
|
'../../misskey-assets/**',
|
||||||
"assets/**",
|
'assets/**',
|
||||||
"public/**",
|
'public/**',
|
||||||
"../../pnpm-lock.yaml",
|
'../../pnpm-lock.yaml',
|
||||||
]).length
|
]).length
|
||||||
) {
|
) {
|
||||||
return;
|
return;
|
||||||
@ -35,7 +43,11 @@ fs.readFile(
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
for (const file of Array.from(modules)) {
|
const stories = micromatch(
|
||||||
process.stdout.write(` --only-story-files ${path.resolve(__dirname, "..", file)}`);
|
Array.from(modules),
|
||||||
|
main.stories.map((story) => path.resolve(__dirname, story))
|
||||||
|
);
|
||||||
|
for (const story of stories) {
|
||||||
|
process.stdout.write(` --only-story-files ${story}`);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -21,7 +21,7 @@ const config = {
|
|||||||
core: {
|
core: {
|
||||||
disableTelemetry: true,
|
disableTelemetry: true,
|
||||||
},
|
},
|
||||||
async viteFinal(config, options) {
|
async viteFinal(config) {
|
||||||
return mergeConfig(config, {
|
return mergeConfig(config, {
|
||||||
plugins: [
|
plugins: [
|
||||||
turbosnap({
|
turbosnap({
|
||||||
|
Loading…
Reference in New Issue
Block a user