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

chore: Update packages #591

Merged
merged 3 commits into from
Nov 28, 2024
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
10 changes: 5 additions & 5 deletions apps/backend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@
"db": "vitnode-backend db"
},
"dependencies": {
"@nestjs/common": "^10.4.8",
"@nestjs/core": "^10.4.8",
"@nestjs/platform-express": "^10.4.8",
"@nestjs/common": "^10.4.11",
"@nestjs/core": "^10.4.11",
"@nestjs/platform-express": "^10.4.11",
"@nestjs/schedule": "^4.1.1",
"@nestjs/throttler": "^6.2.1",
"@react-email/components": "^0.0.28",
Expand All @@ -37,12 +37,12 @@
"@nestjs/schematics": "^10.2.3",
"@swc/cli": "^0.5.1",
"@types/express": "^5.0.0",
"@types/node": "^22.9.1",
"@types/node": "^22.10.1",
"@types/react": "^18.3.12",
"cross-env": "^7.0.3",
"eslint-config-typescript-vitnode": "workspace:*",
"shared": "workspace:*",
"typescript": "^5.6.3",
"typescript": "^5.7.2",
"vitnode-shared": "workspace:*"
}
}
9 changes: 7 additions & 2 deletions apps/frontend/next.config.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,18 @@
import type { NextConfig } from 'next';
import VitNodeConfig from 'vitnode-frontend/next.config';
import bundleAnalyzer from '@next/bundle-analyzer';

const withBundleAnalyzer = bundleAnalyzer({
enabled: process.env.ANALYZE === 'true',
});

const nextConfig: NextConfig = {
output: 'standalone',
// output: 'standalone',
logging: {
fetches: {
fullUrl: true,
},
},
};

export default VitNodeConfig(nextConfig);
export default VitNodeConfig(withBundleAnalyzer(nextConfig));
11 changes: 7 additions & 4 deletions apps/frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"config:init": "vitnode-frontend init",
"config:dev": "vitnode-frontend dev",
"dev": "vitnode-frontend dev && next dev --turbo",
"analyze": "cross-env ANALYZE=true pnpm build",
"build": "next build",
"start": "next start",
"start:prod": "node server.js",
Expand All @@ -15,9 +16,9 @@
"dependencies": {
"@hookform/resolvers": "^3.9.1",
"geist": "^1.3.1",
"lucide-react": "^0.460.0",
"lucide-react": "^0.462.0",
"next": "^15.0.3",
"next-intl": "^3.25.1",
"next-intl": "^3.25.3",
"react": "19.0.0-rc.1",
"react-dom": "19.0.0-rc.1",
"react-hook-form": "^7.53.2",
Expand All @@ -27,15 +28,17 @@
"zod": "^3.23.8"
},
"devDependencies": {
"@types/node": "^22.9.1",
"@next/bundle-analyzer": "^15.0.3",
"@types/node": "^22.10.1",
"@types/react": "^18.3.12",
"@types/react-dom": "^18.3.1",
"autoprefixer": "^10.4.20",
"cross-env": "^7.0.3",
"eslint-config-typescript-vitnode": "workspace:*",
"postcss": "^8.4.49",
"shared": "workspace:*",
"tailwindcss": "^3.4.15",
"typescript": "^5.6.3",
"typescript": "^5.7.2",
"vitnode-shared": "workspace:*"
}
}
2 changes: 1 addition & 1 deletion apps/frontend/src/middleware.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ import { createMiddleware } from 'vitnode-frontend/middleware';
export default createMiddleware();

export const config = {
matcher: '/((?!_next|robots.txt|sitemap.xml|sitemap|sw.js).*)',
matcher: '/((?!_next|robots.txt|sitemap.xml|sitemap|api|sw.js).*)',
};
6 changes: 3 additions & 3 deletions apps/shared/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,16 @@
}
},
"dependencies": {
"@nestjs/common": "^10.4.8",
"@nestjs/common": "^10.4.11",
"@nestjs/swagger": "^8.0.7"
},
"devDependencies": {
"@types/multer": "^1.4.12",
"@types/node": "^22.9.1",
"@types/node": "^22.10.1",
"class-transformer": "^0.5.1",
"class-validator": "^0.14.1",
"eslint-config-typescript-vitnode": "workspace:*",
"typescript": "^5.6.3",
"typescript": "^5.7.2",
"vitnode-shared": "workspace:*"
},
"version": "0.0.10-canary.16"
Expand Down
3 changes: 0 additions & 3 deletions apps/shared/plugins/welcome/example.dto.ts
Original file line number Diff line number Diff line change
@@ -1,3 +0,0 @@
export interface ExampleBody {
name: string;
}
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@
"packages/*"
],
"devDependencies": {
"@types/node": "^22.9.1",
"@types/node": "^22.10.1",
"eslint-config-typescript-vitnode": "workspace:*",
"turbo": "^2.3.1"
"turbo": "^2.3.3"
},
"packageManager": "[email protected]",
"engines": {
Expand Down
8 changes: 4 additions & 4 deletions packages/backend-ai-google/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,13 @@
"devDependencies": {
"@swc/cli": "^0.5.1",
"@swc/core": "^1.9.3",
"@types/node": "^22.9.1",
"ai": "^4.0.3",
"@types/node": "^22.10.1",
"ai": "^4.0.8",
"concurrently": "^9.1.0",
"eslint-config-typescript-vitnode": "workspace:*",
"typescript": "^5.6.3"
"typescript": "^5.7.2"
},
"dependencies": {
"@ai-sdk/google": "^1.0.3"
"@ai-sdk/google": "^1.0.4"
}
}
8 changes: 4 additions & 4 deletions packages/backend-ai-open-ai/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,13 @@
"devDependencies": {
"@swc/cli": "^0.5.1",
"@swc/core": "^1.9.3",
"@types/node": "^22.9.1",
"ai": "^4.0.3",
"@types/node": "^22.10.1",
"ai": "^4.0.8",
"concurrently": "^9.1.0",
"eslint-config-typescript-vitnode": "workspace:*",
"typescript": "^5.6.3"
"typescript": "^5.7.2"
},
"dependencies": {
"@ai-sdk/openai": "^1.0.4"
"@ai-sdk/openai": "^1.0.5"
}
}
4 changes: 2 additions & 2 deletions packages/backend-email-resend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@
"devDependencies": {
"@swc/cli": "^0.5.1",
"@swc/core": "^1.9.3",
"@types/node": "^22.9.1",
"@types/node": "^22.10.1",
"concurrently": "^9.1.0",
"eslint-config-typescript-vitnode": "workspace:*",
"typescript": "^5.6.3"
"typescript": "^5.7.2"
},
"dependencies": {
"resend": "^4.0.1"
Expand Down
4 changes: 2 additions & 2 deletions packages/backend-email-smtp/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,11 @@
"devDependencies": {
"@swc/cli": "^0.5.1",
"@swc/core": "^1.9.3",
"@types/node": "^22.9.1",
"@types/node": "^22.10.1",
"@types/nodemailer": "^6.4.17",
"concurrently": "^9.1.0",
"eslint-config-typescript-vitnode": "workspace:*",
"typescript": "^5.6.3"
"typescript": "^5.7.2"
},
"dependencies": {
"nodemailer": "^6.9.16"
Expand Down
12 changes: 6 additions & 6 deletions packages/backend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,16 +58,16 @@
"codegen"
],
"devDependencies": {
"@nestjs/common": "^10.4.8",
"@nestjs/platform-express": "^10.4.8",
"@nestjs/common": "^10.4.11",
"@nestjs/platform-express": "^10.4.11",
"@nestjs/schedule": "^4.1.1",
"@react-email/components": "^0.0.28",
"@swc/cli": "^0.5.1",
"@swc/core": "^1.9.3",
"@types/cookie-parser": "^1.4.7",
"@types/cookie-parser": "^1.4.8",
"@types/express": "^5.0.0",
"@types/multer": "^1.4.12",
"@types/node": "^22.9.1",
"@types/node": "^22.10.1",
"@types/pg": "^8.11.10",
"@types/react": "^18.3.12",
"@types/ua-parser-js": "^0.7.39",
Expand All @@ -78,11 +78,11 @@
"react": "19.0.0-rc.1",
"react-dom": "19.0.0-rc.1",
"tsup": "^8.3.5",
"typescript": "^5.6.3"
"typescript": "^5.7.2"
},
"dependencies": {
"@nestjs/config": "^3.3.0",
"@nestjs/core": "^10.4.8",
"@nestjs/core": "^10.4.11",
"@nestjs/jwt": "^10.2.0",
"@nestjs/serve-static": "^4.0.2",
"@nestjs/swagger": "^8.0.7",
Expand Down
48 changes: 24 additions & 24 deletions packages/backend/scripts/helpers/update-object.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,27 @@
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unnecessary-type-parameters
export function objectToArray<T extends Record<string, any>>(
obj: T,
): Record<string, unknown> {
if (typeof obj !== 'object') {
return obj;
}

return Object.entries(obj).reduce(
(acc: Record<string, unknown>, [key, value]) => {
if (Array.isArray(value)) {
acc[key] = value.map(objectToArray);
} else if (typeof value === 'object' && value !== null) {
acc[key] = [objectToArray(value)];
} else {
acc[key] = value;
}

return acc;
},
{},
);
}

// eslint-disable-next-line @typescript-eslint/no-explicit-any
export function updateObject<T extends Record<string, any>>(
config: T,
Expand Down Expand Up @@ -32,27 +56,3 @@ export function updateObject<T extends Record<string, any>>(

return updatedConfig;
}

// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unnecessary-type-parameters
export function objectToArray<T extends Record<string, any>>(
obj: T,
): Record<string, unknown> {
if (typeof obj !== 'object') {
return obj;
}

return Object.entries(obj).reduce(
(acc: Record<string, unknown>, [key, value]) => {
if (Array.isArray(value)) {
acc[key] = value.map(objectToArray);
} else if (typeof value === 'object' && value !== null) {
acc[key] = [objectToArray(value)];
} else {
acc[key] = value;
}

return acc;
},
{},
);
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,29 +16,29 @@ import {
import { DeleteFilesAdvancedAdminService } from './services/delete.service';
import { ShowFilesAdvancedAdminService } from './services/show.service';

@ApiSecurity('admin')
@ApiTags('Admin')
@Controller('admin/advanced/files')
@ApiSecurity('admin')
@UseGuards(AdminAuthGuard)
export class FilesAdvancedAdminController {
constructor(
private readonly showService: ShowFilesAdvancedAdminService,
private readonly deleteService: DeleteFilesAdvancedAdminService,
) {}

@Delete(':id')
@ApiOkResponse({
description: 'Delete file',
})
@Delete(':id')
async deleteFile(@Param('id') id: string): Promise<void> {
await this.deleteService.delete(+id);
}

@Get()
@ApiOkResponse({
type: ShowFilesAdvancedAdminObj,
description: 'Show files from all users',
})
@Get()
async showFiles(
@Query() query: ShowFilesAdvancedAdminQuery,
): Promise<ShowFilesAdvancedAdminObj> {
Expand Down
6 changes: 3 additions & 3 deletions packages/backend/src/core/admin/auth/auth.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,33 +14,33 @@ import { User } from 'vitnode-shared/user.dto';
import { SearchAuthAdminService } from './services/nav/search.service';
import { ShowAuthAdminService } from './services/show.service';

@ApiSecurity('admin')
@ApiTags('Admin')
@Controller('admin/auth')
@ApiSecurity('admin')
@UseGuards(AdminAuthGuard)
export class AuthAdminController {
constructor(
private readonly showService: ShowAuthAdminService,
private readonly searchService: SearchAuthAdminService,
) {}

@Get('search')
@ApiOkResponse({
description: 'Search for a navigation item',
type: SearchNavAuthAdminObj,
})
@Get('search')
async search(
@Query() query: SearchNavAuthAdminQuery,
@CurrentUser() user: User,
): Promise<SearchNavAuthAdminObj> {
return await this.searchService.search({ query, user });
}

@Get()
@ApiOkResponse({
type: ShowAuthAdminObj,
description: 'Show the admin user with personal information',
})
@Get()
async show(
@Req() req: Request,
@Res({ passthrough: true }) res: Response,
Expand Down
Loading
Loading