Repository navigation
feat(cli): add evlog addon - #1030
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
1181506 to
8f3ca32
Compare
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
WalkthroughAdds first-class support for the "evlog" addon across CLI, prompts, validation, generator templates/deps, web UI, types/schemas, docs, and tests, including addon-setup wiring, compatibility rules, curated skills source, dependency pins, and extensive regression/unit tests. Changes
Possibly related PRs
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 37df2059-7ef8-4838-8577-2811566ccefe
📒 Files selected for processing (32)
apps/cli/README.mdapps/cli/src/constants.tsapps/cli/src/helpers/addons/addons-setup.tsapps/cli/src/helpers/addons/evlog-setup.tsapps/cli/src/helpers/addons/skills-setup.tsapps/cli/src/helpers/core/add-handler.tsapps/cli/src/helpers/core/command-handlers.tsapps/cli/src/prompts/addons.tsapps/cli/src/prompts/config-prompts.tsapps/cli/src/utils/compatibility-rules.tsapps/cli/src/utils/config-validation.tsapps/cli/test/addon-setup-regressions.test.tsapps/cli/test/addons.test.tsapps/cli/test/input-schemas.test.tsapps/web/content/docs/cli/agent-workflows.mdxapps/web/content/docs/cli/options.mdxapps/web/content/docs/index.mdxapps/web/content/docs/project-structure.mdxapps/web/src/app/(home)/new/_components/utils.tsapps/web/src/lib/constant.tsapps/web/src/lib/stack-utils.tsapps/web/test/stack-builder-compatibility.test.tspackages/template-generator/src/processors/addons-deps.tspackages/template-generator/src/processors/db-deps.tspackages/template-generator/src/processors/workspace-deps.tspackages/template-generator/src/templates.generated.tspackages/template-generator/src/utils/add-deps.tspackages/template-generator/templates/auth/better-auth/web/svelte/src/components/SignInForm.svelte.hbspackages/template-generator/templates/auth/better-auth/web/svelte/src/components/SignUpForm.svelte.hbspackages/template-generator/templates/backend/server/elysia/src/index.ts.hbspackages/template-generator/templates/frontend/react/next/next.config.ts.hbspackages/types/src/schemas.ts
| { | ||
| "source": "https://www.evlog.dev", | ||
| "skills": ["review-logging-patterns", "analyze-logs"] | ||
| } |
There was a problem hiding this comment.
Clarify the add-json Evlog example by including the evlog addon.
The example adds Evlog-specific skills but the addons list does not include evlog, which makes the intent ambiguous.
Suggested docs fix
- "addons": ["skills", "ultracite"],
+ "addons": ["skills", "ultracite", "evlog"],8f3ca32 to
a3f2e30
Compare
There was a problem hiding this comment.
Actionable comments posted: 1
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: bead96b8-42c6-431d-be13-f8884fc319d8
📒 Files selected for processing (12)
apps/cli/README.mdapps/cli/src/helpers/addons/evlog-setup.tsapps/cli/src/helpers/core/add-handler.tsapps/cli/src/helpers/core/command-handlers.tsapps/cli/src/prompts/addons.tsapps/cli/src/prompts/config-prompts.tsapps/cli/src/utils/compatibility-rules.tsapps/cli/src/utils/config-validation.tsapps/cli/test/addons.test.tsapps/web/content/docs/cli/options.mdxapps/web/src/app/(home)/new/_components/utils.tsapps/web/test/stack-builder-compatibility.test.ts
✅ Files skipped from review due to trivial changes (1)
- apps/web/content/docs/cli/options.mdx
🚧 Files skipped from review as they are similar to previous changes (2)
- apps/cli/src/prompts/config-prompts.ts
- apps/web/test/stack-builder-compatibility.test.ts
| async function readSourceFiles(dir: string): Promise<{ path: string; content: string }[]> { | ||
| if (!existsSync(dir)) return []; | ||
|
|
||
| const entries = await readdir(dir, { withFileTypes: true }); | ||
| const files = await Promise.all( | ||
| entries.map(async (entry) => { | ||
| const entryPath = join(dir, entry.name); | ||
| if (entry.isDirectory()) return readSourceFiles(entryPath); | ||
| if (!/\.(?:cjs|js|mjs|ts|tsx|vue)$/.test(entry.name)) return []; | ||
| return [{ path: entryPath, content: await readFile(entryPath, "utf-8") }]; | ||
| }), | ||
| ); | ||
|
|
||
| return files.flat(); | ||
| } | ||
|
|
||
| function expectParseableTypeScript(content: string) { | ||
| const diagnostics = | ||
| transpileModule(content, { | ||
| compilerOptions: { | ||
| module: ModuleKind.ESNext, | ||
| target: ScriptTarget.ESNext, | ||
| }, | ||
| reportDiagnostics: true, | ||
| }).diagnostics?.filter((diagnostic) => diagnostic.category === DiagnosticCategory.Error) ?? []; | ||
|
|
||
| expect( | ||
| diagnostics.map((diagnostic) => flattenDiagnosticMessageText(diagnostic.messageText, "\n")), | ||
| ).toEqual([]); | ||
| } |
There was a problem hiding this comment.
🧩 Analysis chain
🌐 Web query:
TypeScript 6.0 transpileModule API changes
💡 Result:
In TypeScript 6.0, the transpileModule API has a breaking change related to the handling of the rootDir compiler option. Previously, in TypeScript 5.x, transpileModule would silently infer rootDir from the common source directory if not explicitly set. In 6.0, rootDir must be explicitly provided in the compilerOptions passed to transpileModule; setting it to undefined (as some tools like ts-loader did) now triggers error TS5011: "The common source directory of 'tsconfig.json' is './src/connect'. The 'rootDir' setting must be explicitly set to this or another path to adjust your output's file layout." This change aligns with broader 6.0 updates where rootDir defaults to the tsconfig directory instead of being inferred, affecting standalone transpile scenarios. Tools using transpileModule need to ensure rootDir is explicitly passed from their configuration rather than overridden to undefined. No other API changes to transpileModule parameters, return types, or behavior are documented in official TypeScript 6.0 release notes. The compiler API remains compatible with 5.9 as stated in announcements.
Citations:
- 1: https://www.typescriptlang.org/docs/handbook/release-notes/typescript-6-0.html
- 2: https://devblogs.microsoft.com/typescript/announcing-typescript-6-0/
- 3: https://devblogs.microsoft.com/typescript/announcing-typescript-6-0-rc
- 4: https://github.com/TypeStrong/ts-loader/releases
- 5: TS5011 errors with TypeScript 6.0: transpileModule called with rootDir: undefined TypeStrong/ts-loader#1678
- 6: fix: TS5011 errors with TypeScript 6.0: transpileModule called with rootDir: undefined TypeStrong/ts-loader#1679
- 7: 6.0 Migration Guide microsoft/TypeScript#62508
🏁 Script executed:
fd package.json | head -10Repository: AmanVarshney01/create-better-t-stack
Length of output: 553
🏁 Script executed:
cat package.json | grep -A 2 -B 2 typescriptRepository: AmanVarshney01/create-better-t-stack
Length of output: 316
🏁 Script executed:
cat apps/cli/test/setup.ts 2>/dev/null || echo "Setup file not found"Repository: AmanVarshney01/create-better-t-stack
Length of output: 1678
🏁 Script executed:
cat tsconfig.json 2>/dev/null | head -30Repository: AmanVarshney01/create-better-t-stack
Length of output: 793
Add explicit rootDir to transpileModule call for TypeScript 6.0 compatibility.
The expectParseableTypeScript function calls transpileModule without setting rootDir in compilerOptions. TypeScript 6.0 requires rootDir to be explicitly provided; omitting it triggers error TS5011. Add rootDir: "." (or an appropriate path) to the compilerOptions:
Fix for expectParseableTypeScript
function expectParseableTypeScript(content: string) {
const diagnostics =
transpileModule(content, {
compilerOptions: {
module: ModuleKind.ESNext,
target: ScriptTarget.ESNext,
rootDir: ".",
},
reportDiagnostics: true,
}).diagnostics?.filter((diagnostic) => diagnostic.category === DiagnosticCategory.Error) ?? [];
expect(
diagnostics.map((diagnostic) => flattenDiagnosticMessageText(diagnostic.messageText, "\n")),
).toEqual([]);
}a3f2e30 to
fff37a5
Compare
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (2)
apps/cli/src/utils/compatibility-rules.ts (1)
89-106: 💤 Low valueUnused
_runtimeparameter insupportsEvlogAddon.The
_runtimeparameter is declared but never used in the function body. If this is intentional for future use, the underscore prefix is appropriate. However, if runtime should affect evlog compatibility (e.g., workers runtime restrictions), this may be incomplete.💡 If runtime is not needed, consider removing it
export function supportsEvlogAddon( frontend: Frontend[] = [], backend?: Backend, - _runtime?: Runtime, ) {And update all call sites accordingly in
validateAddonCompatibilityandgetCompatibleAddons.apps/cli/src/helpers/addons/evlog-setup.ts (1)
124-154: 💤 Low valueConsider edge case when
streamTextcall structure varies.The regex patterns for AI SDK telemetry wiring assume specific code structure (e.g.,
const result = streamText({...model,...). If the generated template code structure changes, these patterns may fail silently sinceinsertAfterOnceand string replacements return unchanged content when markers aren't found.This is acceptable for template-controlled code, but worth noting for maintainability.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 860ff152-89c5-4e58-8e79-14f4997a8f44
📒 Files selected for processing (13)
apps/cli/README.mdapps/cli/src/helpers/addons/evlog-setup.tsapps/cli/src/helpers/core/add-handler.tsapps/cli/src/helpers/core/command-handlers.tsapps/cli/src/prompts/addons.tsapps/cli/src/prompts/config-prompts.tsapps/cli/src/utils/compatibility-rules.tsapps/cli/src/utils/config-validation.tsapps/cli/test/addons.test.tsapps/web/content/docs/cli/options.mdxapps/web/src/app/(home)/new/_components/utils.tsapps/web/test/stack-builder-compatibility.test.tspackages/template-generator/src/processors/alchemy-plugins.ts
✅ Files skipped from review due to trivial changes (3)
- apps/web/content/docs/cli/options.mdx
- apps/cli/src/utils/config-validation.ts
- apps/cli/test/addons.test.ts
🚧 Files skipped from review as they are similar to previous changes (1)
- apps/cli/README.md
There was a problem hiding this comment.
Actionable comments posted: 4
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 6c5472b9-685e-4ecb-bc94-c1532233c7f5
📒 Files selected for processing (10)
apps/cli/src/helpers/addons/evlog-setup.tsapps/cli/test/addons.test.tspackages/template-generator/src/processors/alchemy-plugins.tspackages/template-generator/src/processors/auth-deps.tspackages/template-generator/src/templates.generated.tspackages/template-generator/src/utils/add-deps.tspackages/template-generator/templates/auth/better-auth/web/nuxt/app/plugins/auth-client.ts.hbspackages/template-generator/templates/frontend/nuxt/nuxt.config.ts.hbspackages/template-generator/templates/frontend/nuxt/package.json.hbspackages/template-generator/templates/packages/env/src/server.ts.hbs
✅ Files skipped from review due to trivial changes (3)
- packages/template-generator/src/processors/auth-deps.ts
- packages/template-generator/templates/packages/env/src/server.ts.hbs
- packages/template-generator/templates/frontend/nuxt/package.json.hbs
🚧 Files skipped from review as they are similar to previous changes (2)
- packages/template-generator/src/utils/add-deps.ts
- packages/template-generator/src/templates.generated.ts
Summary
Adds an
evlogaddon to Better T Stack.The addon wires structured request logging into supported generated apps:
better-t-stack addskillsis selected with the Evlog addonLatest Package Alignment
better-authand@better-auth/expoto1.6.9@convex-dev/better-auth@^0.12.1nuxt@^4.4.4evlog@^2.14.1is already the latest published evlog versionCompatibility
Evlog is hidden and blocked for unsupported stacks, especially Convex and backend
none. The CLI prompt, flag validation,addcommand, and/newstack builder share the same compatibility shape so unsupported stacks do not show or accept the addon.Fixes Covered
createAuthMiddleware(auth as BetterAuthInstance, ...)orcreateAuthIdentifier(auth as BetterAuthInstance, ...)directly.declare module "h3",H3EventContext,createEvlogAuth,toHeaders, andas unknown as BetterAuthInstancecode from evlog auth output.createAuth()is not evaluated before runtime env exists.createAuthMiddlewareand no Nitro plugin event cast.createAuthIdentifiershape.cloudflare:workersfallback wiring for generated Nuxt, TanStack Start, and Astro Cloudflare web builds when Alchemy config is not present yet..envloader whenevent.platform.envis unavailable.baseURLthrough the Nuxt client plugin for self backend projects.Validation
bun run checkpasses with 0 warnings and 0 errors.bun run build:clipasses.bun test apps/cli/test/addons.test.ts -t "Evlog Addon"passes: 33 tests, 442 expects.install: truepassed for all 31 evlog-supported combinations. Each case ran dependency install,bun run check-types,bun run build, and a runtime HTTP smoke:webDeploynone/Cloudflare where supportedrgscan confirms removed bridge/hack strings only exist in negative test assertions.cd apps/cli && bun run testfull-suite runs hit unrelated long-running child-process timeouts in existing git-init/create smoke tests under Bun's per-test timeout. The exact timed-out cases rerun individually passed, includingPWA + tanstack-router,nuxt + oRPC, andsilent-create-output.test.ts.Source Checks
https://www.evlog.dev/llms.txthttps://www.evlog.dev/raw/logging/better-auth.mdhttps://www.evlog.dev/raw/frameworks/nitro.mdhttps://www.evlog.dev/raw/frameworks/tanstack-start.mdHugoRCD/evlogsource integration typesHugoRCD/evlogGitHub issues for an existing Better Auth header/type mismatch report; no exact issue found