Giter Club home page Giter Club logo

Comments (8)

amwmedia avatar amwmedia commented on July 18, 2024 3

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.

amwmedia avatar amwmedia commented on July 18, 2024

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.

amwmedia avatar amwmedia commented on July 18, 2024

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.

andrewjensen avatar andrewjensen commented on July 18, 2024

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.

amwmedia avatar amwmedia commented on July 18, 2024

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.

andrewjensen avatar andrewjensen commented on July 18, 2024

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.

amwmedia avatar amwmedia commented on July 18, 2024

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.

rdewolff avatar rdewolff commented on July 18, 2024

That's a good news that we can use node-plop! Thanks for your work!

from plop.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.