Skip to content

Commit

Permalink
build with tsc (#65)
Browse files Browse the repository at this point in the history
* build with tsc

* rename CIs
  • Loading branch information
Thykof authored May 10, 2023
1 parent cf14767 commit dfbabd5
Show file tree
Hide file tree
Showing 7 changed files with 26 additions and 9 deletions.
19 changes: 18 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,27 @@
name: Tests
name: Build

on:
push:
workflow_call:

jobs:
build:
runs-on: ubuntu-latest

strategy:
matrix:
node-version: [16.x, 18.x]

steps:
- uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: "npm"
- run: npm ci
- run: npm run build

build-storybook:
runs-on: ubuntu-latest

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Tests
name: Lint & format

on:
push:
Expand Down
1 change: 1 addition & 0 deletions .husky/pre-push
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@
. "$(dirname "$0")/_/husky.sh"

npm run test
npm run build
3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@
"main": "src/index.ts",
"style": "src/global.css",
"scripts": {
"dev": "vite",
"preview": "vite preview",
"build": "tsc",
"storybook": "storybook dev -p 6006",
"storybook:build": "storybook build",
"lint": "eslint .",
Expand Down
2 changes: 1 addition & 1 deletion src/components/Colors/Color/Color.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { ComponentPropsWithoutRef } from "react";
import { ComponentPropsWithoutRef } from "react";

export interface ColorRectangleProps extends ComponentPropsWithoutRef<"div"> {
theme: string;
Expand Down
4 changes: 2 additions & 2 deletions src/components/Input/Input.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { useState, ComponentPropsWithoutRef } from "react";
import { useState, ComponentPropsWithoutRef, ChangeEvent } from "react";

export interface InputProps extends ComponentPropsWithoutRef<"input"> {
placeholder?: string | undefined;
Expand All @@ -14,7 +14,7 @@ export function Input(props: InputProps) {
const warningClass = warning ? "border-s-warning" : "";
const messageClass = errorClass || warningClass;

function handleOnChange(e) {
function handleOnChange(e: ChangeEvent<HTMLInputElement>) {
setField(e.target.value);
}

Expand Down
4 changes: 2 additions & 2 deletions src/components/Password/Password.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { useState, ComponentPropsWithoutRef } from "react";
import { useState, ComponentPropsWithoutRef, ChangeEvent } from "react";
import { FiEyeOff, FiEye } from "react-icons/fi";

export interface PasswordProps extends ComponentPropsWithoutRef<"input"> {
Expand Down Expand Up @@ -31,7 +31,7 @@ export function Password(props: PasswordProps) {
const [{ type, icon }, setType] = useState(close);
const [password, setPassword] = useState("");

function handleOnChange(e) {
function handleOnChange(e: ChangeEvent<HTMLInputElement>) {
setPassword(e.target.value);
}

Expand Down

0 comments on commit dfbabd5

Please sign in to comment.