Skip to content

Commit

Permalink
chore(storybook): init
Browse files Browse the repository at this point in the history
init
  • Loading branch information
snomiao committed Jul 3, 2024
1 parent 9ad257e commit 30c3a53
Show file tree
Hide file tree
Showing 5 changed files with 37 additions and 19 deletions.
9 changes: 9 additions & 0 deletions .storybook/main.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import { StorybookConfig } from '@storybook/react-vite';

const config: StorybookConfig = {
// ...
// framework: '@storybook/react-webpack5', 👈 Remove this
framework: '@storybook/react-vite', // 👈 Add this
};

export default config;
2 changes: 2 additions & 0 deletions app/(dashboard)/PullsStatusTable.stories.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@

export const PullsStatusTable = ()=><PullsStatusTable name='random'>
Binary file modified bun.lockb
Binary file not shown.
3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
"@monaco-editor/react": "^4.6.0",
"@slack/web-api": "^7.2.0",
"@snomiao/die": "^1.1.0",
"@storybook/builder-vite": "^8.1.11",
"@trpc/server": "^10.45.2",
"@types/d3": "^7.4.3",
"@types/file-saver": "^2.0.7",
Expand Down Expand Up @@ -65,6 +66,7 @@
"react-hook-form": "^7.52.0",
"react-markdown": "^9.0.1",
"snoflow": "^1.6.0",
"storybook": "^8.1.11",
"toml": "^3.0.0",
"trpc-openapi": "^1.2.0",
"ts-pattern": "^5.2.0",
Expand All @@ -74,6 +76,7 @@
"zx": "^8.1.3"
},
"devDependencies": {
"@storybook/cli": "^8.1.11",
"@types/bun": "^1.1.5",
"@types/js-yaml": "^4.0.9",
"@types/json-stable-stringify": "^1.0.36",
Expand Down
42 changes: 23 additions & 19 deletions src/analyzePullsStatus.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,7 @@ if (import.meta.main) {
// console.log("done");
// generate zod schema
// await writeFile("src/zPullsStatus.ts", jsonToZod(await analyzePullsStatus({ limit: 1 }), "zPullsStatus", true));

// analyzePullsStatusPipeline
// analyzePullsStatusPipeline

await snoflow(analyzePullsStatusPipeline().aggregate())
// .filter(e=>e.email)
Expand Down Expand Up @@ -94,7 +93,22 @@ export function analyzePullsStatusPipeline() {
.set({ updated_at: { $toDate: "$updated_at" } })
.set({ latest_comment_at: { $toDate: "$latest_comment_at" } })
.set({ updated_at: { $max: ["$latest_comment_at", "$updated_at"] } })


// concat comment authors with space, to confirm whos reacting in this pr
.set({
comments_author: {
$trim: {
input: {
$reduce: {
input: "$comments.user.login",
initialValue: "",
in: { $concat: ["$$value", " ", "$$this"] },
},
},
chars: " ",
},
},
})
// projecting
.project({
created_at: 1,
Expand All @@ -112,21 +126,10 @@ export function analyzePullsStatusPipeline() {
nickName: "$base.user.name",
head: { $concat: ["$user.login", ":", "$type"] },
comments: { $size: "$comments" },
comments_author: {
$trim: {
input: {
$reduce: {
input: "$comments.user.login",
initialValue: "",
in: { $concat: ["$$value", " ", "$$this"] },
},
},
chars: " ",
},
},
comments_author: 1,
lastwords: 1,
actived_at: 1,
email: {$ifNull: ["$author.email", '']},
email: { $ifNull: ["$author.email", ""] },
})
// .project({ latest_comment_at: {$toDate: '$latest_comment_at'} })
.project({ latest_comment_at: 0 })
Expand All @@ -140,20 +143,21 @@ export function analyzePullsStatusPipeline() {
.unset(["CLOSED", "MERGED", "OPEN"])
.as<{
actived_at: Date;
email: string | '';
comments_author: string;
comments: number;
created_at: Date;
email: string | "";
head: string;
lastwords: string;
nickName: string;
on_registry_at: Date;
on_registry: boolean;
comments_author: string;
ownername: string;
nickName: string;
repository: string;
state: "OPEN" | "MERGED" | "CLOSED";
updated_at: Date;
url: string;
}>()
);
}
z

0 comments on commit 30c3a53

Please sign in to comment.