Skip to content

Commit

Permalink
chore: install commander and remove obsolete deps
Browse files Browse the repository at this point in the history
  • Loading branch information
maverox committed Jun 7, 2024
1 parent 1bdf924 commit 5e6a70b
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 21 deletions.
32 changes: 14 additions & 18 deletions packages/create-webpack-app/bin/cli.js
Original file line number Diff line number Diff line change
@@ -1,19 +1,15 @@
import path from "node:path";
import { fileURLToPath } from "node:url";
import minimist from "minimist";
import { Plop, run } from "plop";
// cSpell:ignore plopfile, plopfile.js
const args = process.argv.slice(2);
const argv = minimist(args);
const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);
import { Command } from "commander";
const program = new Command();

Plop.prepare(
{
cwd: argv.cwd,
configPath: path.resolve(__dirname, "../lib/plopfile.js"),
preload: argv.preload || [],
completion: argv.completion,
},
(env) => Plop.execute(env, run),
);
import pkg from "../package.json" with { type: "json" };

program.version(pkg.version, "-v, --version");
program.helpOption("-h, --help", "Display help for command");

program
.option("-s, --skip", "Skip the prompt and use the default values")
.option("-f, --force", "Force the generator actions to override existing files");

program.parse(process.argv);

console.log(program.opts());
5 changes: 2 additions & 3 deletions packages/create-webpack-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,9 @@
"!**/*__tests__"
],
"dependencies": {
"commander": "^12.1.0",
"ejs": "^3.1.10",
"minimist": "^1.2.8",
"node-plop": "^0.32.0",
"plop": "^4.0.1"
"node-plop": "^0.32.0"
},
"devDependencies": {
"@types/ejs": "^3.1.5"
Expand Down

0 comments on commit 5e6a70b

Please sign in to comment.