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

feat(frontend): Add top loader #503

Merged
merged 5 commits into from
Sep 10, 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
8 changes: 4 additions & 4 deletions apps/backend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,11 @@
"@graphql-codegen/typescript-operations": "^4.2.3",
"@nestjs/cli": "^10.4.5",
"@nestjs/schematics": "^10.1.4",
"@react-email/components": "^0.0.24",
"@react-email/components": "^0.0.25",
"@swc/cli": "^0.4.0",
"@swc/core": "^1.7.22",
"@swc/core": "^1.7.24",
"@types/express": "^4.17.21",
"@types/node": "^22.5.1",
"@types/node": "^22.5.4",
"@types/pg": "^8.11.8",
"@types/react": "^18.3.5",
"class-transformer": "^0.5.1",
Expand All @@ -54,7 +54,7 @@
"ts-loader": "^9.5.1",
"ts-node": "^10.9.2",
"tsconfig-paths": "^4.2.0",
"typescript": "^5.5.4",
"typescript": "^5.6.2",
"vitnode-backend": "workspace:*"
}
}
7 changes: 2 additions & 5 deletions apps/backend/schema.gql
Original file line number Diff line number Diff line change
Expand Up @@ -229,9 +229,9 @@ type Mutation {
admin__core_plugins__download(code: String!, version: String, version_code: Int): String!
admin__core_plugins__edit(author: String!, author_url: String, code: String!, default: Boolean, description: String, enabled: Boolean, name: String!, support_url: String!): ShowAdminPlugins!
admin__core_plugins__nav__change_position(code: String!, index_to_move: Int!, parent_code: String, plugin_code: String!): String!
admin__core_plugins__nav__create(code: String!, href: String!, icon: String, keywords: [String!]!, parent_code: String, plugin_code: String!): ShowAdminNavPluginsObj!
admin__core_plugins__nav__create(code: String!, icon: String, keywords: [String!]!, parent_code: String, plugin_code: String!): ShowAdminNavPluginsObj!
admin__core_plugins__nav__delete(code: String!, parent_code: String, plugin_code: String!): String!
admin__core_plugins__nav__edit(code: String!, href: String!, icon: String, keywords: [String!]!, parent_code: String, plugin_code: String!, previous_code: String!): ShowAdminNavPluginsObj!
admin__core_plugins__nav__edit(code: String!, icon: String, keywords: [String!]!, parent_code: String, plugin_code: String!, previous_code: String!): ShowAdminNavPluginsObj!
admin__core_plugins__upload(code: String, file: Upload!): ShowAdminPlugins!
admin__core_security__captcha__edit(secret_key: String!, site_key: String!, type: CaptchaTypeEnum!): ShowAdminCaptchaSecurityObj!
admin__core_staff_administrators__create(group_id: Int, unrestricted: Boolean!, user_id: Int): ShowAdminStaffAdministrators!
Expand Down Expand Up @@ -262,7 +262,6 @@ type Mutation {
type NavSearchAdminSessions {
code: String!
code_plugin: String!
href: String!
icon: String
keywords: [String!]!
parent_nav_code: String
Expand Down Expand Up @@ -444,15 +443,13 @@ type ShowAdminNavObj {

type ShowAdminNavPlugins {
code: String!
href: String!
icon: String
keywords: [String!]!
}

type ShowAdminNavPluginsObj {
children: [ShowAdminNavPlugins!]
code: String!
href: String!
icon: String
keywords: [String!]!
}
Expand Down
2 changes: 1 addition & 1 deletion apps/docs/content/docs/dev/pages-admin.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ Now you can see your navigation item in the AdminCP.

## Add Page

TODO: Add content
Now you can create `page.tsx` file in the `apps/frontend/src/app/[locale]/admin/(auth)`.

</Step>

Expand Down
18 changes: 9 additions & 9 deletions apps/docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,27 +11,27 @@
"@radix-ui/react-slot": "^1.1.0",
"class-variance-authority": "^0.7.0",
"clsx": "^2.1.1",
"embla-carousel-autoplay": "^8.2.0",
"embla-carousel-react": "^8.2.0",
"framer-motion": "^11.3.31",
"embla-carousel-autoplay": "^8.2.1",
"embla-carousel-react": "^8.2.1",
"framer-motion": "^11.5.4",
"fumadocs-core": "13.0.4",
"fumadocs-mdx": "9.0.0",
"fumadocs-ui": "13.0.4",
"geist": "^1.3.1",
"lucide-react": "^0.424.0",
"next": "^14.2.5",
"next": "^14.2.9",
"react": "19.0.0-rc-fb9a90fa48-20240614",
"react-dom": "19.0.0-rc-fb9a90fa48-20240614",
"tailwind-merge": "^2.4.0",
"tailwind-merge": "^2.5.2",
"zod": "^3.23.8"
},
"devDependencies": {
"@types/mdx": "^2.0.13",
"@types/react": "^18.3.3",
"@types/react": "^18.3.5",
"@types/react-dom": "^18.3.0",
"autoprefixer": "^10.4.20",
"postcss": "^8.4.40",
"tailwindcss": "^3.4.7",
"typescript": "^5.5.4"
"postcss": "^8.4.45",
"tailwindcss": "^3.4.10",
"typescript": "^5.6.2"
}
}
9 changes: 2 additions & 7 deletions apps/frontend/next.config.ts
Original file line number Diff line number Diff line change
@@ -1,18 +1,13 @@
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',
});

