Skip to content

Commit

Permalink
chore(aft): Bootstrap docs package
Browse files Browse the repository at this point in the history
  • Loading branch information
Dillon Nys committed Jun 28, 2023
1 parent 6b85d39 commit 8d51e37
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
2 changes: 1 addition & 1 deletion packages/aft/lib/src/commands/bootstrap_command.dart
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ const amplifyEnvironments = <String, String>{};
// 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(
Expand Down
9 changes: 9 additions & 0 deletions packages/aft/lib/src/models/config.dart
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@ class PackageInfo
required this.pubspecInfo,
required this.flavor,
this.example,
this.docs,
});

factory PackageInfo.fromJson(Map<String, Object?> json) =>
Expand Down Expand Up @@ -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,
);
}

Expand All @@ -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');
Expand Down

0 comments on commit 8d51e37

Please sign in to comment.