@vitnode/blog 1.2.0-canary.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (75) hide show
  1. package/LICENSE.md +21 -0
  2. package/dist/src/api/modules/categories/categories.module.d.ts +343 -0
  3. package/dist/src/api/modules/categories/categories.module.d.ts.map +1 -0
  4. package/dist/src/api/modules/categories/categories.module.js +1 -0
  5. package/dist/src/api/modules/categories/routes/create.route.d.ts +79 -0
  6. package/dist/src/api/modules/categories/routes/create.route.d.ts.map +1 -0
  7. package/dist/src/api/modules/categories/routes/create.route.js +1 -0
  8. package/dist/src/api/modules/categories/routes/delete.route.d.ts +40 -0
  9. package/dist/src/api/modules/categories/routes/delete.route.d.ts.map +1 -0
  10. package/dist/src/api/modules/categories/routes/delete.route.js +1 -0
  11. package/dist/src/api/modules/categories/routes/edit.route.d.ts +100 -0
  12. package/dist/src/api/modules/categories/routes/edit.route.d.ts.map +1 -0
  13. package/dist/src/api/modules/categories/routes/edit.route.js +1 -0
  14. package/dist/src/api/modules/categories/routes/get.route.d.ts +148 -0
  15. package/dist/src/api/modules/categories/routes/get.route.d.ts.map +1 -0
  16. package/dist/src/api/modules/categories/routes/get.route.js +1 -0
  17. package/dist/src/api/modules/categories/utils/generate-unique-title-seo.d.ts +1 -0
  18. package/dist/src/api/modules/categories/utils/generate-unique-title-seo.d.ts.map +1 -0
  19. package/dist/src/app_admin/blog/categories/page.d.ts +5 -0
  20. package/dist/src/app_admin/blog/categories/page.d.ts.map +1 -0
  21. package/dist/src/app_admin/blog/categories/page.js +1 -0
  22. package/dist/src/config.api.d.ts +2 -0
  23. package/dist/src/config.api.d.ts.map +1 -0
  24. package/dist/src/config.api.js +1 -0
  25. package/dist/src/config.d.ts +4 -0
  26. package/dist/src/config.d.ts.map +1 -0
  27. package/dist/src/config.js +1 -0
  28. package/dist/src/database/categories.d.ts +97 -0
  29. package/dist/src/database/categories.d.ts.map +1 -0
  30. package/dist/src/database/categories.js +1 -0
  31. package/dist/src/plugin.d.ts +2 -0
  32. package/dist/src/plugin.d.ts.map +1 -0
  33. package/dist/src/plugin.js +1 -0
  34. package/dist/src/views/admin/categories/actions/actions.d.ts +2 -0
  35. package/dist/src/views/admin/categories/actions/actions.d.ts.map +1 -0
  36. package/dist/src/views/admin/categories/actions/actions.js +1 -0
  37. package/dist/src/views/admin/categories/actions/create/create-edit.d.ts +2 -0
  38. package/dist/src/views/admin/categories/actions/create/create-edit.d.ts.map +1 -0
  39. package/dist/src/views/admin/categories/actions/create/create.d.ts +1 -0
  40. package/dist/src/views/admin/categories/actions/create/create.d.ts.map +1 -0
  41. package/dist/src/views/admin/categories/actions/create-edit/create-edit.d.ts +8 -0
  42. package/dist/src/views/admin/categories/actions/create-edit/create-edit.d.ts.map +1 -0
  43. package/dist/src/views/admin/categories/actions/create-edit/create-edit.js +1 -0
  44. package/dist/src/views/admin/categories/actions/create-edit/create-mutation-api.d.ts +6 -0
  45. package/dist/src/views/admin/categories/actions/create-edit/create-mutation-api.d.ts.map +1 -0
  46. package/dist/src/views/admin/categories/actions/create-edit/mutation-api.d.ts +11 -0
  47. package/dist/src/views/admin/categories/actions/create-edit/mutation-api.d.ts.map +1 -0
  48. package/dist/src/views/admin/categories/actions/create-edit/mutation-api.js +1 -0
  49. package/dist/src/views/admin/categories/actions/create-edit.d.ts +2 -0
  50. package/dist/src/views/admin/categories/actions/create-edit.d.ts.map +1 -0
  51. package/dist/src/views/admin/categories/actions.d.ts +2 -0
  52. package/dist/src/views/admin/categories/actions.d.ts.map +1 -0
  53. package/dist/src/views/admin/categories/categories-admin-view.d.ts +4 -0
  54. package/dist/src/views/admin/categories/categories-admin-view.d.ts.map +1 -0
  55. package/dist/src/views/admin/categories/categories-admin-view.js +1 -0
  56. package/dist/src/views/admin/categories/row-actions/delete/delete-action.d.ts +5 -0
  57. package/dist/src/views/admin/categories/row-actions/delete/delete-action.d.ts.map +1 -0
  58. package/dist/src/views/admin/categories/row-actions/delete/delete-action.js +1 -0
  59. package/dist/src/views/admin/categories/row-actions/delete/mutation-api.d.ts +4 -0
  60. package/dist/src/views/admin/categories/row-actions/delete/mutation-api.d.ts.map +1 -0
  61. package/dist/src/views/admin/categories/row-actions/delete/mutation-api.js +1 -0
  62. package/dist/src/views/admin/categories/row-actions/edit-action.d.ts +9 -0
  63. package/dist/src/views/admin/categories/row-actions/edit-action.d.ts.map +1 -0
  64. package/dist/src/views/admin/categories/row-actions/edit-action.js +1 -0
  65. package/dist/src/views/admin/categories/row-actions/mutation-api.d.ts +4 -0
  66. package/dist/src/views/admin/categories/row-actions/mutation-api.d.ts.map +1 -0
  67. package/dist/src/views/admin/categories/row-actions/row-actions.d.ts +3 -0
  68. package/dist/src/views/admin/categories/row-actions/row-actions.d.ts.map +1 -0
  69. package/dist/src/views/admin/categories-admin-view.d.ts +4 -0
  70. package/dist/src/views/admin/categories-admin-view.d.ts.map +1 -0
  71. package/dist/tsconfig.tsbuildinfo +1 -0
  72. package/package.json +47 -0
  73. package/src/app_admin/blog/categories/page.tsx +38 -0
  74. package/src/database/categories.ts +12 -0
  75. package/src/locales/en.json +38 -0
