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: Enhance custom template generation #404

Merged
merged 3 commits into from
Oct 30, 2024

Conversation

c12i
Copy link
Collaborator

@c12i c12i commented Oct 28, 2024

This PR replaces the separate custom-template with a system that builds custom templates from existing template bases (vue, svelte, lit, react, headless).

Changes

  • Removed standalone custom-template
  • Added ability to use existing templates as bases for custom templates
  • Shifted from nix flake init to CLI-based template generation

Benefits

  • Greater flexibility: Developers can now choose from multiple starting points (vue, svelte, lit, react, headless)
  • Reduced maintenance: Eliminates need to maintain a separate custom template
  • Less code duplication: Leverages existing template code

Trade-offs

  • Deprecates nix flake init -t github:holochain/scaffolding workflow
  • Requires using CLI directly to generate custom template base i.e nix run github:holochain/scaffolding#hc-scaffold -- template new or hc-scaffold template new if installed via cargo

Rationale

The increased flexibility and reduced maintenance overhead outweigh the loss of the nix flake init workflow, as developers gain access to multiple template starting points instead of being limited to the previous lit-based custom template.

TODOs

  • Generate custom templates via CLI
  • Update custom template documentation

Closes #388

@c12i c12i marked this pull request as draft October 28, 2024 11:10
@c12i c12i changed the title feat: Add a new template subcommand to create new custom template bases from existing templates feat: Enhance custom template generation Oct 28, 2024
@c12i c12i force-pushed the feat/add-template-new-template-subcommand branch from 5c7d20b to 05bbdad Compare October 28, 2024 14:37
@c12i c12i requested a review from guillemcordoba October 28, 2024 14:42
@c12i c12i marked this pull request as ready for review October 28, 2024 14:42
@c12i c12i requested a review from matthme October 28, 2024 14:42
@matthme
Copy link
Collaborator

matthme commented Oct 30, 2024

This seems great to me! I'm not sure I'm understanding all the consequences but I think removing the nix command merely for template generation is not really a problem and being able to start a custom template from all the already available options seems really useful!

@c12i c12i merged commit 21387f7 into develop Oct 30, 2024
8 checks passed
@c12i c12i deleted the feat/add-template-new-template-subcommand branch October 30, 2024 09:47
@c12i c12i added the ShouldBackport/0.4 This change should be backported to develop-0.1 label Nov 1, 2024
@c12i c12i removed the ShouldBackport/0.4 This change should be backported to develop-0.1 label Nov 26, 2024
c12i added a commit that referenced this pull request Nov 26, 2024
* feat: Add a new template subcommand to create new custom template bases
from existing templates

* Remove call to wrapCustoTemplate in scaffolding nix flake

* Update custom template docs
c12i added a commit that referenced this pull request Dec 10, 2024
* feat: Add a new template subcommand to create new custom template bases
from existing templates

* Remove call to wrapCustoTemplate in scaffolding nix flake

* Update custom template docs
c12i added a commit that referenced this pull request Dec 12, 2024
* fix: Skip writing scaffold config for nixified custom templates (#415)

* Add skip_config_check global flag to scaffolding

* Prefer not writing the scaffold config for nixified custom templates

* Fix rustfmt warning

* feat: further improve ci runtime (#414)

* Remove dependency to holochain

* Add rust-cache

* Add cachix nix config

* Add ci job concurrency options

* Update cachix configurations

* Run rust checks/tests outside nix

* add missing components

* Cache rust builds

* Bump holochain deps

* Update rustdocs

* Build cargo deps separately

* refactor flake

* Update maintenance docs

* Add extraPullNames input to cachix actions

* Add nix_build step

* Extend extra-substituters and public-keys in nixConfig

* Fix ci workflow

* Bump client-js version

* fix: Fix misplaced doc comments (#411)

* Fix misplaced doc comments

* Slightly refactor link_type integrity codegen

* feat: Enhance custom template generation (#404)

* feat: Add a new template subcommand to create new custom template bases
from existing templates

* Remove call to wrapCustoTemplate in scaffolding nix flake

* Update custom template docs

* chore: update ui dependencies (#407)

* Bump holochain playground

* Update ui core dependencies

* Update lit dependencies

* Fix cli output lines

* Fix broken css import in lit template

* Revert custom-template changes

* Fix vue templates

* Increase testTimeout

* Remove eslint from lit template

* Fix lit CI failure

* Add missing shared styles

* feat: Reprompt user on invalid input (#402)

* Fix imports

* Merge pull request #428 from holochain/fix/svelte-client-race-condition-0.4

chore: backport svelte race condition to 0.4 and release 0.4000.0-rc.1

* feat: Add ability to go back and modify entry type fields (#418)

* Add go back functionality for hc scaffold entry-type

* address PR comments

* Ensure the fields vec is not empty on change

* Improve text spacing

* Simplify prompt

* Pin typescript version for vue-tsc compatibility

---------

Co-authored-by: matthme <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants