Open mstenta opened 4 years ago
Per @jgaehring in https://github.com/jgaehring/farm_precipitation/pull/3#issuecomment-612653468:
I think a better option would be to set up an npm script that, in addition to running the Webpack build process, also runs a Node process for assembling the necessary PHP and Drupal files. We could include some custom settings in
package.json
, or have a separatefield-module.json
file, which could provide the details specific to that module, such as it'sname
,label
,description
, etc, which could get injected automatically into the boilerplate files. Ultimately, I'd love to have something like create-react-app, where we could just have a script, which we publish to npm, then when the user runs it, it asks a few questions from the terminal and spits out a fully scaffolded project, without the need to maintain a specialfield-module.json
file, and even the Webpack details would be hidden and rolled up into a single dependency, which they could just update periodically when they needed too.
A good starting place for a (mostly) blank project template might be: https://github.com/jgaehring/farm_spray/tree/96b6580624fd8e1de6b8cd765c627271819f9a62
(Just saving a reference to that commit so we have it somewhere)
In talking this through with @jgaehring, the main drawback of #3 is that you wouldn't be able to run it locally. The alternative is to do it with an npm package that handles all the webpack stuff, including generating PHP files (#2).