mirror of
https://github.com/jakejarvis/stanza.git
synced 2026-07-16 18:05:58 -04:00
fix: rename auth-clerk's app-scoped middleware.ts → proxy.ts for Next 16
- Rename the template file and update `src`/`dest` in the adapter's file list to match the new `proxy.ts` convention required by Next 16 - Update the example filename in `AGENTS.md` and `authoring.mdx` (`middleware.ts` → `proxy.ts`) so the scope guidance stays accurate - Refactor `BarList` bar fill to animate `width` instead of `transform: scaleX` so the gradient and rounded cap don't distort; replace diagonal hatch overlay with a solid gradient + inset ring and tighten leading gap to `gap-1`
This commit is contained in:
@@ -58,7 +58,7 @@ Use `agent-browser` for web automation (`agent-browser --help`); prefer it over
|
||||
## Module authoring
|
||||
|
||||
- Modules live in `registry/modules/<category>-<id>/`. `module.ts` exports `defineModule({...})` with one `category` and ≥1 adapter (`match: {}` for "default / no peer"). For `many`-cardinality categories, give co-existing modules disjoint `scripts` keys / file paths so region claims don't collide
|
||||
- **Template `scope`**: `"app"` (default) → each targeted app's `dir`; `"repo"` → repo root; `"package"` → `packages/<dir>/` (only valid for `home: package` categories). For package-home modules, default to `scope: "package"` for everything that fits inside the package; reach for `"app"` only when framework convention forces it (e.g. Next `middleware.ts`). App-scoped files should be thin shims that import from `{{package.name}}` with `template: true`
|
||||
- **Template `scope`**: `"app"` (default) → each targeted app's `dir`; `"repo"` → repo root; `"package"` → `packages/<dir>/` (only valid for `home: package` categories). For package-home modules, default to `scope: "package"` for everything that fits inside the package; reach for `"app"` only when framework convention forces it (e.g. Next `proxy.ts`). App-scoped files should be thin shims that import from `{{package.name}}` with `template: true`
|
||||
- **Hoist shared install fields** (`dependencies`, `devDependencies`, `env`, `scripts`, `consumesPackages`) to the module level. Adapter-level values still override per-key (`env` merges by `name`)
|
||||
- **Never ship `package.json` or `tsconfig.json` templates** — they collide with the runner's `ensureSlotPackage` / `addPackageDependency`. Framework modules must not ship `package.json.tpl`; package-home modules must not ship `packages/<dir>/package.json`
|
||||
- **Codemod invocations**: `codemods: [{ id, args }]` on the adapter. String values in `args` go through mustache (same template context). For codemods operating on files inside a slot's package, pass `base: "package:<dir>"` (honored by `re-export` and `append-to-file`)
|
||||
|
||||
@@ -91,7 +91,7 @@ Every module fills exactly one [category](/docs/concepts#categories). A category
|
||||
- **`home: "repo"`** (`tooling`, `monorepo`, `deploy`) — config + scripts land at the monorepo root.
|
||||
- **`home: "package"`** (`auth`, `db`, `orm`, `ui`, `api`, `ai`, `payments`, `email`) — the module installs into its own workspace package at `packages/<dir>/`, named `@<project>/<dir>`. Every consuming app gets a `workspace:*` dep.
|
||||
|
||||
Template `scope` derives from this. For a package-home module, prefer `scope: "package"` for everything that can live inside the package, and reach for `scope: "app"` only when a framework convention forces a file to the app root (e.g. Next's `middleware.ts`).
|
||||
Template `scope` derives from this. For a package-home module, prefer `scope: "package"` for everything that can live inside the package, and reach for `scope: "app"` only when a framework convention forces a file to the app root (e.g. Next's `proxy.ts`).
|
||||
|
||||
## Adapters and peer resolution
|
||||
|
||||
|
||||
@@ -29,9 +29,10 @@ type BarListProps = {
|
||||
* interactive when `href` is set: hover deepens the fill so the affordance is
|
||||
* felt across the whole bar, not just the link text.
|
||||
*
|
||||
* Bars carry an EvilCharts-style diagonal hatch laid over a horizontal gradient,
|
||||
* and grow in from 0% on mount with a small per-row stagger so the leaderboard
|
||||
* settles into place instead of flashing fully-formed.
|
||||
* Bars grow in from 0 on mount with a small per-row stagger so the leaderboard
|
||||
* settles into place instead of flashing fully-formed. Animating `width` (not
|
||||
* `transform: scaleX`) keeps the fill's gradient and rounded cap from distorting
|
||||
* relative to the row's actual filled length.
|
||||
*/
|
||||
export function BarList({ data, emptyMessage = "No data yet.", className }: BarListProps) {
|
||||
// Bars render at width 0 on first commit, then transition to their real
|
||||
@@ -60,25 +61,24 @@ export function BarList({ data, emptyMessage = "No data yet.", className }: BarL
|
||||
{data.map((entry, idx) => {
|
||||
const pct = (entry.value / max) * 100;
|
||||
return (
|
||||
<li key={entry.name} className="group/row relative h-7 overflow-hidden">
|
||||
<li key={entry.name} className="group/row relative h-7">
|
||||
<div
|
||||
aria-hidden="true"
|
||||
className={cn(
|
||||
"absolute inset-y-0 left-0 w-full origin-left bg-gradient-to-r from-muted via-muted/70 to-muted/30 transition-transform duration-700 ease-out motion-reduce:transition-none",
|
||||
"group-hover/row:from-foreground/20 group-hover/row:via-foreground/12 group-hover/row:to-foreground/5",
|
||||
)}
|
||||
className="absolute inset-y-0 left-0 transition-[width] duration-700 ease-out motion-reduce:transition-none"
|
||||
style={{
|
||||
transform: `scaleX(${mounted ? pct / 100 : 0})`,
|
||||
width: mounted ? `${pct}%` : 0,
|
||||
transitionDelay: `${Math.min(idx * 40, 240)}ms`,
|
||||
}}
|
||||
>
|
||||
<div
|
||||
aria-hidden="true"
|
||||
className="absolute inset-0 bg-[image:repeating-linear-gradient(135deg,currentColor_0_1px,transparent_1px_5px)] text-foreground opacity-[0.07] transition-opacity duration-300 group-hover/row:opacity-[0.14] motion-reduce:transition-none"
|
||||
className={cn(
|
||||
"absolute inset-0 bg-gradient-to-r from-foreground/[0.10] to-foreground/[0.04] ring-1 ring-foreground/[0.04] transition-colors duration-200 ring-inset",
|
||||
"group-hover/row:from-foreground/[0.18] group-hover/row:to-foreground/[0.08] group-hover/row:ring-foreground/[0.08]",
|
||||
)}
|
||||
/>
|
||||
</div>
|
||||
<div className="relative flex h-full items-center justify-between gap-3 px-2 text-xs">
|
||||
<div className="flex min-w-0 items-center gap-2">
|
||||
<div className="flex min-w-0 items-center gap-1">
|
||||
{entry.leading}
|
||||
{entry.href ? (
|
||||
<a
|
||||
|
||||
@@ -36,10 +36,10 @@ export default defineModule({
|
||||
// Package-scoped: provider + barrel land in packages/auth/.
|
||||
{ src: "next/provider.tsx", dest: "src/provider.tsx", scope: "package" },
|
||||
{ src: "next/index.ts", dest: "src/index.ts", scope: "package" },
|
||||
// App-scoped: Next requires middleware.ts at the app root. We ship a
|
||||
// thin shim that re-exports clerkMiddleware from the auth package, so
|
||||
// the @clerk/nextjs dep stays in packages/auth/.
|
||||
{ src: "next/middleware.ts", dest: "middleware.ts", scope: "app", template: true },
|
||||
// App-scoped: Next 16 requires proxy.ts at the app root (renamed from
|
||||
// middleware.ts). We ship a thin shim that re-exports clerkMiddleware
|
||||
// from the auth package, so the @clerk/nextjs dep stays in packages/auth/.
|
||||
{ src: "next/proxy.ts", dest: "proxy.ts", scope: "app", template: true },
|
||||
],
|
||||
codemods: [
|
||||
{
|
||||
|
||||
+1
@@ -6,5 +6,6 @@ export const config = {
|
||||
matcher: [
|
||||
"/((?!_next|[^?]*\\.(?:html?|css|js(?!on)|jpe?g|webp|png|gif|svg|ttf|woff2?|ico|csv|docx?|xlsx?|zip|webmanifest)).*)",
|
||||
"/(api|trpc)(.*)",
|
||||
"/__clerk/(.*)",
|
||||
],
|
||||
};
|
||||
Reference in New Issue
Block a user