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

Add support for remote custom templates #502

Closed

Conversation

benjlevesque
Copy link

Proposal for #441

Add support for custom remote templates:

tsdx create template --template https://github.com/benjlevesque/tsdx-template-basic my-app

Note: the repository must follow a specific structure

  • there MUST be a template directory, containing the template files.
  • there MIGHT be a template.json file, with the following structure:
{
  "name": "...",
  "dependencies": [  ],
  "packageJson": {  }
}

Template structure & approach inspired from CRA.

@benjlevesque benjlevesque mentioned this pull request Feb 8, 2020
@jaredpalmer
Copy link
Owner

This looks good. Let’s fix tests and merge

@jaredpalmer
Copy link
Owner

Needs docs too

@benjlevesque
Copy link
Author

Needs docs too

@jaredpalmer where do you want the docs? I didn't find docs about the existing --template option

@flaviouk
Copy link

This would be very much appreciated! @jaredpalmer ?

@emersonlaurentino
Copy link

what is missing for this PR to be dipped? tsdx is really interesting, but this feature is interesting for my usage context.

@agilgur5
Copy link
Collaborator

agilgur5 commented Jul 20, 2020

I haven't reviewed this myself as I'd need to take a good bit of time to understand the use-case of how this is beneficial beyond what you can do with template repos and haven't had that time.

Off the top of my head:

  • Auto-installing unvetted/untracked dependencies seems like an avenue for some security issues (my current day job).
  • Usage of synchronous fs.existsSync instead of async fs.pathExists, which I've spent a good bit of time replacing/removing everywhere in the codebase where possible previously and would not want to be re-introduced unnecessarily
  • Docs, particularly as there's a requirement on repo structure (introduces a new "API" basically)

@emersonlaurentino
Copy link

At my company, we need a tool similar to tsdx and we are thinking about it, but we need to use a custom template. So this resource is essential for us. Currently, we using a Create React Library fork, but it's no legal to maintain.

@agilgur5
Copy link
Collaborator

At my company, we need a tool similar to tsdx and we are thinking about it, but we need to use a custom template. So this resource is essential for us.

Couldn't you do the same thing with a template repo? Either via GitHub's templates or via copy+paste. I do that myself with my repos, which are a good bit different from TSDX's templates.

@agilgur5
Copy link
Collaborator

Had looked into this before, but did some more digging to try to see what CRA's rationale was for this feature. Unfortunately I couldn't see a clear one:

@benjlevesque benjlevesque deleted the custom-templates branch June 2, 2022 06:58
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.

5 participants