A CLI tool for managing the Amplify Flutter repository.
bootstrap
/bs
: Sets up repo for development workclean
: Cleans temporary files and build artifacts for all packagescreate
: Creates new Amplify packages and pluginsconstraints
: Manages constraints of all packages in the repocheck
: Checks constraints againstaft.yaml
, for use in CIupdate
: Updates constraints inaft.yaml
to match latest inpub.dev
apply
: Applies constraints inaft.yaml
to all repo packagespub-verify
: Verifies Amplify constraints against the top pub.dev packages
docs
: Develop package documentationbuild
: Builds documentation for packagesserve
: Serves package documentation for local development
exec
: Execute a command in all repo packagesgenerate
: Generates various repo itemsworkflows
: Generates GitHub actions workflows for all packages in the repo
link
: Links all packages together usingpubspec_overrides.yaml
list
: Lists all packages in the repopublish
: Runsdart pub publish
/flutter pub publish
for all packages which need publishingrun
: Run a script defined inaft.yaml
version-bump
: Bumps version using git history
A full list of available commands and options can be found by running aft --help
.
To activate and run the local aft
package:
$ dart pub global activate -spath packages/aft
$ aft --help
Make sure the Dart pub cache is in your PATH to run aft
as a global executable after activating. See here for more information.
aft
supports running named scripts using the aft run
command. Scripts are defined in the scripts
section of the aft.yaml
and consist of two parts:
from
: defines where the script will runrun
: defines the script which will run
The from
option specifies a package selector which is a way to describe which packages (or more specifically, package paths) a script will run from.
Selectors can be:
- A built-in selector:
all
: All packages in the repoexample
: Example appstest
: Packages used exclusively for testingdev
: All development packages (those which are neither examples nor tests)root
: Selects the root repo directorycurrent
: Selects the current directorydart
: All Dart packagesflutter
: All Flutter packages
- A String which is not a built-in selector:
- A package name (e.g.
amplify_flutter
) - A component name (e.g.
Amplify Dart
) - A glob which is matched against the package name and path (e.g.
*auth*
)
- A package name (e.g.
- A List of selectors which get OR'd together.
- A Map which has keys for one of:
include
/exclude
: Explicitly includes/excludes a package selectorand
: A list of selectors which are AND'd togetheror
: A list of selectors which are OR'd together.
Some examples:
To select a specific set of packages:
from:
- amplify_auth_cognito
- amplify_secure_storage
- Amplify UI
To select all but a few packages:
from:
exclude:
- aft
- smithy
# Same as:
from:
include: all
exclude:
- aft
- smithy
To select all Flutter example packages:
from:
and:
- flutter
- example
The combinations can get as complex as you want!
The run
option takes in any valid Bash script which will be templated using mustache
to give access to the context in which the script is running.
Currently, a Map with the following shape is available for querying:
{
"package": {
"name": "Name of the current package",
"path": "The absolute path of the current package",
"pubspecInfo": {
"pubspec": {
// "The contents of the pubspec"
},
"pubspecYaml": "The original YAML string of the pubspec"
},
"flavor": "dart | flutter",
"example": {
// Same properties for the example package, if any
}
}
}
The script passed to run
is templated each time it is run with the current package. So when using {{ package.name }}
in a script, for example, it will always reference the package currently running the script.