// @ts-ignore
const nextConfig: NextConfig = withBundleAnalyzer({
const nextConfig: NextConfig = {
logging: {
fetches: {
fullUrl: process.env.NODE_ENV === 'development',
},
},
});
};

export default VitNodeConfig(nextConfig);
11 changes: 5 additions & 6 deletions apps/frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,22 +18,21 @@
"dependencies": {
"geist": "^1.3.1",
"lucide-react": "^0.437.0",
"next": "15.0.0-canary.137",
"next-intl": "^3.19.0",
"next": "15.0.0-canary.146",
"next-intl": "^3.19.1",
"react": "19.0.0-rc-e56f4ae3-20240830",
"react-dom": "19.0.0-rc-e56f4ae3-20240830",
"vitnode-frontend": "workspace:*"
},
"devDependencies": {
"@next/bundle-analyzer": "15.0.0-canary.101",
"@types/node": "^22.5.1",
"@types/node": "^22.5.4",
"@types/react": "^18.3.5",
"@types/react-dom": "^18.3.0",
"autoprefixer": "^10.4.20",
"eslint-config-typescript-vitnode": "workspace:*",
"graphql-tag": "^2.12.6",
"postcss": "^8.4.42",
"postcss": "^8.4.45",
"tailwindcss": "^3.4.10",
"typescript": "^5.5.4"
"typescript": "^5.6.2"
}
}
5 changes: 0 additions & 5 deletions apps/frontend/src/graphql/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -456,7 +456,6 @@ export type MutationAdmin__Core_Plugins__Nav__Change_PositionArgs = {

export type MutationAdmin__Core_Plugins__Nav__CreateArgs = {
code: Scalars['String']['input'];
href: Scalars['String']['input'];
icon?: InputMaybe<Scalars['String']['input']>;
keywords: Array<Scalars['String']['input']>;
parent_code?: InputMaybe<Scalars['String']['input']>;
Expand All @@ -473,7 +472,6 @@ export type MutationAdmin__Core_Plugins__Nav__DeleteArgs = {

export type MutationAdmin__Core_Plugins__Nav__EditArgs = {
code: Scalars['String']['input'];
href: Scalars['String']['input'];
icon?: InputMaybe<Scalars['String']['input']>;
keywords: Array<Scalars['String']['input']>;
parent_code?: InputMaybe<Scalars['String']['input']>;
Expand Down Expand Up @@ -625,7 +623,6 @@ export type NavSearchAdminSessions = {
__typename?: 'NavSearchAdminSessions';
code: Scalars['String']['output'];
code_plugin: Scalars['String']['output'];
href: Scalars['String']['output'];
icon?: Maybe<Scalars['String']['output']>;
keywords: Array<Scalars['String']['output']>;
parent_nav_code?: Maybe<Scalars['String']['output']>;
Expand Down Expand Up @@ -933,7 +930,6 @@ export type ShowAdminNavObj = {
export type ShowAdminNavPlugins = {
__typename?: 'ShowAdminNavPlugins';
code: Scalars['String']['output'];
href: Scalars['String']['output'];
icon?: Maybe<Scalars['String']['output']>;
keywords: Array<Scalars['String']['output']>;
};
Expand All @@ -942,7 +938,6 @@ export type ShowAdminNavPluginsObj = {
__typename?: 'ShowAdminNavPluginsObj';
children?: Maybe<Array<ShowAdminNavPlugins>>;
code: Scalars['String']['output'];
href: Scalars['String']['output'];
icon?: Maybe<Scalars['String']['output']>;
keywords: Array<Scalars['String']['output']>;
};
Expand Down
4 changes: 0 additions & 4 deletions apps/frontend/src/plugins/admin/langs/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -233,10 +233,6 @@
"desc": "Should be unique. Min 3-50 characters.",
"exists": "Navigation with this code already exists."
},
"href": {
"label": "URL",
"desc": "Your link will be: /admin/<link></link>"
},
"icon": {
"label": "Icon"
},
Expand Down
8 changes: 6 additions & 2 deletions apps/frontend/src/plugins/welcome/langs/en.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
{
"welcome": {},
"admin_welcome": {}
}
"admin_welcome": {
"nav": {
"title": "Welcome"
}
}
}
3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,7 @@
"eslint-config-typescript-vitnode": "workspace:*",
"prettier": "^3.3.3",
"prettier-plugin-tailwindcss": "^0.6.6",
"turbo": "^2.1.1",
"typescript": "^5.5.4"
"turbo": "^2.1.1"
},
"packageManager": "pnpm@9.5.0"
}
14 changes: 7 additions & 7 deletions packages/backend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -68,12 +68,12 @@
"@nestjs/throttler": "^6.2.1",
"@react-email/render": "^1.0.1",
"@swc/cli": "^0.4.0",
"@swc/core": "^1.7.22",
"@swc/core": "^1.7.24",
"busboy": "^1.6.0",
"cookie-parser": "^1.4.6",
"helmet": "^7.1.0",
"http-errors": "^2.0.0",
"nodemailer": "^6.9.14",
"nodemailer": "^6.9.15",
"object-path": "^0.11.8",
"resend": "^4.0.0",
"sharp": "^0.33.5",
Expand All @@ -86,30 +86,30 @@
"@nestjs/core": "^10.4.1",
"@nestjs/graphql": "^12.2.0",
"@nestjs/schedule": "^4.1.0",
"@react-email/components": "^0.0.24",
"@react-email/components": "^0.0.25",
"@types/busboy": "^1.5.4",
"@types/cookie-parser": "^1.4.7",
"@types/express": "^4.17.21",
"@types/http-errors": "^2.0.4",
"@types/node": "^22.5.1",
"@types/node": "^22.5.4",
"@types/nodemailer": "^6.4.15",
"@types/object-path": "^0.11.4",
"@types/pg": "^8.11.8",
"@types/react": "^18.3.5",
"class-transformer": "^0.5.1",
"class-validator": "^0.14.1",
"concurrently": "^8.2.2",
"concurrently": "^9.0.0",
"dotenv": "^16.4.5",
"drizzle-kit": "^0.24.2",
"drizzle-orm": "^0.33.0",
"eslint-config-typescript-vitnode": "workspace:*",
"express": "^4.19.2",
"express": "^4.20.0",
"graphql": "^16.9.0",
"pg": "^8.12.0",
"react": "19.0.0-rc-e56f4ae3-20240830",
"react-dom": "19.0.0-rc-e56f4ae3-20240830",
"ts-node": "^10.9.2",
"tsup": "^8.2.4",
"typescript": "^5.5.4"
"typescript": "^5.6.2"
}
}
3 changes: 1 addition & 2 deletions packages/backend/src/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@ export const ABSOLUTE_PATHS_BACKEND = {
internalPaths.frontend,
'app',
'[locale]',
'(admin)',
'admin',
'(auth)',
code,
Expand All @@ -92,7 +91,7 @@ export const ABSOLUTE_PATHS_BACKEND = {
),
templates: join(internalPaths.frontend, 'plugins', code, 'templates'),
plugin: join(internalPaths.frontend, 'plugins', code),
language: join(internalPaths.frontend, 'plugins', code, 'langs'),
languages: join(internalPaths.frontend, 'plugins', code, 'langs'),
},
}),
frontend: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,15 @@ export class CreateAdminCoreLanguageService {

[...plugins, { code: 'core' }, { code: 'admin' }].forEach(plugin => {
const path = join(
ABSOLUTE_PATHS_BACKEND.plugin({ code: plugin.code }).frontend.language,
ABSOLUTE_PATHS_BACKEND.plugin({ code: plugin.code }).frontend.languages,
`${pluginCode}.json`,
);
if (fs.existsSync(path)) return;

fs.cpSync(
join(
ABSOLUTE_PATHS_BACKEND.plugin({ code: plugin.code }).frontend
.language,
.languages,
'en.json',
),
path,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ export class DeleteAdminCoreLanguageService {
fs.unlinkSync(
join(
ABSOLUTE_PATHS_BACKEND.plugin({ code: plugin.code }).frontend
.language,
.languages,
`${code}.json`,
),
);
Expand Down
Loading
Loading