Skip to content

Commit

Permalink
feat: add Warehouse page
Browse files Browse the repository at this point in the history
  • Loading branch information
Romakita committed Oct 21, 2024
1 parent a796560 commit dd166ff
Show file tree
Hide file tree
Showing 12 changed files with 33 additions and 33 deletions.
2 changes: 2 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,5 @@ docs/.vitepress/cache
!.storybook
**/snippets/**
packages
**/node_modules
storybook-static
4 changes: 4 additions & 0 deletions docs/.vitepress/config.mts
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,10 @@ export default defineConfig({
}
].sort((a, b) => (a.text < b.text ? -1 : 1))
},
{
text: "Plugins",
link: "./plugins"
},
{
text: "More",
items: [
Expand Down
2 changes: 1 addition & 1 deletion docs/.vitepress/theme/molecules/banner/LightBanner.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<script setup lang="ts">
import {defineProps, ref} from "vue";
import {defineProps} from "vue";
import {withDefaults} from "vue";
interface LightBannerProps {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,7 @@
import type {Meta, StoryObj} from "@storybook/vue3";
import {expect, within} from "@storybook/test";
import CardPackage from "./CardPackage.vue";

function delay() {
return new Promise((resolve) => {
setTimeout(resolve, 1000);
});
}
import {formatNumber} from "../../utils/format";

const meta = {
title: "CardPackage",
Expand Down Expand Up @@ -48,8 +43,8 @@ export const Official: Story = {
await expect(screen.getByText("A TypeScript Framework on top of Express")).toBeInTheDocument();
await expect(screen.queryByText("PREMIUM")).not.toBeInTheDocument();

await expect(screen.getByTestId("downloads-stats")).toHaveTextContent("68 k");
await expect(screen.getByTestId("stars-stats")).toHaveTextContent("2,8 k stars");
await expect(screen.getByTestId("downloads-stats")).toHaveTextContent(formatNumber(68000));
await expect(screen.getByTestId("stars-stats")).toHaveTextContent(formatNumber(2800) + " stars");
await expect(screen.getByTestId("card-avatar")).toHaveAttribute(
"src",
"https://www.gravatar.com/avatar/de3f2df14a0230b7cd6372ed50d93573?s=48&d=mp"
Expand Down Expand Up @@ -84,8 +79,8 @@ export const Premium: Story = {
await expect(screen.getByText("A TypeScript Framework on top of Express")).toBeInTheDocument();
await expect(screen.queryByText("PREMIUM")).toBeInTheDocument();

await expect(screen.getByTestId("downloads-stats")).toHaveTextContent("68 k");
await expect(screen.getByTestId("stars-stats")).toHaveTextContent("2,8 k stars");
await expect(screen.getByTestId("downloads-stats")).toHaveTextContent(formatNumber(68000));
await expect(screen.getByTestId("stars-stats")).toHaveTextContent(formatNumber(2800) + " stars");
await expect(screen.getByTestId("card-avatar")).toHaveAttribute(
"src",
"https://www.gravatar.com/avatar/de3f2df14a0230b7cd6372ed50d93573?s=48&d=mp"
Expand Down Expand Up @@ -120,8 +115,8 @@ export const Community: Story = {
await expect(screen.getByText("A TypeScript Framework on top of Express")).toBeInTheDocument();
await expect(screen.queryByText("PREMIUM")).not.toBeInTheDocument();

await expect(screen.getByTestId("downloads-stats")).toHaveTextContent("68 k");
await expect(screen.getByTestId("stars-stats")).toHaveTextContent("2,8 k stars");
await expect(screen.getByTestId("downloads-stats")).toHaveTextContent(formatNumber(68000));
await expect(screen.getByTestId("stars-stats")).toHaveTextContent(formatNumber(2800) + " stars");
await expect(screen.getByTestId("card-avatar")).toHaveAttribute(
"src",
"https://www.gravatar.com/avatar/de3f2df14a0230b7cd6372ed50d93573?s=48&d=mp"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import type {Meta, StoryObj} from "@storybook/vue3";
import CardStats from "./CardStats.vue";
import {within, expect} from "@storybook/test";
import {formatNumber} from "../../utils/format";

const meta = {
title: "CardStats",
Expand All @@ -25,7 +26,7 @@ export const Default: StoryObj<typeof CardStats> = {
expect(canvas.getByText("7")).toBeInTheDocument();
expect(canvas.getByText("downloads last 30 days")).toBeInTheDocument();

expect(canvas.getByText("20 k")).toBeInTheDocument();
expect(canvas.getByText(formatNumber(20000))).toBeInTheDocument();
},
args: {
items: [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ describe("<ClearableFilter />", () => {

expect(onClear).toHaveBeenCalled();
});
it("should render component with empty keywords and 100 plugins", async () => {
it("should render component with empty keywords and 100 plugins", () => {
const onClear = vi.fn();

render(ClearableFilter, {
Expand Down
6 changes: 0 additions & 6 deletions docs/.vitepress/theme/molecules/filters/FilterBy.stories.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,6 @@ import FilterBy from "./FilterBy.vue";
import {ref, watch} from "vue";
import {within, expect, waitFor, userEvent} from "@storybook/test";

function delay() {
return new Promise((resolve) => {
setTimeout(resolve, 1000);
});
}

const meta = {
title: "FilterBy",
component: FilterBy,
Expand Down
6 changes: 0 additions & 6 deletions docs/.vitepress/theme/molecules/sort-by/SortBy.stories.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,6 @@ import SortBy from "./SortBy.vue";
import {ref, watch} from "vue";
import {expect, userEvent, waitFor, within} from "@storybook/test";

function delay() {
return new Promise((resolve) => {
setTimeout(resolve, 1000);
});
}

const meta = {
title: "SortBy",
component: SortBy,
Expand Down
10 changes: 10 additions & 0 deletions docs/plugins/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
layout: page
meta:
- name: description
content: Discover our list of plugins to extends your Ts.ED project. Created by the Ts.ED team and community.
- name: keywords
content: Ts.ED nodejs express typescript javascript es6 decorators mvc model ioc service model middleware socket.io swagger typeorm mongoose ajv
---

<Warehouse />
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"typescript": "tsc --init",
"test": "vitest run",
"lint": "eslint . --ext .ts,.tsx,.js,.jsx,.vue",
"lint:fix": "eslint . --ext .ts,.tsx,.js,.jsx,.vue --fix && yarn run prettier:fix",
"lint:fix": "yarn lint --fix",
"prettier:fix": "prettier . --write",
"storybook:dev": "storybook dev -p 6006",
"storybook:build": "storybook build",
Expand Down
2 changes: 1 addition & 1 deletion tailwind.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import {tailwindPreset} from "./tailwind.preset.js";
const config = {
presets: [tailwindPreset as unknown as Config],
darkMode: "class",
content: ["./docs/.vitepress/**/*.{js,ts,vue}", "./docs/**/*.md"],
content: ["./docs/.vitepress/**/*.{js,ts,vue}", "./docs/.vitepress/themes/**/*.{js,ts,vue}", "./docs/**/*.md"],
safelist: [
{pattern: /^bg-/},
{pattern: /^text-/},
Expand Down
8 changes: 4 additions & 4 deletions vitest.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ export default defineConfig({
enabled: true,
thresholds: {
autoUpdate: true,
statements: 58.84,
branches: 77.87,
functions: 61.76,
lines: 58.84
statements: 62.23,
branches: 78.28,
functions: 66.66,
lines: 62.23
},
include: ["**/*.{ts,vue}"],
exclude: [
Expand Down

0 comments on commit dd166ff

Please sign in to comment.