package/package.json ADDED
@@ -0,0 +1,47 @@
1
+ {
2
+ "name": "@vitnode/blog",
3
+ "version": "1.2.0-canary.10",
4
+ "description": "Blog plugin for VitNode",
5
+ "author": "VitNode",
6
+ "homepage": "https://vitnode.com",
7
+ "type": "module",
8
+ "exports": {
9
+ "./*": {
10
+ "import": "./dist/src/*.js",
11
+ "types": "./dist/src/*.d.ts",
12
+ "default": "./dist/src/*.js"
13
+ }
14
+ },
15
+ "dependencies": {
16
+ "@hono/zod-openapi": "^0.19.6",
17
+ "drizzle-kit": "^0.31.0",
18
+ "drizzle-orm": "^0.44.1",
19
+ "hono": "^4.7.8",
20
+ "lucide-react": "^0.513.0",
21
+ "next": "^15.3.1",
22
+ "next-intl": "^4.1.0",
23
+ "react": "^19.1.0",
24
+ "react-dom": "^19.1.0",
25
+ "react-hook-form": "^7.57.0",
26
+ "sonner": "^2.0.5",
27
+ "zod": "^3.25.56",
28
+ "@vitnode/core": "1.2.0-canary.10"
29
+ },
30
+ "devDependencies": {
31
+ "@swc/cli": "0.6.0",
32
+ "@swc/core": "^1.11.24",
33
+ "@types/react": "^19.1.3",
34
+ "@types/react-dom": "^19.1.5",
35
+ "concurrently": "^9.1.2",
36
+ "eslint": "^9.25.1",
37
+ "tsc-alias": "^1.8.15",
38
+ "typescript": "^5.8.3",
39
+ "eslint-config-typescript-vitnode": "1.2.0-canary.10"
40
+ },
41
+ "scripts": {
42
+ "build:plugins": "tsc && swc src -d dist --config-file .swcrc && tsc-alias -p tsconfig.json",
43
+ "dev": "concurrently \"tsc -w --preserveWatchOutput\" \"swc src -d dist --config-file .swcrc -w\" \"tsc-alias -w\" \"vitnode plugin --w\"",
44
+ "lint": "eslint .",
45
+ "lint:fix": "eslint . --fix"
46
+ }
47
+ }
@@ -0,0 +1,38 @@
1
+ import type { Metadata } from 'next';
2
+
3
+ import { I18nProvider } from '@vitnode/core/components/i18n-provider';
4
+ import { HeaderContent } from '@vitnode/core/components/ui/header-content';
5
+ import { getTranslations } from 'next-intl/server';
6
+
7
+ import { CategoriesAdminView } from '@/views/admin/categories/categories-admin-view';
8
+
9
+ import { ActionsCategoriesAdmin } from '../../../views/admin/categories/actions/actions';
10
+
11
+ export const generateMetadata = async (): Promise<Metadata> => {
12
+ const t = await getTranslations('@vitnode/blog.admin.nav');
13
+
14
+ return {
15
+ title: t('categories'),
16
+ };
17
+ };
18
+
19
+ export default async function CategoriesPage(
20
+ params: React.ComponentProps<typeof CategoriesAdminView>,
21
+ ) {
22
+ const [t, tNav] = await Promise.all([
23
+ getTranslations('@vitnode/blog.admin.categories'),
24
+ getTranslations('@vitnode/blog.admin.nav'),
25
+ ]);
26
+
27
+ return (
28
+ <I18nProvider namespaces={['@vitnode/blog.admin.categories']}>
29
+ <div className="container mx-auto p-4">
30
+ <HeaderContent desc={t('desc')} h1={tNav('categories')}>
31
+ <ActionsCategoriesAdmin />
32
+ </HeaderContent>
33
+
34
+ <CategoriesAdminView {...params} />
35
+ </div>
36
+ </I18nProvider>
37
+ );
38
+ }
@@ -0,0 +1,12 @@
1
+ import { pgTable } from 'drizzle-orm/pg-core';
2
+
3
+ export const blog_categories = pgTable('blog_categories', t => ({
4
+ id: t.serial().primaryKey(),
5
+ title: t.varchar({ length: 100 }).notNull(),
6
+ createdAt: t.timestamp().notNull().defaultNow(),
7
+ updatedAt: t
8
+ .timestamp()
9
+ .notNull()
10
+ .$onUpdate(() => new Date()),
11
+ titleSeo: t.varchar({ length: 100 }).notNull().unique().default(''),
12
+ })).enableRLS();
@@ -0,0 +1,38 @@
1
+ {
2
+ "@vitnode/blog": {
3
+ "title": "Blog",
4
+ "admin": {
5
+ "nav": {
6
+ "categories": "Categories"
7
+ },
8
+ "categories": {
9
+ "desc": "Manage categories for blog posts.",
10
+ "table": {
11
+ "title": "Title",
12
+ "updated_at": "Updated At"
13
+ },
14
+ "delete": {
15
+ "title": "Delete Category",
16
+ "desc": "Are you sure you want to delete <title></title> category? This action cannot be undone.",
17
+ "confirm": "Yes, delete this category",
18
+ "success": "Category has been deleted successfully."
19
+ },
20
+ "create": {
21
+ "title": "Create Category",
22
+ "desc": "A new category for your blog posts.",
23
+ "form": {
24
+ "title": {
25
+ "label": "Title",
26
+ "already_exists": "This category title already exists."
27
+ }
28
+ },
29
+ "submit": "Create"
30
+ },
31
+ "edit": {
32
+ "title": "Edit Category",
33
+ "submit": "Save Changes"
34
+ }
35
+ }
36
+ }
37
+ }
38
+ }