Skip to main content

cobalt_analyzer 1.7.0 copy "cobalt_analyzer: ^1.7.0" to clipboard
cobalt_analyzer: ^1.7.0 copied to clipboard

Internal analysis layer of cobalt_generator and cobalt_lint — parses Cobalt annotations once for both. Not covered by semver; depend on those packages instead.

1.7.0 #

  • No code changes in this package. Republished in lockstep with 1.7.0: a widget-tree hint in cobalt_flutter, a lint rule for reads that always throw, generated names without $, CobaltStartupObserver, a Mermaid copy in the inspector, and decorators in child scopes.

1.6.0 #

  • No code changes in this package. Republished in lockstep with 1.6.0: child scopes in the lint plugin, openForTest in cobalt_test, a reminder about a forgotten bootstrap in cobalt_flutter, and record names without $ in cobalt_generator.

1.5.0 #

  • Reads @CobaltChildScope into CobaltChildScopeClass (values, parent, provides) and scope: into CobaltInjectableClass.scope; CobaltLibraryDeclarations.childScopes carries the markers. Requires cobalt and cobalt_annotations 1.5.0.

1.4.0 #

  • Internal: a constructor parameter records whether it has a default value (CobaltInjectedProperty.hasDefault), and CobaltInjectableClass.withConstructorParameters replaces them. exposeAs beside instantiations is read when written without type arguments, and each instantiation is exposed under its own. cobalt_generator and cobalt_lint 1.4.0 require this version.

1.3.0 #

  • Internal: an @injected field on a generic class with instantiations is no longer a build error. Each instantiation reads the field under its own type arguments, and CobaltInjectableParser.declaredPropertiesOf returns the fields as the class declares them, for its one mixin. cobalt_generator and cobalt_lint 1.3.0 require this version.

1.2.0 #

  • Internal: parses @CobaltInject(instantiations:) into one declaration per instantiation, so parseClass returns a list, and reports a raw type, a duplicate entry, exposeAs, an @injected field or a module member with instantiations as build errors. A type argument keeps its ? in a registration's identity. Requires cobalt_annotations 1.2.0; cobalt_generator and cobalt_lint 1.2.0 require this version.

1.1.1 #

  • No code changes in this package. Republished in lockstep with 1.1.1: a shorter README with a Quick start, examples/hello as the smallest app, docs/OVERVIEW.md for everything the README no longer holds, and docs/TROUBLESHOOTING.md, one entry per error.

1.1.0 #

  • No code changes in this package. Republished in lockstep with 1.1.0, which adds Korean to the inspector and to the documentation.

1.0.0 #

  • Internal to cobalt_generator and cobalt_lint, and now says so: its models and parsers follow what those two need, not semantic versioning. Depend on them rather than on this package. The version still moves in lockstep.

0.9.0 #

  • An @cobaltHookAll class extends CobaltHook<T>, now a base class; the parser's message says so.

0.8.0 #

  • Reads @CobaltHookAll classes: CobaltHookClass, CobaltHookParser and CobaltLibraryDeclarations.hooks. The class implements CobaltHook<T> for one T and has a constructor without required parameters.
  • CobaltParseError is final.

0.7.0 #

  • No code changes in this package. Republished in lockstep with 0.7.0, which makes CobaltResolver a base class (breaking), adds getters to CobaltRegistrationKind and lets the inspector open on a chosen tab — see cobalt's changelog.

0.6.0 #

  • No code changes in this package. Republished in lockstep with 0.6.0, which adds build times to observers and the inspector, a graph snapshot in cobalt_test and a lint rule — see cobalt's changelog.

0.5.0 #

  • A transient lifetime on an @CobaltInit class or on a module member returning a Future is honoured: CobaltInjectableClass.isAsyncTransient and isAwaited. Before, it was silently read as a singleton built by init(). lazy: true / lazyInit, dependsOn and dispose: on one are refused.
  • CobaltDecoratorClass.allNames, refused together with name.
  • @injected fields on an @CobaltDecorates class are read instead of refused — CobaltDecoratorClass.injectedFields — and count among its dependencies. Field reading is shared with registrations, so the same late final and static refusals apply.
  • IR written before these fields reads as before: not transient, not allNames, no injected fields.

