xfiveco / generator-chisel

Chisel is a development framework for creating easy to maintain and fast WordPress websites.
https://www.getchisel.co
MIT License
270 stars 37 forks source link

Yeoman and Chisel as dependencies for generated project? #203

Closed jakub300 closed 2 years ago

jakub300 commented 7 years ago

Hey, I was wondering what do you think about the idea to add yeoman and chisel as the dependencies for generated projects.

We are increasingly dependent on the Chisel itself for doing things after projects is generated, and that leads to problems. First such instance was chisel:page subgenerator. When we changed twig structure some time ago that lead to the problem that chisel:page was crashing when called on older project because the path for template that is copied when creating the page changed.

Now we are working on ACF WP-CLI integration that is obviously depends on WP-CLI that is included Chisel but not generated project so the integration must be done as chisel subgenerators, not npm/gulp commands.

Coming up next is PHP linting that requires linting tool to be accessible somehow by the project, we could include it in generator similarly to WP-CLI.

Alternative is to somehow download the WP-CLI, linter and other things in the future during project setup (npm install), that would be probably similar to how phantomjs-prebuilt is downloading phantom or node-sass is downloading native library.

thymikee commented 7 years ago

Thanks for bringing that up. Too bad we need to depend on yeoman, but adding it as a dependency should be better than nothing. As a part of implementing this I'd also like to introduce generator version in yo-rc (which then again won't be needed so badly as with global Chisel installation, we use now, but why not have it).

luboskmetko commented 7 years ago

Just want to understand it better - if Yeoman and Chisel wouldn't be installed globally but separately as dependencies for each project how project generation works then - first it installs Yeoman and Chisel and then prompts the user?

Also somehow I don't get how it could help with situation like was that chisel:page was crashing when Twig structure changed. If the project was generated with the older version of Chisel, the generated structure remains same even if we update Chisel to newer version, doesn't it?

thymikee commented 7 years ago

You generate globally, but when you jump in to the project after a year, you can use the version compatible with existing project, not the one you have globally.

This is especially useful when chisel config or scripts change.

luboskmetko commented 7 years ago

Ok, now I understand, thanks :) Makes sense.

luboskmetko commented 3 years ago

I guess the new version solves this, can we close this issue?