Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update dependencies, bump release version and a lot more #2144

Merged
merged 3 commits into from
Jan 12, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion .github/workflows/publish-docker-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ jobs:
password: ${{ secrets.DOCKER_TOKEN }}

- name: Deploy the latest image on rxresu.me
run: curl -X POST ${{ secrets.SERVICE_WEBHOOK }}
run: curl -Xk POST ${{ secrets.SERVICE_WEBHOOK }}

- name: Inform about the release on Discord
uses: sarisia/[email protected]
Expand Down
9 changes: 8 additions & 1 deletion .ncurc.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
{
"$schema": "https://raw.githubusercontent.com/raineorshine/npm-check-updates/main/src/types/RunOptions.json",
"upgrade": true,
"target": "minor",
"install": "always",
"packageManager": "pnpm",
"reject": ["eslint", "eslint-plugin-unused-imports", "@reactive-resume/*"]
"reject": [
"eslint",
"@swc/*",
"@swc-node/*",
"@reactive-resume/*",
"eslint-plugin-unused-imports"
]
}
60 changes: 57 additions & 3 deletions apps/client/.eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,14 @@
"ignorePatterns": ["!**/*"],
"overrides": [
{
"files": ["*.ts", "*.tsx", "*.js", "*.jsx"],
"files": ["*.ts", "*.tsx"],
"extends": [
"plugin:tailwindcss/recommended",
"plugin:@tanstack/eslint-plugin-query/recommended"
],
"parserOptions": {
"projectService": "./apps/client/tsconfig.json"
},
"settings": {
"tailwindcss": {
"callees": ["cn", "clsx", "cva"],
Expand Down Expand Up @@ -39,8 +42,59 @@
"lingui/no-unlocalized-strings": [
2,
{
"ignoreFunction": ["cn"],
"ignoreAttribute": ["alt"]
"ignore": [
// Ignore strings which are a single "word" (no spaces)
// and doesn't start with an uppercase letter
"^(?![A-Z])\\S+$",
// Ignore UPPERCASE literals
// Example: const test = "FOO"
"^[A-Z0-9_-]+$"
],
"ignoreNames": [
// Ignore matching className (case-insensitive)
{ "regex": { "pattern": "className", "flags": "i" } },
// Ignore UPPERCASE names
// Example: test.FOO = "ola!"
{ "regex": { "pattern": "^[A-Z0-9_-]+$" } },
"id",
"src",
"srcSet",
"styleName",
"placeholder",
"alt",
"type",
"width",
"height",
"displayName",
"Authorization"
],
"ignoreFunctions": [
"cn",
"cva",
"track",
"Error",
"console.*",
"*headers.set",
"*.addEventListener",
"*.removeEventListener",
"*.postMessage",
"*.getElementById",
"*.dispatch",
"*.commit",
"*.includes",
"*.indexOf",
"*.endsWith",
"*.startsWith",
"require"
],
// Following settings require typed linting https://typescript-eslint.io/getting-started/typed-linting/
"useTsTypes": true,
"ignoreMethodsOnTypes": [
// Ignore specified methods on Map and Set types
"Map.get",
"Map.has",
"Set.has"
]
}
],
"lingui/t-call-in-function": 2,
Expand Down
11 changes: 4 additions & 7 deletions apps/client/src/pages/builder/sidebars/right/sections/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import {
verticalListSortingStrategy,
} from "@dnd-kit/sortable";
import { CSS } from "@dnd-kit/utilities";
import { t, Trans } from "@lingui/macro";
import { t } from "@lingui/macro";
import { ArrowCounterClockwise, DotsSixVertical, Plus, TrashSimple } from "@phosphor-icons/react";
import { defaultMetadata } from "@reactive-resume/schema";
import { Button, Portal, Tooltip } from "@reactive-resume/ui";
Expand Down Expand Up @@ -92,9 +92,7 @@ type SectionProps = {
};

const Section = ({ id, isDragging = false }: SectionProps) => {
const name = useResumeStore((state) =>
get(state.resume.data.sections, `${id}.name`, id),
) as string;
const name = useResumeStore((state) => get(state.resume.data.sections, `${id}.name`, id));

return (
<div
Expand Down Expand Up @@ -229,13 +227,12 @@ export const LayoutSection = () => {

const main = page[0];
const sidebar = page[1];
const pageNumber = pageIndex + 1;

return (
<div key={pageIndex} className="rounded border p-3 pb-4">
<div className="flex items-center justify-between">
<p className="mb-3 text-xs font-bold">
<Trans>Page {pageIndex + 1}</Trans>
</p>
<p className="mb-3 text-xs font-bold">{t`Page ${pageNumber}`}</p>

{pageIndex !== 0 && (
<Tooltip content={t`Remove Page`}>
Expand Down
2 changes: 1 addition & 1 deletion apps/server/src/auth/utils/payload.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { idSchema } from "@reactive-resume/schema";
import { z } from "nestjs-zod/z";
import { z } from "zod";

export const payloadSchema = z.object({
id: idSchema,
Expand Down
2 changes: 1 addition & 1 deletion apps/server/src/config/schema.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { z } from "nestjs-zod/z";
import { z } from "zod";

export const configSchema = z.object({
NODE_ENV: z.enum(["development", "production"]).default("production"),
Expand Down
2 changes: 1 addition & 1 deletion apps/server/src/resume/resume.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ export class ResumeService {
title: updateResumeDto.title,
slug: updateResumeDto.slug,
visibility: updateResumeDto.visibility,
data: updateResumeDto.data as unknown as Prisma.JsonObject,
data: updateResumeDto.data as Prisma.JsonObject,
},
where: { userId_id: { userId, id } },
});
Expand Down
3 changes: 2 additions & 1 deletion libs/dto/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
"@reactive-resume/utils": "*",
"@reactive-resume/schema": "*",
"nestjs-zod": "^3.0.0",
"@swc/helpers": "~0.5.11"
"@swc/helpers": "~0.5.11",
"zod": "^3.24.1"
}
}
2 changes: 1 addition & 1 deletion libs/dto/src/auth/forgot-password.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { createZodDto } from "nestjs-zod/dto";
import { z } from "nestjs-zod/z";
import { z } from "zod";

export const forgotPasswordSchema = z.object({ email: z.string().email() });

Expand Down
4 changes: 2 additions & 2 deletions libs/dto/src/auth/login.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import { createZodDto } from "nestjs-zod/dto";
import { z } from "nestjs-zod/z";
import { z } from "zod";

import { usernameSchema } from "../user";

export const loginSchema = z
.object({
identifier: z.string().transform((value) => value.toLowerCase()),
password: z.password().min(6),
password: z.string().min(6),
})
.refine(
(value) => {
Expand Down
2 changes: 1 addition & 1 deletion libs/dto/src/auth/message.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { createZodDto } from "nestjs-zod/dto";
import { z } from "nestjs-zod/z";
import { z } from "zod";

export const messageSchema = z.object({ message: z.string() });

Expand Down
2 changes: 1 addition & 1 deletion libs/dto/src/auth/providers.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { createZodDto } from "nestjs-zod/dto";
import { z } from "nestjs-zod/z";
import { z } from "zod";

const authProvidersSchema = z.array(z.enum(["email", "github", "google"]));

Expand Down
4 changes: 2 additions & 2 deletions libs/dto/src/auth/register.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { createZodDto } from "nestjs-zod/dto";
import { z } from "nestjs-zod/z";
import { z } from "zod";

import { userSchema } from "../user";

export const registerSchema = userSchema
.pick({ name: true, email: true, username: true, locale: true })
.extend({ password: z.password().min(6) });
.extend({ password: z.string().min(6) });

export class RegisterDto extends createZodDto(registerSchema) {}
4 changes: 2 additions & 2 deletions libs/dto/src/auth/reset-password.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { createZodDto } from "nestjs-zod/dto";
import { z } from "nestjs-zod/z";
import { z } from "zod";

export const resetPasswordSchema = z.object({
token: z.string(),
password: z.password().min(6),
password: z.string().min(6),
});

export class ResetPasswordDto extends createZodDto(resetPasswordSchema) {}
2 changes: 1 addition & 1 deletion libs/dto/src/auth/response.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { createZodDto } from "nestjs-zod/dto";
import { z } from "nestjs-zod/z";
import { z } from "zod";

import { userSchema } from "../user";

Expand Down
2 changes: 1 addition & 1 deletion libs/dto/src/auth/two-factor.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { createZodDto } from "nestjs-zod/dto";
import { z } from "nestjs-zod/z";
import { z } from "zod";

export const twoFactorSchema = z.object({
code: z
Expand Down
2 changes: 1 addition & 1 deletion libs/dto/src/auth/update-password.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { createZodDto } from "nestjs-zod/dto";
import { z } from "nestjs-zod/z";
import { z } from "zod";

export const updatePasswordSchema = z.object({
password: z.string().min(6),
Expand Down
2 changes: 1 addition & 1 deletion libs/dto/src/contributors/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { createZodDto } from "nestjs-zod/dto";
import { z } from "nestjs-zod/z";
import { z } from "zod";

export const contributorSchema = z.object({
id: z.number(),
Expand Down
2 changes: 1 addition & 1 deletion libs/dto/src/feature/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { createZodDto } from "nestjs-zod/dto";
import { z } from "nestjs-zod/z";
import { z } from "zod";

export const featureSchema = z.object({
isSignupsDisabled: z.boolean().default(false),
Expand Down
2 changes: 1 addition & 1 deletion libs/dto/src/resume/create.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { kebabCase } from "@reactive-resume/utils";
import { createZodDto } from "nestjs-zod/dto";
import { z } from "nestjs-zod/z";
import { z } from "zod";

export const createResumeSchema = z.object({
title: z.string().min(1),
Expand Down
2 changes: 1 addition & 1 deletion libs/dto/src/resume/delete.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { idSchema } from "@reactive-resume/schema";
import { createZodDto } from "nestjs-zod/dto";
import { z } from "nestjs-zod/z";
import { z } from "zod";

export const deleteResumeSchema = z.object({
id: idSchema,
Expand Down
2 changes: 1 addition & 1 deletion libs/dto/src/resume/import.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { resumeDataSchema } from "@reactive-resume/schema";
import { kebabCase } from "@reactive-resume/utils";
import { createZodDto } from "nestjs-zod/dto";
import { z } from "nestjs-zod/z";
import { z } from "zod";

export const importResumeSchema = z.object({
title: z.string().optional(),
Expand Down
7 changes: 4 additions & 3 deletions libs/dto/src/resume/resume.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { defaultResumeData, idSchema, resumeDataSchema } from "@reactive-resume/schema";
import { dateSchema } from "@reactive-resume/utils";
import { createZodDto } from "nestjs-zod/dto";
import { z } from "nestjs-zod/z";
import { z } from "zod";

import { userSchema } from "../user";

Expand All @@ -13,8 +14,8 @@ export const resumeSchema = z.object({
locked: z.boolean().default(false),
userId: idSchema,
user: userSchema.optional(),
createdAt: z.date().or(z.dateString()),
updatedAt: z.date().or(z.dateString()),
createdAt: dateSchema,
updatedAt: dateSchema,
});

export class ResumeDto extends createZodDto(resumeSchema) {}
2 changes: 1 addition & 1 deletion libs/dto/src/resume/url.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { createZodDto } from "nestjs-zod/dto";
import { z } from "nestjs-zod/z";
import { z } from "zod";

export const urlSchema = z.object({ url: z.string().url() });

Expand Down
2 changes: 1 addition & 1 deletion libs/dto/src/secrets/secrets.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { idSchema } from "@reactive-resume/schema";
import { z } from "nestjs-zod/z";
import { z } from "zod";

export const secretsSchema = z.object({
id: idSchema,
Expand Down
2 changes: 1 addition & 1 deletion libs/dto/src/statistics/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { createZodDto } from "nestjs-zod/dto";
import { z } from "nestjs-zod/z";
import { z } from "zod";

export const statisticsSchema = z.object({
views: z.number().int().default(0),
Expand Down
7 changes: 4 additions & 3 deletions libs/dto/src/user/user.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { idSchema } from "@reactive-resume/schema";
import { dateSchema } from "@reactive-resume/utils";
import { createZodDto } from "nestjs-zod/dto";
import { z } from "nestjs-zod/z";
import { z } from "zod";

import { secretsSchema } from "../secrets";

Expand All @@ -26,8 +27,8 @@ export const userSchema = z.object({
emailVerified: z.boolean().default(false),
twoFactorEnabled: z.boolean().default(false),
provider: z.enum(["email", "github", "google"]).default("email"),
createdAt: z.date().or(z.dateString()),
updatedAt: z.date().or(z.dateString()),
createdAt: dateSchema,
updatedAt: dateSchema,
});

export class UserDto extends createZodDto(userSchema) {}
Expand Down
3 changes: 2 additions & 1 deletion libs/utils/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
"unique-names-generator": "^4.7.1",
"clsx": "^2.1.1",
"tailwind-merge": "^2.3.0",
"@swc/helpers": "~0.5.11"
"@swc/helpers": "~0.5.11",
"zod": "^3.24.1"
}
}
6 changes: 6 additions & 0 deletions libs/utils/src/namespaces/date.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
import dayjs from "dayjs";
import { z } from "zod";

export const dateSchema = z.union([z.date(), z.string().datetime()]).transform((value) => {
if (typeof value === "string") return dayjs(value).toDate();
return value;
});

export const sortByDate = <T>(a: T, b: T, key: keyof T, desc = true) => {
if (!a[key] || !b[key]) return 0;
Expand Down
Loading
Loading