@helloleo/plugins 0.1.20 → 0.2.0-beta.1

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 (133) hide show
  1. package/dist/index.js +12361 -58
  2. package/dist/templates/tanstack-start-2026-06-18/components.json +22 -0
  3. package/dist/templates/tanstack-start-2026-06-18/drizzle.config.ts +15 -0
  4. package/dist/templates/tanstack-start-2026-06-18/package.json +103 -0
  5. package/dist/templates/tanstack-start-2026-06-18/src/components/ui/accordion.tsx +51 -0
  6. package/dist/templates/tanstack-start-2026-06-18/src/components/ui/alert-dialog.tsx +115 -0
  7. package/dist/templates/tanstack-start-2026-06-18/src/components/ui/alert.tsx +49 -0
  8. package/dist/templates/tanstack-start-2026-06-18/src/components/ui/aspect-ratio.tsx +5 -0
  9. package/dist/templates/tanstack-start-2026-06-18/src/components/ui/avatar.tsx +47 -0
  10. package/dist/templates/tanstack-start-2026-06-18/src/components/ui/badge.tsx +32 -0
  11. package/dist/templates/tanstack-start-2026-06-18/src/components/ui/breadcrumb.tsx +101 -0
  12. package/dist/templates/tanstack-start-2026-06-18/src/components/ui/button.tsx +49 -0
  13. package/dist/templates/tanstack-start-2026-06-18/src/components/ui/calendar.tsx +177 -0
  14. package/dist/templates/tanstack-start-2026-06-18/src/components/ui/card.tsx +55 -0
  15. package/dist/templates/tanstack-start-2026-06-18/src/components/ui/carousel.tsx +240 -0
  16. package/dist/templates/tanstack-start-2026-06-18/src/components/ui/chart.tsx +331 -0
  17. package/dist/templates/tanstack-start-2026-06-18/src/components/ui/checkbox.tsx +26 -0
  18. package/dist/templates/tanstack-start-2026-06-18/src/components/ui/collapsible.tsx +11 -0
  19. package/dist/templates/tanstack-start-2026-06-18/src/components/ui/command.tsx +143 -0
  20. package/dist/templates/tanstack-start-2026-06-18/src/components/ui/context-menu.tsx +187 -0
  21. package/dist/templates/tanstack-start-2026-06-18/src/components/ui/dialog.tsx +104 -0
  22. package/dist/templates/tanstack-start-2026-06-18/src/components/ui/drawer.tsx +98 -0
  23. package/dist/templates/tanstack-start-2026-06-18/src/components/ui/dropdown-menu.tsx +188 -0
  24. package/dist/templates/tanstack-start-2026-06-18/src/components/ui/form.tsx +171 -0
  25. package/dist/templates/tanstack-start-2026-06-18/src/components/ui/hover-card.tsx +27 -0
  26. package/dist/templates/tanstack-start-2026-06-18/src/components/ui/input-otp.tsx +69 -0
  27. package/dist/templates/tanstack-start-2026-06-18/src/components/ui/input.tsx +22 -0
  28. package/dist/templates/tanstack-start-2026-06-18/src/components/ui/label.tsx +21 -0
  29. package/dist/templates/tanstack-start-2026-06-18/src/components/ui/menubar.tsx +229 -0
  30. package/dist/templates/tanstack-start-2026-06-18/src/components/ui/navigation-menu.tsx +120 -0
  31. package/dist/templates/tanstack-start-2026-06-18/src/components/ui/pagination.tsx +98 -0
  32. package/dist/templates/tanstack-start-2026-06-18/src/components/ui/popover.tsx +31 -0
  33. package/dist/templates/tanstack-start-2026-06-18/src/components/ui/progress.tsx +25 -0
  34. package/dist/templates/tanstack-start-2026-06-18/src/components/ui/radio-group.tsx +36 -0
  35. package/dist/templates/tanstack-start-2026-06-18/src/components/ui/resizable.tsx +37 -0
  36. package/dist/templates/tanstack-start-2026-06-18/src/components/ui/scroll-area.tsx +44 -0
  37. package/dist/templates/tanstack-start-2026-06-18/src/components/ui/select.tsx +152 -0
  38. package/dist/templates/tanstack-start-2026-06-18/src/components/ui/separator.tsx +24 -0
  39. package/dist/templates/tanstack-start-2026-06-18/src/components/ui/sheet.tsx +122 -0
  40. package/dist/templates/tanstack-start-2026-06-18/src/components/ui/sidebar.tsx +744 -0
  41. package/dist/templates/tanstack-start-2026-06-18/src/components/ui/skeleton.tsx +7 -0
  42. package/dist/templates/tanstack-start-2026-06-18/src/components/ui/slider.tsx +23 -0
  43. package/dist/templates/tanstack-start-2026-06-18/src/components/ui/sonner.tsx +23 -0
  44. package/dist/templates/tanstack-start-2026-06-18/src/components/ui/switch.tsx +27 -0
  45. package/dist/templates/tanstack-start-2026-06-18/src/components/ui/table.tsx +94 -0
  46. package/dist/templates/tanstack-start-2026-06-18/src/components/ui/tabs.tsx +53 -0
  47. package/dist/templates/tanstack-start-2026-06-18/src/components/ui/textarea.tsx +21 -0
  48. package/dist/templates/tanstack-start-2026-06-18/src/components/ui/toggle-group.tsx +57 -0
  49. package/dist/templates/tanstack-start-2026-06-18/src/components/ui/toggle.tsx +42 -0
  50. package/dist/templates/tanstack-start-2026-06-18/src/components/ui/tooltip.tsx +32 -0
  51. package/dist/templates/tanstack-start-2026-06-18/src/db/index.ts +9 -0
  52. package/dist/templates/tanstack-start-2026-06-18/src/db/schema.ts +18 -0
  53. package/dist/templates/tanstack-start-2026-06-18/src/global.d.ts +3 -0
  54. package/dist/templates/tanstack-start-2026-06-18/src/hooks/use-mobile.tsx +19 -0
  55. package/dist/templates/tanstack-start-2026-06-18/src/lib/proxy.ts +83 -0
  56. package/dist/templates/tanstack-start-2026-06-18/src/lib/utils.ts +6 -0
  57. package/dist/templates/tanstack-start-2026-06-18/src/routeTree.gen.ts +59 -0
  58. package/dist/templates/tanstack-start-2026-06-18/src/router.tsx +33 -0
  59. package/dist/templates/tanstack-start-2026-06-18/src/routes/__root.tsx +60 -0
  60. package/dist/templates/tanstack-start-2026-06-18/src/routes/api/health.ts +81 -0
  61. package/dist/templates/tanstack-start-2026-06-18/src/routes/index.tsx +33 -0
  62. package/dist/templates/tanstack-start-2026-06-18/src/server.ts +32 -0
  63. package/dist/templates/tanstack-start-2026-06-18/src/styles.css +214 -0
  64. package/dist/templates/tanstack-start-2026-06-18/tsconfig.json +27 -0
  65. package/dist/templates/tanstack-start-2026-06-18/vite.config.ts +17 -0
  66. package/package.json +1 -1
  67. package/src/template-render.ts +5 -0
  68. package/src/templates/tanstack-start-2026-06-18/components.json +22 -0
  69. package/src/templates/tanstack-start-2026-06-18/drizzle.config.ts +15 -0
  70. package/src/templates/tanstack-start-2026-06-18/package.json +103 -0
  71. package/src/templates/tanstack-start-2026-06-18/src/components/ui/accordion.tsx +51 -0
  72. package/src/templates/tanstack-start-2026-06-18/src/components/ui/alert-dialog.tsx +115 -0
  73. package/src/templates/tanstack-start-2026-06-18/src/components/ui/alert.tsx +49 -0
  74. package/src/templates/tanstack-start-2026-06-18/src/components/ui/aspect-ratio.tsx +5 -0
  75. package/src/templates/tanstack-start-2026-06-18/src/components/ui/avatar.tsx +47 -0
  76. package/src/templates/tanstack-start-2026-06-18/src/components/ui/badge.tsx +32 -0
  77. package/src/templates/tanstack-start-2026-06-18/src/components/ui/breadcrumb.tsx +101 -0
  78. package/src/templates/tanstack-start-2026-06-18/src/components/ui/button.tsx +49 -0
  79. package/src/templates/tanstack-start-2026-06-18/src/components/ui/calendar.tsx +177 -0
  80. package/src/templates/tanstack-start-2026-06-18/src/components/ui/card.tsx +55 -0
  81. package/src/templates/tanstack-start-2026-06-18/src/components/ui/carousel.tsx +240 -0
  82. package/src/templates/tanstack-start-2026-06-18/src/components/ui/chart.tsx +331 -0
  83. package/src/templates/tanstack-start-2026-06-18/src/components/ui/checkbox.tsx +26 -0
  84. package/src/templates/tanstack-start-2026-06-18/src/components/ui/collapsible.tsx +11 -0
  85. package/src/templates/tanstack-start-2026-06-18/src/components/ui/command.tsx +143 -0
  86. package/src/templates/tanstack-start-2026-06-18/src/components/ui/context-menu.tsx +187 -0
  87. package/src/templates/tanstack-start-2026-06-18/src/components/ui/dialog.tsx +104 -0
  88. package/src/templates/tanstack-start-2026-06-18/src/components/ui/drawer.tsx +98 -0
  89. package/src/templates/tanstack-start-2026-06-18/src/components/ui/dropdown-menu.tsx +188 -0
  90. package/src/templates/tanstack-start-2026-06-18/src/components/ui/form.tsx +171 -0
  91. package/src/templates/tanstack-start-2026-06-18/src/components/ui/hover-card.tsx +27 -0
  92. package/src/templates/tanstack-start-2026-06-18/src/components/ui/input-otp.tsx +69 -0
  93. package/src/templates/tanstack-start-2026-06-18/src/components/ui/input.tsx +22 -0
  94. package/src/templates/tanstack-start-2026-06-18/src/components/ui/label.tsx +21 -0
  95. package/src/templates/tanstack-start-2026-06-18/src/components/ui/menubar.tsx +229 -0
  96. package/src/templates/tanstack-start-2026-06-18/src/components/ui/navigation-menu.tsx +120 -0
  97. package/src/templates/tanstack-start-2026-06-18/src/components/ui/pagination.tsx +98 -0
  98. package/src/templates/tanstack-start-2026-06-18/src/components/ui/popover.tsx +31 -0
  99. package/src/templates/tanstack-start-2026-06-18/src/components/ui/progress.tsx +25 -0
  100. package/src/templates/tanstack-start-2026-06-18/src/components/ui/radio-group.tsx +36 -0
  101. package/src/templates/tanstack-start-2026-06-18/src/components/ui/resizable.tsx +37 -0
  102. package/src/templates/tanstack-start-2026-06-18/src/components/ui/scroll-area.tsx +44 -0
  103. package/src/templates/tanstack-start-2026-06-18/src/components/ui/select.tsx +152 -0
  104. package/src/templates/tanstack-start-2026-06-18/src/components/ui/separator.tsx +24 -0
  105. package/src/templates/tanstack-start-2026-06-18/src/components/ui/sheet.tsx +122 -0
  106. package/src/templates/tanstack-start-2026-06-18/src/components/ui/sidebar.tsx +744 -0
  107. package/src/templates/tanstack-start-2026-06-18/src/components/ui/skeleton.tsx +7 -0
  108. package/src/templates/tanstack-start-2026-06-18/src/components/ui/slider.tsx +23 -0
  109. package/src/templates/tanstack-start-2026-06-18/src/components/ui/sonner.tsx +23 -0
  110. package/src/templates/tanstack-start-2026-06-18/src/components/ui/switch.tsx +27 -0
  111. package/src/templates/tanstack-start-2026-06-18/src/components/ui/table.tsx +94 -0
  112. package/src/templates/tanstack-start-2026-06-18/src/components/ui/tabs.tsx +53 -0
  113. package/src/templates/tanstack-start-2026-06-18/src/components/ui/textarea.tsx +21 -0
  114. package/src/templates/tanstack-start-2026-06-18/src/components/ui/toggle-group.tsx +57 -0
  115. package/src/templates/tanstack-start-2026-06-18/src/components/ui/toggle.tsx +42 -0
  116. package/src/templates/tanstack-start-2026-06-18/src/components/ui/tooltip.tsx +32 -0
  117. package/src/templates/tanstack-start-2026-06-18/src/db/index.ts +9 -0
  118. package/src/templates/tanstack-start-2026-06-18/src/db/schema.ts +18 -0
  119. package/src/templates/tanstack-start-2026-06-18/src/global.d.ts +3 -0
  120. package/src/templates/tanstack-start-2026-06-18/src/hooks/use-mobile.tsx +19 -0
  121. package/src/templates/tanstack-start-2026-06-18/src/lib/proxy.ts +83 -0
  122. package/src/templates/tanstack-start-2026-06-18/src/lib/utils.ts +6 -0
  123. package/src/templates/tanstack-start-2026-06-18/src/routeTree.gen.ts +59 -0
  124. package/src/templates/tanstack-start-2026-06-18/src/router.tsx +33 -0
  125. package/src/templates/tanstack-start-2026-06-18/src/routes/__root.tsx +60 -0
  126. package/src/templates/tanstack-start-2026-06-18/src/routes/api/health.ts +81 -0
  127. package/src/templates/tanstack-start-2026-06-18/src/routes/index.tsx +33 -0
  128. package/src/templates/tanstack-start-2026-06-18/src/server.ts +32 -0
  129. package/src/templates/tanstack-start-2026-06-18/src/styles.css +214 -0
  130. package/src/templates/tanstack-start-2026-06-18/tsconfig.json +27 -0
  131. package/src/templates/tanstack-start-2026-06-18/vite.config.ts +17 -0
  132. package/src/tools/scaffold.ts +42 -43
  133. package/src/tools/setup-netsuite.ts +28 -58
