@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.
- package/dist/index.js +12361 -58
- package/dist/templates/tanstack-start-2026-06-18/components.json +22 -0
- package/dist/templates/tanstack-start-2026-06-18/drizzle.config.ts +15 -0
- package/dist/templates/tanstack-start-2026-06-18/package.json +103 -0
- package/dist/templates/tanstack-start-2026-06-18/src/components/ui/accordion.tsx +51 -0
- package/dist/templates/tanstack-start-2026-06-18/src/components/ui/alert-dialog.tsx +115 -0
- package/dist/templates/tanstack-start-2026-06-18/src/components/ui/alert.tsx +49 -0
- package/dist/templates/tanstack-start-2026-06-18/src/components/ui/aspect-ratio.tsx +5 -0
- package/dist/templates/tanstack-start-2026-06-18/src/components/ui/avatar.tsx +47 -0
- package/dist/templates/tanstack-start-2026-06-18/src/components/ui/badge.tsx +32 -0
- package/dist/templates/tanstack-start-2026-06-18/src/components/ui/breadcrumb.tsx +101 -0
- package/dist/templates/tanstack-start-2026-06-18/src/components/ui/button.tsx +49 -0
- package/dist/templates/tanstack-start-2026-06-18/src/components/ui/calendar.tsx +177 -0
- package/dist/templates/tanstack-start-2026-06-18/src/components/ui/card.tsx +55 -0
- package/dist/templates/tanstack-start-2026-06-18/src/components/ui/carousel.tsx +240 -0
- package/dist/templates/tanstack-start-2026-06-18/src/components/ui/chart.tsx +331 -0
- package/dist/templates/tanstack-start-2026-06-18/src/components/ui/checkbox.tsx +26 -0
- package/dist/templates/tanstack-start-2026-06-18/src/components/ui/collapsible.tsx +11 -0
- package/dist/templates/tanstack-start-2026-06-18/src/components/ui/command.tsx +143 -0
- package/dist/templates/tanstack-start-2026-06-18/src/components/ui/context-menu.tsx +187 -0
- package/dist/templates/tanstack-start-2026-06-18/src/components/ui/dialog.tsx +104 -0
- package/dist/templates/tanstack-start-2026-06-18/src/components/ui/drawer.tsx +98 -0
- package/dist/templates/tanstack-start-2026-06-18/src/components/ui/dropdown-menu.tsx +188 -0
- package/dist/templates/tanstack-start-2026-06-18/src/components/ui/form.tsx +171 -0
- package/dist/templates/tanstack-start-2026-06-18/src/components/ui/hover-card.tsx +27 -0
- package/dist/templates/tanstack-start-2026-06-18/src/components/ui/input-otp.tsx +69 -0
- package/dist/templates/tanstack-start-2026-06-18/src/components/ui/input.tsx +22 -0
- package/dist/templates/tanstack-start-2026-06-18/src/components/ui/label.tsx +21 -0
- package/dist/templates/tanstack-start-2026-06-18/src/components/ui/menubar.tsx +229 -0
- package/dist/templates/tanstack-start-2026-06-18/src/components/ui/navigation-menu.tsx +120 -0
- package/dist/templates/tanstack-start-2026-06-18/src/components/ui/pagination.tsx +98 -0
- package/dist/templates/tanstack-start-2026-06-18/src/components/ui/popover.tsx +31 -0
- package/dist/templates/tanstack-start-2026-06-18/src/components/ui/progress.tsx +25 -0
- package/dist/templates/tanstack-start-2026-06-18/src/components/ui/radio-group.tsx +36 -0
- package/dist/templates/tanstack-start-2026-06-18/src/components/ui/resizable.tsx +37 -0
- package/dist/templates/tanstack-start-2026-06-18/src/components/ui/scroll-area.tsx +44 -0
- package/dist/templates/tanstack-start-2026-06-18/src/components/ui/select.tsx +152 -0
- package/dist/templates/tanstack-start-2026-06-18/src/components/ui/separator.tsx +24 -0
- package/dist/templates/tanstack-start-2026-06-18/src/components/ui/sheet.tsx +122 -0
- package/dist/templates/tanstack-start-2026-06-18/src/components/ui/sidebar.tsx +744 -0
- package/dist/templates/tanstack-start-2026-06-18/src/components/ui/skeleton.tsx +7 -0
- package/dist/templates/tanstack-start-2026-06-18/src/components/ui/slider.tsx +23 -0
- package/dist/templates/tanstack-start-2026-06-18/src/components/ui/sonner.tsx +23 -0
- package/dist/templates/tanstack-start-2026-06-18/src/components/ui/switch.tsx +27 -0
- package/dist/templates/tanstack-start-2026-06-18/src/components/ui/table.tsx +94 -0
- package/dist/templates/tanstack-start-2026-06-18/src/components/ui/tabs.tsx +53 -0
- package/dist/templates/tanstack-start-2026-06-18/src/components/ui/textarea.tsx +21 -0
- package/dist/templates/tanstack-start-2026-06-18/src/components/ui/toggle-group.tsx +57 -0
- package/dist/templates/tanstack-start-2026-06-18/src/components/ui/toggle.tsx +42 -0
- package/dist/templates/tanstack-start-2026-06-18/src/components/ui/tooltip.tsx +32 -0
- package/dist/templates/tanstack-start-2026-06-18/src/db/index.ts +9 -0
- package/dist/templates/tanstack-start-2026-06-18/src/db/schema.ts +18 -0
- package/dist/templates/tanstack-start-2026-06-18/src/global.d.ts +3 -0
- package/dist/templates/tanstack-start-2026-06-18/src/hooks/use-mobile.tsx +19 -0
- package/dist/templates/tanstack-start-2026-06-18/src/lib/proxy.ts +83 -0
- package/dist/templates/tanstack-start-2026-06-18/src/lib/utils.ts +6 -0
- package/dist/templates/tanstack-start-2026-06-18/src/routeTree.gen.ts +59 -0
- package/dist/templates/tanstack-start-2026-06-18/src/router.tsx +33 -0
- package/dist/templates/tanstack-start-2026-06-18/src/routes/__root.tsx +60 -0
- package/dist/templates/tanstack-start-2026-06-18/src/routes/api/health.ts +81 -0
- package/dist/templates/tanstack-start-2026-06-18/src/routes/index.tsx +33 -0
- package/dist/templates/tanstack-start-2026-06-18/src/server.ts +32 -0
- package/dist/templates/tanstack-start-2026-06-18/src/styles.css +214 -0
- package/dist/templates/tanstack-start-2026-06-18/tsconfig.json +27 -0
- package/dist/templates/tanstack-start-2026-06-18/vite.config.ts +17 -0
- package/package.json +1 -1
- package/src/template-render.ts +5 -0
- package/src/templates/tanstack-start-2026-06-18/components.json +22 -0
- package/src/templates/tanstack-start-2026-06-18/drizzle.config.ts +15 -0
- package/src/templates/tanstack-start-2026-06-18/package.json +103 -0
- package/src/templates/tanstack-start-2026-06-18/src/components/ui/accordion.tsx +51 -0
- package/src/templates/tanstack-start-2026-06-18/src/components/ui/alert-dialog.tsx +115 -0
- package/src/templates/tanstack-start-2026-06-18/src/components/ui/alert.tsx +49 -0
- package/src/templates/tanstack-start-2026-06-18/src/components/ui/aspect-ratio.tsx +5 -0
- package/src/templates/tanstack-start-2026-06-18/src/components/ui/avatar.tsx +47 -0
- package/src/templates/tanstack-start-2026-06-18/src/components/ui/badge.tsx +32 -0
- package/src/templates/tanstack-start-2026-06-18/src/components/ui/breadcrumb.tsx +101 -0
- package/src/templates/tanstack-start-2026-06-18/src/components/ui/button.tsx +49 -0
- package/src/templates/tanstack-start-2026-06-18/src/components/ui/calendar.tsx +177 -0
- package/src/templates/tanstack-start-2026-06-18/src/components/ui/card.tsx +55 -0
- package/src/templates/tanstack-start-2026-06-18/src/components/ui/carousel.tsx +240 -0
- package/src/templates/tanstack-start-2026-06-18/src/components/ui/chart.tsx +331 -0
- package/src/templates/tanstack-start-2026-06-18/src/components/ui/checkbox.tsx +26 -0
- package/src/templates/tanstack-start-2026-06-18/src/components/ui/collapsible.tsx +11 -0
- package/src/templates/tanstack-start-2026-06-18/src/components/ui/command.tsx +143 -0
- package/src/templates/tanstack-start-2026-06-18/src/components/ui/context-menu.tsx +187 -0
- package/src/templates/tanstack-start-2026-06-18/src/components/ui/dialog.tsx +104 -0
- package/src/templates/tanstack-start-2026-06-18/src/components/ui/drawer.tsx +98 -0
- package/src/templates/tanstack-start-2026-06-18/src/components/ui/dropdown-menu.tsx +188 -0
- package/src/templates/tanstack-start-2026-06-18/src/components/ui/form.tsx +171 -0
- package/src/templates/tanstack-start-2026-06-18/src/components/ui/hover-card.tsx +27 -0
- package/src/templates/tanstack-start-2026-06-18/src/components/ui/input-otp.tsx +69 -0
- package/src/templates/tanstack-start-2026-06-18/src/components/ui/input.tsx +22 -0
- package/src/templates/tanstack-start-2026-06-18/src/components/ui/label.tsx +21 -0
- package/src/templates/tanstack-start-2026-06-18/src/components/ui/menubar.tsx +229 -0
- package/src/templates/tanstack-start-2026-06-18/src/components/ui/navigation-menu.tsx +120 -0
- package/src/templates/tanstack-start-2026-06-18/src/components/ui/pagination.tsx +98 -0
- package/src/templates/tanstack-start-2026-06-18/src/components/ui/popover.tsx +31 -0
- package/src/templates/tanstack-start-2026-06-18/src/components/ui/progress.tsx +25 -0
- package/src/templates/tanstack-start-2026-06-18/src/components/ui/radio-group.tsx +36 -0
- package/src/templates/tanstack-start-2026-06-18/src/components/ui/resizable.tsx +37 -0
- package/src/templates/tanstack-start-2026-06-18/src/components/ui/scroll-area.tsx +44 -0
- package/src/templates/tanstack-start-2026-06-18/src/components/ui/select.tsx +152 -0
- package/src/templates/tanstack-start-2026-06-18/src/components/ui/separator.tsx +24 -0
- package/src/templates/tanstack-start-2026-06-18/src/components/ui/sheet.tsx +122 -0
- package/src/templates/tanstack-start-2026-06-18/src/components/ui/sidebar.tsx +744 -0
- package/src/templates/tanstack-start-2026-06-18/src/components/ui/skeleton.tsx +7 -0
- package/src/templates/tanstack-start-2026-06-18/src/components/ui/slider.tsx +23 -0
- package/src/templates/tanstack-start-2026-06-18/src/components/ui/sonner.tsx +23 -0
- package/src/templates/tanstack-start-2026-06-18/src/components/ui/switch.tsx +27 -0
- package/src/templates/tanstack-start-2026-06-18/src/components/ui/table.tsx +94 -0
- package/src/templates/tanstack-start-2026-06-18/src/components/ui/tabs.tsx +53 -0
- package/src/templates/tanstack-start-2026-06-18/src/components/ui/textarea.tsx +21 -0
- package/src/templates/tanstack-start-2026-06-18/src/components/ui/toggle-group.tsx +57 -0
- package/src/templates/tanstack-start-2026-06-18/src/components/ui/toggle.tsx +42 -0
- package/src/templates/tanstack-start-2026-06-18/src/components/ui/tooltip.tsx +32 -0
- package/src/templates/tanstack-start-2026-06-18/src/db/index.ts +9 -0
- package/src/templates/tanstack-start-2026-06-18/src/db/schema.ts +18 -0
- package/src/templates/tanstack-start-2026-06-18/src/global.d.ts +3 -0
- package/src/templates/tanstack-start-2026-06-18/src/hooks/use-mobile.tsx +19 -0
- package/src/templates/tanstack-start-2026-06-18/src/lib/proxy.ts +83 -0
- package/src/templates/tanstack-start-2026-06-18/src/lib/utils.ts +6 -0
- package/src/templates/tanstack-start-2026-06-18/src/routeTree.gen.ts +59 -0
- package/src/templates/tanstack-start-2026-06-18/src/router.tsx +33 -0
- package/src/templates/tanstack-start-2026-06-18/src/routes/__root.tsx +60 -0
- package/src/templates/tanstack-start-2026-06-18/src/routes/api/health.ts +81 -0
- package/src/templates/tanstack-start-2026-06-18/src/routes/index.tsx +33 -0
- package/src/templates/tanstack-start-2026-06-18/src/server.ts +32 -0
- package/src/templates/tanstack-start-2026-06-18/src/styles.css +214 -0
- package/src/templates/tanstack-start-2026-06-18/tsconfig.json +27 -0
- package/src/templates/tanstack-start-2026-06-18/vite.config.ts +17 -0
- package/src/tools/scaffold.ts +42 -43
- 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
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
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
|
-
*
|
|
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
|
-
"
|
|
349
|
-
"
|
|
350
|
-
"
|
|
351
|
-
"
|
|
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
|
-
`
|
|
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
|
-
"
|
|
395
|
-
"
|
|
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
|
-
"
|
|
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
|
-
"
|
|
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
|
-
"
|
|
423
|
-
"
|
|
424
|
-
"
|
|
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
|
});
|