From 8d51e37ebd80f65842941f1cd90f6b86f379d0f1 Mon Sep 17 00:00:00 2001 From: Dillon Nys Date: Wed, 28 Jun 2023 14:18:05 -0700 Subject: [PATCH] chore(aft): Bootstrap docs package --- packages/aft/lib/src/commands/bootstrap_command.dart | 2 +- packages/aft/lib/src/models/config.dart | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/packages/aft/lib/src/commands/bootstrap_command.dart b/packages/aft/lib/src/commands/bootstrap_command.dart index f43c00cfe2..d94a89af35 100644 --- a/packages/aft/lib/src/commands/bootstrap_command.dart +++ b/packages/aft/lib/src/commands/bootstrap_command.dart @@ -79,7 +79,7 @@ const amplifyEnvironments = {}; // command is significantly newer/older than the embedded one. (pkg) => pkg.name != 'aft', ) - .expand((pkg) => [pkg, pkg.example]) + .expand((pkg) => [pkg, pkg.example, pkg.docs]) .nonNulls; for (final package in bootstrapPackages) { await pubAction( diff --git a/packages/aft/lib/src/models/config.dart b/packages/aft/lib/src/models/config.dart index d565b875a0..c8a4f3e0a9 100644 --- a/packages/aft/lib/src/models/config.dart +++ b/packages/aft/lib/src/models/config.dart @@ -128,6 +128,7 @@ class PackageInfo required this.pubspecInfo, required this.flavor, this.example, + this.docs, }); factory PackageInfo.fromJson(Map json) => @@ -158,12 +159,17 @@ class PackageInfo example ??= PackageInfo.fromDirectory(categoryExampleDir); } + // Look for docs package + final docsDir = Directory.fromUri(dir.uri.resolve('doc/')); + final docs = PackageInfo.fromDirectory(docsDir); + return PackageInfo( name: pubspec.name, path: dir.path, pubspecInfo: pubspecInfo, flavor: pubspec.flavor, example: example, + docs: docs, ); } @@ -182,6 +188,9 @@ class PackageInfo /// The example for this package, if any. final PackageInfo? example; + /// The docs package, if any. + final PackageInfo? docs; + /// The unit test directory within the enclosing directory, if any Directory? get unitTestDirectory { final expectedPath = p.join(path, 'test');