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 template preview #1451

Open
bswck opened this issue Dec 8, 2023 · 4 comments
Open

Add template preview #1451

bswck opened this issue Dec 8, 2023 · 4 comments
Labels
documentation Issue that requires updating docs enhancement good first issue Easy things for newbies
Milestone

Comments

@bswck
Copy link

bswck commented Dec 8, 2023

Actual Situation

During developing my pretty advanced template, when I want to check how my update will render in the downstream projects, I usually:

  • commit my change,
  • push it (up to some point I did push to a dev branch, but it became exhausting),
  • open a special downstream project (lucky if I have skeleton and downstream open in one workspace, but it's still pretty hard to work with),
  • poe bump (wrapper around copier update)
  • see what needs fix,
  • open back the skeleton project,
  • commit my fix,
  • push it...

I know I can update from a template in a directory that is locally in my filesystem, but it would conflict with my poe bump command that not only is configured to pull changes from the skeleton repository on GitHub, but also automatically makes a commit.

And this is a pretty messy workflow and it definitely shouldn't be like that.

Desired Situation

I can easily inspect how my copier template renders as I am developing it, ideally with hot-reloading.

Proposed solution

A browser-based or IDE-based GUI for previewing a template that is made in a temporary directory as the developer makes changes with hot-reloading (I suggest watchfiles).
My goal would be getting a DX like when writing a React application.

@yajo
Copy link
Member

yajo commented Dec 17, 2023

I've been doing snapshot-based testing based on ctt. I think that's gonna work for you, so let me close this. You can keep the discussion or reopen later otherwise. Thanks!

@yajo yajo closed this as not planned Won't fix, can't repro, duplicate, stale Dec 17, 2023
@bswck
Copy link
Author

bswck commented Dec 18, 2023

Thank you for recommending the right tool. Mind referencing it in the documentation, so others can find it quickly? Maybe in the FAQ? A proper annotation can be made to inform that the copier tester is not maintained by copier maintainers; just similarly to how Python docs reference some outside-CPython projects for solutions to some complex problems, like in the AST reference.

@bswck
Copy link
Author

bswck commented Dec 19, 2023

@yajo Pinging as I don't know if you were notified on this.

@yajo
Copy link
Member

yajo commented Dec 19, 2023

Mind referencing it in the documentation, so others can find it quickly? Maybe in the FAQ?

Makes sense indeed.

@yajo yajo reopened this Dec 19, 2023
@yajo yajo added good first issue Easy things for newbies documentation Issue that requires updating docs labels Dec 19, 2023
@yajo yajo added this to the Soon milestone Dec 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Issue that requires updating docs enhancement good first issue Easy things for newbies
Projects
None yet
Development

No branches or pull requests

2 participants