Skip to content

Commit

Permalink
fix: Fix linting issues
Browse files Browse the repository at this point in the history
  • Loading branch information
chanbakjsd committed Apr 3, 2024
1 parent 365c28c commit 1bd3e49
Show file tree
Hide file tree
Showing 16 changed files with 70 additions and 82 deletions.
47 changes: 24 additions & 23 deletions .github/workflows/cd-staging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,29 +6,30 @@ on:
workflow_dispatch:

jobs:
build-cms:
name: Build CMS Docker Image
runs-on: ubuntu-22.04
steps:
- name: Checkout repo
uses: actions/checkout@v3

- name: Login to GitHub Container Registry
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build and push
uses: docker/build-push-action@v2
with:
file: ./apps/cms/docker/staging/Dockerfile
context: .
push: true
tags: |
ghcr.io/${{ github.repository_owner }}/website/cms:${{ github.sha }}
ghcr.io/${{ github.repository_owner }}/website/cms:latest
# TODO: CMS build is currently broken.
# build-cms:
# name: Build CMS Docker Image
# runs-on: ubuntu-22.04
# steps:
# - name: Checkout repo
# uses: actions/checkout@v3

# - name: Login to GitHub Container Registry
# uses: docker/login-action@v1
# with:
# registry: ghcr.io
# username: ${{ github.repository_owner }}
# password: ${{ secrets.GITHUB_TOKEN }}

# - name: Build and push
# uses: docker/build-push-action@v2
# with:
# file: ./apps/cms/docker/staging/Dockerfile
# context: .
# push: true
# tags: |
# ghcr.io/${{ github.repository_owner }}/website/cms:${{ github.sha }}
# ghcr.io/${{ github.repository_owner }}/website/cms:latest

build-merch:
name: Build Merch Docker Image
Expand Down
9 changes: 5 additions & 4 deletions apps/cms/docker/staging/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM node:16-alpine AS builder
FROM node:18-alpine AS builder

RUN apk add --no-cache libc6-compat
RUN apk update
Expand All @@ -11,7 +11,7 @@ RUN rm -rf **/node_modules **/build **/dist **/out **/.turbo
RUN rm -rf **/.env
RUN turbo prune --scope=cms --docker

FROM node:16-alpine AS installer
FROM node:18-alpine AS installer
# Add lockfile and package.json's of isolated subworkspace
RUN apk add --no-cache libc6-compat
RUN apk update
Expand All @@ -21,14 +21,15 @@ WORKDIR /app
COPY .gitignore .gitignore
COPY --from=builder /app/out/json/ .
COPY --from=builder /app/out/yarn.lock ./yarn.lock
RUN yarn install
RUN yarn --version
RUN yarn install --verbose

# Build the project and its dependencies
COPY --from=builder /app/out/full/ .
COPY turbo.json turbo.json
RUN yarn turbo run build --filter=cms...

FROM node:16-alpine AS runner
FROM node:18-alpine AS runner

WORKDIR /app

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
"turbo": "^1.12.5"
},
"engines": {
"node": ">=16.0.0",
"node": ">=18.0.0",
"npm": "please-use-yarn",
"yarn": ">= 1.22.17",
"pnpm": "please-use-yarn"
Expand Down
8 changes: 3 additions & 5 deletions packages/ui/components/blog-card/BlogCard.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,20 +1,18 @@
import React from "react";
import { ComponentStory, ComponentMeta } from "@storybook/react";
import { type Meta, type StoryFn } from "@storybook/react";
import { BlogCard } from "./BlogCard";

export default {
title: "Components/BlogCard",
component: BlogCard,
argTypes: {},
} as ComponentMeta<typeof BlogCard>;
} as Meta<typeof BlogCard>;

