-
-
Notifications
You must be signed in to change notification settings - Fork 6
feat: Add watch script to copy pages & layouts to nextjs #651
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
Conversation
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR scaffolds Next.js page and layout components for various core, admin, auth, and plugin routes, updates the package scripts to include a prepare step, and refreshes accompanying documentation and editor settings.
- Adds new
page.tsxfiles for core admin views, auth flows, dynamic rest route (now returningnotFound), and blog plugin pages/layouts - Updates
package.jsonto include apreparescript - Refines plugin documentation in MDX and adds VSCode/Copilot configuration
Reviewed Changes
Copilot reviewed 80 out of 80 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| apps/web/src/app/[locale]/admin/(auth)/(vitnode)/core/users/page.tsx | Add UsersAdminView page |
| apps/web/src/app/[locale]/admin/(auth)/(vitnode)/core/test/page.tsx | Add TestView page |
| apps/web/src/app/[locale]/admin/(auth)/(vitnode)/core/page.tsx | Add DashboardAdminView page |
| apps/web/src/app/[locale]/admin/(auth)/(plugins)/(vitnode-blog)/blog/categories/page.tsx | Add blog categories admin page |
| apps/web/src/app/[locale]/(main)/[...rest]/page.tsx | Replace dynamic view with notFound() |
| apps/web/src/app/[locale]/(main)/(vitnode)/register/page.tsx | Add SignUpView page and metadata generator |
| apps/web/src/app/[locale]/(main)/(vitnode)/login/sso/[providerId]/page.tsx | Add CallbackSSOView page for SSO |
| apps/web/src/app/[locale]/(main)/(vitnode)/login/page.tsx | Add SignInView page and metadata generator |
| apps/web/src/app/[locale]/(main)/(plugins)/(vitnode-blog)/blog/test/page.tsx | Add blog plugin test page |
| apps/web/src/app/[locale]/(main)/(plugins)/(vitnode-blog)/blog/page.tsx | Add blog plugin main page with Test/TestClient views |
| apps/web/src/app/[locale]/(main)/(plugins)/(vitnode-blog)/blog/layout.tsx | Add blog plugin layout component |
| apps/web/package.json | Add "prepare": "vitnode prepare" script |
| apps/docs/content/docs/plugins/layouts-and-pages.mdx | Revise plugin routing, pages, and layout docs |
| .vscode/settings.json | Add Copilot commit message guidelines |
| .github/copilot-instructions.md | Add VitNode development guidelines |
| .cursor/rules/global.mdc | Remove global cursor rule |
| .cursor/rules/frontend/i18n.mdc | Remove i18n cursor rule |
| .cursor/rules/frontend/frontend.mdc | Remove frontend cursor rule |
| .cursor/rules/docs.mdc | Remove docs cursor rule |
| .cursor/rules/backend/backend.mdc | Remove backend cursor rule |
apps/web/src/app/[locale]/(main)/(vitnode)/login/sso/[providerId]/page.tsx
Show resolved
Hide resolved
apps/web/src/app/[locale]/(main)/(vitnode)/login/sso/[providerId]/page.tsx
Outdated
Show resolved
Hide resolved
apps/web/src/app/[locale]/admin/(auth)/(plugins)/(vitnode-blog)/blog/categories/page.tsx
Show resolved
Hide resolved
| For admin pages, follow the same pattern but create your files in the `src/app_admin` directory of your plugin. This is the only difference - the structure and implementation remain the same. | ||
|
|
||
| ```tsx title="plugins/blog/src/components/blog-post.client.tsx" | ||
| 'use client'; | ||
| For example, to create an admin page at `/admin/{plugin_name}/settings`: | ||
|
|
||
| import { useState } from 'react'; | ||
| ``` | ||
| src/app_admin/settings/page.tsx | ||
| ``` | ||
|
|
||
| export function ClientBlogPost({ initialData }) { | ||
| const [likes, setLikes] = useState(initialData.likes); | ||
| And for a layout: | ||
|
|
||
| return ( | ||
| <div> | ||
| <h1>{initialData.title}</h1> | ||
| <p>{initialData.content}</p> | ||
| <button onClick={() => setLikes(likes + 1)}>Like ({likes})</button> | ||
| </div> | ||
| ); | ||
| } | ||
| ``` | ||
| src/app_admin/settings/layout.tsx |
Copilot
AI
May 25, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The example uses src/app_admin, but earlier you mention src/app. This inconsistency can confuse readers—align the directory path with your plugin conventions.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR introduces changes to streamline the integration of pages and layouts into the Next.js application, along with updates to documentation and development guidelines.
- Removed the legacy dynamic admin catch-all page.
- Added multiple new pages for various authentication flows, plugin views, and layout implementations.
- Updated documentation and configuration files to reflect the current development guidelines.
Reviewed Changes
Copilot reviewed 80 out of 80 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| apps/web/src/app/[locale]/admin/(auth)/[...rest]/page.tsx | Removed the legacy dynamic admin catch-all page. |
| apps/web/src/app/[locale]/admin/(auth)/(vitnode)/core/users/page.tsx | Added a page for UsersAdminView. |
| apps/web/src/app/[locale]/admin/(auth)/(vitnode)/core/test/page.tsx | Added a test view page. |
| apps/web/src/app/[locale]/admin/(auth)/(vitnode)/core/page.tsx | Added a page for DashboardAdminView. |
| apps/web/src/app/[locale]/admin/(auth)/(plugins)/(vitnode-blog)/blog/categories/page.tsx | Introduced a categories page for the blog plugin. |
| apps/web/src/app/[locale]/(main)/[...rest]/page.tsx | Modified routing to use notFound() for unmatched routes. |
| apps/web/src/app/[locale]/(main)/(vitnode)/register/page.tsx | Added registration page with metadata generation. |
| apps/web/src/app/[locale]/(main)/(vitnode)/login/sso/[providerId]/page.tsx | Added an SSO callback page handling async route parameters. |
| apps/web/src/app/[locale]/(main)/(vitnode)/login/page.tsx | Added sign-in page with metadata generation. |
| apps/web/src/app/[locale]/(main)/(plugins)/(vitnode-blog)/blog/test/page.tsx | Added a test page for the blog plugin. |
| apps/web/src/app/[locale]/(main)/(plugins)/(vitnode-blog)/blog/page.tsx | Added a blog page combining test views and navigation links. |
| apps/web/src/app/[locale]/(main)/(plugins)/(vitnode-blog)/blog/layout.tsx | Added a layout file wrapping the blog pages. |
| apps/docs/content/docs/plugins/layouts-and-pages.mdx | Updated documentation to clarify routing, layouts, and admin page structures. |
| .vscode/settings.json | Updated settings to include commit message generation guidelines. |
| .github/copilot-instructions.md | Added detailed development guidelines. |
| .cursor/rules/* | Removed outdated rule files in favor of updated guidelines. |
Improving Documentation
pnpm lint:fixto fix formatting issues before opening the PR.Description
What?
Why?
How?
TODO: