fluzer 2.2.1 copy "fluzer: ^2.2.1" to clipboard
fluzer: ^2.2.1 copied to clipboard

CLI tool for scaffolding Flutter Zero template projects.

2.2.1 #

Added #

  • gen-l10n 命令在生成文件(第 5 步)之后新增第 6 步:调用 dart format 格式化 l10n_code.dart / l10n_code_ext.dart / l10n_toast_effect_helper.dart 三个生成文件,无需再手动格式化。原第 6 步「接线 defaultToastHandle」顺延为第 7 步。GenL10nV1V2AdapterGenL10nV4Adapter 均已接入。(Flutter 3.x 已移除 flutter format 子命令,故统一使用 dart format。)
  • 格式化失败(如 dart 不在 PATH、生成的代码存在语法错误)时仅打印告警并继续执行,不会中断 gen-l10n 流程——文件已落盘,交由用户自行处理。

Changed #

  • 直接执行 fluzer version 检查更新时不再读取本地缓存,每次都实时查询 pub.dev,确保拿到的是最新发布状态。
  • 其他命令(new / create / gen-l10n 等)启动时的被动更新提示,其结果缓存时间由 24 小时缩短为 1 小时,新版本提示更及时。

2.2.0 #

Added #

  • gen-l10n 命令新增 GenL10nV4Adapter(区间 [4.0.0, 5.0.0)),采用 Dart 3.13 主构造语法生成 L10nCode / L10nCodeExt / L10nToastEffectHelper,与模板 4.0.0 对齐。原计划 v4 生成器逻辑与 v3 完全一致,仅语法迁移。
  • new 命令的 NewV3V4Adapter 区间由 [3.1.0, 4.0.0) 扩展到 [3.1.0, 5.0.0),覆盖模板 4.0.0 的 feature_bloc / feature_cubit 选砖。

Changed #

  • gen-l10n 命令的 GenL10nV1V2Adapter 区间收紧为 [1.0.0, 4.0.0)(原无上界),使 4.0.0 及以上模板正确路由到 GenL10nV4Adapter

Compatibility #

  • 模板 4.0.0 需搭配 CLI 2.2.0 才能完整工作(旧 CLI 的 new 不认领 4.0.0、gen-l10n 可能用 v3 生成器静默产出不兼容代码)。template_registry.jsonminCliVersion 字段当前未被 CLI 读取(属历史遗留/死数据),故 4.0.0 条目不设置该字段;CLI 不会自动拦截旧版本。硬性保障是发布顺序:CLI 2.2.0 必须先于(或同时)模板 4.0.0 上线。

2.1.0 #

Added #

  • new command now supports choosing the state-management pattern via --bloc (MVI/BLoC, default) and --cubit (MVVM/Cubit) flags. Projects generated from a 3.1.0+ template use the feature_bloc / feature_cubit bricks accordingly; omitting both flags keeps the previous feature brick (backward compatible).

Changed #

  • Added NewV3Adapter to handle templates 3.1.0 and above; it picks feature_bloc or feature_cubit based on the --bloc/--cubit flag (defaults to feature_bloc).
  • NewV1V2Adapter range narrowed to [1.0.0, 3.1.0) so 3.0.x projects still resolve to the single feature brick.
  • FeatureGenerator.generate now takes a required brickName argument instead of hard-coding feature, letting each adapter choose its brick.

Fixed #

  • Version routing for 3.0.0 template projects now correctly resolves to NewV1V2Adapter (previously the 3.0.0 upper bound left it unhandled by any adapter).

2.0.1 #