@@ -2,21 +2,17 @@ import { mkdir } from "node:fs/promises";
2
2
  import path from "node:path";
3
3
  import type { Plugin } from "@opencode-ai/plugin";
4
4
  import { tool } from "@opencode-ai/plugin";
5
- import { writeBaseScaffold } from "./scaffold.ts";
6
5
 
7
6
  /**
8
- * One-shot bootstrap for a NetSuite project. Writes the base HelloLeo
9
- * scaffold (via writeBaseScaffold) plus ADDITIVE NetSuite OAuth wiring:
10
- * the netsuite OAuth client, a NetSuite auth context (auth.tsx), and the
11
- * AuthLayout / LoginPage / SignInWithNetSuite components. It never
12
- * overwrites a scaffold file -- the one manual step is wrapping the root
13
- * route's <Outlet /> with <AuthLayout> (the tool's output shows the
14
- * snippet). All NetSuite-specific templates live in this file -- one place
15
- * to read or change anything NetSuite-related.
7
+ * Adds NetSuite OAuth wiring on top of an existing scaffold: the netsuite
8
+ * OAuth client, a NetSuite auth context (auth.tsx), and the AuthLayout /
9
+ * LoginPage / SignInWithNetSuite components. It never overwrites a
10
+ * scaffold file -- the one manual step is wrapping the root route's
11
+ * <Outlet /> with <AuthLayout> (the tool's output shows the snippet).
12
+ * All NetSuite-specific templates live in this file -- one place to read
13
+ * or change anything NetSuite-related.
16
14
  *
17
- * Use INSTEAD of `scaffold` when the project needs NetSuite. The tool
18
- * name carries the intent so the LLM can't accidentally ship a project
19
- * without the auth files.
15
+ * Called AFTER `scaffold`, never instead of it.
20
16
  */