const Template: ComponentStory<typeof BlogCard> = (args) => (
const Template: StoryFn<typeof BlogCard> = (args) => (
<BlogCard {...args} />
);

export const Default = Template.bind({});
Default.args = {
link: "/#",
blogCardImageProps: {
src: "https://images.unsplash.com/photo-1515378791036-0648a3ef77b2?ixid=MXwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHw%3D&ixlib=rb-1.2.1&auto=format&fit=crop&w=1350&q=80",
alt: "unsplash image",
Expand Down
7 changes: 3 additions & 4 deletions packages/ui/components/button/ButtonLink.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import React from "react";
import { ComponentStory, ComponentMeta } from "@storybook/react";
import { type Meta, type StoryFn } from "@storybook/react";

import { ButtonLink } from "./ButtonLink";

Expand All @@ -8,9 +7,9 @@ export default {
component: ButtonLink,
// More on argTypes: https://storybook.js.org/docs/react/api/argtypes
argTypes: {},
} as ComponentMeta<typeof ButtonLink>;
} as Meta<typeof ButtonLink>;

const Template: ComponentStory<typeof ButtonLink> = (args) => <ButtonLink {...args} />;
const Template: StoryFn<typeof ButtonLink> = (args) => <ButtonLink {...args} />;

export const PrimaryBlue = Template.bind({});
PrimaryBlue.args = {
Expand Down
7 changes: 3 additions & 4 deletions packages/ui/components/carousel/Carousel.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
import React from "react";
import { ComponentStory, ComponentMeta } from "@storybook/react";
import { type Meta, type StoryFn } from "@storybook/react";
import { Carousel } from "./Carousel";

export default {
title: "Components/Carousel",
component: Carousel,
argTypes: {},
} as ComponentMeta<typeof Carousel>;
} as Meta<typeof Carousel>;

const Template: ComponentStory<typeof Carousel> = (args) => (
const Template: StoryFn<typeof Carousel> = (args) => (
<Carousel {...args} />
);
export const Primary = Template.bind({});
Expand Down
7 changes: 3 additions & 4 deletions packages/ui/components/faq/Faq.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
import React from "react";
import { ComponentStory, ComponentMeta } from "@storybook/react";
import { type Meta, type StoryFn } from "@storybook/react";
import { Faq } from "./Faq";

export default {
title: "Components/Faq",
component: Faq,
argTypes: {},
} as ComponentMeta<typeof Faq>;
} as Meta<typeof Faq>;

const Template: ComponentStory<typeof Faq> = (args) => <Faq {...args} />;
const Template: StoryFn<typeof Faq> = (args) => <Faq {...args} />;

export const Primary = Template.bind({});
Primary.args = {
Expand Down
7 changes: 3 additions & 4 deletions packages/ui/components/footer/Footer.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import React from "react";
import { ComponentStory, ComponentMeta } from "@storybook/react";
import { type Meta, type StoryFn } from "@storybook/react";

import { Footer } from "./Footer";
import { FaGithub, FaInstagram, FaLinkedin } from "react-icons/fa";
Expand All @@ -8,9 +7,9 @@ export default {
title: "Components/Footer",
component: Footer,
argTypes: {},
} as ComponentMeta<typeof Footer>;
} as Meta<typeof Footer>;

const Template: ComponentStory<typeof Footer> = (args) => <Footer {...args} />;
const Template: StoryFn<typeof Footer> = (args) => <Footer {...args} />;

export const Basic = Template.bind({});
Basic.args = {
Expand Down
1 change: 0 additions & 1 deletion packages/ui/components/footer/Footer.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { Flex, VStack, Box, Text, Stack, Link, Icon } from "@chakra-ui/react";
import { FooterLinkGroup, FooterLinkGroupProps } from "./FooterLink";
import { Image, VercelPowered, VercelPoweredProps } from "ui";
import React from "react";
import { LogoProps } from "../navbar/Logo";

export interface FooterProps {
Expand Down
11 changes: 5 additions & 6 deletions packages/ui/components/hero/Hero.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
import React from "react";
import { ComponentStory, ComponentMeta } from "@storybook/react";
import { type Meta, type StoryFn } from "@storybook/react";
import { Hero } from "./Hero";

export default {
title: "Components/Hero",
component: Hero,
argTypes: {},
} as ComponentMeta<typeof Hero>;
} as Meta<typeof Hero>;

const Template: ComponentStory<typeof Hero> = (args) => <Hero {...args} />;
const Template: StoryFn<typeof Hero> = (args) => <Hero {...args} />;

export const Default = Template.bind({});
Default.args = {
Expand All @@ -20,13 +19,13 @@ Default.args = {
{
label: "LEARN MORE",
href: "/learn",
buttonType: "primary.blue",
variant: "primary-blue",
size: "lg",
},
{
label: "CONTACT US",
href: "/contact",
buttonType: "primary.black",
variant: "primary-black",
size: "lg",
},
],
Expand Down
7 changes: 3 additions & 4 deletions packages/ui/components/map/Map.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
import React from "react";
import { ComponentStory, ComponentMeta } from "@storybook/react";
import { type Meta, type StoryFn } from "@storybook/react";

import { Map } from "./Map";

export default {
title: "Components/Map",
component: Map,
argTypes: {},
} as ComponentMeta<typeof Map>;
} as Meta<typeof Map>;

const Template: ComponentStory<typeof Map> = (args) => <Map {...args} />;
const Template: StoryFn<typeof Map> = (args) => <Map {...args} />;

export const Primary = Template.bind({});
Primary.args = {
Expand Down
7 changes: 3 additions & 4 deletions packages/ui/components/navbar/NavBar.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
import React from "react";
import { ComponentStory, ComponentMeta } from "@storybook/react";
import { type Meta, type StoryFn } from "@storybook/react";
import { NavBar } from "./NavBar";

export default {
title: "Components/NavBar",
component: NavBar,
argTypes: {},
} as ComponentMeta<typeof NavBar>;
} as Meta<typeof NavBar>;

const Template: ComponentStory<typeof NavBar> = (args) => <NavBar {...args} />;
const Template: StoryFn<typeof NavBar> = (args) => <NavBar {...args} />;

export const Default = Template.bind({});
Default.args = {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
import React from "react";
import { ComponentStory, ComponentMeta } from "@storybook/react";
import { type Meta, type StoryFn } from "@storybook/react";

import { VercelPowered } from "./VercelPowered";

export default {
title: "Components/VercelPowered",
component: VercelPowered,
argTypes: {},
} as ComponentMeta<typeof VercelPowered>;
} as Meta<typeof VercelPowered>;

const Template: ComponentStory<typeof VercelPowered> = (args) => (
const Template: StoryFn<typeof VercelPowered> = (args) => (
<VercelPowered {...args} />
);

Expand Down
7 changes: 3 additions & 4 deletions packages/ui/stories/example/Button.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import React from "react";
import { ComponentStory, ComponentMeta } from "@storybook/react";
import { type Meta, type StoryFn } from "@storybook/react";

import { Button } from "./Button";

Expand All @@ -11,10 +10,10 @@ export default {
argTypes: {
backgroundColor: { control: "color" },
},
} as ComponentMeta<typeof Button>;
} as Meta<typeof Button>;

// More on component templates: https://storybook.js.org/docs/react/writing-stories/introduction#using-args
const Template: ComponentStory<typeof Button> = (args) => <Button {...args} />;
const Template: StoryFn<typeof Button> = (args) => <Button {...args} />;

export const Primary = Template.bind({});
// More on args: https://storybook.js.org/docs/react/writing-stories/args
Expand Down
7 changes: 3 additions & 4 deletions packages/ui/stories/example/Header.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import React from "react";
import { ComponentStory, ComponentMeta } from "@storybook/react";
import { type Meta, type StoryFn } from "@storybook/react";

import { Header } from "./Header";

Expand All @@ -10,9 +9,9 @@ export default {
// More on Story layout: https://storybook.js.org/docs/react/configure/story-layout
layout: "fullscreen",
},
} as ComponentMeta<typeof Header>;
} as Meta<typeof Header>;

const Template: ComponentStory<typeof Header> = (args) => <Header {...args} />;
const Template: StoryFn<typeof Header> = (args) => <Header {...args} />;

export const LoggedIn = Template.bind({});
LoggedIn.args = {
Expand Down
11 changes: 5 additions & 6 deletions packages/ui/stories/example/Page.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import React from "react";
import { ComponentStory, ComponentMeta } from "@storybook/react";
import { type Meta, type StoryFn } from "@storybook/react";
import { within, userEvent } from "@storybook/testing-library";
import { Page } from "./Page";

Expand All @@ -10,17 +9,17 @@ export default {
// More on Story layout: https://storybook.js.org/docs/react/configure/story-layout
layout: "fullscreen",
},
} as ComponentMeta<typeof Page>;
} as Meta<typeof Page>;

const Template: ComponentStory<typeof Page> = (args) => <Page {...args} />;
const Template: StoryFn<typeof Page> = (args) => <Page {...args} />;

export const LoggedOut = Template.bind({});

export const LoggedIn = Template.bind({});

// More on interaction testing: https://storybook.js.org/docs/react/writing-tests/interaction-testing
LoggedIn.play = async ({ canvasElement }) => {
const canvas = await within(canvasElement);
const loginButton = await canvas.getByRole("button", { name: /Log in/i });
const canvas = within(canvasElement);
const loginButton = canvas.getByRole("button", { name: /Log in/i });
await userEvent.click(loginButton);
};

0 comments on commit 1bd3e49

Please sign in to comment.