Comments (8)
just pushed up the first pre-release version of node-plop, please have a look and let me know if you run into any issues π
https://github.com/amwmedia/node-plop
it's also up on npm
https://www.npmjs.com/package/node-plop
from plop.
I'll look into this, if it could be coded to return the output you could then run asserts against the generated output. That could be really sweet. good idea! π
from plop.
come to think of it, this could work for add
actions, but in order to do this for an entire generator we would need to implement a virtual file system. this is possible, but would not be a trivial change. π¦ Maybe something like this could be done at the individual action level? Not sure, but I'm open to ideas.
from plop.
To be honest, I'm actually more interested in just using the normal filesystem but through a Node API rather than a command line interface. It looks like if we could decouple the template generating logic from the inquirer prompts, it would come relatively easily.
from plop.
true, I think that much is doable, but it wouldn't function all that well for unit testing if it's actually mucking with your source code. Do you have something in mind for how you're planning to handle this? I'm more curious than anything π
from plop.
I think you're right - adding a Node API probably wouldn't be useful for unit testing. For my current needs, I basically need a way to call plop in a script for quick-and-dirty verification that the generators look right.
A little background about my use case: my team works on small Angular apps and uses a common plopfile packaged into a node module so we can maintain a consistent structure on each app. We're in the middle of changing a lot about our tooling and app architecture, so the plopfile is changing a lot at the moment. My plan is to write a script that calls a bunch of generators inside of a sandbox/
directory that is ignored by git, so when I review a pull request for an improvement to the plopfile, I can quickly explore the generated output without the template variables getting in the way.
from plop.
I've been giving this some thought, and my plan is to break the core of plop out into a new npm package that plop would require. That would enable much of what I think you're trying to achieve, and also make it possible to work with plopfiles and generators in other ways. Just FYI, I'm currently working on a website for plop so this will have to wait for a bit. Hopefully I'll be able to get to it in the coming month.
from plop.
That's a good news that we can use node-plop
! Thanks for your work!
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.