Comments (8)
@davidtaboas Sorry for the delayed response. Yes, I did this by publishing my plop code as a (private) npm module. Then in each of my projects, my plopfile.js
looks something like this:
module.exports = require('my-plops');
and that's it!
from plop.
is your main goal to have multiple projects use the same plop generators and templates? If so I think @nicksrandall was doing this by publishing them as an npm module. Maybe he would be kind enough to share how that approach worked for him π
from plop.
@davidtaboas the short answer to your question is no, plop doesn't support dynamically downloading templates when you trigger plop. However if you're looking to centralize your generators for use on multiple projects, there's a pretty nice solution to be had with npm ;-)
from plop.
@nicksrandall Thanks for that idea, actually I made a couple of plop generators (plop-react-webpack and plop-node-express) with that approach and works pretty well.
Just note, that in the generator plopfile.js
, in all templateFile
property I had to writte the route like that node_modules/plop-node-express/....
is that correct? I mean, another way to do it? Thanks in advance.
from plop.
@calcaide I believe right now this is the way you would do this. However, soon I'll be adding in full support for these types of approaches. The way I'm planning to do this would allow your shared plopfiles to reference everything locally like they normally would, but give the consumer plopfile control to specify where the generated files should be placed. still working out the details, but this is sort of the "next" thing on my agenda for plop after I get it integrated with node-plop
from plop.
@amwmedia Many thanks for the answer. The node-plop looks pretty cool, are you accepting contributors? Because I am interested in contribute to the project. Since I meet plop (a few weeks ago) I really fall in love with, I think is very much simpler than Yeoman. Actually, I am using Plop as a full project generator (replacing yeoman) and as micro-generator. Thank you for make Plop
from plop.
@calcaide really glad you like plop and are having good success with it. I'm always open to ideas and contributions! I would just ask that if you have an idea for a new feature, start the conversation as an issue so we can brainstorm and layout a plan for implementation.
Things that are ready to be worked on are the integration work so that plop
is using node-plop
internally and documentation for node-plop
. Let me know how you'd like to be involved. I'm actually planning to take on this feature (sharable modules) next within node-plop... after I finish up the additional test coverage that I'm wrapping up now.
from plop.
@amwmedia ok, you are right. I thing start the conversation as an issue is perfect. I will do that to not pollute more this issue. My intention is start contributing with little things and ideas.
from plop.
Related Issues (20)
- feat: make it possible to disable the progress spinner HOT 1
- Loaded plopfiles do not respect the `--force` flag HOT 6
- Plop 4 Planning HOT 6
- Set `dest` dynamically within a monorepo (workspace) environment HOT 6
- Add configuration option for custom handlebar delimiters HOT 3
- [node-plop] instanceof Array is not working with array from vm script
- Action `type: "modify"`'s `pattern` property should be built as a Handlebars template HOT 1
- node v14οΌIntl.Segmenter is not a constructor HOT 1
- titleCase fails to transform name HOT 2
- Supporting plopfile.ts .ts extension HOT 5
- Action type that trigger shell command HOT 2
- Possible to make a Multi Level Menu / Sub Menu? HOT 2
- Way of extending ActionType to have type definition for action added with setActionType
- plopfile.ts Typescript support HOT 14
- node-plop and electron: navigator is not defined HOT 2
- Can plop produce files based on json file inputs? HOT 1
- Is it possible to print text? HOT 2
- Can't write tests if the plopfile contains conditional prompts HOT 1
- Bug: Can't use custom action in typescript plopfiles
- Async follow up prompts
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from plop.