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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

馃殌 Feature: Add a script to sync the tooling updates from forked template repo #498

Closed
3 tasks done
navin-moorthy opened this issue Jun 2, 2023 · 8 comments
Closed
3 tasks done
Labels
status: in discussion Not yet ready for implementation or a pull request type: feature New enhancement or request

Comments

@navin-moorthy
Copy link
Contributor

Bug Report Checklist

  • I have tried restarting my IDE and the issue persists.
  • I have pulled the latest main branch of the repository.
  • I have searched for related issues and found none that matched my issue.

Overview

It would be nice to have a script that syncs the latest changes done on the template repo to the existing repo that already use the template.

At this point I have made changes to the src directory, dependencies & devDependencies in package.json, I had to manually copy paste the updates from the template to have the latest changes.

Additional Info

No response

@navin-moorthy navin-moorthy added the type: feature New enhancement or request label Jun 2, 2023
@JoshuaKGoldberg
Copy link
Owner

Agreed, this would be really nice!

Have you tried using the hydration script I added recently (https://github.com/JoshuaKGoldberg/template-typescript-node-package/tree/6a0d42d7f07e3a70c7b0dd239c7431c58f43bd69#repository-hydration)? I imagine it probably would need more logic around in-place updates for new features, but might be a good start?

@JoshuaKGoldberg JoshuaKGoldberg added the status: waiting for author Needs an action taken by the original poster label Jun 2, 2023
@navin-moorthy
Copy link
Contributor Author

Cool, I will check the hydration script as a starting point and update you further.

@JoshuaKGoldberg
Copy link
Owner

Btw, I'm聽also going to start looking at this area of functionality. Once typescript-eslint@v6 lands I'm going to start focusing on updating all my other repositories to use this template. Which means I'll really want to get tooling update syncs working!

@JoshuaKGoldberg
Copy link
Owner

JoshuaKGoldberg commented Sep 1, 2023

Tracking issue for migrating other repos: #734.

hydration script

Note that since June I've renamed that mode to "migrate".


Anyway! I think this is actually pretty doable, especially after the refactors around #681 and #695. I think what we'd have to do is:

  1. Put every piece of tooling -CSpell, Knip, etc.- into its own asynchronous object containing its CLI flag, name, description, etc.
  2. Add some concept of "hooks" (though preferably with a name not already used by frontend UI frameworks) so that tooling portions can add behavior specific to each other
    • For example, if Knip is enabled, CSpell should include "knip" in its dictionary
    • Perhaps this is a use case for Symbols?
    • I don't know what direction this should flow in... Does the Knip tool augment CSpell's result? Or does CSpell react to Knip existing? Either?

Long term this system could be used to make this template much more configurable. I could see it being used to add more framework/library-specific portions, such as Astro/Next.js/Remix. Or even being extracted out of create-typescript-app into its own generalized builder - like a competitor to Yeoman.

What do you think @navin-moorthy / anybody else reading?

@JoshuaKGoldberg JoshuaKGoldberg added status: in discussion Not yet ready for implementation or a pull request and removed status: waiting for author Needs an action taken by the original poster labels Sep 1, 2023
@navin-moorthy
Copy link
Contributor Author

This looks cool, I will take a look at the migrate mode.

Yeah, I agree, it would be nice if if we have some kind of custom configuration based on which tooling should be used. May be support that via a config file?

For Eg, Not everyone uses Vitest, in that case they need not have those tooling configuration, so they should be opt it in. Same thing for the framework tooling aswell.

@JoshuaKGoldberg
Copy link
Owner

Ok! Following up, I split out two large-scope issues out of this one:

I'll go ahead and close this one as the discussion history is a little long. Thanks for filing @navin-moorthy - I really appreciate it!

@JoshuaKGoldberg
Copy link
Owner

@allcontributors add @navin-moorthy for ideas

Copy link
Contributor

@JoshuaKGoldberg

I've put up a pull request to add @navin-moorthy! 馃帀

JoshuaKGoldberg pushed a commit that referenced this issue Jan 3, 2024
Adds @navin-moorthy as a contributor for ideas.

This was requested by JoshuaKGoldberg [in this
comment](#498 (comment))

---------

Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: in discussion Not yet ready for implementation or a pull request type: feature New enhancement or request
Projects
None yet
Development

No branches or pull requests

2 participants