@betterstart/cli 0.1.69 → 0.1.70

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 (77) hide show
  1. package/dist/chunk-E4HZYXQ2.js +36 -0
  2. package/dist/chunk-E4HZYXQ2.js.map +1 -0
  3. package/dist/cli.js +580 -4444
  4. package/dist/cli.js.map +1 -1
  5. package/dist/reader-2T45D7JZ.js +7 -0
  6. package/package.json +1 -1
  7. package/templates/init/api/auth-route.ts +3 -0
  8. package/templates/init/api/upload-route.ts +74 -0
  9. package/templates/init/cms-globals.css +200 -0
  10. package/templates/init/components/data-table/data-table-pagination.tsx +90 -0
  11. package/templates/init/components/data-table/data-table-toolbar.tsx +93 -0
  12. package/templates/init/components/data-table/data-table.tsx +188 -0
  13. package/templates/init/components/layout/cms-header.tsx +32 -0
  14. package/templates/init/components/layout/cms-nav-link.tsx +25 -0
  15. package/templates/init/components/layout/cms-providers.tsx +33 -0
  16. package/templates/init/components/layout/cms-search.tsx +25 -0
  17. package/templates/init/components/layout/cms-sidebar.tsx +192 -0
  18. package/templates/init/components/layout/cms-sign-out.tsx +30 -0
  19. package/templates/init/components/shared/delete-dialog.tsx +75 -0
  20. package/templates/init/components/shared/page-header.tsx +23 -0
  21. package/templates/init/components/shared/status-badge.tsx +43 -0
  22. package/templates/init/data/navigation.ts +39 -0
  23. package/templates/init/db/client.ts +8 -0
  24. package/templates/init/db/schema.ts +88 -0
  25. package/{dist/chunk-6JCWMKSY.js → templates/init/drizzle.config.ts} +2 -11
  26. package/templates/init/hooks/use-cms-theme.tsx +78 -0
  27. package/templates/init/hooks/use-editor-image-upload.ts +82 -0
  28. package/templates/init/hooks/use-local-storage.ts +46 -0
  29. package/templates/init/hooks/use-mobile.ts +19 -0
  30. package/templates/init/hooks/use-upload.ts +177 -0
  31. package/templates/init/hooks/use-users.ts +13 -0
  32. package/templates/init/lib/actions/form-settings.ts +126 -0
  33. package/templates/init/lib/actions/profile.ts +62 -0
  34. package/templates/init/lib/actions/upload.ts +153 -0
  35. package/templates/init/lib/actions/users.ts +145 -0
  36. package/templates/init/lib/auth/auth-client.ts +12 -0
  37. package/templates/init/lib/auth/auth.ts +43 -0
  38. package/templates/init/lib/auth/middleware.ts +44 -0
  39. package/templates/init/lib/markdown/cached.ts +7 -0
  40. package/templates/init/lib/markdown/format.ts +55 -0
  41. package/templates/init/lib/markdown/render.ts +182 -0
  42. package/templates/init/lib/r2.ts +55 -0
  43. package/templates/init/pages/account-layout.tsx +63 -0
  44. package/templates/init/pages/authenticated-layout.tsx +26 -0
  45. package/templates/init/pages/cms-layout.tsx +16 -0
  46. package/templates/init/pages/dashboard-page.tsx +91 -0
  47. package/templates/init/pages/login-form.tsx +117 -0
  48. package/templates/init/pages/login-page.tsx +17 -0
  49. package/templates/init/pages/profile/profile-form.tsx +361 -0
  50. package/templates/init/pages/profile/profile-page.tsx +34 -0
  51. package/templates/init/pages/users/columns.tsx +241 -0
  52. package/templates/init/pages/users/create-user-dialog.tsx +116 -0
  53. package/templates/init/pages/users/edit-role-dialog.tsx +92 -0
  54. package/templates/init/pages/users/users-page-content.tsx +29 -0
  55. package/templates/init/pages/users/users-page.tsx +19 -0
  56. package/templates/init/pages/users/users-table.tsx +219 -0
  57. package/templates/init/types/auth.ts +78 -0
  58. package/templates/init/types/index.ts +79 -0
  59. package/templates/init/types/table-meta.ts +16 -0
  60. package/templates/init/utils/cn.ts +6 -0
  61. package/templates/init/utils/mailchimp.ts +39 -0
  62. package/templates/init/utils/seo.ts +90 -0
  63. package/templates/init/utils/validation.ts +105 -0
  64. package/templates/init/utils/webhook.ts +28 -0
  65. package/templates/ui/alert-dialog.tsx +46 -28
  66. package/templates/ui/avatar.tsx +37 -20
  67. package/templates/ui/button.tsx +3 -3
  68. package/templates/ui/card.tsx +30 -18
  69. package/templates/ui/dialog.tsx +46 -22
  70. package/templates/ui/dropdown-menu.tsx +1 -1
  71. package/templates/ui/input.tsx +1 -1
  72. package/templates/ui/select.tsx +42 -34
  73. package/templates/ui/sidebar.tsx +13 -13
  74. package/templates/ui/table.tsx +2 -2
  75. package/dist/chunk-6JCWMKSY.js.map +0 -1
  76. package/dist/drizzle-config-EDKOEZ6G.js +0 -7
  77. /package/dist/{drizzle-config-EDKOEZ6G.js.map → reader-2T45D7JZ.js.map} +0 -0
