Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: 🎉 Add config files on init 🎉 #418

Merged
merged 8 commits into from
Feb 7, 2025
Merged

feat: 🎉 Add config files on init 🎉 #418

merged 8 commits into from
Feb 7, 2025

Conversation

ieedan
Copy link
Owner

@ieedan ieedan commented Feb 7, 2025

This has long been an feature that I have wanted to add to jsrepo but with a few things getting merged and finally having the time to hack on it it's here.

With this PR you can now add the configFiles key to your jsrepo-build-config.json to specify config files that will be added to users projects upon installation.

This will be incredibly helpful when you have a registry that includes custom config files like a tailwind.config or even for managing your own eslint or prettier configs!

{
	"configFiles": [
		{
			"name": "app.css", // name displayed in prompts
			"path": "./src/app.css", // path to the file in your project
			"expectedPath": "./src/app.css", // expected path in the users project (used as a default value)
			"optional": false // when true jsrepo will prompt the user and ask them if they would like to add the config file
		}
	]
}

In true jsrepo fashion when a file already exists you will be prompted to update it with a diff and the "Update with AI" option.

In a future PR I will update the docs so that the registry docs gen also shows the config files.

Still need to work on init command to actually add files
Super basic at the moment just overwrites the file
@ieedan ieedan self-assigned this Feb 7, 2025
Copy link

changeset-bot bot commented Feb 7, 2025

🦋 Changeset detected

Latest commit: 34198ac

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

This PR includes changesets to release 1 package
Name Type
jsrepo Minor

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

Copy link

vercel bot commented Feb 7, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
jsrepo ✅ Ready (Inspect) Visit Preview 💬 Add feedback Feb 7, 2025 7:20pm

Copy link

pkg-pr-new bot commented Feb 7, 2025

Open in Stackblitzprojectregistry

npm i https://pkg.pr.new/ieedan/jsrepo@418

commit: 34198ac

@ieedan ieedan changed the title feat: 🎉 Config files 🎉 feat: 🎉 Add config files on init 🎉 Feb 7, 2025
@ieedan ieedan merged commit 21f8cb8 into main Feb 7, 2025
5 checks passed
@ieedan ieedan deleted the config-files branch February 7, 2025 19:21
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