mirror of
https://github.com/misskey-dev/misskey.git
synced 2024-12-26 14:50:20 +01:00
chore: detect changes manually
This commit is contained in:
parent
b027170d75
commit
a46176c56d
3 changed files with 33 additions and 18 deletions
20
.github/workflows/storybook.yml
vendored
20
.github/workflows/storybook.yml
vendored
|
@ -36,23 +36,9 @@ jobs:
|
|||
- name: Build storybook
|
||||
run: pnpm --filter frontend build-storybook
|
||||
- name: Publish to Chromatic
|
||||
id: chromatic
|
||||
uses: chromaui/action@v1
|
||||
with:
|
||||
debug: true
|
||||
exitOnceUploaded: true
|
||||
externals: |
|
||||
- "assets/**"
|
||||
- "fluent-emojis/**"
|
||||
- "locales/**"
|
||||
- "misskey-assets/**"
|
||||
- "packages/frontend/assets/**"
|
||||
- "packages/frontend/public/**"
|
||||
- "pnpm-lock.yaml"
|
||||
onlyChanged: "!(master)"
|
||||
projectToken: ${{ secrets.CHROMATIC_PROJECT_TOKEN }}
|
||||
workingDir: packages/frontend
|
||||
traceChanged: extended
|
||||
run: pnpm --filter frontend chromatic --exit-once-uploaded --externals "assets/**" --externals "fluent-emojis/**" --externals "locales/**" --externals "misskey-assets/**" --externals "packages/frontend/assets/**" --externals "packages/frontend/public/**" --externals "pnpm-lock.yaml" --only-changed "!(master)" $(node packages/frontend/.storybook/changes.js $(git diff-tree --no-commit-id --name-only -r HEAD | xargs))
|
||||
env:
|
||||
CHROMATIC_PROJECT_TOKEN: ${{ secrets.CHROMATIC_PROJECT_TOKEN }}
|
||||
- name: Upload Artifacts
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
|
|
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"
|
||||
]
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue