Skip to content

Commit

Permalink
Merge pull request #513 from VitNode/export_string_lang_helper
Browse files Browse the repository at this point in the history
perf(backend): Export string language helper to package
  • Loading branch information
aXenDeveloper authored Sep 15, 2024
2 parents 88f776f + 15a6b5c commit bd3758b
Show file tree
Hide file tree
Showing 10 changed files with 57 additions and 315 deletions.
7 changes: 5 additions & 2 deletions apps/frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,14 @@
"dependencies": {
"geist": "^1.3.1",
"lucide-react": "^0.441.0",
"next": "^15.0.0-canary.155",
"next": "15.0.0-canary.155",
"next-intl": "^3.19.1",
"react": "19.0.0-rc-fb9a90fa48-20240614",
"react-dom": "19.0.0-rc-fb9a90fa48-20240614",
"vitnode-frontend": "workspace:*"
"react-hook-form": "^7.53.0",
"sonner": "^1.5.0",
"vitnode-frontend": "workspace:*",
"zod": "^3.23.8"
},
"devDependencies": {
"@types/node": "^22.5.5",
Expand Down
2 changes: 1 addition & 1 deletion packages/backend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@
"@nestjs/config": "^3.2.3",
"@nestjs/jwt": "^10.2.0",
"@nestjs/serve-static": "^4.0.2",
"@nestjs/throttler": "^6.2.1",
"@react-email/render": "^1.0.1",
"@swc/cli": "^0.4.0",
"@swc/core": "^1.7.26",
Expand All @@ -86,6 +85,7 @@
"@nestjs/core": "^10.4.1",
"@nestjs/graphql": "^12.2.0",
"@nestjs/schedule": "^4.1.0",
"@nestjs/throttler": "^6.2.1",
"@react-email/components": "^0.0.25",
"@types/busboy": "^1.5.4",
"@types/cookie-parser": "^1.4.7",
Expand Down
2 changes: 1 addition & 1 deletion packages/backend/src/core/admin/plugins/delete/contents.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ export const removeLangFromTypes = ({
}) => {
// Remove the import statement for the module
let updatedCode = content.replace(
`\nimport type ${code} from '@/plugins/${code}/langs/en.json';`,
`\nimport ${code.replace('-', '')} from '@/plugins/${code}/langs/en.json';`,
'',
);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ export const changeLangTypes = ({
return content
.replace(
'// ! === IMPORT ===',
`import type ${code} from '@/plugins/${code}/langs/en.json';\n// ! === IMPORT ===`,
`import ${code.replace('-', '')} from '@/plugins/${code}/langs/en.json';\n// ! === IMPORT ===`,
)
.replace('; // ! === MODULE ===', ` & typeof ${code}; // ! === MODULE ===`);
};

This file was deleted.

This file was deleted.

2 changes: 1 addition & 1 deletion packages/backend/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ export * from './app.module';
export * from './core/admin/security/captcha/captcha.service';
// Services
export * from './core/admin/sessions/authorization/authorization.service';
export * from './core/helpers/text_language/parser/parser.service';
export * from './core/helpers/string_language/helpers.service';
export * from './core/sessions/authorization/internal/internal_authorization.service';
export * from './decorators';
export * from './errors';
Expand Down
5 changes: 4 additions & 1 deletion packages/create-vitnode-app/helpers/create-packages-json.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,12 +89,14 @@ export const createPackagesJSON = ({
'@hookform/resolvers': '^3.9.0',
geist: '^1.3.1',
'lucide-react': '^0.441.0',
next: '^15.0.0-canary.155',
next: '15.0.0-canary.155',
'next-intl': '^3.19.1',
react: '^19.0.0-rc-d6cb4e77-20240911',
'react-dom': '^19.0.0-rc-d6cb4e77-20240911',
'react-hook-form': '^7.53.0',
sonner: '^1.5.0',
'vitnode-frontend': `^${pkg.version}`,
zod: '^3.23.8',
},
devDependencies: {
'@types/node': '^22.5.5',
Expand Down Expand Up @@ -135,6 +137,7 @@ export const createPackagesJSON = ({
'@nestjs/core': '^10.4.1',
'@nestjs/graphql': '^12.2.0',
'@nestjs/schedule': '^4.1.0',
'@nestjs/throttler': '^6.2.1',
'@react-email/components': '^0.0.25',
'class-transformer': '^0.5.1',
'class-validator': '^0.14.1',
Expand Down
8 changes: 4 additions & 4 deletions packages/frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -121,9 +121,11 @@
"react": "19.0.0-rc-e56f4ae3-20240830",
"react-dom": "19.0.0-rc-e56f4ae3-20240830",
"react-hook-form": "^7.53.0",
"sonner": "^1.5.0",
"tailwindcss": "^3.4.11",
"tsup": "^8.2.4",
"typescript": "^5.6.2"
"typescript": "^5.6.2",
"zod": "^3.23.8"
},
"dependencies": {
"@dnd-kit/core": "^6.1.0",
Expand Down Expand Up @@ -180,12 +182,10 @@
"react-cropper": "^2.3.3",
"react-day-picker": "^8.10.1",
"react-virtuoso": "^4.10.4",
"sonner": "^1.5.0",
"tailwind-merge": "^2.5.2",
"tailwindcss-animate": "^1.0.7",
"tippy.js": "^6.3.7",
"use-debounce": "^10.0.3",
"vaul": "^0.9.3",
"zod": "^3.23.8"
"vaul": "^0.9.3"
}
}
Loading

0 comments on commit bd3758b

Please sign in to comment.