dart_minify 0.2.1 copy "dart_minify: ^0.2.1" to clipboard
dart_minify: ^0.2.1 copied to clipboard

Semantic context packing and structured edit application for Dart agents.

Changelog #

0.2.1 #

  • Add the opt-in liveday benchmark for comparing raw Dart and focused packs across installed coding CLIs, plus one recorded sample and pack-vs-raw charts. The pack arm is read-only context and does not request a DMP reply.
  • Publish a balanced-v1 savings table in the README from the checked-in medium-commerce scenario.
  • stats reports compact-versus-pack packSavings and accepts pack focus flags (--symbol, --declaration, --task, --max-tokens, --max-bytes).
  • DartMinifyWorkflow.apply parses planned sources and analyzes the affected closure by default.
  • CI compares medium_scenario.dart stdout with the canonical JSON on stable Dart.
  • Removed unused ValidationResult / ValidationIssue types. Protocol and path validation still throw their dedicated exceptions.
  • Removed the unused isWithinCanonicalRoot helper and the leftover .llm.min.dart generated-file suffix.
  • computeContentHash now reuses sha256String.
  • Dropped the unused encodeCanonicalJson alias.
  • Require dart_style 3.x for formatting compatibility.
  • Skip unparsable files and redundant cache rebuilds during indexing.
  • Format edits with the project Dart version and compact packed declaration source.
  • Reserve the empty dictionary in the protocol.
  • Default CLI verification tests off and analysis on during apply.

0.2.0 #

This is a breaking redesign from a whole-file minifier into a bidirectional, provider-agnostic agent codec.

Added #

  • Analyzer-backed, deterministic source compaction with significant-token equivalence and structured malformed-source diagnostics.
  • Content-addressed Dart and Flutter project indexes with stable file and declaration IDs, dependency relationships, hashes, and cache invalidation.
  • Task-focused packs with explicit inclusion reasons, hard budgets, dependency stubs, and incremental session state.
  • Provider-neutral first-turn and follow-up instruction preambles with project/base/session identity descriptors and measured overhead.
  • Canonical protocol v2 in compact text and JSON forms.
  • Declaration, directive, and file edit operations anchored by stable IDs, fingerprints, and expected base hashes.
  • Atomic multi-file preflight and application with dry-run previews and local transaction records.
  • Opt-in apply-time semantic closure analysis over planned in-memory sources, with pre-existing analyzer errors subtracted from the failure set.
  • Parse, format, analyze, test, and custom-command verification with normalized diagnostics and focused repair-pack selection.
  • The index, pack, apply, verify, stats, and doctor command surface, including per-command help and injected-stdin support where applicable.
  • CI coverage for Dart 3.9 and latest stable Dart, formatting, analysis, tests, coverage artifacts, and package publication validation.

Changed #

  • Raised the minimum Dart SDK to 3.9.
  • Narrowed analyzer support to the tested 8.x API family.
  • Redefined statistics to separate raw bytes, lexical tokens, estimated model tokens, and compact-protocol overhead.
  • Kept machine-readable stdout separate from progress and diagnostic stderr.
  • Moved local cache and session state under .dart_minify/; recoverable transaction journals remain at the project root as .dart_minify.transaction.*, with transaction-owned temporary files beside their targets for same-filesystem replacement.

Fixed #

  • Preserve significant token boundaries for separated operators such as - - and for tokens separated only by removed comments.
  • Correctly preserve raw, triple, interpolated, escaped, multiline, and Unicode string contents through analyzer tokenization.
  • Reject malformed Dart, corrupt/truncated protocol input, unsupported protocol versions, duplicate operations, stale bases, and unsafe paths explicitly.
  • Use canonical containment checks instead of lexical path-prefix checks.
  • Preflight every file operation before committing any source change.

Removed #

  • The minify, expand, lossy-build, and apply-lossy commands.
  • Framed <<<DART_MINIFY_FILE:...>>> payloads and whole-source reverse maps.
  • The build-runner builder, build.yaml, and the package's build and build_runner dependencies.
  • .llm.min.dart, .llm.map.json, and lossy-manifest source workflows.
  • Both 0.1.x symbol-renaming strategies and regex-based reverse renaming.

See the migration guide for command and artifact replacements.

0.1.1 #

  • Prepare package for pub.flutter-io.cn publishing.
  • Pin local Flutter toolchain via .fvmrc (3.41.4) for consistent development.
  • Improve package metadata in pubspec.yaml (homepage/repository/issues/docs/topics).
  • Rewrite README for clearer purpose, quickstart, and command guidance.
  • Add runnable examples under example/ (CLI flow and Dart wrapper).
  • Add MIT LICENSE.

0.1.0 #

  • Initial release of dart_minify CLI.
  • Added minify, expand, stats, doctor, lossy-build, and apply-lossy.
1
likes
140
points
84
downloads

Documentation

Documentation
API reference

Publisher

verified publisherhashstudios.dev

Weekly Downloads

Semantic context packing and structured edit application for Dart agents.

Repository (GitHub)
View/report issues

Topics

#ai #cli #flutter #minification #tooling

License

MIT (license)

Dependencies

analyzer, args, crypto, dart_style, path, pub_semver

More

Packages that depend on dart_minify