Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
7e27063
Merge branch 'master' into develop
Sep 3, 2024
ce82664
chore: update package dependencies and versions
ax-sh Sep 12, 2024
aa0707c
refactor: change type from any to unknown in onSubmit
ax-sh Sep 12, 2024
8a28f53
chore: update package dependencies to latest versions
ax-sh Sep 30, 2024
6c6ceea
chore(package.json): rename dev script and update command
ax-sh Sep 30, 2024
efb5076
chore: update biome schema and add format script
ax-sh Sep 30, 2024
622c0f6
chore: update lint script and add new dependency
ax-sh Sep 30, 2024
931bce9
chore: add @hookform/error-message dependency
ax-sh Sep 30, 2024
b1a21ef
feat: add TypeScript ignore comment for Obfuscate usage
ax-sh Sep 30, 2024
8aed330
refactor: Rename contactFormFields to ContactFormFields
ax-sh Sep 30, 2024
8c71ebd
chore: update release hooks and ESLint config formatting
ax-sh Sep 30, 2024
e0b2ae6
build(deps): bump next from 14.2.5 to 14.2.10 (#33)
dependabot[bot] Sep 30, 2024
cf02c51
refactor(contact): specify name type for ErrorMessage component
ax-sh Sep 30, 2024
c93040c
chore: update dependencies and add knip script
ax-sh Oct 13, 2024
51d3f96
chore: update package versions in package.json
ax-sh Oct 13, 2024
860ee81
ci: add initial CI workflow configuration
ax-sh Oct 13, 2024
7a21098
ci: add local CI command for spelling checks
ax-sh Oct 13, 2024
ae6dc95
feat: add manifest for portfolio app
ax-sh Oct 13, 2024
0e7d3b5
chore: update CI configuration and script names
ax-sh Oct 13, 2024
4b61579
build: add git-cliff dependency to package.json
ax-sh Oct 13, 2024
b4fe590
chore: update release hooks in configuration file
ax-sh Oct 13, 2024
0403bb6
style: Fix formatting inconsistencies in code files
ax-sh Oct 13, 2024
48d1d5c
build: add changelog command to package.json
ax-sh Oct 13, 2024
eecd56a
build: add new GitHub command for PR creation
ax-sh Oct 13, 2024
139c4ab
chore: add new command for pull request creation
ax-sh Oct 13, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
name: CI

on: pull_request
#on: [pull_request, push]

jobs:
show:
runs-on: ubuntu-latest
steps:
- name: Show Env
# run: echo "Env ${{ env.ENV_ID }}
run: echo "Env for ci website pr"
5 changes: 3 additions & 2 deletions .release-it.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
module.exports = {
hooks: {
"before:init": "nr test run",
"before:init": ["nr test run"],
"before:beforeBump": [
"git flow release start v${version}",
"echo \uD83D\uDC4A before:bump version=v${version} latestVersion=v${latestVersion}"
],
"after:bump": [
"pnpx auto-changelog -p && git add CHANGELOG.md",
"nr git-cliff -o CHANGELOG.md && git add CHANGELOG.md",
'git commit --allow-empty -am "ci: update CHANGELOG"',
"echo \uD83D\uDC4A after:bump version=v${version} latestVersion=v${latestVersion}"
],
"after:release": [
Expand Down
4 changes: 2 additions & 2 deletions biome.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"$schema": "https://biomejs.dev/schemas/1.5.1/schema.json",
"$schema": "https://biomejs.dev/schemas/1.9.2/schema.json",
"files": {
"ignore": [".next", "./**/*config.js", "./**/*.d.ts"],
"ignoreUnknown": true
Expand Down Expand Up @@ -29,7 +29,7 @@
"formatter": {
"jsxQuoteStyle": "single",
"quoteProperties": "asNeeded",
"trailingComma": "none",
"trailingCommas": "none",
"semicolons": "always",
"arrowParentheses": "always",
"bracketSpacing": true,
Expand Down
Binary file modified bun.lockb
Binary file not shown.
119 changes: 65 additions & 54 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,18 @@
"version": "1.14.0",
"private": true,
"scripts": {
"dev": "next dev",
"dev:turbo": "next dev --turbo",
"dev:old": "next dev",
"format": "biome format --write",
"dev": "next dev --turbo",
"bun:dev": "bun --bun run dev",
"build": "next build",
"start": "next start",
"lint": "next lint --format=stylish",
"lint:fix": "pnpm lint --fix",
"lint:types": "pnpm tsc",
"lint:types": "nr tsc --noEmit",
"test": "vitest",
"commitlint": "commitlint --edit",
"changelog:latest": "nr git-cliff -l",
"check": "biome check --apply ./",
"biome:migrate": "biome migrate prettier --write",
"formatter": "nr prettier --write --ignore-unknown .",
Expand All @@ -24,95 +26,104 @@
"clean": "rimraf .next out",
"bump": "changeset version",
"pr:deploy": "git push origin develop && gh pr create -H develop -B master --fill",
"pr:push": "gh pr create --body '${nr git-cliff -l}' --title pr:deploy -d",
"gh:workflows": "gh workflow view",
"ci:spelling": "act -j spelling",
"ci:local": "act pull_request",
"ci:graph": "act --graph",
"gh:workflow:deploy": "gh run list --workflow deploy.yml",
"gh:status": "gh run watch --exit-status",
"gh:actionslogs": "gh run view 9553155963 --log",
"lighthouse:local": "lighthouse http://localhost:3000/ --output-path=./report.json --output json --quiet --chrome-flags=\"--headless\" --view --only-categories=performance,color-contrast ",
"storybook": "storybook dev -p 6006",
"build-storybook": "storybook build"
"build-storybook": "storybook build",
"knip": "knip"
},
"dependencies": {
"@changesets/cli": "^2.27.7",
"@icons-pack/react-simple-icons": "^9.7.0",
"@tanstack/react-query": "^5.53.3",
"@tanstack/react-query-devtools": "^5.54.0",
"@changesets/cli": "^2.27.9",
"@hookform/error-message": "^2.0.1",
"@hookform/resolvers": "^3.9.0",
"@icons-pack/react-simple-icons": "^10.0.0",
"@tanstack/react-query": "^5.59.13",
"@tanstack/react-query-devtools": "^5.59.13",
"@testing-library/jest-dom": "^6.5.0",
"chalk": "^5.3.0",
"clsx": "^2.1.1",
"next": "14.2.5",
"git-cliff": "^2.6.1",
"next": "14.2.15",
"nextjs-google-analytics": "^2.3.7",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"react-hook-form": "^7.53.0",
"react-hotjar": "^6.3.1",
"react-obfuscate": "^3.7.0",
"remeda": "^2.12.0",
"tailwindcss-radix": "^3.0.4",
"remeda": "^2.15.0",
"tailwindcss-radix": "^3.0.5",
"validator": "^13.12.0",
"zod": "^3.23.8"
},
"devDependencies": {
"@biomejs/biome": "1.8.3",
"@chromatic-com/storybook": "1.6.1",
"@commitlint/cli": "^19.4.1",
"@commitlint/config-conventional": "^19.4.1",
"@eslint/js": "^9.9.1",
"@faker-js/faker": "^8.4.1",
"@release-it/conventional-changelog": "^8.0.1",
"@storybook/addon-essentials": "^8.2.9",
"@storybook/addon-interactions": "^8.2.9",
"@storybook/addon-links": "^8.2.9",
"@storybook/addon-onboarding": "^8.2.9",
"@storybook/blocks": "^8.2.9",
"@storybook/nextjs": "^8.2.9",
"@storybook/react": "^8.2.9",
"@storybook/test": "^8.2.9",
"@tailwindcss/forms": "^0.5.8",
"@biomejs/biome": "1.9.3",
"@chromatic-com/storybook": "2.0.2",
"@commitlint/cli": "^19.5.0",
"@commitlint/config-conventional": "^19.5.0",
"@eslint/js": "^9.12.0",
"@faker-js/faker": "^9.0.3",
"@release-it/conventional-changelog": "^9.0.0",
"@storybook/addon-essentials": "^8.3.5",
"@storybook/addon-interactions": "^8.3.5",
"@storybook/addon-links": "^8.3.5",
"@storybook/addon-onboarding": "^8.3.5",
"@storybook/blocks": "^8.3.5",
"@storybook/nextjs": "^8.3.5",
"@storybook/react": "^8.3.5",
"@storybook/test": "^8.3.5",
"@tailwindcss/forms": "^0.5.9",
"@tailwindcss/typography": "^0.5.15",
"@tanstack/eslint-plugin-query": "^5.53.0",
"@tanstack/eslint-plugin-query": "^5.59.7",
"@testing-library/react": "^16.0.1",
"@trivago/prettier-plugin-sort-imports": "^4.3.0",
"@types/fs-extra": "^11.0.4",
"@types/node": "^20.16.3",
"@types/react": "^18.3.5",
"@types/react-dom": "^18.3.0",
"@typescript-eslint/eslint-plugin": "^7.18.0",
"@vitejs/plugin-react": "^4.3.1",
"@types/node": "^22.7.5",
"@types/react": "^18.3.11",
"@types/react-dom": "^18.3.1",
"@typescript-eslint/eslint-plugin": "^8.8.1",
"@vitejs/plugin-react": "^4.3.2",
"autoprefixer": "^10.4.20",
"depcheck": "^1.4.7",
"dotenv-cli": "^7.4.2",
"eslint": "^9.9.1",
"eslint": "^9.12.0",
"eslint-config-airbnb": "^19.0.4",
"eslint-config-next": "14.2.5",
"eslint-config-next": "14.2.15",
"eslint-config-prettier": "^9.1.0",
"eslint-formatter-pretty": "^6.0.1",
"eslint-formatter-table": "^7.32.1",
"eslint-plugin-prettier": "^5.2.1",
"eslint-plugin-security": "^3.0.1",
"eslint-plugin-sonarjs": "^1.0.4",
"eslint-plugin-storybook": "^0.8.0",
"eslint-plugin-unicorn": "^55.0.0",
"execa": "^9.3.1",
"eslint-plugin-sonarjs": "^2.0.3",
"eslint-plugin-storybook": "^0.9.0",
"eslint-plugin-unicorn": "^56.0.0",
"execa": "^9.4.0",
"fs-extra": "^11.2.0",
"globals": "^15.9.0",
"husky": "^9.1.5",
"jsdom": "^24.1.3",
"lighthouse": "^12.2.0",
"oxlint": "^0.6.1",
"postcss": "^8.4.44",
"globals": "^15.11.0",
"husky": "^9.1.6",
"jsdom": "^25.0.1",
"knip": "^5.33.3",
"lighthouse": "^12.2.1",
"oxlint": "^0.9.10",
"postcss": "^8.4.47",
"prettier": "^3.3.3",
"pretty-quick": "^4.0.0",
"release-it": "^17.6.0",
"release-it": "^17.8.2",
"rimraf": "^6.0.1",
"storybook": "^8.2.9",
"tailwindcss": "^3.4.10",
"tsx": "^4.19.0",
"typescript": "^5.5.4",
"typescript-eslint": "^7.18.0",
"unplugin-auto-import": "^0.18.2",
"vite-tsconfig-paths": "^4.3.2",
"vitest": "^2.0.5"
"storybook": "^8.3.5",
"tailwindcss": "^3.4.13",
"tsx": "^4.19.1",
"typescript": "^5.6.3",
"typescript-eslint": "^8.8.1",
"unplugin-auto-import": "^0.18.3",
"vite-tsconfig-paths": "^5.0.1",
"vitest": "^2.1.2"
},
"eslintConfig": {
"extends": [
Expand Down
25 changes: 25 additions & 0 deletions src/app/manifest.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import type { MetadataRoute } from "next";

export default function manifest(): MetadataRoute.Manifest {
return {
name: "Axmin Shrestha | Portfolio",
short_name: "Portfolio",
description: "A wip Portfolio.",
start_url: "/",
display: "standalone",
background_color: "#000000",
theme_color: "#000000"
// icons: [
// {
// src: '/icon-192x192.png',
// sizes: '192x192',
// type: 'image/png',
// },
// {
// src: '/icon-512x512.png',
// sizes: '512x512',
// type: 'image/png',
// },
// ],
};
}
6 changes: 3 additions & 3 deletions src/hooks/use-contact-form.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,16 +25,16 @@ const contactFormSchema = z.object({
// message: z.string().min(1, { message: "Message is Required" })
// age: z.number().min(10),
});
export type contactFormFields = z.infer<typeof contactFormSchema>; // string
export type ContactFormFields = z.infer<typeof contactFormSchema>; // string

export function useContactForm() {
const {
register,
handleSubmit,
control,
formState: { errors, isSubmitting }
} = useForm({
} = useForm<ContactFormFields>({
resolver: zodResolver(contactFormSchema)
});
return { control, register, handleSubmit, errors, isSubmitting };
return { control, register, handleSubmit, errors, isSubmitting } as const;
}
2 changes: 1 addition & 1 deletion src/ui/contact.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export default meta;
type Story = StoryObj<typeof ContactForm>;
export const Default: Story = {
args: {
onSubmit: async (data: any) => {
onSubmit: async (data: unknown) => {
await delay(2000);
console.log("Form submitted with data:", data);
// You can add any logic here
Expand Down
8 changes: 4 additions & 4 deletions src/ui/contact.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import type { SubmitHandler } from "react-hook-form";

import { type contactFormFields, useContactForm } from "@/hooks/use-contact-form";
import { type ContactFormFields, useContactForm } from "@/hooks/use-contact-form";
import Button from "@/ui/button";
import { ErrorMessage } from "@hookform/error-message";
import { StarIcon } from "@storybook/icons";

import clsx from "clsx";

export type ContactFormProps = { onSubmit: SubmitHandler<contactFormFields> };
export type ContactFormProps = { onSubmit: SubmitHandler<ContactFormFields> };

// Street
// Suite 100
Expand Down Expand Up @@ -69,7 +69,7 @@ export function ContactForm(props: ContactFormProps) {
<ErrorMessage
key={name}
errors={errors}
name={name}
name={name as keyof ContactFormFields}
render={({ message }) => <p className={"text-red-500"}>{message}</p>}
/>
);
Expand All @@ -79,7 +79,7 @@ export function ContactForm(props: ContactFormProps) {
}

export default function ContactSection() {
const handleSubmit: SubmitHandler<contactFormFields> = async (data) => {
const handleSubmit: SubmitHandler<ContactFormFields> = async (data) => {
console.time("work");
await new Promise((r) => setTimeout(r, 2000));
console.log("Contact Form", data);
Expand Down
1 change: 1 addition & 0 deletions src/ui/sections/external-links-section.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ export function ExternalLinksSection() {
<ul className='flex w-60 justify-between pointer-events-auto list-none'>
{Object.entries(data.links).map(([label, value]) => (
<li key={label}>
{/* @ts-ignore */}
<Obfuscate target='_blank' href={value}>
<GetIcon name={label} />
</Obfuscate>
Expand Down
21 changes: 12 additions & 9 deletions vitest.config.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
import react from "@vitejs/plugin-react";
import tsconfigPaths from "vite-tsconfig-paths";
import { defineConfig } from "vitest/config";

export default defineConfig({
plugins: [react(), tsconfigPaths()],
test: {
environment: "jsdom",
include: ["**/*.test.{ts,tsx}"],
globals: true,
setupFiles: ["./vitest-setup.ts"]
}
export default defineConfig(async () => {
const tsconfigPaths = (await import("vite-tsconfig-paths")).default;

return {
plugins: [react(), tsconfigPaths()],
test: {
environment: "jsdom",
include: ["**/*.test.{ts,tsx}"],
globals: true,
setupFiles: ["./vitest-setup.ts"]
}
};
});