Skip to content

feat: Lifecycle hooks - #762

Merged
ieedan merged 7 commits into
mainfrom
hooks
Feb 17, 2026
Merged

ieedan merged 7 commits into
mainfrom
hooks

Conversation

@ieedan

@ieedan ieedan commented Feb 11, 2026 •

Copy link
Copy Markdown
Collaborator

Now you can hook into the jsrepo lifecycle using the before and after hooks. Run codemods, formatters, linters, you name it.

You just configure the hooks in your config like so:

import { defineConfig } from "jsrepo";

export default defineConfig({
	hooks: {
		before: ({ command }) => {
			console.log(`Running ${command}...`);
		},
		after: "echo done",
	},
});

You can run arbitrary code or commands by setting them up in your config.

Any before hooks that fail will cause the user to be prompted on whether or not they wish to continue. After hooks will simply log a warning and continue.

It's possible we will introduce more commands in the future but I think for now before and after are a good start...

FAQ

Where does this leave transforms?

Transforms are still the preferred way to modify your code as it's added to your project they run before the code is actually added to your project. Because of this we can show diffs with formatted code when using transforms like oxfmt, biome, and prettier. That being said hooks will be extremely nice for those cases where a transform plugin doesn't yet exist for your use case.

Side note: Pretty impressed with this. This is 100% composer-1.5 after creating a plan with Opus. Not one shot unfortunately but I would say this is pretty much exactly what I would've wrote.

@changeset-bot

changeset-bot Bot commented Feb 11, 2026 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: b75a396

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 9 packages
Name Type
jsrepo Minor
@jsrepo/mcp Patch
@jsrepo/migrate Patch
@jsrepo/shadcn Major
@jsrepo/transform-biome Major
@jsrepo/transform-filecasing Major
@jsrepo/transform-javascript Major
@jsrepo/transform-oxfmt Major
@jsrepo/transform-prettier Major

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@vercel

vercel Bot commented Feb 11, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
jsrepo.dev Ready Ready Preview, Comment Feb 17, 2026 0:10am

Request Review

@pkg-pr-new

pkg-pr-new Bot commented Feb 11, 2026 •

Copy link
Copy Markdown

Open in StackBlitz

jsrepo

pnpm add https://pkg.pr.new/jsrepojs/jsrepo@762

@jsrepo/mcp

pnpm add https://pkg.pr.new/jsrepojs/jsrepo/@jsrepo/mcp@762

@jsrepo/migrate

pnpm add https://pkg.pr.new/jsrepojs/jsrepo/@jsrepo/migrate@762

@jsrepo/transform-biome

pnpm add https://pkg.pr.new/jsrepojs/jsrepo/@jsrepo/transform-biome@762

@jsrepo/transform-filecasing

pnpm add https://pkg.pr.new/jsrepojs/jsrepo/@jsrepo/transform-filecasing@762

@jsrepo/transform-javascript

pnpm add https://pkg.pr.new/jsrepojs/jsrepo/@jsrepo/transform-javascript@762

@jsrepo/transform-oxfmt

pnpm add https://pkg.pr.new/jsrepojs/jsrepo/@jsrepo/transform-oxfmt@762

@jsrepo/transform-prettier

pnpm add https://pkg.pr.new/jsrepojs/jsrepo/@jsrepo/transform-prettier@762

commit: b75a396

@ieedan
ieedan merged commit e620ca9 into main Feb 17, 2026
7 checks passed
@ieedan
ieedan deleted the hooks branch February 17, 2026 12:11

This branch was successfully deployed

1 active deployment
Preview — b75a3968 Deployed Feb 17, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant