Add Oxc checks and PR preview publishing#18
Conversation
WalkthroughThis PR introduces linting and formatting tools (oxlint and oxfmt) to the project, restructures CI/CD workflows for npm package previews and releases, updates package metadata configuration, and applies comprehensive code formatting across source and template files. Changes
Possibly related PRs
Suggested reviewers
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
src/tasks/setup-prisma.ts (1)
420-428: 🧹 Nitpick | 🔵 TrivialConsider extracting the nested ternary to improve readability.
The deeply nested ternary chain for resolving
singletonPathworks correctly but is difficult to scan. A helper function or early-return pattern would improve maintainability.♻️ Optional refactor using a lookup array
+async function resolveSingletonPath(prismaProjectDir: string): Promise<string> { + const candidates = [ + "src/lib/prisma.ts", + "src/lib/prisma.server.ts", + "src/lib/server/prisma.ts", + "server/utils/prisma.ts", + ]; + + for (const candidate of candidates) { + if (await fs.pathExists(path.join(prismaProjectDir, candidate))) { + return path.join(prismaProjectDir, candidate); + } + } + + return path.join(prismaProjectDir, "src/client.ts"); +}Then replace the nested ternary:
- const singletonPath = (await fs.pathExists(path.join(prismaProjectDir, "src/lib/prisma.ts"))) - ? path.join(prismaProjectDir, "src/lib/prisma.ts") - : (await fs.pathExists(path.join(prismaProjectDir, "src/lib/prisma.server.ts"))) - ? path.join(prismaProjectDir, "src/lib/prisma.server.ts") - : (await fs.pathExists(path.join(prismaProjectDir, "src/lib/server/prisma.ts"))) - ? path.join(prismaProjectDir, "src/lib/server/prisma.ts") - : (await fs.pathExists(path.join(prismaProjectDir, "server/utils/prisma.ts"))) - ? path.join(prismaProjectDir, "server/utils/prisma.ts") - : path.join(prismaProjectDir, "src/client.ts"); + const singletonPath = await resolveSingletonPath(prismaProjectDir);
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Pro
Run ID: 1681bc9a-ef42-4a87-9eb4-5775df886d04
⛔ Files ignored due to path filters (1)
bun.lockis excluded by!**/*.lock
📒 Files selected for processing (32)
.github/workflows/publish.yml.oxfmtrc.json.oxlintrc.jsonREADME.mdpackage.jsonsrc/commands/create.tssrc/constants/db-packages.tssrc/index.tssrc/tasks/install.tssrc/tasks/prisma-postgres.tssrc/tasks/setup-addons.tssrc/tasks/setup-prisma.tssrc/templates/render-create-template.tssrc/templates/shared.tssrc/types.tssrc/ui/branding.tssrc/utils/package-manager.tstemplates/create/next/eslint.config.mjstemplates/create/next/src/app/globals.csstemplates/create/svelte/.vscode/extensions.jsontemplates/create/svelte/src/app.d.tstemplates/create/svelte/src/app.htmltemplates/create/svelte/svelte.config.jstemplates/create/svelte/tsconfig.jsontemplates/create/svelte/vite.config.tstemplates/create/tanstack-start/prisma.config.tstemplates/create/tanstack-start/src/router.tsxtemplates/create/tanstack-start/src/styles.csstemplates/create/tanstack-start/vite.config.tstemplates/create/turborepo/apps/api/tsconfig.jsontemplates/create/turborepo/packages/db/tsconfig.jsontemplates/create/turborepo/turbo.json
💤 Files with no reviewable changes (3)
- templates/create/tanstack-start/src/styles.css
- templates/create/tanstack-start/src/router.tsx
- templates/create/tanstack-start/prisma.config.ts
Summary
oxlintandoxfmtto the repo withlint,lint:fix,format, andformat:checkscriptstemplates/**/*.hbsout ofoxfmtfor now because some Handlebars templates do not parse cleanly yetcreate-prisma@pr18Preview publish behavior
For a PR like
#18, GitHub Actions now publishes a unique prerelease version ofcreate-prismaand tags it withpr18on npm.That means reviewers can install the latest build for the PR with:
bunx create-prisma@pr18npm install create-prisma@pr18yarn add create-prisma@pr18pnpm add create-prisma@pr18Each new push to the PR republishes a fresh preview version behind the same
pr18tag.Verification
bun run lintbun run format:checkbun run typecheckbun run buildSummary by CodeRabbit
New Features
Documentation
Chores