ModulePackage class final

The package of a module and the rules it follows, which the package checks in its own tests with problems:

  • the Dart files in lib/ import, export and include as parts only dart: libraries but those that reach the machine, such as dart:io, the module model of smf_contracts (smf_contracts.dart and core.dart), the files of the package and the public libraries, outside src/, of the packages among its dependencies, and a relative URI does not leave lib/, conditional ones included;
  • of the SMF packages, the Dart files in test/ use only the module model of smf_contracts and the public libraries of the package itself, the packages among its dependencies, such as a module it depends on, smf_pipeline and testModules, and a relative URI does not leave test/, so a test uses no file of another package;
  • the package depends on smf_contracts and dependencies, on no other package, and on none that no file in lib/ uses;
  • of the SMF packages, its dev dependencies are smf_pipeline, for the contract harness, and testModules.

So the code of a module knows only the module model and the modules it depends on.

test('follows the rules of the package of a module', () {
  expect(
    const ModulePackage(
      'smf_riverpod',
      testModules: {'smf_flutter_core'},
    ).problems(),
    isEmpty,
  );
});

Constructors

ModulePackage(String name, {Set<String> dependencies = const {}, Set<String> testModules = const {}})
Describes the package name of a module.
const

Properties

dependencies → Set<String>
The packages besides smf_contracts that the code of the module uses, such as mason for the bundles of its bricks, or the package of a module it depends on, which the tests use too.
final
hashCode → int
The hash code for this object.
no setterinherited
name → String
The name of the package, such as smf_riverpod.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
testModules → Set<String>
The packages of other modules that the tests use, besides smf_pipeline, such as smf_flutter_core for the app entry of the apps they render.
final

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
problems({String root = '.', FileSystem fileSystem = const LocalFileSystem()}) → List<String>
The problems of the package in the directory root, the current directory by default, which is the package's own when dart test runs its tests: one line for every package and every URI of a file that breaks a rule.
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited