dart-decimate 0.0.63 → 0.0.64

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.
package/Cargo.lock CHANGED
@@ -102,7 +102,7 @@ checksum = "a31eee39dddec8330830986fcd7625edb5a24ec90ea038215273bbc3adb08ac6"
102
102
 
103
103
  [[package]]
104
104
  name = "dart-decimate"
105
- version = "0.0.63"
105
+ version = "0.0.64"
106
106
  dependencies = [
107
107
  "clap",
108
108
  "glob",
package/Cargo.toml CHANGED
@@ -1,6 +1,6 @@
1
1
  [package]
2
2
  name = "dart-decimate"
3
- version = "0.0.63"
3
+ version = "0.0.64"
4
4
  edition = "2024"
5
5
  rust-version = "1.90"
6
6
  description = "Rust-native codebase intelligence for Dart and Flutter module graphs."
package/README.md CHANGED
@@ -90,7 +90,7 @@ You do not need to install anything permanently. Use the command above.
90
90
  For repeatable automation, pin the version:
91
91
 
92
92
  ```bash
93
- pnpm dlx dart-decimate@0.0.63
93
+ pnpm dlx dart-decimate@0.0.64
94
94
  ```
95
95
 
96
96
  Add this to `package.json` if you want a short project command:
@@ -101,7 +101,7 @@ Add this to `package.json` if you want a short project command:
101
101
  "dart-decimate": "dart-decimate json ."
102
102
  },
103
103
  "devDependencies": {
104
- "dart-decimate": "0.0.63"
104
+ "dart-decimate": "0.0.64"
105
105
  }
106
106
  }
107
107
  ```
@@ -117,7 +117,7 @@ pnpm run dart-decimate
117
117
  If you prefer Cargo, install the matching tagged source:
118
118
 
119
119
  ```bash
120
- cargo install --git https://github.com/sgaabdu4/dart-decimate.git --tag v0.0.63 --locked
120
+ cargo install --git https://github.com/sgaabdu4/dart-decimate.git --tag v0.0.64 --locked
121
121
  ```
122
122
 
123
123
  The npm release `X.Y.Z` and Cargo tag `vX.Y.Z` are verified against each other
@@ -128,7 +128,7 @@ Confirm a Cargo build's version with:
128
128
 
129
129
  ```bash
130
130
  dart-decimate --version
131
- # dart-decimate 0.0.63
131
+ # dart-decimate 0.0.64
132
132
  ```
133
133
 
134
134
  ## pnpm dlx
@@ -539,7 +539,7 @@ Example shape:
539
539
  {
540
540
  "schema_version": "dart-decimate.report.v1",
541
541
  "kind": "combined",
542
- "tool": "dart-decimate 0.0.63",
542
+ "tool": "dart-decimate 0.0.64",
543
543
  "command": "check",
544
544
  "verdict": "fail",
545
545
  "summary": {
@@ -555,7 +555,7 @@ Example shape:
555
555
 
556
556
  The `dart-decimate.report.v1` field layout is unchanged. Its existing `tool`
557
557
  string includes the producing version so saved reports identify the exact
558
- build, for example `dart-decimate 0.0.63`.
558
+ build, for example `dart-decimate 0.0.64`.
559
559
 
560
560
  When grouped security findings hide additional occurrences, `next_steps` can
561
561
  include `review-security-surface`, which reruns
@@ -643,7 +643,7 @@ you need the installed binary's exact list.
643
643
  For a complete repository check, including discovered local packages:
644
644
 
645
645
  ```bash
646
- pnpm dlx dart-decimate@0.0.63 --strict
646
+ pnpm dlx dart-decimate@0.0.64 --strict
647
647
  ```
648
648
 
649
649
  This runs every enabled check from the repository root. The default duplication
@@ -686,7 +686,7 @@ This repository forbids `unsafe_code`.
686
686
 
687
687
  ## Release Flow
688
688
 
689
- Current source version: `0.0.63`.
689
+ Current source version: `0.0.64`.
690
690
 
691
691
  After the first public release, changes should go through pull requests. PRs to
692
692
  `main` must bump both `Cargo.toml` and `package.json` above the base branch and to
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dart-decimate",
3
- "version": "0.0.63",
3
+ "version": "0.0.64",
4
4
  "description": "Rust-native codebase intelligence for Dart and Flutter module graphs.",
5
5
  "license": "MIT",
6
6
  "bin": {
@@ -437,19 +437,46 @@ fn function_expression_body_constructor_name(node: Node<'_>, source: &str) -> Op
437
437
  if node.kind() != "call_expression" {
438
438
  return None;
439
439
  }
440
- let function = node.child_by_field_name("function")?;
440
+ let callee = node.child_by_field_name("function")?;
441
+ let (function, named_constructor) = if callee.kind() == "member_expression" {
442
+ (
443
+ callee.child_by_field_name("object")?,
444
+ Some(callee.child_by_field_name("property")?),
445
+ )
446
+ } else {
447
+ (callee, None)
448
+ };
441
449
  if function.kind() != "function_expression" {
442
450
  return None;
443
451
  }
444
452
  let body = function.child_by_field_name("body")?;
445
453
  let mut expression = body.named_child(0)?;
446
454
  while expression.kind() == "conditional_expression" {
447
- expression = expression.named_children(&mut expression.walk()).last()?;
455
+ expression = expression.child_by_field_name("alternative")?;
456
+ }
457
+ if let Some(named_constructor) = named_constructor {
458
+ return split_closure_body_named_constructor(expression, named_constructor, source);
448
459
  }
449
460
  constructor_call_type_name(expression, source)
450
461
  .or_else(|| split_closure_body_constructor_name(node, expression, source))
451
462
  }
452
463
 
464
+ fn split_closure_body_named_constructor(
465
+ expression: Node<'_>,
466
+ named_constructor: Node<'_>,
467
+ source: &str,
468
+ ) -> Option<String> {
469
+ if !matches!(expression.kind(), "identifier" | "type_identifier") {
470
+ return None;
471
+ }
472
+ let constructor = format!(
473
+ "{}.{}",
474
+ expression.utf8_text(source.as_bytes()).ok()?,
475
+ named_constructor.utf8_text(source.as_bytes()).ok()?
476
+ );
477
+ (!constructor_name_candidates(&constructor).is_empty()).then_some(constructor)
478
+ }
479
+
453
480
  fn constructor_call_type_name(node: Node<'_>, source: &str) -> Option<String> {
454
481
  if !is_object_constructor(node) {
455
482
  return None;