0.4.0 #

  • @CobaltInit with an @CobaltParam is parsed instead of refused, and CobaltInjectableClass gains isAsyncParam and isBuiltInPhaseOne. Such a class with lazy: true or dependsOn is refused: it is built per call, never by init().

0.3.0 #

  • CobaltDecoratorClass, read by CobaltDecoratorParser, and CobaltLibraryDeclarations.decorators, read tolerantly from IR written by an older build. A decorator is kept apart from the injectables: it claims no key, and every check that groups by key would take it for a duplicate.
  • The parser refuses a decorator that is not a subtype of its target, that takes other than one parameter of the target type, that is also a registration, that decorates twice, that is abstract or generic, that has no public generative constructor, or that asks for @CobaltParam or @injected fields.

0.2.1 #

  • Accepts analyzer up to 14.x (>=10.0.1 <15.0.0, was <13.0.0). The cap kept the repository's own workspace from resolving on Flutter 3.49, whose test needs analyzer 13, and kept projects on current build, build_runner, freezed or json_serializable from using the generator. Flutter 3.38.9 stays the floor: the same source builds and passes its tests on analyzer 10.0.1, 12.1.0, 13.3.0 and 14.4.0.

0.2.0 #

  • CobaltInjectableClass.isLazyAsync, read from @CobaltInit(lazy: true) and from lazyInit on a module member. IR written before it existed reads as not lazy.
  • Refused while parsing: a lazy class that declares dependsOn, lazyInit on a class (the class form is @CobaltInit(lazy: true)), and lazyInit on a module member that does not return a Future.

0.1.2 #

  • No code changes in this package. Republished in lockstep with a packaging fix in cobalt 0.1.2 (a stray file removed from its archive) — see its changelog. A fix in one package still ships as a patch for all fifteen, because publishing a subset is what lets the set drift.

0.1.1 #

  • No code changes in this package. Republished in lockstep with the fix in cobalt_lint 0.1.1 — see its changelog. Lockstep is the whole versioning policy: a fix in one package still ships as a patch for all fifteen, because publishing a subset is what lets the set drift.

0.1.0 #

  • Requires Dart ^3.10.0 — Flutter 3.38 — instead of ^3.13.0, and moves analyzer to >=10.0.1 <13.0.0. A Flutter 3.38 application cannot resolve past 10.0.1, because Flutter pins meta 1.17.0 there; everything else takes 12.1.0. This package reads only the element model, which does not change across that range.

  • Initial release.

  • One parsing layer over analyzer, shared by cobalt_generator and cobalt_lint so the IDE and the build agree on what a declaration means.

  • Typed IR — CobaltInjectableClass, CobaltBootstrapStepClass, CobaltScopeRootClass, CobaltTypeRef — with JSON round-tripping, which is what makes the generator's two-phase pipeline possible.

  • CobaltTypeRef.signature is the single definition of registration identity: type arguments are part of it, nullability is not.

  • Annotations are matched by class name and owning package rather than by exact library path, so moving a declaration inside cobalt_annotations does not break consumers, and test stubs still resolve.

  • CobaltScopeRootClass.provides carries the registrations a package makes by hand, as CobaltProvidedRef pairs of type and optional name. IR written before the field existed still reads.

  • CobaltModuleParser reads an @CobaltModule class into one registration per member — the only parser that is one-to-many. A member returning Future<T> registers T.

0
likes
160
points
1.6k
downloads

Documentation

API reference

Publisher

unverified uploader

Weekly Downloads

Internal analysis layer of cobalt_generator and cobalt_lint — parses Cobalt annotations once for both. Not covered by semver; depend on those packages instead.

Repository (GitHub)
View/report issues
Contributing

Topics

#dependency-injection #analyzer #codegen #static-analysis

License

MIT (license)

Dependencies

analyzer, cobalt, cobalt_annotations, collection, meta, path

More

Packages that depend on cobalt_analyzer