wlmaker 1.0.2 → 1.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/cli.mjs +7 -1
  2. package/package.json +1 -1
package/dist/cli.mjs CHANGED
@@ -1,6 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
 
3
3
  // src/cli.ts
4
+ import { createRequire } from "module";
4
5
  import { Command } from "commander";
5
6
  import chalk3 from "chalk";
6
7
 
@@ -348,6 +349,9 @@ async function interactiveMode() {
348
349
  } else {
349
350
  targetDir = path5.join(project.projectRoot, "lib", "features", feature);
350
351
  }
352
+ } else if (fs5.existsSync(path5.join(project.projectRoot, "lib", "bloc"))) {
353
+ targetDir = path5.join(project.projectRoot, "lib", "bloc");
354
+ clack.log.info(`Target: ${chalk2.cyan("lib/bloc/")}`);
351
355
  } else {
352
356
  clack.note("No lib/features/ directory found. Provide a target path manually.", "Info");
353
357
  const customPath = await clack.text({
@@ -388,8 +392,10 @@ async function interactiveMode() {
388
392
  }
389
393
 
390
394
  // src/cli.ts
395
+ var require2 = createRequire(import.meta.url);
396
+ var pkg = require2("../package.json");
391
397
  var program = new Command();
392
- program.name("wlmaker").description("Create Flutter BLoCs with Freezed sealed classes from the terminal").version("1.0.0");
398
+ program.name("wlmaker").description("Create Flutter BLoCs with Freezed sealed classes from the terminal").version(pkg.version);
393
399
  program.command("bloc").description("Create a new BLoC with Freezed sealed classes").argument("[name]", "BLoC name in snake_case (e.g. user_login)").option("-d, --dir <path>", "target directory", process.cwd()).option("--no-build-runner", "skip build_runner execution").action(async (name, options) => {
394
400
  if (!name) {
395
401
  await interactiveMode();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "wlmaker",
3
- "version": "1.0.2",
3
+ "version": "1.1.1",
4
4
  "description": "Create Flutter BLoCs with Freezed sealed classes from the terminal",
5
5
  "keywords": [
6
6
  "flutter",