Fixed #

  • Fixed a bug where the gen-l10n command generated an uncompilable l10n_code.dart. The L10nCode class was closed too early (the closing brace was emitted right after the toastTypeKey constant), so the _mapEquals helper ended up as a top-level function. Because it was declared static, the generated file failed to analyze (Can't have modifier 'static' here). _mapEquals is now correctly emitted as a static method inside the class.

2.0.0 #

Removed #

  • Removed the CLI/template version compatibility gate from the new and gen-l10n commands. These commands no longer read the minCliVersion field from flutter_zero_config.yaml to reject or allow a CLI version, and the --skip-version-check flag (debug-only bypass) has been removed as it is no longer needed.

Changed #

  • create now always selects the latest available template version instead of filtering candidates by a minimum CLI version.
  • Refined and unified the localized (zh/en/ja) prompt text across template-source resolution, cache operations, and the version-update notice; stale comments were cleaned up.

1.2.1 #

Fixed #

  • create no longer removes an existing directory that has the same name as the project being created. Previously the command reported the name conflict and then recursively deleted that directory together with all of its contents. It now reports the error and exits without touching your files. Cleaning up a half-created project still happens when a later step of create fails.

1.2.0 #

Added #

  • Terminal CLI is now localized: Chinese (zh), English (en) and Japanese (ja) are supported. A new global --locale/-L flag selects the UI language; when omitted, it follows the system locale or environment variables.
  • Configuration-validation error messages emitted by the new and gen-l10n commands are now localized (zh/en/ja) instead of hardcoded mixed-language text.

Changed #

  • Subprocess output is now drained concurrently for both stdout and stderr. This eliminates a pipe-backpressure stall that made child commands (notably build_runner during new) extremely slow when run without --log.
  • Subprocesses now start with their standard input closed by default, so a child command that waits for interactive input (such as a confirmation prompt) no longer hangs silently and instead proceeds with its default behavior.

1.1.3 #

Changed #

  • create, new and gen-l10n now show a one-line upgrade hint at startup when a newer CLI version is available, without blocking the command.
  • The version command now shows a live progress indicator while checking for updates.
  • The new command now runs code generation only for the newly created module instead of the whole project, making scaffolding much faster on large codebases.

Removed #

  • Removed the build_runner step at the end of the create command. A freshly created project template needs no code generation, so create now finishes right after flutter gen-l10n.

1.1.2 #

Added #

  • Concurrent mirror-racing HTTP client for template downloads: the direct URL now races against configured GitHub mirror prefixes; the first successful response wins and the rest are cancelled, removing the sequential wait for direct-timeout-then-mirror fallback.

Changed #

  • Logging overhaul: removed the LogPolicy abstraction — visibility is now driven solely by Logger.level. Every command step is wrapped in runWithSpinner for a live progress indicator; in --log mode the spinner is suppressed and child-command output is streamed live instead.
  • The download progress bar now appears only in --log mode (verbose); in the default mode the step spinner conveys progress, avoiding duplicate/overlapping output.
  • Internal refactors with no user-facing behavior change: TemplateSourceResolver is now the single public template-source API (top-level helpers removed); the gen-l10n parameter-type switch was replaced by an extensible L10nParamType registry (OCP); config/version/util packages were restructured to remove cyclic dependencies.

Fixed #

  • Fixed a Windows CI crash where the global Directory.current was restored to a temporary directory already deleted by a parallel test, failing the NewCommand full-flow test. Commands and the CLI entry point now accept an explicit workingDirectory instead of mutating global cwd.
  • Improved cross-platform test stability on the Linux/macOS/Windows CI matrix: Platform.resolvedExecutable replaces the 'dart' string command, path.join replaces hardcoded separators, and temporary-directory deletion now retries under Windows file locking.

1.1.1 #

Added #

  • Version compatibility gate for new and gen-l10n commands: the CLI now validates the running CLI version against the project template's required minimum (the minCliVersion field in flutter_zero_config.yaml) before proceeding. Incompatible versions are rejected with a clear upgrade prompt. A --skip-version-check flag bypasses the gate for debugging only.
  • new command now pins the exact template version declared in the project config (flutter_zero_config.yaml version) when resolving the download source, instead of always picking the latest CLI-compatible template.
  • ProjectConfig gains a minCliVersion field and an isCliCompatible(currentCliVersion) helper. Legacy projects without minCliVersion default to "0.0.0" (accepted by any CLI).

Fixed #

  • SemanticVersion lacked value equality (== / hashCode), causing unreliable version comparisons; value equality is now implemented.

1.1.0 #

Added #

  • fluzer gen-l10n: runs flutter gen-l10n and auto-generates a type-safe localization access layer.
    • Parses l10n.yaml (arb-dir / output-dir / output-class, with fallback probing) and the generated AppLocalizations abstract class (brace-counting class-body scanner).
    • Generates l10n_code.dart: the L10nCode value object with typed factory constructors, symmetric toString/parse serialization, ==/hashCode, and immutable Map<String, String> parameters.
    • Generates l10n_code_ext.dart: typeS()/typeE()/typeI()/typeW() toast-type markers and a toToastEffect() shortcut for emitting effects directly from BLoCs.
    • Generates l10n_toast_effect_helper.dart: a centralized switch dispatcher covering every ARB key, deserializing parameters by declared type (int.tryParse, DateTime.tryParse, ...).
    • Auto-wires L10nToastEffectHelper into defaultToastHandle via an AST-based patch with three-state detection (template / already-wired / customized), idempotent on repeated runs. Flags: --skip-handle-patch, --force-handle-patch.
    • Generated sources are formatted with dart_style and tagged with the CLI version.

Fixed #

  • Placeholder types declared in ARB (e.g. "type": "int") no longer break generation: parameter types are preserved end-to-end instead of being hardcoded as Object; unparseable parameter declarations now fail loudly with FormatException instead of being silently dropped.
  • L10nCode.parse tolerates malformed input (e.g. incomplete percent-encoding) instead of throwing inside the effect chain.
  • Factory parameters named code/parameters are renamed (codeParam/parametersParam) to avoid shadowing class members; map keys remain unchanged.

1.0.1 #

Changed #

  • Switched README.md to English (Chinese version preserved as README_CN.md).
  • Rewrote CHANGELOG.md in English.
  • Changed pubspec.yaml description to English-only.

Added #

  • Added example/ directory with CLI usage examples and programmatic API demo.
  • Added library-level dartdoc to lib/fluzer.dart.

Fixed #

  • Improved pub.dev score: widened analyzer constraint from ^10.2.0 to >=10.0.1 <15.0.0 so the constraint supports the latest version (the actual resolved version is still capped at 10.x by codemod_recipe's transitive ^10.0.1).

1.0.0 #

Initial release.

Added #

  • fluzer create <name>: Generate a Flutter Zero project in one step (supports local path, remote zip, and template registry sources).
  • fluzer new <feature>: Generate a feature module in an existing project with automatic DI registration injection.
  • fluzer version: Check the latest CLI and template versions with update notifications.
  • fluzer cache list|clean: View or clear the local template cache.
  • Built-in China mirror fallback (ghfast.top / api.gitproxy.dev) for improved domestic access stability.
  • Colored log output and clear command help messages.
1
likes
160
points
289
downloads

Documentation

Documentation
API reference

Publisher

unverified uploader

Weekly Downloads

CLI tool for scaffolding Flutter Zero template projects.

Repository (GitHub)
View/report issues

License

MIT (license)

Dependencies

analyzer, archive, args, codemod_recipe, dart_style, dio, intl, mason, mason_logger, path, slang, yaml

More

Packages that depend on fluzer