node_modules ignore

This commit is contained in:
2025-05-08 23:43:47 +02:00
parent e19d52f172
commit 4574544c9f
65041 changed files with 10593536 additions and 0 deletions

View File

@@ -0,0 +1,27 @@
#!/usr/bin/env node
import path from "node:path";
import minimist from "minimist";
import { Plop, run } from "../../../instrumented/src/plop.js";
const args = process.argv.slice(2);
const argv = minimist(args);
import { fileURLToPath } from "node:url";
const __dirname = path.dirname(fileURLToPath(import.meta.url));
Plop.prepare(
{
cwd: argv.cwd,
preload: argv.preload || [],
// In order for `plop` to always pick up the `plopfile.js` despite the CWD, you must use `__dirname`
configPath: path.join(__dirname, "plopfile.cjs"),
completion: argv.completion,
// This will merge the `plop` argv and the generator argv.
// This means that you don't need to use `--` anymore
},
function (env) {
Plop.execute(env, function (env) {
return run(env, undefined, true);
});
},
);

View File

View File

@@ -0,0 +1,7 @@
{
"name": "plop-example-wrap",
"type": "module",
"engines": {
"node": ">=18"
}
}

View File

@@ -0,0 +1,37 @@
module.exports = function (plop) {
plop.setGenerator("test", {
description: "this is a test",
prompts: [
{
type: "input",
name: "name",
message: "What is your name?",
validate: function (value) {
if (/.+/.test(value)) {
return true;
}
return "name is required";
},
},
{
type: "checkbox",
name: "toppings",
message: "What pizza toppings do you like?",
choices: [
{ name: "Cheese", value: "cheese", checked: true },
{ name: "Pepperoni", value: "pepperoni" },
{ name: "Pineapple", value: "pineapple" },
{ name: "Mushroom", value: "mushroom" },
{ name: "Bacon", value: "bacon", checked: true },
],
},
],
actions: [
{
type: "add",
path: "./output/added.txt",
templateFile: "./templates/to-add.txt",
},
],
});
};

View File

@@ -0,0 +1 @@
Hello