@@ -0,0 +1,36 @@
1
+ // src/init/templates/reader.ts
2
+ import fs2 from "fs";
3
+ import path2 from "path";
4
+
5
+ // src/utils/cli-root.ts
6
+ import fs from "fs";
7
+ import path from "path";
8
+ function findCliRoot() {
9
+ let dir = new URL(".", import.meta.url).pathname;
10
+ for (let i = 0; i < 5; i++) {
11
+ const pkgPath = path.join(dir, "package.json");
12
+ if (fs.existsSync(pkgPath)) {
13
+ try {
14
+ const pkg = JSON.parse(fs.readFileSync(pkgPath, "utf-8"));
15
+ if (pkg.name === "@betterstart/cli") {
16
+ return dir;
17
+ }
18
+ } catch {
19
+ }
20
+ }
21
+ dir = path.dirname(dir);
22
+ }
23
+ return path.resolve(new URL(".", import.meta.url).pathname, "..", "..");
24
+ }
25
+
26
+ // src/init/templates/reader.ts
27
+ function readTemplate(relativePath) {
28
+ const cliRoot = findCliRoot();
29
+ return fs2.readFileSync(path2.join(cliRoot, "templates", "init", relativePath), "utf-8");
30
+ }
31
+
32
+ export {
33
+ findCliRoot,
34
+ readTemplate
35
+ };
36
+ //# sourceMappingURL=chunk-E4HZYXQ2.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/init/templates/reader.ts","../src/utils/cli-root.ts"],"sourcesContent":["import fs from 'node:fs'\nimport path from 'node:path'\nimport { findCliRoot } from '../../utils/cli-root.js'\n\n/**\n * Read a template file from `templates/init/` by its relative path.\n * Used by scaffolders and update-component to get template content.\n */\nexport function readTemplate(relativePath: string): string {\n const cliRoot = findCliRoot()\n return fs.readFileSync(path.join(cliRoot, 'templates', 'init', relativePath), 'utf-8')\n}\n","import fs from 'node:fs'\nimport path from 'node:path'\n\n/**\n * Find the CLI package root by looking for package.json with our name.\n * Works both from source (src/) and built (dist/) locations.\n */\nexport function findCliRoot(): string {\n let dir = new URL('.', import.meta.url).pathname\n for (let i = 0; i < 5; i++) {\n const pkgPath = path.join(dir, 'package.json')\n if (fs.existsSync(pkgPath)) {\n try {\n const pkg = JSON.parse(fs.readFileSync(pkgPath, 'utf-8'))\n if (pkg.name === '@betterstart/cli') {\n return dir\n }\n } catch {\n // continue\n }\n }\n dir = path.dirname(dir)\n }\n // Fallback: assume 2 levels up from dist/\n return path.resolve(new URL('.', import.meta.url).pathname, '..', '..')\n}\n"],"mappings":";AAAA,OAAOA,SAAQ;AACf,OAAOC,WAAU;;;ACDjB,OAAO,QAAQ;AACf,OAAO,UAAU;AAMV,SAAS,cAAsB;AACpC,MAAI,MAAM,IAAI,IAAI,KAAK,YAAY,GAAG,EAAE;AACxC,WAAS,IAAI,GAAG,IAAI,GAAG,KAAK;AAC1B,UAAM,UAAU,KAAK,KAAK,KAAK,cAAc;AAC7C,QAAI,GAAG,WAAW,OAAO,GAAG;AAC1B,UAAI;AACF,cAAM,MAAM,KAAK,MAAM,GAAG,aAAa,SAAS,OAAO,CAAC;AACxD,YAAI,IAAI,SAAS,oBAAoB;AACnC,iBAAO;AAAA,QACT;AAAA,MACF,QAAQ;AAAA,MAER;AAAA,IACF;AACA,UAAM,KAAK,QAAQ,GAAG;AAAA,EACxB;AAEA,SAAO,KAAK,QAAQ,IAAI,IAAI,KAAK,YAAY,GAAG,EAAE,UAAU,MAAM,IAAI;AACxE;;;ADjBO,SAAS,aAAa,cAA8B;AACzD,QAAM,UAAU,YAAY;AAC5B,SAAOC,IAAG,aAAaC,MAAK,KAAK,SAAS,aAAa,QAAQ,YAAY,GAAG,OAAO;AACvF;","names":["fs","path","fs","path"]}