21
17
 
22
18
  function netsuiteTs(): string {
@@ -345,21 +341,13 @@ function Gate({ children }: { children: ReactNode }) {
345
341
 
346
342
  export const setupNetsuite = tool({
347
343
  description:
348
- "Bootstrap a NetSuite-backed React + Vite + Tailwind v4 + TanStack Router " +
349
- "project in one call. Writes the full HelloLeo base scaffold PLUS the " +
350
- "NetSuite OAuth wiring, all ADDITIVE -- it never overwrites a scaffold " +
351
- "file. Adds src/lib/netsuite.ts (OAuth client), src/lib/auth.tsx " +
352
- "(NetSuiteAuthProvider + useNetSuiteAuth), and " +
353
- "src/components/auth/{AuthLayout,LoginPage,SignInWithNetSuite}.tsx. " +
354
- "Use this INSTEAD of `scaffold` for any project that needs NetSuite. " +
355
- "After it runs there is exactly ONE manual step: wrap the root route's " +
356
- "<Outlet /> with <AuthLayout> in src/routes/__root.tsx (the tool's output " +
357
- "shows the snippet). Real OAuth is wired from day one -- never replace " +
358
- "<AuthLayout> with a password placeholder.",
344
+ "Add NetSuite OAuth wiring to an existing project. Call scaffold first, " +
345
+ "then this. Writes the OAuth client, auth provider and login components. " +
346
+ "All files are additive, nothing is overwritten. Real OAuth is wired " +
347
+ "from day one, never replace <AuthLayout> with a password placeholder.",
359
348
  args: {},
360
349
  async execute(_args, context) {
361
350
  const dir = context.directory;
362
- const base = await writeBaseScaffold({}, dir);
363
351
 
364
352
  await mkdir(path.join(dir, "src", "components", "auth"), {
365
353
  recursive: true,
@@ -387,45 +375,27 @@ export const setupNetsuite = tool({
387
375
  await Bun.write(path.join(dir, filePath), content);
388
376
  }
389
377
 
390
- const all = [...base, ...nsFiles.map(([f]) => f)];
391
378
  return [
392
- `Generated ${all.length} files (base scaffold + NetSuite OAuth, all additive -- nothing overwritten).`,
379
+ `Wrote ${nsFiles.length} NetSuite OAuth files (all additive, nothing overwritten):`,
380
+ " - src/lib/netsuite.ts (OAuth client: signIn, session, workerFetch)",
381
+ " - src/lib/auth.tsx (NetSuiteAuthProvider and useNetSuiteAuth)",
382
+ " - src/components/auth/AuthLayout.tsx (provider and auth gate)",
383
+ " - src/components/auth/LoginPage.tsx (unauthenticated view)",
384
+ " - src/components/auth/SignInWithNetSuite.tsx (sign-in button)",
393
385
  "",
394
- "All you need to do is wrap the root layout with the auth layout.",
395
- "In src/routes/__root.tsx, import AuthLayout and wrap <Outlet />:",
386
+ "Notes:",
387
+ "- AuthLayout shows LoginPage to signed-out users and renders the app's routes once they sign in with NetSuite.",
388
+ "- Read the session anywhere with useNetSuiteAuth() from src/lib/auth.tsx.",
389
+ "- Never replace AuthLayout with a password gate. Real OAuth is the only supported login.",
390
+ "- The auth worker (deployed via the cloudflare-backend MCP) serves /auth/netsuite/start, /auth/netsuite/callback, /api/me and /auth/netsuite/logout. It reads env.NETSUITE_ACCOUNT_ID, _CLIENT_ID and _CLIENT_SECRET. VITE_WORKER_URL must be set (HelloLeo Cloud seeds it).",
396
391
  "",
397
- " import { AuthLayout } from '../components/auth/AuthLayout'",
398
- "",
399
- " function RootComponent() {",
400
- " return (",
401
- " <>",
402
- " <AuthLayout>",
403
- " <Outlet />",
404
- " </AuthLayout>",
405
- " {/* keep the existing <TanStackDevtools ... /> here */}",
406
- " </>",
407
- " )",
408
- " }",
392
+ "Next: in src/routes/__root.tsx, import AuthLayout and wrap <Outlet /> with it. Keep any existing providers.",
409
393
  "",
410
- "That single wrap gates every route: <LoginPage /> until the user signs",
411
- "in with NetSuite, your routes after. Read the session anywhere below it",
412
- "with useNetSuiteAuth() from src/lib/auth.tsx. NEVER swap <AuthLayout>",
413
- "for a password gate -- real OAuth is the only supported login.",
414
- "",
415
- "NetSuite OAuth files written:",
416
- " - src/lib/netsuite.ts OAuth client (signIn / session / workerFetch)",
417
- " - src/lib/auth.tsx NetSuiteAuthProvider + useNetSuiteAuth",
418
- " - src/components/auth/AuthLayout.tsx provider + gate (wrap root with this)",
419
- " - src/components/auth/LoginPage.tsx unauthenticated view",
420
- " - src/components/auth/SignInWithNetSuite.tsx sign-in button",
394
+ " import { AuthLayout } from '../components/auth/AuthLayout'",
421
395
  "",
422
- "Worker (deploy via cloudflare-backend MCP) must serve:",
423
- " GET /auth/netsuite/start -- redirect to NetSuite OAuth",
424
- " GET /auth/netsuite/callback -- code -> token exchange",
425
- " GET /api/me -- current session",
426
- " POST /auth/netsuite/logout -- clear session",
427
- " Reads env.NETSUITE_ACCOUNT_ID / _CLIENT_ID / _CLIENT_SECRET.",
428
- " VITE_WORKER_URL must be set (HelloLeo Cloud provisioner seeds it).",
396
+ " <AuthLayout>",
397
+ " <Outlet />",
398
+ " </AuthLayout>",
429
399
  ].join("\n");
430
400
  },
431
401
  });