Freeze a2ui_core and a2ui_agent in this repo. - #1024
Conversation
There was a problem hiding this comment.
Code Review
This pull request removes the a2ui_agent and a2ui_core packages from the workspace and replaces standard package imports with relative path imports across multiple tools, examples, and tests. The reviewer feedback correctly points out that using relative imports to reach into another package's lib/ directory, or importing a package's own library from its tests/examples via relative paths, violates Dart's avoid_relative_lib_imports linter rule. It is recommended to revert these relative imports and instead define proper path dependencies in the respective pubspec.yaml files to maintain standard package: imports.
I am having trouble creating individual review comments. Click here to see my feedback.
dev_tools/catalog_gallery/lib/sample_parser.dart (7)
Using relative imports to reach into another package's lib/ directory is highly discouraged in Dart and violates the avoid_relative_lib_imports linter rule. It can lead to duplicate library instances at runtime and breaks package encapsulation.
Instead of using relative paths in Dart files, you should define a path dependency in dev_tools/catalog_gallery/pubspec.yaml:
dependencies:
a2ui_core:
path: ../../packages/archive/a2ui_coreThis allows you to keep using the clean, standard package: import.
import 'package:a2ui_core/a2ui_core.dart' as core;
dev_tools/composer/lib/surface_editor.dart (8)
Using relative imports to reach into another package's lib/ directory is highly discouraged in Dart and violates the avoid_relative_lib_imports linter rule.
Instead, define a path dependency in dev_tools/composer/pubspec.yaml:
dependencies:
a2ui_core:
path: ../../packages/archive/a2ui_coreThis allows you to keep using the standard package: import.
import 'package:a2ui_core/a2ui_core.dart' as core;
examples/simple_chat/lib/a2ui_transport.dart (7)
Using relative imports to reach into another package's lib/ directory is highly discouraged in Dart and violates the avoid_relative_lib_imports linter rule.
Instead, define a path dependency in examples/simple_chat/pubspec.yaml:
dependencies:
a2ui_core:
path: ../../packages/archive/a2ui_coreThis allows you to keep using the standard package: import.
import 'package:a2ui_core/a2ui_core.dart' as core;
examples/verdure/client/lib/features/ai/ai_provider.dart (8-9)
Using relative imports to reach into another package's lib/ directory is highly discouraged in Dart and violates the avoid_relative_lib_imports linter rule.
Instead, define a path dependency in examples/verdure/client/pubspec.yaml:
dependencies:
a2ui_core:
path: ../../../../../packages/archive/a2ui_coreThis allows you to keep using the standard package: import.
import 'package:a2ui_core/a2ui_core.dart' as core;packages/genui/test/error_reporting_test.dart (7)
Using relative imports to reach into another package's lib/ directory is highly discouraged in Dart and violates the avoid_relative_lib_imports linter rule.
Instead, define a path dependency in packages/genui/pubspec.yaml:
dependencies:
a2ui_core:
path: ../archive/a2ui_coreThis allows you to keep using the standard package: import.
import 'package:a2ui_core/a2ui_core.dart' as core;
packages/archive/a2ui_agent/example/a2ui_agent_example.dart (5)
In Dart, examples and tests located outside the lib/ directory of a package should import the package using its package: URI rather than a relative path. This avoids violating the avoid_relative_lib_imports linter rule.
import 'package:a2ui_agent/a2ui_agent.dart';
packages/archive/a2ui_agent/test/a2ui_agent_test.dart (5)
In Dart, tests located outside the lib/ directory of a package should import the package using its package: URI rather than a relative path. This avoids violating the avoid_relative_lib_imports linter rule.
import 'package:a2ui_agent/a2ui_agent.dart';
packages/archive/a2ui_core/test/binder_lifecycle_test.dart (5)
In Dart, tests located outside the lib/ directory of a package should import the package using its package: URI rather than a relative path. This avoids violating the avoid_relative_lib_imports linter rule.
import 'package:a2ui_core/a2ui_core.dart';
packages/archive/a2ui_core/test/binder_test.dart (5-9)
In Dart, tests located outside the lib/ directory of a package should import the package's internal files using package:a2ui_core/... rather than relative paths. This avoids violating the avoid_relative_lib_imports linter rule.
import 'package:a2ui_core/src/core/component_model.dart';
import 'package:a2ui_core/src/core/contexts.dart';
import 'package:a2ui_core/src/core/minimal_catalog.dart';
import 'package:a2ui_core/src/core/surface_model.dart';
import 'package:a2ui_core/src/rendering/binder.dart';
packages/archive/a2ui_core/test/data_model_test.dart (5-7)
In Dart, tests located outside the lib/ directory of a package should import the package's internal files using package:a2ui_core/... rather than relative paths. This avoids violating the avoid_relative_lib_imports linter rule.
import 'package:a2ui_core/src/core/data_model.dart';
import 'package:a2ui_core/src/primitives/errors.dart';
import 'package:a2ui_core/src/primitives/reactivity.dart';
packages/archive/a2ui_core/test/processor_test.dart (5-11)
In Dart, tests located outside the lib/ directory of a package should import the package's internal files using package:a2ui_core/... rather than relative paths. This avoids violating the avoid_relative_lib_imports linter rule.
import 'package:a2ui_core/src/core/catalog.dart';
import 'package:a2ui_core/src/core/common_schemas.dart';
import 'package:a2ui_core/src/core/component_model.dart';
import 'package:a2ui_core/src/core/messages.dart';
import 'package:a2ui_core/src/core/minimal_catalog.dart';
import 'package:a2ui_core/src/core/surface_model.dart';
import 'package:a2ui_core/src/processing/processor.dart';
Contributes to a2ui-project/a2ui#2234