ci(#10336): stabilize

This commit is contained in:
Acid Chicken (硫酸鶏) 2023-04-02 14:59:19 +09:00
parent 9982ead9e6
commit 388ecfb1ea
No known key found for this signature in database
GPG key ID: 3E87B98A3F6BAB99
8 changed files with 68 additions and 9 deletions

View file

@ -35,6 +35,10 @@ jobs:
run: pnpm --filter frontend build-storybook run: pnpm --filter frontend build-storybook
env: env:
NODE_OPTIONS: "--max_old_space_size=7168" NODE_OPTIONS: "--max_old_space_size=7168"
- name: Publish to Chromatic
run: "pnpm --filter frontend chromatic -d storybook-static || :"
env:
CHROMATIC_PROJECT_TOKEN: ${{ secrets.CHROMATIC_PROJECT_TOKEN }}
- name: Upload Artifacts - name: Upload Artifacts
uses: actions/upload-artifact@v3 uses: actions/upload-artifact@v3
with: with:

View file

@ -3,7 +3,7 @@ import type { entities } from 'misskey-js'
export const userDetailed = { export const userDetailed = {
id: 'someuserid', id: 'someuserid',
username: 'miskist', username: 'miskist',
host: null, host: 'misskey-hub.net',
name: 'Misskey User', name: 'Misskey User',
onlineStatus: 'unknown', onlineStatus: 'unknown',
avatarUrl: 'https://github.com/misskey-dev/misskey/blob/master/packages/frontend/assets/about-icon.png?raw=true', avatarUrl: 'https://github.com/misskey-dev/misskey/blob/master/packages/frontend/assets/about-icon.png?raw=true',

View file

@ -6,6 +6,7 @@
"build": "vite build", "build": "vite build",
"storybook-dev": "chokidar 'src/**/*.{mdx,ts,vue}' -d 1000 -t 1000 --initial -i '**/*.stories.ts' -c 'pkill -f node_modules/storybook/index.js; node_modules/.bin/tsc -p .storybook && node .storybook/generate.js && node .storybook/preload-locale.js && node .storybook/preload-theme.js && node_modules/.bin/storybook dev -p 6006 --ci'", "storybook-dev": "chokidar 'src/**/*.{mdx,ts,vue}' -d 1000 -t 1000 --initial -i '**/*.stories.ts' -c 'pkill -f node_modules/storybook/index.js; node_modules/.bin/tsc -p .storybook && node .storybook/generate.js && node .storybook/preload-locale.js && node .storybook/preload-theme.js && node_modules/.bin/storybook dev -p 6006 --ci'",
"build-storybook": "node_modules/.bin/tsc -p .storybook && node .storybook/generate.js && node .storybook/preload-locale.js && node .storybook/preload-theme.js && node_modules/.bin/storybook build", "build-storybook": "node_modules/.bin/tsc -p .storybook && node .storybook/generate.js && node .storybook/preload-locale.js && node .storybook/preload-theme.js && node_modules/.bin/storybook build",
"chromatic": "chromatic",
"test": "vitest --run", "test": "vitest --run",
"test-and-coverage": "vitest --run --coverage", "test-and-coverage": "vitest --run --coverage",
"typecheck": "vue-tsc --noEmit", "typecheck": "vue-tsc --noEmit",

View file

@ -24,7 +24,10 @@ export const Default = {
}; };
}, },
args: { args: {
user: userDetailed, user: {
...userDetailed,
host: null,
},
}, },
parameters: { parameters: {
layout: 'centered', layout: 'centered',
@ -34,6 +37,7 @@ export const Detail = {
...Default, ...Default,
args: { args: {
...Default.args, ...Default.args,
user: userDetailed,
detail: true, detail: true,
}, },
} satisfies StoryObj<typeof MkAcct>; } satisfies StoryObj<typeof MkAcct>;

View file

@ -44,9 +44,6 @@ export const ProfilePage = {
indicator: true, indicator: true,
}, },
} satisfies StoryObj<typeof MkAvatar>; } satisfies StoryObj<typeof MkAvatar>;
/* Your story couldnt be captured because it exceeds our 25,000,000px limit. Its dimensions are 5,504,893x5,504,892px. Possible ways to resolve:
* * Separate pages into components
* * Minimize the number of very large elements in a story
export const ProfilePageCat = { export const ProfilePageCat = {
...ProfilePage, ...ProfilePage,
args: { args: {
@ -56,5 +53,13 @@ export const ProfilePageCat = {
isCat: true, isCat: true,
}, },
}, },
parameters: {
chromatic: {
/* Your story couldnt be captured because it exceeds our 25,000,000px limit. Its dimensions are 5,504,893x5,504,892px. Possible ways to resolve:
* * Separate pages into components
* * Minimize the number of very large elements in a story
*/
disableSnapshot: true,
},
},
} satisfies StoryObj<typeof MkAvatar>; } satisfies StoryObj<typeof MkAvatar>;
*/

View file

@ -0,0 +1,32 @@
/* eslint-disable @typescript-eslint/explicit-function-return-type */
import { StoryObj } from '@storybook/vue3';
import isChromatic from 'chromatic/isChromatic';
import MkEllipsis from './MkEllipsis.vue';
export const Default = {
render(args) {
return {
components: {
MkEllipsis,
},
setup() {
return {
args,
};
},
computed: {
props() {
return {
...this.args,
};
},
},
template: '<MkEllipsis v-bind="props" />',
};
},
args: {
static: isChromatic,
},
parameters: {
layout: 'centered',
},
} satisfies StoryObj<typeof MkEllipsis>;

View file

@ -1,9 +1,19 @@
<template> <template>
<span :class="$style.root"> <span :class="[$style.root, { [$style.static]: static }]">
<span :class="$style.dot">.</span><span :class="$style.dot">.</span><span :class="$style.dot">.</span> <span :class="$style.dot">.</span><span :class="$style.dot">.</span><span :class="$style.dot">.</span>
</span> </span>
</template> </template>
<script lang="ts" setup>
import { } from 'vue';
const props = withDefaults(defineProps<{
static?: boolean;
}>(), {
static: false,
});
</script>
<style lang="scss" module> <style lang="scss" module>
@keyframes ellipsis { @keyframes ellipsis {
0%, 80%, 100% { 0%, 80%, 100% {
@ -15,7 +25,9 @@
} }
.root { .root {
&.static > .dot {
animation-play-state: paused;
}
} }
.dot { .dot {

View file

@ -1,5 +1,6 @@
/* eslint-disable @typescript-eslint/explicit-function-return-type */ /* eslint-disable @typescript-eslint/explicit-function-return-type */
import { StoryObj } from '@storybook/vue3'; import { StoryObj } from '@storybook/vue3';
import isChromatic from 'chromatic/isChromatic';
import MkLoading from './MkLoading.vue'; import MkLoading from './MkLoading.vue';
export const Default = { export const Default = {
render(args) { render(args) {
@ -23,7 +24,7 @@ export const Default = {
}; };
}, },
args: { args: {
static: true, static: isChromatic,
}, },
parameters: { parameters: {
layout: 'centered', layout: 'centered',