Skip to content

Commit fd39ba2

Browse files
Dillon Nysragingsquirrel3
authored andcommitted
feat(aft): Docs commands
Adds `aft docs build` and `aft docs serve` to compile docs and serve docs on a local HTTP server with auto-rebuild, respectively.
1 parent 18d52f3 commit fd39ba2

File tree

10 files changed

+409
-31
lines changed

10 files changed

+409
-31
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ temp/
1818
.fvm/
1919
.packages
2020
pubspec_overrides.yaml
21+
doc/api/
22+
**/doc/api/
2123

2224
# IDEs
2325
.idea/

aft.yaml

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -152,30 +152,3 @@ scripts:
152152
if [ -d android ]; then
153153
flutter build apk --debug
154154
fi
155-
build:docs:
156-
description: Builds the documentation examples
157-
run: |
158-
if [ ! -f doc/build.yaml ]; then
159-
echo "No documentation examples for {{ package.name }}" >&2
160-
exit 0
161-
fi
162-
163-
pushd doc
164-
# All `doc` packages should allow `flutter` dependencies even if they
165-
# are subpackages of a Dart-only package. For example, we want to use
166-
# `amplify_flutter` in the `amplify_core` docs.
167-
flutter pub get
168-
flutter pub run build_runner build
169-
popd
170-
171-
if [ "{{ package.flavor }}" == "flutter" ]; then
172-
PUB="flutter pub"
173-
else
174-
PUB="dart"
175-
fi
176-
177-
$PUB run code_excerpt_updater \
178-
--fragment-dir-path=doc/.dart_tool/build/generated \
179-
--yaml \
180-
--write-in-place \
181-
lib

packages/aft/README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@ A CLI tool for managing the Amplify Flutter repository.
1212
- `update`: Updates constraints in `aft.yaml` to match latest in `pub.dev`
1313
- `apply`: Applies constraints in `aft.yaml` to all repo packages
1414
- `pub-verify`: Verifies Amplify constraints against the top pub.dev packages
15+
- `docs`: Develop package documentation
16+
- `build`: Builds documentation for packages
17+
- `serve`: Serves package documentation for local development
1518
- `exec`: Execute a command in all repo packages
1619
- `generate`: Generates various repo items
1720
- `workflows`: Generates GitHub actions workflows for all packages in the repo

packages/aft/lib/aft.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ export 'src/commands/bootstrap_command.dart';
88
export 'src/commands/clean_command.dart';
99
export 'src/commands/constraints_command.dart';
1010
export 'src/commands/create_command.dart';
11+
export 'src/commands/docs_command.dart';
1112
export 'src/commands/exec_command.dart';
1213
export 'src/commands/generate/generate_command.dart';
1314
export 'src/commands/link_command.dart';

packages/aft/lib/src/command_runner.dart

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,8 @@ Future<void> run(List<String> args) async {
3636
..addCommand(ExecCommand())
3737
..addCommand(CreateCommand())
3838
..addCommand(SaveRepoStateCommand())
39-
..addCommand(RunCommand());
39+
..addCommand(RunCommand())
40+
..addCommand(DocsCommand());
4041

4142
try {
4243
final argResults = runner.argParser.parse(args);

0 commit comments

Comments
 (0)