From d05c0179a1f86a7183c5ed947e3fa0eec1f71f7a Mon Sep 17 00:00:00 2001 From: Jordan Nelson Date: Wed, 11 Sep 2024 12:41:31 -0400 Subject: [PATCH] chore: `aft version-bump` test suite (#5424) * chore: add `--skip-build-version` option * chore: use `base-ref`/`head-ref` over env vars * chore: add new version bump test suite * chore: remove old version bump tests * chore: only include first change log entry * fix: sort change types before writing to the change log * chore: remove non essential info from diffs * chore: generate repo snapshot * chore: generate diff snapshots * chore: clean up tests and test output --- .gitattributes | 4 + packages/aft/lib/src/changelog/changelog.dart | 4 +- .../aft/lib/src/changelog/commit_message.dart | 2 +- .../src/commands/version_bump_command.dart | 33 +- .../aft/lib/src/options/git_ref_options.dart | 8 +- packages/aft/test/e2e_test.dart | 437 ------------------ packages/aft/test/version_bump/README.md | 11 + .../amplify/amplify_flutter/CHANGELOG.md | 6 + .../amplify/amplify_flutter/pubspec.yaml | 37 ++ .../packages/amplify_core/CHANGELOG.md | 4 + .../packages/amplify_core/pubspec.yaml | 39 ++ .../packages/amplify_datastore/CHANGELOG.md | 4 + .../packages/amplify_datastore/pubspec.yaml | 38 ++ .../CHANGELOG.md | 4 + .../pubspec.yaml | 23 + .../packages/amplify_lints/CHANGELOG.md | 5 + .../packages/amplify_lints/pubspec.yaml | 13 + .../CHANGELOG.md | 3 + .../pubspec.yaml | 27 ++ .../amplify_analytics_pinpoint/CHANGELOG.md | 4 + .../amplify_analytics_pinpoint/pubspec.yaml | 45 ++ .../CHANGELOG.md | 4 + .../pubspec.yaml | 40 ++ .../packages/api/amplify_api/CHANGELOG.md | 4 + .../packages/api/amplify_api/pubspec.yaml | 39 ++ .../api/amplify_api_dart/CHANGELOG.md | 4 + .../api/amplify_api_dart/pubspec.yaml | 29 ++ .../auth/amplify_auth_cognito/CHANGELOG.md | 4 + .../auth/amplify_auth_cognito/pubspec.yaml | 54 +++ .../amplify_auth_cognito_dart/CHANGELOG.md | 4 + .../amplify_auth_cognito_dart/pubspec.yaml | 59 +++ .../amplify_authenticator/CHANGELOG.md | 4 + .../amplify_authenticator/pubspec.yaml | 53 +++ .../packages/aws_common/CHANGELOG.md | 4 + .../packages/aws_common/pubspec.yaml | 35 ++ .../packages/aws_signature_v4/CHANGELOG.md | 4 + .../packages/aws_signature_v4/pubspec.yaml | 34 ++ .../common/amplify_db_common/CHANGELOG.md | 4 + .../common/amplify_db_common/pubspec.yaml | 34 ++ .../amplify_db_common_dart/CHANGELOG.md | 4 + .../amplify_db_common_dart/pubspec.yaml | 26 ++ .../amplify_push_notifications/CHANGELOG.md | 4 + .../amplify_push_notifications/pubspec.yaml | 42 ++ .../CHANGELOG.md | 5 + .../pubspec.yaml | 39 ++ .../amplify_secure_storage/CHANGELOG.md | 4 + .../amplify_secure_storage/pubspec.yaml | 45 ++ .../amplify_secure_storage_dart/CHANGELOG.md | 4 + .../amplify_secure_storage_dart/pubspec.yaml | 50 ++ .../packages/smithy/smithy/CHANGELOG.md | 4 + .../packages/smithy/smithy/pubspec.yaml | 36 ++ .../packages/smithy/smithy_aws/CHANGELOG.md | 4 + .../packages/smithy/smithy_aws/pubspec.yaml | 36 ++ .../smithy/smithy_codegen/CHANGELOG.md | 4 + .../smithy/smithy_codegen/pubspec.yaml | 52 +++ .../storage/amplify_storage_s3/CHANGELOG.md | 4 + .../storage/amplify_storage_s3/pubspec.yaml | 38 ++ .../amplify_storage_s3_dart/CHANGELOG.md | 4 + .../amplify_storage_s3_dart/pubspec.yaml | 35 ++ .../packages/worker_bee/e2e/pubspec.yaml | 31 ++ .../worker_bee/worker_bee/CHANGELOG.md | 4 + .../worker_bee/worker_bee/pubspec.yaml | 28 ++ .../worker_bee_builder/CHANGELOG.md | 4 + .../worker_bee_builder/pubspec.yaml | 27 ++ .../data/repo_snapshot/pubspec.yaml | 166 +++++++ .../data/snapshots/aws_common_fix.diff | 9 + .../data/snapshots/multi_package_update.diff | 231 +++++++++ .../single_dart_package_breaking.diff | 39 ++ .../snapshots/single_dart_package_chore.diff | 8 + .../snapshots/single_dart_package_feat.diff | 12 + .../snapshots/single_dart_package_fix.diff | 9 + .../snapshots/single_package_breaking.diff | 212 +++++++++ .../data/snapshots/single_package_chore.diff | 8 + .../data/snapshots/single_package_feat.diff | 138 ++++++ .../data/snapshots/single_package_fix.diff | 9 + .../test/version_bump/version_bump_test.dart | 226 +++++++++ packages/aft/tool/repo_snapshot.sh | 54 +++ 77 files changed, 2365 insertions(+), 454 deletions(-) delete mode 100644 packages/aft/test/e2e_test.dart create mode 100644 packages/aft/test/version_bump/README.md create mode 100644 packages/aft/test/version_bump/data/repo_snapshot/packages/amplify/amplify_flutter/CHANGELOG.md create mode 100644 packages/aft/test/version_bump/data/repo_snapshot/packages/amplify/amplify_flutter/pubspec.yaml create mode 100644 packages/aft/test/version_bump/data/repo_snapshot/packages/amplify_core/CHANGELOG.md create mode 100644 packages/aft/test/version_bump/data/repo_snapshot/packages/amplify_core/pubspec.yaml create mode 100644 packages/aft/test/version_bump/data/repo_snapshot/packages/amplify_datastore/CHANGELOG.md create mode 100644 packages/aft/test/version_bump/data/repo_snapshot/packages/amplify_datastore/pubspec.yaml create mode 100644 packages/aft/test/version_bump/data/repo_snapshot/packages/amplify_datastore_plugin_interface/CHANGELOG.md create mode 100644 packages/aft/test/version_bump/data/repo_snapshot/packages/amplify_datastore_plugin_interface/pubspec.yaml create mode 100644 packages/aft/test/version_bump/data/repo_snapshot/packages/amplify_lints/CHANGELOG.md create mode 100644 packages/aft/test/version_bump/data/repo_snapshot/packages/amplify_lints/pubspec.yaml create mode 100644 packages/aft/test/version_bump/data/repo_snapshot/packages/amplify_native_legacy_wrapper/CHANGELOG.md create mode 100644 packages/aft/test/version_bump/data/repo_snapshot/packages/amplify_native_legacy_wrapper/pubspec.yaml create mode 100644 packages/aft/test/version_bump/data/repo_snapshot/packages/analytics/amplify_analytics_pinpoint/CHANGELOG.md create mode 100644 packages/aft/test/version_bump/data/repo_snapshot/packages/analytics/amplify_analytics_pinpoint/pubspec.yaml create mode 100644 packages/aft/test/version_bump/data/repo_snapshot/packages/analytics/amplify_analytics_pinpoint_dart/CHANGELOG.md create mode 100644 packages/aft/test/version_bump/data/repo_snapshot/packages/analytics/amplify_analytics_pinpoint_dart/pubspec.yaml create mode 100644 packages/aft/test/version_bump/data/repo_snapshot/packages/api/amplify_api/CHANGELOG.md create mode 100644 packages/aft/test/version_bump/data/repo_snapshot/packages/api/amplify_api/pubspec.yaml create mode 100644 packages/aft/test/version_bump/data/repo_snapshot/packages/api/amplify_api_dart/CHANGELOG.md create mode 100644 packages/aft/test/version_bump/data/repo_snapshot/packages/api/amplify_api_dart/pubspec.yaml create mode 100644 packages/aft/test/version_bump/data/repo_snapshot/packages/auth/amplify_auth_cognito/CHANGELOG.md create mode 100644 packages/aft/test/version_bump/data/repo_snapshot/packages/auth/amplify_auth_cognito/pubspec.yaml create mode 100644 packages/aft/test/version_bump/data/repo_snapshot/packages/auth/amplify_auth_cognito_dart/CHANGELOG.md create mode 100644 packages/aft/test/version_bump/data/repo_snapshot/packages/auth/amplify_auth_cognito_dart/pubspec.yaml create mode 100644 packages/aft/test/version_bump/data/repo_snapshot/packages/authenticator/amplify_authenticator/CHANGELOG.md create mode 100644 packages/aft/test/version_bump/data/repo_snapshot/packages/authenticator/amplify_authenticator/pubspec.yaml create mode 100644 packages/aft/test/version_bump/data/repo_snapshot/packages/aws_common/CHANGELOG.md create mode 100644 packages/aft/test/version_bump/data/repo_snapshot/packages/aws_common/pubspec.yaml create mode 100644 packages/aft/test/version_bump/data/repo_snapshot/packages/aws_signature_v4/CHANGELOG.md create mode 100644 packages/aft/test/version_bump/data/repo_snapshot/packages/aws_signature_v4/pubspec.yaml create mode 100644 packages/aft/test/version_bump/data/repo_snapshot/packages/common/amplify_db_common/CHANGELOG.md create mode 100644 packages/aft/test/version_bump/data/repo_snapshot/packages/common/amplify_db_common/pubspec.yaml create mode 100644 packages/aft/test/version_bump/data/repo_snapshot/packages/common/amplify_db_common_dart/CHANGELOG.md create mode 100644 packages/aft/test/version_bump/data/repo_snapshot/packages/common/amplify_db_common_dart/pubspec.yaml create mode 100644 packages/aft/test/version_bump/data/repo_snapshot/packages/notifications/push/amplify_push_notifications/CHANGELOG.md create mode 100644 packages/aft/test/version_bump/data/repo_snapshot/packages/notifications/push/amplify_push_notifications/pubspec.yaml create mode 100644 packages/aft/test/version_bump/data/repo_snapshot/packages/notifications/push/amplify_push_notifications_pinpoint/CHANGELOG.md create mode 100644 packages/aft/test/version_bump/data/repo_snapshot/packages/notifications/push/amplify_push_notifications_pinpoint/pubspec.yaml create mode 100644 packages/aft/test/version_bump/data/repo_snapshot/packages/secure_storage/amplify_secure_storage/CHANGELOG.md create mode 100644 packages/aft/test/version_bump/data/repo_snapshot/packages/secure_storage/amplify_secure_storage/pubspec.yaml create mode 100644 packages/aft/test/version_bump/data/repo_snapshot/packages/secure_storage/amplify_secure_storage_dart/CHANGELOG.md create mode 100644 packages/aft/test/version_bump/data/repo_snapshot/packages/secure_storage/amplify_secure_storage_dart/pubspec.yaml create mode 100644 packages/aft/test/version_bump/data/repo_snapshot/packages/smithy/smithy/CHANGELOG.md create mode 100644 packages/aft/test/version_bump/data/repo_snapshot/packages/smithy/smithy/pubspec.yaml create mode 100644 packages/aft/test/version_bump/data/repo_snapshot/packages/smithy/smithy_aws/CHANGELOG.md create mode 100644 packages/aft/test/version_bump/data/repo_snapshot/packages/smithy/smithy_aws/pubspec.yaml create mode 100644 packages/aft/test/version_bump/data/repo_snapshot/packages/smithy/smithy_codegen/CHANGELOG.md create mode 100644 packages/aft/test/version_bump/data/repo_snapshot/packages/smithy/smithy_codegen/pubspec.yaml create mode 100644 packages/aft/test/version_bump/data/repo_snapshot/packages/storage/amplify_storage_s3/CHANGELOG.md create mode 100644 packages/aft/test/version_bump/data/repo_snapshot/packages/storage/amplify_storage_s3/pubspec.yaml create mode 100644 packages/aft/test/version_bump/data/repo_snapshot/packages/storage/amplify_storage_s3_dart/CHANGELOG.md create mode 100644 packages/aft/test/version_bump/data/repo_snapshot/packages/storage/amplify_storage_s3_dart/pubspec.yaml create mode 100644 packages/aft/test/version_bump/data/repo_snapshot/packages/worker_bee/e2e/pubspec.yaml create mode 100644 packages/aft/test/version_bump/data/repo_snapshot/packages/worker_bee/worker_bee/CHANGELOG.md create mode 100644 packages/aft/test/version_bump/data/repo_snapshot/packages/worker_bee/worker_bee/pubspec.yaml create mode 100644 packages/aft/test/version_bump/data/repo_snapshot/packages/worker_bee/worker_bee_builder/CHANGELOG.md create mode 100644 packages/aft/test/version_bump/data/repo_snapshot/packages/worker_bee/worker_bee_builder/pubspec.yaml create mode 100644 packages/aft/test/version_bump/data/repo_snapshot/pubspec.yaml create mode 100644 packages/aft/test/version_bump/data/snapshots/aws_common_fix.diff create mode 100644 packages/aft/test/version_bump/data/snapshots/multi_package_update.diff create mode 100644 packages/aft/test/version_bump/data/snapshots/single_dart_package_breaking.diff create mode 100644 packages/aft/test/version_bump/data/snapshots/single_dart_package_chore.diff create mode 100644 packages/aft/test/version_bump/data/snapshots/single_dart_package_feat.diff create mode 100644 packages/aft/test/version_bump/data/snapshots/single_dart_package_fix.diff create mode 100644 packages/aft/test/version_bump/data/snapshots/single_package_breaking.diff create mode 100644 packages/aft/test/version_bump/data/snapshots/single_package_chore.diff create mode 100644 packages/aft/test/version_bump/data/snapshots/single_package_feat.diff create mode 100644 packages/aft/test/version_bump/data/snapshots/single_package_fix.diff create mode 100644 packages/aft/test/version_bump/version_bump_test.dart create mode 100755 packages/aft/tool/repo_snapshot.sh diff --git a/.gitattributes b/.gitattributes index da75f8a5cc..3fcc994970 100644 --- a/.gitattributes +++ b/.gitattributes @@ -87,6 +87,10 @@ packages/smithy/goldens/models/custom/** -linguist-vendored ## Genrated dart files *.g.dart linguist-generated +## Genrated test files +**/snapshots/*.diff linguist-generated +**/repo_snapshot/** linguist-generated + ## Lock files package-lock.json linguist-generated pnpm-lock.yaml linguist-generated diff --git a/packages/aft/lib/src/changelog/changelog.dart b/packages/aft/lib/src/changelog/changelog.dart index 3ed06baaf8..7ca882dff0 100644 --- a/packages/aft/lib/src/changelog/changelog.dart +++ b/packages/aft/lib/src/changelog/changelog.dart @@ -87,7 +87,9 @@ abstract class Changelog implements Built { // bug fixes/improvements. nodes.add(Element.text('li', 'Minor bug fixes and improvements\n')); } else { - for (final typedCommits in commitsByType.entries) { + final sortedCommitTypes = + commitsByType.entries.sortedBy((entry) => entry.key.index); + for (final typedCommits in sortedCommitTypes) { nodes.add(Element.text('h3', typedCommits.key.header)); // Transform PR #'s into links to the main repo diff --git a/packages/aft/lib/src/changelog/commit_message.dart b/packages/aft/lib/src/changelog/commit_message.dart index 21582b74cf..d357f9675d 100644 --- a/packages/aft/lib/src/changelog/commit_message.dart +++ b/packages/aft/lib/src/changelog/commit_message.dart @@ -19,8 +19,8 @@ final RegExp _trailerRegex = RegExp(r'^[^:\s]+:[^:]+$'); enum CommitTypeGroup { breaking('Breaking Changes'), - fixes('Fixes'), features('Features'), + fixes('Fixes'), other('Other Changes'); const CommitTypeGroup(this.header); diff --git a/packages/aft/lib/src/commands/version_bump_command.dart b/packages/aft/lib/src/commands/version_bump_command.dart index 3086f235dc..2d90f07278 100644 --- a/packages/aft/lib/src/commands/version_bump_command.dart +++ b/packages/aft/lib/src/commands/version_bump_command.dart @@ -37,6 +37,12 @@ class VersionBumpCommand extends AmplifyCommand 'force-patch', help: 'Forces a patch version bump', negatable: false, + ) + ..addFlag( + 'skip-build-version', + help: 'Skips running build version in packages that depend on ' + 'build_version. Intended for use in tests.', + negatable: false, ); } @@ -90,18 +96,23 @@ class VersionBumpCommand extends AmplifyCommand final bumpedPackages = await _updateVersions(); - for (final package in bumpedPackages) { - // Run build_runner for packages which generate their version number. - final needsBuildRunner = package.pubspecInfo.pubspec.devDependencies - .containsKey('build_version'); - if (!needsBuildRunner) { - continue; + final skipBuildVersion = + argResults?['skip-build-version'] as bool? ?? false; + + if (!skipBuildVersion) { + for (final package in bumpedPackages) { + // Run build_runner for packages which generate their version number. + final needsBuildRunner = package.pubspecInfo.pubspec.devDependencies + .containsKey('build_version'); + if (!needsBuildRunner) { + continue; + } + await runBuildRunner( + package, + logger: logger, + verbose: verbose, + ); } - await runBuildRunner( - package, - logger: logger, - verbose: verbose, - ); } logger.info('Version successfully bumped'); diff --git a/packages/aft/lib/src/options/git_ref_options.dart b/packages/aft/lib/src/options/git_ref_options.dart index 97abe6dbd2..7456fe75f6 100644 --- a/packages/aft/lib/src/options/git_ref_options.dart +++ b/packages/aft/lib/src/options/git_ref_options.dart @@ -25,16 +25,16 @@ mixin GitRefOptions on AmplifyCommand { /// /// By default, this is the latest release tag. String? get baseRef { - return Platform.environment['GITHUB_BASE_REF'] ?? - argResults!['base-ref'] as String?; + return argResults?['base-ref'] as String? ?? + Platform.environment['GITHUB_BASE_REF']; } /// The head reference git operations should be based on. /// /// By default, this is the current `HEAD`. String get headRef { - return Platform.environment['GITHUB_HEAD_REF'] ?? - argResults!['head-ref'] as String? ?? + return argResults?['head-ref'] as String? ?? + Platform.environment['GITHUB_HEAD_REF'] ?? 'HEAD'; } } diff --git a/packages/aft/test/e2e_test.dart b/packages/aft/test/e2e_test.dart deleted file mode 100644 index 2978bc6e37..0000000000 --- a/packages/aft/test/e2e_test.dart +++ /dev/null @@ -1,437 +0,0 @@ -// Copyright 2022 Amazon.com, Inc. or its affiliates. All Rights Reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// ignore_for_file: overridden_fields - -import 'dart:io'; - -import 'package:aft/src/repo.dart'; -import 'package:aws_common/aws_common.dart'; -import 'package:path/path.dart' as p; -import 'package:test/test.dart'; - -import 'helpers/descriptors.dart' as d; - -void main() { - final logger = AWSLogger().createChild('E2E'); - - group('Repo', () { - late Repo repo; - late String baseRef; - final packageBumps = {}; - - Future runGit(List args) async { - final result = await repo.git.runCommand(args); - final stdout = result.stdout as String; - logger.info('git ${args.join(' ')}:\n$stdout'); - return stdout.trim(); - } - - Future makeChange( - String commitTitle, - List packages, { - Map? trailers, - }) async { - for (final package in packages) { - final newDir = Directory(repo[package].path).createTempSync(); - File(p.join(newDir.path, 'file.txt')).createSync(); - } - - await runGit(['add', '.']); - await runGit([ - 'commit', - '-m', - commitTitle, - if (trailers != null) - ...trailers.entries - .expand((e) => ['--trailer', '${e.key}:${e.value}']), - ]); - return runGit(['rev-parse', 'HEAD']); - } - - group('E2E', () { - const nextVersion = '1.0.0-next.0'; - const coreVersion = '0.1.0'; - const nextConstraint = '>=1.0.0-next.0 <1.0.0-next.1'; - const coreConstraint = '^0.1.0'; - - setUp(() async { - repo = await d.repo([ - d.package( - 'amplify_auth_cognito', - version: nextVersion, - dependencies: { - // Flutter packages in component - 'amplify_analytics_pinpoint': nextConstraint, - 'amplify_core': nextConstraint, - - // Related Dart package - 'amplify_auth_cognito_dart': coreConstraint, - - // Dart package not in component - 'aws_common': coreConstraint, - }, - ), - d.package( - 'amplify_analytics_pinpoint', - version: nextVersion, - ), - d.package( - 'amplify_auth_cognito_dart', - version: coreVersion, - dependencies: { - 'amplify_core': coreConstraint, - 'aws_common': coreConstraint, - }, - ), - d.package( - 'amplify_core', - version: nextVersion, - dependencies: { - 'aws_common': coreConstraint, - }, - ), - d.package('aws_common', version: coreVersion), - ]).create(); - - await runGit(['add', '.']); - await runGit(['commit', '-m', 'Add packages']); - baseRef = await runGit(['rev-parse', 'HEAD']); - - // Make changes that affect: - // - Only a leaf package - // - Only one package of a component - // - Only a root package - await makeChange('fix(aws_common): Fix type', ['aws_common']); - await makeChange( - 'chore(amplify_analytics_pinpoint): Update dependency', - ['amplify_analytics_pinpoint'], - ); - await makeChange( - 'fix(amplify_analytics_pinpoint)!: Change dependency', - ['amplify_analytics_pinpoint'], - ); - await makeChange( - 'feat(amplify_core): New hub events', - ['amplify_core'], - ); - await makeChange( - 'feat(auth): New feature', - [ - 'amplify_core', - 'amplify_auth_cognito', - 'amplify_auth_cognito_dart', - ], - ); - final coreBump = await makeChange( - 'chore(version): Release core', - [ - 'amplify_core', - 'amplify_auth_cognito_dart', - ], - trailers: { - 'Updated-Components': 'amplify_core, amplify_auth_cognito_dart', - }, - ); - packageBumps['amplify_core'] = coreBump; - packageBumps['amplify_auth_cognito_dart'] = coreBump; - final flutterBump = await makeChange( - 'chore(version): Release flutter', - [ - 'amplify_auth_cognito', - 'amplify_analytics_pinpoint', - ], - trailers: { - 'Updated-Components': 'Amplify Flutter', - }, - ); - packageBumps['amplify_core'] = flutterBump; - packageBumps['amplify_auth_cognito'] = flutterBump; - packageBumps['amplify_analytics_pinpoint'] = flutterBump; - }); - - Future changesForPackage( - String package, { - required String baseRef, - }) { - return repo.changes(baseRef, 'HEAD'); - } - - group('changesForPackage', () { - group('w/ no version bump', () { - final packages = { - 'aws_common': 1, - 'amplify_core': 3, - 'amplify_auth_cognito_dart': 2, - 'amplify_auth_cognito': 2, - 'amplify_analytics_pinpoint': 3, - }; - for (final entry in packages.entries) { - test(entry.key, () async { - final numCommits = entry.value; - final package = repo.allPackages[entry.key]!; - final changes = await changesForPackage( - package.name, - baseRef: baseRef, - ); - expect( - changes.commitsByPackage[package], - hasLength(numCommits), - ); - }); - } - }); - - group('w/ version bump', () { - final packages = { - 'aws_common': 1, // since it was never released - 'amplify_core': 0, - 'amplify_auth_cognito_dart': 0, - 'amplify_auth_cognito': 0, - 'amplify_analytics_pinpoint': 0, - }; - for (final entry in packages.entries) { - test(entry.key, () async { - final package = repo.allPackages[entry.key]!; - final lastBump = await repo.latestBumpRef(package); - expect(lastBump, packageBumps[package.name]); - - final numCommits = entry.value; - final changes = await changesForPackage( - package.name, - baseRef: lastBump ?? baseRef, - ); - expect( - changes.commitsByPackage[package], - hasLength(numCommits), - ); - }); - } - }); - }); - - group('calculates changes', () { - final numCommits = { - 'aws_common': 1, - 'amplify_core': 3, - 'amplify_auth_cognito_dart': 2, - 'amplify_auth_cognito': 2, - 'amplify_analytics_pinpoint': 3, - }; - final changelogs = { - 'aws_common': ''' -## NEXT - -### Fixes -- fix(aws_common): Fix type -''', - 'amplify_core': ''' -## NEXT - -### Features -- feat(amplify_core): New hub events -- feat(auth): New feature -''', - 'amplify_auth_cognito_dart': ''' -## NEXT - -### Features -- feat(auth): New feature -''', - 'amplify_auth_cognito': ''' -## NEXT - -### Features -- feat(auth): New feature -''', - 'amplify_analytics_pinpoint': ''' -## NEXT - -### Breaking Changes -- fix(amplify_analytics_pinpoint)!: Change dependency -''', - }; - - for (final check in numCommits.entries) { - final packageName = check.key; - - test(packageName, () async { - final package = repo.allPackages[packageName]!; - final changes = await changesForPackage( - package.name, - baseRef: baseRef, - ); - final commits = changes.commitsByPackage[package]!; - expect(commits, hasLength(check.value)); - - // Bump changelogs to NEXT - final updateChangelog = package.changelog.update( - commits: commits, - ); - expect(updateChangelog.hasUpdate, true); - expect( - updateChangelog.newText, - equalsIgnoringWhitespace(changelogs[packageName]!), - ); - }); - } - }); - - test('bumps versions', () async { - final finalRepo = d.repo([ - d.package( - 'aws_common', - version: '0.1.1', - contents: [ - d.pubspec(''' -name: aws_common -version: 0.1.1 - -environment: - sdk: ^3.0.0 -'''), - d.file('CHANGELOG.md', ''' -## 0.1.1 - -### Fixes -- fix(aws_common): Fix type - -## 0.1.0 - -Initial version. -'''), - ], - ), - d.package( - 'amplify_core', - version: '1.0.0-next.1', - contents: [ - d.pubspec(''' -name: amplify_core -version: 1.0.0-next.1 - -environment: - sdk: ^3.0.0 - -dependencies: - aws_common: "^0.1.0" -'''), - d.file('CHANGELOG.md', ''' -## 1.0.0-next.1 - -### Features -- feat(amplify_core): New hub events -- feat(auth): New feature - -## 1.0.0-next.0 - -Initial version. -'''), - ], - ), - d.package( - 'amplify_auth_cognito_dart', - version: '0.1.1', - contents: [ - d.pubspec(''' -name: amplify_auth_cognito_dart -version: 0.1.1 - -environment: - sdk: ^3.0.0 - -dependencies: - amplify_core: ">=1.0.0-next.1 <1.0.0-next.2" - aws_common: ^0.1.0 -'''), - d.file('CHANGELOG.md', ''' -## 0.1.1 - -### Features -- feat(auth): New feature - -## 0.1.0 - -Initial version. -'''), - ], - ), - d.package( - 'amplify_auth_cognito', - version: '1.0.0-next.1', - contents: [ - d.pubspec(''' -name: amplify_auth_cognito -version: 1.0.0-next.1 - -environment: - sdk: ^3.0.0 - -dependencies: - amplify_analytics_pinpoint: ">=1.0.0-next.1 <1.0.0-next.2" - amplify_auth_cognito_dart: ">=0.1.1 <0.2.0" - amplify_core: ">=1.0.0-next.1 <1.0.0-next.2" - aws_common: "^0.1.0" -'''), - d.file('CHANGELOG.md', ''' -## 1.0.0-next.1 - -### Features -- feat(auth): New feature - -## 1.0.0-next.0 - -Initial version. -'''), - ], - ), - d.package( - 'amplify_analytics_pinpoint', - version: '1.0.0-next.1', - contents: [ - d.pubspec(''' -name: amplify_analytics_pinpoint -version: 1.0.0-next.1 - -environment: - sdk: ^3.0.0 -'''), - d.file('CHANGELOG.md', ''' -## 1.0.0-next.1 - -### Breaking Changes -- fix(amplify_analytics_pinpoint)!: Change dependency - -## 1.0.0-next.0 - -Initial version. -'''), - ], - ), - ]); - - await repo.bumpAllVersions( - repo.allPackages, - changesForPackage: (pkg) => changesForPackage( - pkg.name, - baseRef: baseRef, - ), - ); - await repo.writeChanges(); - - await finalRepo.validate(); - }); - }); - }); -} diff --git a/packages/aft/test/version_bump/README.md b/packages/aft/test/version_bump/README.md new file mode 100644 index 0000000000..6e69bba697 --- /dev/null +++ b/packages/aft/test/version_bump/README.md @@ -0,0 +1,11 @@ +## aft version-bump tests + +This directory contains tests for `aft version-bump`. + +The tests in this directory are snapshot tests. They take a given input (a copy of the Amplify Flutter repo + a series of commits) and generate an output (aka snapshot) which is compared against an expected output. + +The generated output is a diff that is generated from running `aft version-bump` after applying the commits in the given test. + +The tests are not run against the actual Amplify Flutter repo since this would require updating the tests after each release. Instead tests are run against a copy of the Amplify Flutter repo located in `packages/aft/test/version_bump/data/repo_snapshot`. This snapshot only contains the files required to run and test the version bump script, which include only the `pubspec.yaml` files and `changelog.md` files from packages published to pub. To update the Amplify Flutter monorepo copy run `./tool/repo_snapshot.sh` from the `packages/aft` directory. + +The expected outputs/snapshots are diffs stored in `.diff` files in `packages/aft/test/version_bump/data/snapshots`. To regenerate them run `dart --define=generate-snapshots=true test ./test/version_bump/version_bump_test.dart --use-data-isolate-strategy` from `packages/aft`. Note: `--use-data-isolate-strategy` is a workaround for https://github.com/dart-lang/test/issues/1794. diff --git a/packages/aft/test/version_bump/data/repo_snapshot/packages/amplify/amplify_flutter/CHANGELOG.md b/packages/aft/test/version_bump/data/repo_snapshot/packages/amplify/amplify_flutter/CHANGELOG.md new file mode 100644 index 0000000000..bdfb713202 --- /dev/null +++ b/packages/aft/test/version_bump/data/repo_snapshot/packages/amplify/amplify_flutter/CHANGELOG.md @@ -0,0 +1,6 @@ +## 2.3.0 + +### Fixes +- fix(datastore): prevent auth plugin from throwing during configuration ([#5132](https://github.com/aws-amplify/amplify-flutter/pull/5132)) +- fix(notifications): allow configuration when auth token is expired ([#5117](https://github.com/aws-amplify/amplify-flutter/pull/5117)) + diff --git a/packages/aft/test/version_bump/data/repo_snapshot/packages/amplify/amplify_flutter/pubspec.yaml b/packages/aft/test/version_bump/data/repo_snapshot/packages/amplify/amplify_flutter/pubspec.yaml new file mode 100644 index 0000000000..62b1a47913 --- /dev/null +++ b/packages/aft/test/version_bump/data/repo_snapshot/packages/amplify/amplify_flutter/pubspec.yaml @@ -0,0 +1,37 @@ +name: amplify_flutter +description: The top level Flutter package for the AWS Amplify libraries. +version: 2.3.0 +homepage: https://docs.amplify.aws/lib/q/platform/flutter/ +repository: https://github.com/aws-amplify/amplify-flutter/tree/main/packages/amplify/amplify_flutter +issue_tracker: https://github.com/aws-amplify/amplify-flutter/issues + +environment: + sdk: ^3.3.0 + flutter: ">=3.19.0" + +# Helps `pana` since we do not use Flutter plugins for most platforms +platforms: + ios: + android: + macos: + windows: + linux: + web: + +dependencies: + amplify_core: ">=2.3.0 <2.4.0" + amplify_secure_storage: ">=0.5.4 <0.6.0" + aws_common: ">=0.7.1 <0.8.0" + collection: ^1.15.0 + flutter: + sdk: flutter + meta: ^1.7.0 + +dev_dependencies: + amplify_lints: ">=3.1.0 <3.2.0" + amplify_test: + path: ../../test/amplify_test + build_runner: ^2.4.9 + flutter_test: + sdk: flutter + json_serializable: 6.8.0 diff --git a/packages/aft/test/version_bump/data/repo_snapshot/packages/amplify_core/CHANGELOG.md b/packages/aft/test/version_bump/data/repo_snapshot/packages/amplify_core/CHANGELOG.md new file mode 100644 index 0000000000..0076c56feb --- /dev/null +++ b/packages/aft/test/version_bump/data/repo_snapshot/packages/amplify_core/CHANGELOG.md @@ -0,0 +1,4 @@ +## 2.3.0 + +- Minor bug fixes and improvements + diff --git a/packages/aft/test/version_bump/data/repo_snapshot/packages/amplify_core/pubspec.yaml b/packages/aft/test/version_bump/data/repo_snapshot/packages/amplify_core/pubspec.yaml new file mode 100644 index 0000000000..6d3570dce8 --- /dev/null +++ b/packages/aft/test/version_bump/data/repo_snapshot/packages/amplify_core/pubspec.yaml @@ -0,0 +1,39 @@ +name: amplify_core +description: The base package containing common types and utilities that are shared across the Amplify Flutter packages. +version: 2.3.0 +homepage: https://docs.amplify.aws/lib/q/platform/flutter/ +repository: https://github.com/aws-amplify/amplify-flutter/tree/main/packages/amplify_core +issue_tracker: https://github.com/aws-amplify/amplify-flutter/issues + +environment: + sdk: ^3.3.0 + +dependencies: + async: ^2.10.0 + aws_common: ">=0.7.1 <0.8.0" + aws_signature_v4: ">=0.6.1 <0.7.0" + collection: ^1.15.0 + graphs: ^2.1.0 + intl: ">=0.18.0 <1.0.0" + json_annotation: ">=4.9.0 <4.10.0" + logging: ^1.0.0 + meta: ^1.7.0 + retry: ^3.1.0 + stack_trace: ^1.10.0 + uuid: ">=3.0.6 <5.0.0" + +dev_dependencies: + amplify_lints: ">=3.1.0 <3.2.0" + build_runner: ^2.4.9 + build_test: ^2.1.5 + build_version: ^2.1.1 + build_web_compilers: ^4.0.0 + code_excerpt_updater: + git: + url: https://github.com/dart-lang/site-shared + path: packages/code_excerpt_updater + # TODO: Bump when global SDK >=3.1 + ref: 923adadacbb95f11d222e6fc6135f6dbb66f84ee + json_serializable: 6.8.0 + path: any + test: ^1.22.1 diff --git a/packages/aft/test/version_bump/data/repo_snapshot/packages/amplify_datastore/CHANGELOG.md b/packages/aft/test/version_bump/data/repo_snapshot/packages/amplify_datastore/CHANGELOG.md new file mode 100644 index 0000000000..0076c56feb --- /dev/null +++ b/packages/aft/test/version_bump/data/repo_snapshot/packages/amplify_datastore/CHANGELOG.md @@ -0,0 +1,4 @@ +## 2.3.0 + +- Minor bug fixes and improvements + diff --git a/packages/aft/test/version_bump/data/repo_snapshot/packages/amplify_datastore/pubspec.yaml b/packages/aft/test/version_bump/data/repo_snapshot/packages/amplify_datastore/pubspec.yaml new file mode 100644 index 0000000000..e502eb2f68 --- /dev/null +++ b/packages/aft/test/version_bump/data/repo_snapshot/packages/amplify_datastore/pubspec.yaml @@ -0,0 +1,38 @@ +name: amplify_datastore +description: The Amplify Flutter DataStore category plugin, providing a queryable, on-device data store. +version: 2.3.0 +homepage: https://docs.amplify.aws/lib/q/platform/flutter/ +repository: https://github.com/aws-amplify/amplify-flutter/tree/main/packages/amplify_datastore +issue_tracker: https://github.com/aws-amplify/amplify-flutter/issues + +environment: + sdk: ^3.3.0 + flutter: ">=3.19.0" + +dependencies: + flutter: + sdk: flutter + amplify_datastore_plugin_interface: ">=2.3.0 <2.4.0" + amplify_core: ">=2.3.0 <2.4.0" + plugin_platform_interface: ^2.0.0 + meta: ^1.7.0 + collection: ^1.14.13 + async: ^2.10.0 + +dev_dependencies: + amplify_test: + path: ../test/amplify_test + flutter_test: + sdk: flutter + fake_async: ^1.2.0 + pigeon: ^11.0.0 + +# The following section is specific to Flutter. +flutter: + plugin: + platforms: + android: + package: com.amazonaws.amplify.amplify_datastore + pluginClass: AmplifyDataStorePlugin + ios: + pluginClass: SwiftAmplifyDataStorePlugin diff --git a/packages/aft/test/version_bump/data/repo_snapshot/packages/amplify_datastore_plugin_interface/CHANGELOG.md b/packages/aft/test/version_bump/data/repo_snapshot/packages/amplify_datastore_plugin_interface/CHANGELOG.md new file mode 100644 index 0000000000..0076c56feb --- /dev/null +++ b/packages/aft/test/version_bump/data/repo_snapshot/packages/amplify_datastore_plugin_interface/CHANGELOG.md @@ -0,0 +1,4 @@ +## 2.3.0 + +- Minor bug fixes and improvements + diff --git a/packages/aft/test/version_bump/data/repo_snapshot/packages/amplify_datastore_plugin_interface/pubspec.yaml b/packages/aft/test/version_bump/data/repo_snapshot/packages/amplify_datastore_plugin_interface/pubspec.yaml new file mode 100644 index 0000000000..7f16220cbc --- /dev/null +++ b/packages/aft/test/version_bump/data/repo_snapshot/packages/amplify_datastore_plugin_interface/pubspec.yaml @@ -0,0 +1,23 @@ +name: amplify_datastore_plugin_interface +description: The platform interface for the DataStore module of Amplify Flutter. +version: 2.3.0 +homepage: https://docs.amplify.aws/lib/q/platform/flutter/ +repository: https://github.com/aws-amplify/amplify-flutter/tree/main/packages/amplify_datastore_plugin_interface +issue_tracker: https://github.com/aws-amplify/amplify-flutter/issues + +environment: + sdk: ^3.3.0 + flutter: ">=3.19.0" + +dependencies: + amplify_core: ">=2.3.0 <2.4.0" + collection: ^1.15.0 + flutter: + sdk: flutter + meta: ^1.7.0 + +dev_dependencies: + amplify_test: + path: ../test/amplify_test + flutter_test: + sdk: flutter diff --git a/packages/aft/test/version_bump/data/repo_snapshot/packages/amplify_lints/CHANGELOG.md b/packages/aft/test/version_bump/data/repo_snapshot/packages/amplify_lints/CHANGELOG.md new file mode 100644 index 0000000000..2a28e07719 --- /dev/null +++ b/packages/aft/test/version_bump/data/repo_snapshot/packages/amplify_lints/CHANGELOG.md @@ -0,0 +1,5 @@ +## 3.1.0 + +### Features +- feat: update plus plugins version ([#4619](https://github.com/aws-amplify/amplify-flutter/pull/4619)) + diff --git a/packages/aft/test/version_bump/data/repo_snapshot/packages/amplify_lints/pubspec.yaml b/packages/aft/test/version_bump/data/repo_snapshot/packages/amplify_lints/pubspec.yaml new file mode 100644 index 0000000000..01d83766c0 --- /dev/null +++ b/packages/aft/test/version_bump/data/repo_snapshot/packages/amplify_lints/pubspec.yaml @@ -0,0 +1,13 @@ +name: amplify_lints +description: The lint rules used in developing Amplify Flutter packages and plugins. +version: 3.1.0 +homepage: https://docs.amplify.aws/lib/q/platform/flutter/ +repository: https://github.com/aws-amplify/amplify-flutter/tree/main/packages/amplify_lints +issue_tracker: https://github.com/aws-amplify/amplify-flutter/issues + +environment: + sdk: ^3.3.0 + +dependencies: + flutter_lints: ^3.0.0 + lints: ^3.0.0 diff --git a/packages/aft/test/version_bump/data/repo_snapshot/packages/amplify_native_legacy_wrapper/CHANGELOG.md b/packages/aft/test/version_bump/data/repo_snapshot/packages/amplify_native_legacy_wrapper/CHANGELOG.md new file mode 100644 index 0000000000..339d42b247 --- /dev/null +++ b/packages/aft/test/version_bump/data/repo_snapshot/packages/amplify_native_legacy_wrapper/CHANGELOG.md @@ -0,0 +1,3 @@ +## 0.0.1 + +- Initial release diff --git a/packages/aft/test/version_bump/data/repo_snapshot/packages/amplify_native_legacy_wrapper/pubspec.yaml b/packages/aft/test/version_bump/data/repo_snapshot/packages/amplify_native_legacy_wrapper/pubspec.yaml new file mode 100644 index 0000000000..1727efaa84 --- /dev/null +++ b/packages/aft/test/version_bump/data/repo_snapshot/packages/amplify_native_legacy_wrapper/pubspec.yaml @@ -0,0 +1,27 @@ +name: amplify_native_legacy_wrapper +description: A wrapper around the legacy native amplify plugins. +version: 0.0.1 +publish_to: none + +environment: + sdk: ^3.3.0 + flutter: ">=3.19.0" + +dependencies: + flutter: + sdk: flutter + +dev_dependencies: + amplify_lints: ">=2.0.2 <2.1.0" + flutter_test: + sdk: flutter + pigeon: ^11.0.0 + +flutter: + plugin: + platforms: + ios: + pluginClass: AmplifyNativeLegacyWrapperPlugin + android: + package: com.amazonaws.amplify.amplify_native_legacy_wrapper + pluginClass: AmplifyNativeLegacyWrapperPlugin diff --git a/packages/aft/test/version_bump/data/repo_snapshot/packages/analytics/amplify_analytics_pinpoint/CHANGELOG.md b/packages/aft/test/version_bump/data/repo_snapshot/packages/analytics/amplify_analytics_pinpoint/CHANGELOG.md new file mode 100644 index 0000000000..0076c56feb --- /dev/null +++ b/packages/aft/test/version_bump/data/repo_snapshot/packages/analytics/amplify_analytics_pinpoint/CHANGELOG.md @@ -0,0 +1,4 @@ +## 2.3.0 + +- Minor bug fixes and improvements + diff --git a/packages/aft/test/version_bump/data/repo_snapshot/packages/analytics/amplify_analytics_pinpoint/pubspec.yaml b/packages/aft/test/version_bump/data/repo_snapshot/packages/analytics/amplify_analytics_pinpoint/pubspec.yaml new file mode 100644 index 0000000000..0b8cc40a9e --- /dev/null +++ b/packages/aft/test/version_bump/data/repo_snapshot/packages/analytics/amplify_analytics_pinpoint/pubspec.yaml @@ -0,0 +1,45 @@ +name: amplify_analytics_pinpoint +description: The Amplify Flutter Analytics category plugin using the AWS Pinpoint provider. +version: 2.3.0 +homepage: https://docs.amplify.aws/lib/q/platform/flutter/ +repository: https://github.com/aws-amplify/amplify-flutter/tree/main/packages/analytics/amplify_analytics_pinpoint +issue_tracker: https://github.com/aws-amplify/amplify-flutter/issues + +environment: + sdk: ^3.3.0 + flutter: ">=3.19.0" + +# Helps `pana` since we do not use Flutter plugins for most platforms +platforms: + ios: + android: + macos: + windows: + linux: + web: + +dependencies: + amplify_analytics_pinpoint_dart: ">=0.4.3 <0.5.0" + amplify_core: ">=2.3.0 <2.4.0" + amplify_db_common: ">=0.4.3 <0.5.0" + amplify_secure_storage: ">=0.5.4 <0.6.0" + aws_common: ">=0.7.1 <0.8.0" + device_info_plus: ^10.0.1 + flutter: + sdk: flutter + meta: ^1.7.0 + package_info_plus: ^8.0.0 + path_provider: ^2.0.0 + +dev_dependencies: + amplify_lints: ">=3.1.0 <3.2.0" + flutter_test: + sdk: flutter + pigeon: ^11.0.0 + +flutter: + plugin: + platforms: + android: + package: com.amazonaws.amplify.amplify_analytics_pinpoint + pluginClass: AmplifyAnalyticsPinpointPlugin diff --git a/packages/aft/test/version_bump/data/repo_snapshot/packages/analytics/amplify_analytics_pinpoint_dart/CHANGELOG.md b/packages/aft/test/version_bump/data/repo_snapshot/packages/analytics/amplify_analytics_pinpoint_dart/CHANGELOG.md new file mode 100644 index 0000000000..58498accc0 --- /dev/null +++ b/packages/aft/test/version_bump/data/repo_snapshot/packages/analytics/amplify_analytics_pinpoint_dart/CHANGELOG.md @@ -0,0 +1,4 @@ +## 0.4.3 + +- Minor bug fixes and improvements + diff --git a/packages/aft/test/version_bump/data/repo_snapshot/packages/analytics/amplify_analytics_pinpoint_dart/pubspec.yaml b/packages/aft/test/version_bump/data/repo_snapshot/packages/analytics/amplify_analytics_pinpoint_dart/pubspec.yaml new file mode 100644 index 0000000000..01407744bb --- /dev/null +++ b/packages/aft/test/version_bump/data/repo_snapshot/packages/analytics/amplify_analytics_pinpoint_dart/pubspec.yaml @@ -0,0 +1,40 @@ +name: amplify_analytics_pinpoint_dart +description: A Dart-only implementation of the Amplify Analytics plugin for Pinpoint. +version: 0.4.3 +homepage: https://docs.amplify.aws/lib/q/platform/flutter/ +repository: https://github.com/aws-amplify/amplify-flutter/tree/main/packages/analytics/amplify_analytics_pinpoint_dart +issue_tracker: https://github.com/aws-amplify/amplify-flutter/issues + +environment: + sdk: ^3.3.0 + +dependencies: + amplify_core: ">=2.3.0 <2.4.0" + amplify_db_common_dart: ">=0.4.4 <0.5.0" + amplify_secure_storage_dart: ">=0.5.1 <0.6.0" + aws_common: ">=0.7.1 <0.8.0" + aws_signature_v4: ">=0.6.1 <0.7.0" + built_collection: ^5.0.0 + built_value: ^8.6.0 + collection: ^1.15.0 + drift: ">=2.18.0 <2.19.0" + intl: ">=0.18.0 <1.0.0" + meta: ^1.7.0 + path: ">=1.8.0 <2.0.0" + smithy: ">=0.7.1 <0.8.0" + smithy_aws: ">=0.7.0 <0.8.0" + uuid: ">=3.0.6 <5.0.0" + +dev_dependencies: + amplify_lints: ">=3.1.0 <3.2.0" + build_runner: ^2.4.9 + build_test: ^2.1.5 + build_verify: ^3.0.0 + build_version: ^2.0.0 + build_web_compilers: ^4.0.0 + built_value_generator: 8.8.1 + drift_dev: ">=2.18.0 <2.19.0" + mocktail: ^1.0.0 + test: ^1.22.1 + + # TODO - use cipher libraries for encrypted cached Analytics Events diff --git a/packages/aft/test/version_bump/data/repo_snapshot/packages/api/amplify_api/CHANGELOG.md b/packages/aft/test/version_bump/data/repo_snapshot/packages/api/amplify_api/CHANGELOG.md new file mode 100644 index 0000000000..0076c56feb --- /dev/null +++ b/packages/aft/test/version_bump/data/repo_snapshot/packages/api/amplify_api/CHANGELOG.md @@ -0,0 +1,4 @@ +## 2.3.0 + +- Minor bug fixes and improvements + diff --git a/packages/aft/test/version_bump/data/repo_snapshot/packages/api/amplify_api/pubspec.yaml b/packages/aft/test/version_bump/data/repo_snapshot/packages/api/amplify_api/pubspec.yaml new file mode 100644 index 0000000000..4d9907e3f5 --- /dev/null +++ b/packages/aft/test/version_bump/data/repo_snapshot/packages/api/amplify_api/pubspec.yaml @@ -0,0 +1,39 @@ +name: amplify_api +description: The Amplify Flutter API category plugin, supporting GraphQL and REST operations. +version: 2.3.0 +homepage: https://docs.amplify.aws/lib/q/platform/flutter/ +repository: https://github.com/aws-amplify/amplify-flutter/tree/main/packages/api/amplify_api +issue_tracker: https://github.com/aws-amplify/amplify-flutter/issues + +environment: + sdk: ^3.3.0 + flutter: ">=3.19.0" + +# Helps `pana` since we do not use Flutter plugins for most platforms +platforms: + ios: + android: + macos: + windows: + linux: + web: + +dependencies: + amplify_api_dart: ">=0.5.3 <0.6.0" + amplify_core: ">=2.3.0 <2.4.0" + amplify_flutter: ">=2.3.0 <2.4.0" + connectivity_plus: ^6.0.1 + flutter: + sdk: flutter + meta: ^1.7.0 + plugin_platform_interface: ^2.0.0 + +dev_dependencies: + amplify_lints: ">=3.1.0 <3.2.0" + amplify_test: + path: ../../test/amplify_test + build_runner: ^2.4.9 + connectivity_plus_platform_interface: any + flutter_test: + sdk: flutter + mocktail: ^1.0.0 diff --git a/packages/aft/test/version_bump/data/repo_snapshot/packages/api/amplify_api_dart/CHANGELOG.md b/packages/aft/test/version_bump/data/repo_snapshot/packages/api/amplify_api_dart/CHANGELOG.md new file mode 100644 index 0000000000..542e135c72 --- /dev/null +++ b/packages/aft/test/version_bump/data/repo_snapshot/packages/api/amplify_api_dart/CHANGELOG.md @@ -0,0 +1,4 @@ +## 0.5.3 + +- Minor bug fixes and improvements + diff --git a/packages/aft/test/version_bump/data/repo_snapshot/packages/api/amplify_api_dart/pubspec.yaml b/packages/aft/test/version_bump/data/repo_snapshot/packages/api/amplify_api_dart/pubspec.yaml new file mode 100644 index 0000000000..cd872d0009 --- /dev/null +++ b/packages/aft/test/version_bump/data/repo_snapshot/packages/api/amplify_api_dart/pubspec.yaml @@ -0,0 +1,29 @@ +name: amplify_api_dart +description: The Amplify API category plugin in Dart-only, supporting GraphQL and REST operations. +version: 0.5.3 +homepage: https://docs.amplify.aws/lib/q/platform/flutter/ +repository: https://github.com/aws-amplify/amplify-flutter/tree/main/packages/api/amplify_api_dart +issue_tracker: https://github.com/aws-amplify/amplify-flutter/issues + +environment: + sdk: ^3.3.0 + +dependencies: + amplify_core: ">=2.3.0 <2.4.0" + async: ^2.10.0 + aws_common: ">=0.7.1 <0.8.0" + collection: ^1.15.0 + json_annotation: ">=4.9.0 <4.10.0" + meta: ^1.7.0 + plugin_platform_interface: ^2.0.0 + stream_transform: ^2.0.1 + web_socket_channel: ^2.2.0 + +dev_dependencies: + amplify_lints: ">=3.1.0 <3.2.0" + aws_signature_v4: ">=0.6.1 <0.7.0" + build_runner: ^2.4.9 + build_test: ^2.1.5 + build_web_compilers: ^4.0.0 + stream_channel: ^2.1.0 + test: ^1.22.1 diff --git a/packages/aft/test/version_bump/data/repo_snapshot/packages/auth/amplify_auth_cognito/CHANGELOG.md b/packages/aft/test/version_bump/data/repo_snapshot/packages/auth/amplify_auth_cognito/CHANGELOG.md new file mode 100644 index 0000000000..0076c56feb --- /dev/null +++ b/packages/aft/test/version_bump/data/repo_snapshot/packages/auth/amplify_auth_cognito/CHANGELOG.md @@ -0,0 +1,4 @@ +## 2.3.0 + +- Minor bug fixes and improvements + diff --git a/packages/aft/test/version_bump/data/repo_snapshot/packages/auth/amplify_auth_cognito/pubspec.yaml b/packages/aft/test/version_bump/data/repo_snapshot/packages/auth/amplify_auth_cognito/pubspec.yaml new file mode 100644 index 0000000000..3168e32976 --- /dev/null +++ b/packages/aft/test/version_bump/data/repo_snapshot/packages/auth/amplify_auth_cognito/pubspec.yaml @@ -0,0 +1,54 @@ +name: amplify_auth_cognito +description: The Amplify Flutter Auth category plugin using the AWS Cognito provider. +version: 2.3.0 +homepage: https://docs.amplify.aws/lib/q/platform/flutter/ +repository: https://github.com/aws-amplify/amplify-flutter/tree/main/packages/auth/amplify_auth_cognito +issue_tracker: https://github.com/aws-amplify/amplify-flutter/issues + +environment: + sdk: ^3.3.0 + flutter: ">=3.19.0" + +# Helps `pana` since we do not use Flutter plugins for most platforms +platforms: + ios: + android: + macos: + windows: + linux: + web: + +dependencies: + amplify_analytics_pinpoint: ">=2.3.0 <2.4.0" + amplify_analytics_pinpoint_dart: ">=0.4.3 <0.5.0" + amplify_auth_cognito_dart: ">=0.11.3 <0.12.0" + amplify_core: ">=2.3.0 <2.4.0" + amplify_flutter: ">=2.3.0 <2.4.0" + amplify_secure_storage: ">=0.5.4 <0.6.0" + async: ^2.10.0 + flutter: + sdk: flutter + meta: ^1.7.0 + path: ">=1.8.0 <2.0.0" + plugin_platform_interface: ^2.0.0 + +dev_dependencies: + amplify_auth_cognito_test: + path: ../amplify_auth_cognito_test + amplify_lints: ">=3.1.0 <3.2.0" + flutter_test: + sdk: flutter + pigeon: ^11.0.0 + +flutter: + plugin: + platforms: + android: + package: com.amazonaws.amplify.amplify_auth_cognito + pluginClass: AmplifyAuthCognitoPlugin + ios: + pluginClass: AmplifyAuthCognitoPlugin + sharedDarwinSource: true + macos: + pluginClass: AmplifyAuthCognitoPlugin + sharedDarwinSource: true diff --git a/packages/aft/test/version_bump/data/repo_snapshot/packages/auth/amplify_auth_cognito_dart/CHANGELOG.md b/packages/aft/test/version_bump/data/repo_snapshot/packages/auth/amplify_auth_cognito_dart/CHANGELOG.md new file mode 100644 index 0000000000..42e8503194 --- /dev/null +++ b/packages/aft/test/version_bump/data/repo_snapshot/packages/auth/amplify_auth_cognito_dart/CHANGELOG.md @@ -0,0 +1,4 @@ +## 0.11.3 + +- Minor bug fixes and improvements + diff --git a/packages/aft/test/version_bump/data/repo_snapshot/packages/auth/amplify_auth_cognito_dart/pubspec.yaml b/packages/aft/test/version_bump/data/repo_snapshot/packages/auth/amplify_auth_cognito_dart/pubspec.yaml new file mode 100644 index 0000000000..d2f2222aad --- /dev/null +++ b/packages/aft/test/version_bump/data/repo_snapshot/packages/auth/amplify_auth_cognito_dart/pubspec.yaml @@ -0,0 +1,59 @@ +name: amplify_auth_cognito_dart +description: A Dart-only implementation of the Amplify Auth plugin for Cognito. +version: 0.11.3 +homepage: https://docs.amplify.aws/lib/q/platform/flutter/ +repository: https://github.com/aws-amplify/amplify-flutter/tree/next/packages/auth/amplify_auth_cognito_dart +issue_tracker: https://github.com/aws-amplify/amplify-flutter/issues + +environment: + sdk: ^3.3.0 + +dependencies: + amplify_analytics_pinpoint_dart: ">=0.4.3 <0.5.0" + amplify_core: ">=2.3.0 <2.4.0" + amplify_secure_storage_dart: ">=0.5.1 <0.6.0" + async: ^2.10.0 + aws_common: ">=0.7.1 <0.8.0" + aws_signature_v4: ">=0.6.1 <0.7.0" + built_collection: ^5.0.0 + built_value: ^8.6.0 + clock: ^1.1.1 + collection: ^1.15.0 + convert: ^3.0.1 + crypto: ^3.0.1 + ffi: ^2.0.2 + fixnum: ^1.0.0 + http: ">=0.13.0 <2.0.0" + intl: ">=0.18.0 <1.0.0" + js: ">=0.6.4 <0.8.0" + json_annotation: ">=4.9.0 <4.10.0" + meta: ^1.7.0 + oauth2: ^2.0.2 + path: ">=1.8.0 <2.0.0" + smithy: ">=0.7.1 <0.8.0" + smithy_aws: ">=0.7.0 <0.8.0" + stream_transform: ^2.0.0 + uuid: ">=3.0.6 <5.0.0" + win32: ">=4.1.2 <6.0.0" + win32_registry: ^1.1.0 + worker_bee: ">=0.3.1 <0.4.0" + +dev_dependencies: + amplify_lints: ">=3.1.0 <3.2.0" + build: ^2.2.0 + build_runner: ^2.4.9 + build_verify: ^3.0.0 + build_web_compilers: ^4.0.0 + built_value_generator: 8.8.1 + ffigen: ^9.0.0 + json_serializable: 6.8.0 + mockito: ^5.0.0 + smithy_codegen: + path: ../../smithy/smithy_codegen + test: ^1.22.1 + worker_bee_builder: ">=0.3.1 <0.4.0" + +flutter: + assets: + - lib/src/workers/workers.min.js + - lib/src/workers/workers.min.js.map diff --git a/packages/aft/test/version_bump/data/repo_snapshot/packages/authenticator/amplify_authenticator/CHANGELOG.md b/packages/aft/test/version_bump/data/repo_snapshot/packages/authenticator/amplify_authenticator/CHANGELOG.md new file mode 100644 index 0000000000..c878ff264f --- /dev/null +++ b/packages/aft/test/version_bump/data/repo_snapshot/packages/authenticator/amplify_authenticator/CHANGELOG.md @@ -0,0 +1,4 @@ +## 2.1.1 + +- Minor bug fixes and improvements + diff --git a/packages/aft/test/version_bump/data/repo_snapshot/packages/authenticator/amplify_authenticator/pubspec.yaml b/packages/aft/test/version_bump/data/repo_snapshot/packages/authenticator/amplify_authenticator/pubspec.yaml new file mode 100644 index 0000000000..aedb32e922 --- /dev/null +++ b/packages/aft/test/version_bump/data/repo_snapshot/packages/authenticator/amplify_authenticator/pubspec.yaml @@ -0,0 +1,53 @@ +name: amplify_authenticator +description: A prebuilt Sign In and Sign Up experience for the Amplify Auth category +version: 2.1.1 +homepage: https://ui.docs.amplify.aws/flutter/connected-components/authenticator +repository: https://github.com/aws-amplify/amplify-flutter/tree/main/packages/authenticator/amplify_authenticator +issue_tracker: https://github.com/aws-amplify/amplify-flutter/issues + +environment: + sdk: ^3.3.0 + flutter: ">=3.19.0" + +dependencies: + amplify_auth_cognito: ">=2.3.0 <2.4.0" + amplify_core: ">=2.3.0 <2.4.0" + amplify_flutter: ">=2.3.0 <2.4.0" + async: ^2.10.0 + aws_common: ">=0.7.1 <0.8.0" + collection: ^1.15.0 + flutter: + sdk: flutter + flutter_localizations: + sdk: flutter + intl: ">=0.18.0 <1.0.0" + meta: ^1.7.0 + # TODO(equartey): Remove this once we have our own method of getting the app name + package_info_plus: ^8.0.0 + qr_flutter: 4.1.0 + smithy: ">=0.7.1 <0.8.0" + stream_transform: ^2.0.0 + url_launcher: ^6.1.11 + +dev_dependencies: + amplify_authenticator_test: + path: ../amplify_authenticator_test + amplify_integration_test: + path: ../../test/amplify_integration_test + amplify_lints: ">=3.1.0 <3.2.0" + build_runner: ^2.4.9 + build_version: ^2.1.1 + flutter_test: + sdk: flutter + golden_toolkit: ^0.15.0 + mocktail: ^1.0.0 + path: any + +flutter: + assets: + - assets/social-buttons/google.png + + fonts: + - family: SocialIcons + fonts: + - asset: assets/social-buttons/SocialIcons.ttf diff --git a/packages/aft/test/version_bump/data/repo_snapshot/packages/aws_common/CHANGELOG.md b/packages/aft/test/version_bump/data/repo_snapshot/packages/aws_common/CHANGELOG.md new file mode 100644 index 0000000000..61cff95820 --- /dev/null +++ b/packages/aft/test/version_bump/data/repo_snapshot/packages/aws_common/CHANGELOG.md @@ -0,0 +1,4 @@ +## 0.7.1 + +- Minor bug fixes and improvements + diff --git a/packages/aft/test/version_bump/data/repo_snapshot/packages/aws_common/pubspec.yaml b/packages/aft/test/version_bump/data/repo_snapshot/packages/aws_common/pubspec.yaml new file mode 100644 index 0000000000..084e039b30 --- /dev/null +++ b/packages/aft/test/version_bump/data/repo_snapshot/packages/aws_common/pubspec.yaml @@ -0,0 +1,35 @@ +name: aws_common +description: Common types and utilities used across AWS and Amplify packages. +version: 0.7.1 +homepage: https://docs.amplify.aws/lib/q/platform/flutter/ +repository: https://github.com/aws-amplify/amplify-flutter/tree/main/packages/aws_common +issue_tracker: https://github.com/aws-amplify/amplify-flutter/issues + +environment: + sdk: ^3.3.0 + +dependencies: + async: ^2.10.0 + built_collection: ^5.0.0 + built_value: ^8.6.0 + collection: ^1.15.0 + http2: ^2.0.0 + js: ">=0.6.4 <0.8.0" + json_annotation: ">=4.9.0 <4.10.0" + logging: ^1.0.0 + meta: ^1.7.0 + mime: ^1.0.0 + os_detect: ^2.0.0 + path: ">=1.8.0 <2.0.0" + stream_transform: ^2.0.0 + uuid: ">=3.0.6 <5.0.0" + +dev_dependencies: + amplify_lints: ">=3.1.0 <3.2.0" + build_runner: ^2.4.9 + build_test: ^2.1.5 + build_web_compilers: ^4.0.0 + built_value_generator: 8.8.1 + json_serializable: 6.8.0 + stream_channel: ^2.1.0 + test: ^1.22.1 diff --git a/packages/aft/test/version_bump/data/repo_snapshot/packages/aws_signature_v4/CHANGELOG.md b/packages/aft/test/version_bump/data/repo_snapshot/packages/aws_signature_v4/CHANGELOG.md new file mode 100644 index 0000000000..794ad40508 --- /dev/null +++ b/packages/aft/test/version_bump/data/repo_snapshot/packages/aws_signature_v4/CHANGELOG.md @@ -0,0 +1,4 @@ +## 0.6.1 + +- Minor bug fixes and improvements + diff --git a/packages/aft/test/version_bump/data/repo_snapshot/packages/aws_signature_v4/pubspec.yaml b/packages/aft/test/version_bump/data/repo_snapshot/packages/aws_signature_v4/pubspec.yaml new file mode 100644 index 0000000000..5853b40594 --- /dev/null +++ b/packages/aft/test/version_bump/data/repo_snapshot/packages/aws_signature_v4/pubspec.yaml @@ -0,0 +1,34 @@ +name: aws_signature_v4 +description: Dart implementation of the AWS Signature Version 4 algorithm, for communication with AWS services. +version: 0.6.1 +homepage: https://docs.amplify.aws/lib/q/platform/flutter/ +repository: https://github.com/aws-amplify/amplify-flutter/tree/main/packages/aws_signature_v4 +issue_tracker: https://github.com/aws-amplify/amplify-flutter/issues + +environment: + sdk: ^3.3.0 + +dependencies: + async: ^2.10.0 + aws_common: ">=0.7.1 <0.8.0" + collection: ^1.15.0 + convert: ^3.0.0 + crypto: ^3.0.0 + json_annotation: ">=4.9.0 <4.10.0" + meta: ^1.7.0 + path: ">=1.8.0 <2.0.0" + +dev_dependencies: + amplify_lints: ">=3.1.0 <3.2.0" + args: ^2.2.0 + build_runner: ^2.4.9 + build_test: ^2.1.5 + build_verify: ^3.0.0 + build_version: ^2.1.1 + build_web_compilers: ^4.0.0 + json_serializable: 6.8.0 + stream_channel: ^2.1.0 + test: ^1.22.1 + +false_secrets: + - test/** diff --git a/packages/aft/test/version_bump/data/repo_snapshot/packages/common/amplify_db_common/CHANGELOG.md b/packages/aft/test/version_bump/data/repo_snapshot/packages/common/amplify_db_common/CHANGELOG.md new file mode 100644 index 0000000000..58498accc0 --- /dev/null +++ b/packages/aft/test/version_bump/data/repo_snapshot/packages/common/amplify_db_common/CHANGELOG.md @@ -0,0 +1,4 @@ +## 0.4.3 + +- Minor bug fixes and improvements + diff --git a/packages/aft/test/version_bump/data/repo_snapshot/packages/common/amplify_db_common/pubspec.yaml b/packages/aft/test/version_bump/data/repo_snapshot/packages/common/amplify_db_common/pubspec.yaml new file mode 100644 index 0000000000..a54168ad37 --- /dev/null +++ b/packages/aft/test/version_bump/data/repo_snapshot/packages/common/amplify_db_common/pubspec.yaml @@ -0,0 +1,34 @@ +name: amplify_db_common +description: Common utilities for working with databases such as SQLite. +version: 0.4.3 +homepage: https://github.com/aws-amplify/amplify-flutter/tree/main +repository: https://github.com/aws-amplify/amplify-flutter/tree/main/packages/common/amplify_db_common +issue_tracker: https://github.com/aws-amplify/amplify-flutter/issues + +environment: + sdk: ^3.3.0 + flutter: ">=3.19.0" + +dependencies: + amplify_db_common_dart: ">=0.4.4 <0.5.0" + drift: ">=2.18.0 <2.19.0" + flutter: + sdk: flutter + path: ">=1.8.0 <2.0.0" + path_provider: ^2.0.11 + +dev_dependencies: + amplify_lints: ">=3.1.0 <3.2.0" + flutter_test: + sdk: flutter + +flutter: + plugin: + platforms: + android: + package: com.amazonaws.amplify.amplify_db_common + pluginClass: AmplifyDbCommonPlugin + linux: + pluginClass: AmplifyDbCommonPlugin + windows: + pluginClass: AmplifyDbCommonPlugin diff --git a/packages/aft/test/version_bump/data/repo_snapshot/packages/common/amplify_db_common_dart/CHANGELOG.md b/packages/aft/test/version_bump/data/repo_snapshot/packages/common/amplify_db_common_dart/CHANGELOG.md new file mode 100644 index 0000000000..bb8d226e1e --- /dev/null +++ b/packages/aft/test/version_bump/data/repo_snapshot/packages/common/amplify_db_common_dart/CHANGELOG.md @@ -0,0 +1,4 @@ +## 0.4.4 + +- Minor bug fixes and improvements + diff --git a/packages/aft/test/version_bump/data/repo_snapshot/packages/common/amplify_db_common_dart/pubspec.yaml b/packages/aft/test/version_bump/data/repo_snapshot/packages/common/amplify_db_common_dart/pubspec.yaml new file mode 100644 index 0000000000..9c729b5ba2 --- /dev/null +++ b/packages/aft/test/version_bump/data/repo_snapshot/packages/common/amplify_db_common_dart/pubspec.yaml @@ -0,0 +1,26 @@ +name: amplify_db_common_dart +description: Common utilities for working with databases such as sqlite. Used throughout Amplify packages. +version: 0.4.4 +homepage: https://github.com/aws-amplify/amplify-flutter/tree/main +repository: https://github.com/aws-amplify/amplify-flutter/tree/main/packages/common/amplify_db_common_dart +issue_tracker: https://github.com/aws-amplify/amplify-flutter/issues + +environment: + sdk: ^3.3.0 + +dependencies: + amplify_core: ">=2.3.0 <2.4.0" + async: ^2.10.0 + aws_common: ">=0.7.1 <0.8.0" + drift: ">=2.18.0 <2.19.0" + meta: ^1.7.0 + path: ">=1.8.0 <2.0.0" + sqlite3: ">=2.0.0 <2.4.3" + +dev_dependencies: + amplify_lints: ">=3.1.0 <3.2.0" + build_runner: ^2.4.9 + build_test: ^2.0.0 + build_web_compilers: ^4.0.0 + drift_dev: ">=2.18.0 <2.19.0" + test: ^1.22.1 diff --git a/packages/aft/test/version_bump/data/repo_snapshot/packages/notifications/push/amplify_push_notifications/CHANGELOG.md b/packages/aft/test/version_bump/data/repo_snapshot/packages/notifications/push/amplify_push_notifications/CHANGELOG.md new file mode 100644 index 0000000000..0076c56feb --- /dev/null +++ b/packages/aft/test/version_bump/data/repo_snapshot/packages/notifications/push/amplify_push_notifications/CHANGELOG.md @@ -0,0 +1,4 @@ +## 2.3.0 + +- Minor bug fixes and improvements + diff --git a/packages/aft/test/version_bump/data/repo_snapshot/packages/notifications/push/amplify_push_notifications/pubspec.yaml b/packages/aft/test/version_bump/data/repo_snapshot/packages/notifications/push/amplify_push_notifications/pubspec.yaml new file mode 100644 index 0000000000..d56c2fd498 --- /dev/null +++ b/packages/aft/test/version_bump/data/repo_snapshot/packages/notifications/push/amplify_push_notifications/pubspec.yaml @@ -0,0 +1,42 @@ +name: amplify_push_notifications +description: The Amplify Flutter Push Notifications package implementing features agnostic of an AWS Service such as Pinpoint. +version: 2.3.0 +homepage: https://docs.amplify.aws/lib/q/platform/flutter/ +issue_tracker: https://github.com/aws-amplify/amplify-flutter/issues + +environment: + sdk: ^3.3.0 + flutter: ">=3.19.0" + +dependencies: + amplify_core: ">=2.3.0 <2.4.0" + amplify_secure_storage: ">=0.5.4 <0.6.0" + async: ^2.10.0 + flutter: + sdk: flutter + flutter_plugin_android_lifecycle: ^2.0.9 + os_detect: ^2.0.0 + shared_preferences: ^2.0.15 + +dev_dependencies: + amplify_lints: ">=3.1.0 <3.2.0" + amplify_secure_storage_dart: ">=0.5.1 <0.6.0" + amplify_test: + path: ../../../test/amplify_test + aws_signature_v4: ">=0.6.1 <0.7.0" + build_runner: ^2.4.9 + build_test: ^2.1.5 + flutter_test: + sdk: flutter + mockito: ^5.0.0 + pigeon: ^11.0.0 + test: ^1.22.1 + +flutter: + plugin: + platforms: + android: + package: com.amazonaws.amplify.amplify_push_notifications + pluginClass: AmplifyPushNotificationsPlugin + ios: + pluginClass: AmplifyPushNotificationsPlugin diff --git a/packages/aft/test/version_bump/data/repo_snapshot/packages/notifications/push/amplify_push_notifications_pinpoint/CHANGELOG.md b/packages/aft/test/version_bump/data/repo_snapshot/packages/notifications/push/amplify_push_notifications_pinpoint/CHANGELOG.md new file mode 100644 index 0000000000..2c1ea35d70 --- /dev/null +++ b/packages/aft/test/version_bump/data/repo_snapshot/packages/notifications/push/amplify_push_notifications_pinpoint/CHANGELOG.md @@ -0,0 +1,5 @@ +## 2.3.0 + +### Fixes +- fix(notifications): allow configuration when auth token is expired ([#5117](https://github.com/aws-amplify/amplify-flutter/pull/5117)) + diff --git a/packages/aft/test/version_bump/data/repo_snapshot/packages/notifications/push/amplify_push_notifications_pinpoint/pubspec.yaml b/packages/aft/test/version_bump/data/repo_snapshot/packages/notifications/push/amplify_push_notifications_pinpoint/pubspec.yaml new file mode 100644 index 0000000000..6323c6cacc --- /dev/null +++ b/packages/aft/test/version_bump/data/repo_snapshot/packages/notifications/push/amplify_push_notifications_pinpoint/pubspec.yaml @@ -0,0 +1,39 @@ +name: amplify_push_notifications_pinpoint +description: The Amplify Flutter Push Notifications category plugin using the AWS Pinpoint provider. +version: 2.3.0 +homepage: https://docs.amplify.aws/lib/q/platform/flutter/ +issue_tracker: https://github.com/aws-amplify/amplify-flutter/issues + +environment: + sdk: ^3.3.0 + flutter: ">=3.19.0" + +# Helps `pana` since it does not detect Android support. +platforms: + ios: + android: + +dependencies: + amplify_analytics_pinpoint: ">=2.3.0 <2.4.0" + amplify_analytics_pinpoint_dart: ">=0.4.3 <0.5.0" + amplify_auth_cognito: ">=2.3.0 <2.4.0" + amplify_core: ">=2.3.0 <2.4.0" + amplify_flutter: ">=2.3.0 <2.4.0" + amplify_push_notifications: ">=2.3.0 <2.4.0" + amplify_secure_storage: ">=0.5.4 <0.6.0" + flutter: + sdk: flutter + flutter_plugin_android_lifecycle: ^2.0.9 + +dev_dependencies: + amplify_lints: ">=3.1.0 <3.2.0" + amplify_secure_storage_dart: ">=0.5.1 <0.6.0" + amplify_test: + path: ../../../test/amplify_test + aws_common: ">=0.7.1 <0.8.0" + aws_signature_v4: ">=0.6.1 <0.7.0" + build_runner: ^2.4.9 + built_value_generator: 8.8.1 + flutter_test: + sdk: flutter + mocktail: ^1.0.0 diff --git a/packages/aft/test/version_bump/data/repo_snapshot/packages/secure_storage/amplify_secure_storage/CHANGELOG.md b/packages/aft/test/version_bump/data/repo_snapshot/packages/secure_storage/amplify_secure_storage/CHANGELOG.md new file mode 100644 index 0000000000..38e8b17e3f --- /dev/null +++ b/packages/aft/test/version_bump/data/repo_snapshot/packages/secure_storage/amplify_secure_storage/CHANGELOG.md @@ -0,0 +1,4 @@ +## 0.5.4 + +- Minor bug fixes and improvements + diff --git a/packages/aft/test/version_bump/data/repo_snapshot/packages/secure_storage/amplify_secure_storage/pubspec.yaml b/packages/aft/test/version_bump/data/repo_snapshot/packages/secure_storage/amplify_secure_storage/pubspec.yaml new file mode 100644 index 0000000000..a156636f4b --- /dev/null +++ b/packages/aft/test/version_bump/data/repo_snapshot/packages/secure_storage/amplify_secure_storage/pubspec.yaml @@ -0,0 +1,45 @@ +name: amplify_secure_storage +description: A package for storing secrets, intended for use in Amplify libraries. +version: 0.5.4 +homepage: https://github.com/aws-amplify/amplify-flutter/tree/main +repository: https://github.com/aws-amplify/amplify-flutter/tree/main/packages/secure_storage/amplify_secure_storage +issue_tracker: https://github.com/aws-amplify/amplify-flutter/issues + +environment: + sdk: ^3.3.0 + flutter: ">=3.19.0" + +dependencies: + amplify_secure_storage_dart: ">=0.5.1 <0.6.0" + async: ^2.10.0 + file: ">=6.0.0 <8.0.0" + flutter: + sdk: flutter + flutter_web_plugins: + sdk: flutter + meta: ^1.7.0 + path: ">=1.8.0 <2.0.0" + path_provider: ^2.0.0 + path_provider_windows: ^2.0.0 + +dev_dependencies: + amplify_lints: ">=3.1.0 <3.2.0" + flutter_test: + sdk: flutter + pigeon: ^11.0.0 + +flutter: + plugin: + platforms: + android: + package: com.amazonaws.amplify.amplify_secure_storage + pluginClass: AmplifySecureStoragePlugin + ios: + pluginClass: AmplifySecureStoragePlugin + windows: + dartPluginClass: AmplifySecureStorageDart + linux: + dartPluginClass: AmplifySecureStorageDart + web: + pluginClass: AmplifySecureStorage + fileName: src/amplify_secure_storage.web.dart diff --git a/packages/aft/test/version_bump/data/repo_snapshot/packages/secure_storage/amplify_secure_storage_dart/CHANGELOG.md b/packages/aft/test/version_bump/data/repo_snapshot/packages/secure_storage/amplify_secure_storage_dart/CHANGELOG.md new file mode 100644 index 0000000000..4728b1b6cb --- /dev/null +++ b/packages/aft/test/version_bump/data/repo_snapshot/packages/secure_storage/amplify_secure_storage_dart/CHANGELOG.md @@ -0,0 +1,4 @@ +## 0.5.1 + +- Minor bug fixes and improvements + diff --git a/packages/aft/test/version_bump/data/repo_snapshot/packages/secure_storage/amplify_secure_storage_dart/pubspec.yaml b/packages/aft/test/version_bump/data/repo_snapshot/packages/secure_storage/amplify_secure_storage_dart/pubspec.yaml new file mode 100644 index 0000000000..49cd8dce54 --- /dev/null +++ b/packages/aft/test/version_bump/data/repo_snapshot/packages/secure_storage/amplify_secure_storage_dart/pubspec.yaml @@ -0,0 +1,50 @@ +name: amplify_secure_storage_dart +description: A Dart-only implementation of `amplify_secure_storage`, using `dart:ffi` for Desktop and `dart:html` for Web. +version: 0.5.1 +homepage: https://github.com/aws-amplify/amplify-flutter/tree/main +repository: https://github.com/aws-amplify/amplify-flutter/tree/main/packages/secure_storage/amplify_secure_storage_dart +issue_tracker: https://github.com/aws-amplify/amplify-flutter/issues + +environment: + sdk: ^3.3.0 + +# Explicitly declare platform support to help `pana` +platforms: + web: + windows: + macos: + linux: + ios: + # Android is not supported through this package. + # Use `amplify_secure_storage` instead. + # android: + +dependencies: + async: ^2.10.0 + aws_common: ">=0.7.1 <0.8.0" + built_collection: ^5.0.0 + built_value: ^8.6.0 + ffi: ^2.0.0 + file: ">=6.0.0 <8.0.0" + js: ">=0.6.4 <0.8.0" + meta: ^1.7.0 + path: ">=1.8.0 <2.0.0" + win32: ">=4.1.2 <6.0.0" + worker_bee: ">=0.3.1 <0.4.0" + +dev_dependencies: + amplify_lints: ">=3.1.0 <3.2.0" + amplify_secure_storage_test: + path: ../amplify_secure_storage_test + build: ^2.3.0 + build_runner: ^2.4.9 + build_web_compilers: ^4.0.0 + built_value_generator: 8.8.1 + ffigen: ^9.0.0 + test: ^1.22.1 + worker_bee_builder: ">=0.3.1 <0.4.0" + +flutter: + assets: + - lib/src/worker/workers.min.js + - lib/src/worker/workers.min.js.map diff --git a/packages/aft/test/version_bump/data/repo_snapshot/packages/smithy/smithy/CHANGELOG.md b/packages/aft/test/version_bump/data/repo_snapshot/packages/smithy/smithy/CHANGELOG.md new file mode 100644 index 0000000000..61cff95820 --- /dev/null +++ b/packages/aft/test/version_bump/data/repo_snapshot/packages/smithy/smithy/CHANGELOG.md @@ -0,0 +1,4 @@ +## 0.7.1 + +- Minor bug fixes and improvements + diff --git a/packages/aft/test/version_bump/data/repo_snapshot/packages/smithy/smithy/pubspec.yaml b/packages/aft/test/version_bump/data/repo_snapshot/packages/smithy/smithy/pubspec.yaml new file mode 100644 index 0000000000..fb657e93a4 --- /dev/null +++ b/packages/aft/test/version_bump/data/repo_snapshot/packages/smithy/smithy/pubspec.yaml @@ -0,0 +1,36 @@ +name: smithy +description: Smithy client runtime for Dart with common utilities for I/O and serialization. +version: 0.7.1 +homepage: https://github.com/aws-amplify/amplify-flutter/tree/main +repository: https://github.com/aws-amplify/amplify-flutter/tree/main/packages/smithy/smithy +issue_tracker: https://github.com/aws-amplify/amplify-flutter/issues + +environment: + sdk: ^3.3.0 + +dependencies: + async: ^2.10.0 + aws_common: ">=0.7.1 <0.8.0" + built_collection: ^5.0.0 + built_value: ^8.6.0 + collection: ^1.15.0 + convert: ^3.0.0 + crypto: ^3.0.0 + fixnum: ^1.0.0 + http_parser: ^4.0.0 + intl: ">=0.18.0 <1.0.0" + json_annotation: ">=4.9.0 <4.10.0" + meta: ^1.7.0 + path: ">=1.8.0 <2.0.0" + retry: ^3.1.0 + shelf: ^1.1.0 + typed_data: ^1.3.0 + xml: ">=6.3.0 <=6.5.0" + +dev_dependencies: + amplify_lints: ">=3.1.0 <3.2.0" + build_runner: ^2.4.9 + built_value_generator: 8.8.1 + json_serializable: 6.8.0 + stack_trace: ^1.10.0 + test: ^1.22.1 diff --git a/packages/aft/test/version_bump/data/repo_snapshot/packages/smithy/smithy_aws/CHANGELOG.md b/packages/aft/test/version_bump/data/repo_snapshot/packages/smithy/smithy_aws/CHANGELOG.md new file mode 100644 index 0000000000..61cff95820 --- /dev/null +++ b/packages/aft/test/version_bump/data/repo_snapshot/packages/smithy/smithy_aws/CHANGELOG.md @@ -0,0 +1,4 @@ +## 0.7.1 + +- Minor bug fixes and improvements + diff --git a/packages/aft/test/version_bump/data/repo_snapshot/packages/smithy/smithy_aws/pubspec.yaml b/packages/aft/test/version_bump/data/repo_snapshot/packages/smithy/smithy_aws/pubspec.yaml new file mode 100644 index 0000000000..db1b573339 --- /dev/null +++ b/packages/aft/test/version_bump/data/repo_snapshot/packages/smithy/smithy_aws/pubspec.yaml @@ -0,0 +1,36 @@ +name: smithy_aws +description: Smithy runtime for AWS clients with utilities for endpoint resolution, retry behavior, and SigV4 signing. +version: 0.7.1 +homepage: https://github.com/aws-amplify/amplify-flutter/tree/main +repository: https://github.com/aws-amplify/amplify-flutter/tree/main/packages/smithy/smithy_aws +issue_tracker: https://github.com/aws-amplify/amplify-flutter/issues + +environment: + sdk: ^3.3.0 + +dependencies: + aws_common: ">=0.7.1 <0.8.0" + aws_signature_v4: ">=0.6.1 <0.7.0" + built_collection: ^5.0.0 + built_value: ^8.6.0 + collection: ^1.15.0 + convert: ^3.0.0 + crclib: ^3.0.0 + crypto: ^3.0.0 + intl: ">=0.18.0 <1.0.0" + json_annotation: ">=4.9.0 <4.10.0" + meta: ^1.7.0 + path: ">=1.8.0 <2.0.0" + smithy: ">=0.7.1 <0.8.0" + xml: ">=6.3.0 <=6.5.0" + +dev_dependencies: + amplify_lints: ">=3.1.0 <3.2.0" + build_runner: ^2.4.9 + built_value_generator: 8.8.1 + file: ">=6.0.0 <8.0.0" + glob: ^2.0.2 + json_serializable: 6.8.0 + pubspec_parse: ^1.2.0 + test: ^1.22.1 + yaml: ^3.1.0 diff --git a/packages/aft/test/version_bump/data/repo_snapshot/packages/smithy/smithy_codegen/CHANGELOG.md b/packages/aft/test/version_bump/data/repo_snapshot/packages/smithy/smithy_codegen/CHANGELOG.md new file mode 100644 index 0000000000..4dc5df9029 --- /dev/null +++ b/packages/aft/test/version_bump/data/repo_snapshot/packages/smithy/smithy_codegen/CHANGELOG.md @@ -0,0 +1,4 @@ +## 0.3.2 + +- Minor bug fixes and improvements + diff --git a/packages/aft/test/version_bump/data/repo_snapshot/packages/smithy/smithy_codegen/pubspec.yaml b/packages/aft/test/version_bump/data/repo_snapshot/packages/smithy/smithy_codegen/pubspec.yaml new file mode 100644 index 0000000000..c0c4bb702d --- /dev/null +++ b/packages/aft/test/version_bump/data/repo_snapshot/packages/smithy/smithy_codegen/pubspec.yaml @@ -0,0 +1,52 @@ +name: smithy_codegen +description: Smithy model generator from AST representation +version: 0.3.2 +repository: https://github.com/aws-amplify/amplify-flutter/tree/main/packages/smithy/smithy_codegen +publish_to: none + +environment: + sdk: ^3.3.0 + +dependencies: + args: ^2.3.0 + aws_common: any + aws_signature_v4: any + build_cli_annotations: ^2.0.0 + built_collection: ^5.1.1 + built_value: ^8.6.0 + code_builder: 4.10.0 + collection: ^1.15.0 + crclib: ^3.0.0 + dart_style: ^2.3.2 + fixnum: ^1.0.0 + grpc: ^3.0.2 + html2md: ^1.2.5 + jmespath: ^2.0.0 + json_annotation: ">=4.9.0 <4.10.0" + meta: ^1.7.0 + path: ">=1.8.0 <2.0.0" + protobuf: ^2.0.1 + pub_semver: ^2.1.0 + pubspec_parse: ^1.2.0 + shelf: ^1.1.0 + shelf_router: ^1.1.0 + smithy: ">=0.7.1 <0.8.0" + smithy_aws: ">=0.7.0 <0.8.0" + tuple: ^2.0.0 + xml: ">=6.3.0 <=6.5.0" + yaml_edit: ^2.0.1 + +dev_dependencies: + amplify_lints: ">=3.0.0 <3.1.0" + build_cli: ^2.1.6 + build_runner: ^2.4.9 + build_verify: ^3.0.0 + build_version: ^2.1.0 + built_value_generator: 8.8.1 + json_serializable: 6.8.0 + smithy_test: + path: ../smithy_test + test: ^1.22.1 + +executables: + smithy_codegen: diff --git a/packages/aft/test/version_bump/data/repo_snapshot/packages/storage/amplify_storage_s3/CHANGELOG.md b/packages/aft/test/version_bump/data/repo_snapshot/packages/storage/amplify_storage_s3/CHANGELOG.md new file mode 100644 index 0000000000..0076c56feb --- /dev/null +++ b/packages/aft/test/version_bump/data/repo_snapshot/packages/storage/amplify_storage_s3/CHANGELOG.md @@ -0,0 +1,4 @@ +## 2.3.0 + +- Minor bug fixes and improvements + diff --git a/packages/aft/test/version_bump/data/repo_snapshot/packages/storage/amplify_storage_s3/pubspec.yaml b/packages/aft/test/version_bump/data/repo_snapshot/packages/storage/amplify_storage_s3/pubspec.yaml new file mode 100644 index 0000000000..6769cf014a --- /dev/null +++ b/packages/aft/test/version_bump/data/repo_snapshot/packages/storage/amplify_storage_s3/pubspec.yaml @@ -0,0 +1,38 @@ +name: amplify_storage_s3 +description: The Amplify Flutter Storage category plugin using the AWS S3 provider. +version: 2.3.0 +homepage: https://docs.amplify.aws/lib/q/platform/flutter/ +repository: https://github.com/aws-amplify/amplify-flutter/tree/main/packages/storage/amplify_storage_s3 +issue_tracker: https://github.com/aws-amplify/amplify-flutter/issues + +environment: + sdk: ^3.3.0 + flutter: ">=3.19.0" + +# Helps `pana` since we do not use Flutter plugins for most platforms +platforms: + ios: + android: + macos: + windows: + linux: + web: + +dependencies: + amplify_core: ">=2.3.0 <2.4.0" + amplify_db_common: ">=0.4.3 <0.5.0" + amplify_storage_s3_dart: ">=0.4.3 <0.5.0" + aws_common: ">=0.7.1 <0.8.0" + flutter: + sdk: flutter + meta: ^1.7.0 + path_provider: ^2.0.0 + +dev_dependencies: + amplify_lints: ">=3.1.0 <3.2.0" + amplify_test: + path: ../../test/amplify_test + aws_signature_v4: ">=0.6.1 <0.7.0" + flutter_test: + sdk: flutter + mocktail: ^1.0.0 diff --git a/packages/aft/test/version_bump/data/repo_snapshot/packages/storage/amplify_storage_s3_dart/CHANGELOG.md b/packages/aft/test/version_bump/data/repo_snapshot/packages/storage/amplify_storage_s3_dart/CHANGELOG.md new file mode 100644 index 0000000000..58498accc0 --- /dev/null +++ b/packages/aft/test/version_bump/data/repo_snapshot/packages/storage/amplify_storage_s3_dart/CHANGELOG.md @@ -0,0 +1,4 @@ +## 0.4.3 + +- Minor bug fixes and improvements + diff --git a/packages/aft/test/version_bump/data/repo_snapshot/packages/storage/amplify_storage_s3_dart/pubspec.yaml b/packages/aft/test/version_bump/data/repo_snapshot/packages/storage/amplify_storage_s3_dart/pubspec.yaml new file mode 100644 index 0000000000..200a8d76c1 --- /dev/null +++ b/packages/aft/test/version_bump/data/repo_snapshot/packages/storage/amplify_storage_s3_dart/pubspec.yaml @@ -0,0 +1,35 @@ +name: amplify_storage_s3_dart +description: A Dart-only implementation of the Amplify Storage plugin for S3. +version: 0.4.3 +homepage: https://docs.amplify.aws/lib/q/platform/flutter/ +repository: https://github.com/aws-amplify/amplify-flutter/tree/main/packages/storage/amplify_storage_s3_dart +issue_tracker: https://github.com/aws-amplify/amplify-flutter/issues + +environment: + sdk: ^3.3.0 + +dependencies: + amplify_core: ">=2.3.0 <2.4.0" + amplify_db_common_dart: ">=0.4.4 <0.5.0" + async: ^2.10.0 + aws_common: ">=0.7.1 <0.8.0" + aws_signature_v4: ">=0.6.1 <0.7.0" + built_collection: ^5.0.0 + built_value: ^8.6.0 + drift: ">=2.18.0 <2.19.0" + fixnum: ^1.0.0 + json_annotation: ">=4.9.0 <4.10.0" + meta: ^1.7.0 + path: ">=1.8.0 <2.0.0" + smithy: ">=0.7.1 <0.8.0" + smithy_aws: ">=0.7.0 <0.8.0" + +dev_dependencies: + amplify_lints: ">=3.1.0 <3.2.0" + build_runner: ^2.4.9 + build_verify: ^3.0.0 + built_value_generator: 8.8.1 + drift_dev: ">=2.18.0 <2.19.0" + json_serializable: 6.8.0 + mocktail: ^1.0.0 + test: ^1.22.1 diff --git a/packages/aft/test/version_bump/data/repo_snapshot/packages/worker_bee/e2e/pubspec.yaml b/packages/aft/test/version_bump/data/repo_snapshot/packages/worker_bee/e2e/pubspec.yaml new file mode 100644 index 0000000000..489f822707 --- /dev/null +++ b/packages/aft/test/version_bump/data/repo_snapshot/packages/worker_bee/e2e/pubspec.yaml @@ -0,0 +1,31 @@ +name: e2e +description: E2E tests for the worker_bee package. +publish_to: none + +environment: + sdk: ^3.3.0 + +dependencies: + aws_common: ">=0.4.0 <0.5.0" + built_collection: ^5.0.0 + built_value: ^8.6.0 + fixnum: ^1.0.0 + meta: ^1.7.0 + test: ^1.22.1 + worker_bee: ">=0.3.0 <0.4.0" + +dependency_overrides: + aws_common: + path: ../../aws_common + worker_bee: + path: ../worker_bee + +dev_dependencies: + amplify_lints: + path: ../../amplify_lints + build_runner: ^2.4.9 + build_verify: ^3.0.0 + build_web_compilers: ^4.0.0 + built_value_generator: 8.8.1 + worker_bee_builder: + path: ../worker_bee_builder diff --git a/packages/aft/test/version_bump/data/repo_snapshot/packages/worker_bee/worker_bee/CHANGELOG.md b/packages/aft/test/version_bump/data/repo_snapshot/packages/worker_bee/worker_bee/CHANGELOG.md new file mode 100644 index 0000000000..d02aa61882 --- /dev/null +++ b/packages/aft/test/version_bump/data/repo_snapshot/packages/worker_bee/worker_bee/CHANGELOG.md @@ -0,0 +1,4 @@ +## 0.3.1 + +- Minor bug fixes and improvements + diff --git a/packages/aft/test/version_bump/data/repo_snapshot/packages/worker_bee/worker_bee/pubspec.yaml b/packages/aft/test/version_bump/data/repo_snapshot/packages/worker_bee/worker_bee/pubspec.yaml new file mode 100644 index 0000000000..6859da66ed --- /dev/null +++ b/packages/aft/test/version_bump/data/repo_snapshot/packages/worker_bee/worker_bee/pubspec.yaml @@ -0,0 +1,28 @@ +name: worker_bee +description: A cross-platform isolated worker runtime for Dart Web, VM, and Flutter. +version: 0.3.1 +homepage: https://github.com/aws-amplify/amplify-flutter/tree/main +repository: https://github.com/aws-amplify/amplify-flutter/tree/main/packages/worker_bee/worker_bee +issue_tracker: https://github.com/aws-amplify/amplify-flutter/issues + +environment: + sdk: ^3.3.0 + +dependencies: + async: ^2.10.0 + aws_common: ">=0.7.1 <0.8.0" + built_collection: ^5.0.0 + built_value: ^8.6.0 + collection: ^1.15.0 + js: ">=0.6.4 <0.8.0" + meta: ^1.7.0 + path: ">=1.8.0 <2.0.0" + stack_trace: ^1.10.0 + stream_channel: ^2.1.0 + stream_transform: ^2.0.0 + +dev_dependencies: + amplify_lints: ">=3.1.0 <3.2.0" + build_runner: ^2.4.9 + built_value_generator: 8.8.1 + test: ^1.22.1 diff --git a/packages/aft/test/version_bump/data/repo_snapshot/packages/worker_bee/worker_bee_builder/CHANGELOG.md b/packages/aft/test/version_bump/data/repo_snapshot/packages/worker_bee/worker_bee_builder/CHANGELOG.md new file mode 100644 index 0000000000..d02aa61882 --- /dev/null +++ b/packages/aft/test/version_bump/data/repo_snapshot/packages/worker_bee/worker_bee_builder/CHANGELOG.md @@ -0,0 +1,4 @@ +## 0.3.1 + +- Minor bug fixes and improvements + diff --git a/packages/aft/test/version_bump/data/repo_snapshot/packages/worker_bee/worker_bee_builder/pubspec.yaml b/packages/aft/test/version_bump/data/repo_snapshot/packages/worker_bee/worker_bee_builder/pubspec.yaml new file mode 100644 index 0000000000..d1e621c4f4 --- /dev/null +++ b/packages/aft/test/version_bump/data/repo_snapshot/packages/worker_bee/worker_bee_builder/pubspec.yaml @@ -0,0 +1,27 @@ +name: worker_bee_builder +description: Builder package for worker_bee to quickly generate necessary boilerplate +version: 0.3.1 +homepage: https://github.com/aws-amplify/amplify-flutter/tree/main +repository: https://github.com/aws-amplify/amplify-flutter/tree/main/packages/worker_bee/worker_bee_builder +issue_tracker: https://github.com/aws-amplify/amplify-flutter/issues + +environment: + sdk: ^3.3.0 + +dependencies: + analyzer: ">=5.1.0 <7.0.0" + async: ^2.10.0 + build: ^2.2.1 + code_builder: 4.10.0 + collection: ^1.15.0 + dart_style: ^2.3.2 + meta: ^1.7.0 + path: ">=1.8.0 <2.0.0" + source_gen: ^1.3.2 + stream_channel: ^2.1.0 + tuple: ^2.0.0 + worker_bee: ">=0.3.1 <0.4.0" + +dev_dependencies: + amplify_lints: ">=3.1.0 <3.2.0" + test: ^1.22.1 diff --git a/packages/aft/test/version_bump/data/repo_snapshot/pubspec.yaml b/packages/aft/test/version_bump/data/repo_snapshot/pubspec.yaml new file mode 100644 index 0000000000..7038fca683 --- /dev/null +++ b/packages/aft/test/version_bump/data/repo_snapshot/pubspec.yaml @@ -0,0 +1,166 @@ +name: amplify_flutter_repo +publish_to: none + +# The current constraints for Dart and Flutter SDKs. +environment: + sdk: ^3.3.0 + flutter: ">=3.19.0" + +# Global dependency versions for third-party dependencies of +# Amplify Flutter projects. These represent the values which +# have been vetted by manual review and should be used consistently +# across all packages. +# +# Application of these values can be verified/updated with the `aft` +# tool. +dependencies: + async: ^2.10.0 + build_runner: ^2.4.9 + build_web_compilers: ^4.0.0 + built_value: "^8.6.0" + built_value_generator: 8.8.1 + code_builder: 4.10.0 + connectivity_plus: ^6.0.1 + # This must roughly match what's included in `dart format` + # on stable so that CI checks pass for generated code. + dart_style: ^2.3.2 + device_info_plus: ^10.0.1 + drift: ">=2.18.0 <2.19.0" + drift_dev: ">=2.18.0 <2.19.0" + ffigen: ^9.0.0 + file: ">=6.0.0 <8.0.0" + flutter_plugin_android_lifecycle: ^2.0.9 + graphs: ^2.1.0 + http: ">=0.13.0 <2.0.0" + intl: ">=0.18.0 <1.0.0" + json_annotation: ">=4.9.0 <4.10.0" + json_serializable: 6.8.0 + mime: ^1.0.0 + oauth2: ^2.0.2 + package_info_plus: ^8.0.0 + pigeon: ^11.0.0 + sqlite3: ">=2.0.0 <2.4.3" + source_gen: ^1.3.2 + stack_trace: ^1.10.0 + uuid: ">=3.0.6 <5.0.0" + win32: ">=4.1.2 <6.0.0" + xml: ">=6.3.0 <=6.5.0" + test: ^1.22.1 + +aft: + # The current constraints for platform SDKs and OSs. + platforms: + android: + minSdkVersion: "24" + ios: + minOSVersion: "13.0" + macOS: + minOSVersion: "10.15" + + # Packages to ignore in all repo operations. + ignore: + - synthetic_package + + # Strongly connected components which should have version bumps happen + # in unison, i.e. a version bump to one package cascades to all. + # + # By default, this happens only for minor version bumps. However, this + # can be modified on a per-component basis using the `propagate` flag. + components: + - name: Amplify Flutter + summary: amplify_flutter + packages: + - amplify_flutter + - amplify_core + - amplify_datastore + - amplify_datastore_plugin_interface + - amplify_analytics_pinpoint + - amplify_api + - amplify_auth_cognito + - amplify_storage_s3 + - amplify_push_notifications + - amplify_push_notifications_pinpoint + - name: Amplify Dart + summary: amplify_core + propagate: none + packages: + - amplify_analytics_pinpoint_dart + - amplify_api_dart + - amplify_auth_cognito_dart + - amplify_storage_s3_dart + - name: Amplify UI + packages: + - amplify_authenticator + - name: DB Common + summary: amplify_db_common + packages: + - amplify_db_common + - amplify_db_common_dart + - name: Secure Storage + summary: amplify_secure_storage + packages: + - amplify_secure_storage + - amplify_secure_storage_dart + - name: AWS Common + summary: aws_common + propagate: none + packages: + - aws_common + - aws_signature_v4 + - name: Smithy + summary: smithy + packages: + - smithy + - smithy_aws + - name: Worker Bee + summary: worker_bee + packages: + - worker_bee + - worker_bee_builder + + # Scripts which are runnable via `aft run `. + scripts: + license: + description: Adds license headers recursively in the current directory + from: current + run: $AFT_ROOT/tool/license.sh $@ + format: + description: Checks formatting for all packages + from: all + run: aft format --set-exit-if-changed . + analyze: + description: Runs Dart analysis in all packages + from: all + run: aft analyze $@ + test:unit:flutter: + description: Runs unit tests for all Flutter packages + from: flutter + run: $AFT_ROOT/tool/test_all_plugins.sh flutter {{ package.name }} + test:unit:ios: + description: Runs unit tests for all iOS plugins + from: flutter + run: $AFT_ROOT/tool/test_all_plugins.sh ios {{ package.name }} {{{ package.example.path }}} + test:unit:android: + description: Runs unit tests for all Android plugins + from: flutter + run: $AFT_ROOT/tool/test_all_plugins.sh android {{ package.name }} {{{ package.example.path }}} + build:example:ios: + description: Builds all example apps for iOS + from: + and: + - flutter + - example + run: | + if [ -d ios ]; then + flutter build ios --simulator + fi + build:example:android: + description: Builds all example apps for Android + from: + and: + - flutter + - example + run: | + if [ -d android ]; then + flutter build apk --debug + fi diff --git a/packages/aft/test/version_bump/data/snapshots/aws_common_fix.diff b/packages/aft/test/version_bump/data/snapshots/aws_common_fix.diff new file mode 100644 index 0000000000..51eda56ed3 --- /dev/null +++ b/packages/aft/test/version_bump/data/snapshots/aws_common_fix.diff @@ -0,0 +1,9 @@ +diff --git a/packages/aws_common/CHANGELOG.md b/packages/aws_common/CHANGELOG.md ++## 0.7.2 ++ ++### Fixes ++- fix: test ++ +diff --git a/packages/aws_common/pubspec.yaml b/packages/aws_common/pubspec.yaml +-version: 0.7.1 ++version: 0.7.2 diff --git a/packages/aft/test/version_bump/data/snapshots/multi_package_update.diff b/packages/aft/test/version_bump/data/snapshots/multi_package_update.diff new file mode 100644 index 0000000000..ef6cbbf624 --- /dev/null +++ b/packages/aft/test/version_bump/data/snapshots/multi_package_update.diff @@ -0,0 +1,231 @@ +diff --git a/packages/amplify/amplify_flutter/CHANGELOG.md b/packages/amplify/amplify_flutter/CHANGELOG.md ++## 2.4.0 ++ ++### Features ++- feat: test core/auth feat ++ ++### Fixes ++- fix: test auth fix ++ +diff --git a/packages/amplify/amplify_flutter/pubspec.yaml b/packages/amplify/amplify_flutter/pubspec.yaml +-version: 2.3.0 ++version: 2.4.0 +- amplify_core: ">=2.3.0 <2.4.0" ++ amplify_core: ">=2.4.0 <2.5.0" +- aws_common: ">=0.7.1 <0.8.0" ++ aws_common: ">=0.7.2 <0.8.0" +diff --git a/packages/amplify_core/CHANGELOG.md b/packages/amplify_core/CHANGELOG.md ++## 2.4.0 ++ ++### Features ++- feat: test core/auth feat ++ ++### Fixes ++- fix: test auth fix ++ +diff --git a/packages/amplify_core/pubspec.yaml b/packages/amplify_core/pubspec.yaml +-version: 2.3.0 ++version: 2.4.0 +- aws_common: ">=0.7.1 <0.8.0" ++ aws_common: ">=0.7.2 <0.8.0" +diff --git a/packages/amplify_datastore/CHANGELOG.md b/packages/amplify_datastore/CHANGELOG.md ++## 2.4.0 ++ ++- Minor bug fixes and improvements ++ +diff --git a/packages/amplify_datastore/pubspec.yaml b/packages/amplify_datastore/pubspec.yaml +-version: 2.3.0 ++version: 2.4.0 +- amplify_datastore_plugin_interface: ">=2.3.0 <2.4.0" +- amplify_core: ">=2.3.0 <2.4.0" ++ amplify_datastore_plugin_interface: ">=2.4.0 <2.5.0" ++ amplify_core: ">=2.4.0 <2.5.0" +diff --git a/packages/amplify_datastore_plugin_interface/CHANGELOG.md b/packages/amplify_datastore_plugin_interface/CHANGELOG.md ++## 2.4.0 ++ ++- Minor bug fixes and improvements ++ +diff --git a/packages/amplify_datastore_plugin_interface/pubspec.yaml b/packages/amplify_datastore_plugin_interface/pubspec.yaml +-version: 2.3.0 ++version: 2.4.0 +- amplify_core: ">=2.3.0 <2.4.0" ++ amplify_core: ">=2.4.0 <2.5.0" +diff --git a/packages/analytics/amplify_analytics_pinpoint/CHANGELOG.md b/packages/analytics/amplify_analytics_pinpoint/CHANGELOG.md ++## 2.4.0 ++ ++- Minor bug fixes and improvements ++ +diff --git a/packages/analytics/amplify_analytics_pinpoint/pubspec.yaml b/packages/analytics/amplify_analytics_pinpoint/pubspec.yaml +-version: 2.3.0 ++version: 2.4.0 +- amplify_core: ">=2.3.0 <2.4.0" ++ amplify_core: ">=2.4.0 <2.5.0" +- aws_common: ">=0.7.1 <0.8.0" ++ aws_common: ">=0.7.2 <0.8.0" +diff --git a/packages/analytics/amplify_analytics_pinpoint_dart/pubspec.yaml b/packages/analytics/amplify_analytics_pinpoint_dart/pubspec.yaml +- amplify_core: ">=2.3.0 <2.4.0" ++ amplify_core: ">=2.4.0 <2.5.0" +- aws_common: ">=0.7.1 <0.8.0" ++ aws_common: ">=0.7.2 <0.8.0" +diff --git a/packages/api/amplify_api/CHANGELOG.md b/packages/api/amplify_api/CHANGELOG.md ++## 2.4.0 ++ ++- Minor bug fixes and improvements ++ +diff --git a/packages/api/amplify_api/pubspec.yaml b/packages/api/amplify_api/pubspec.yaml +-version: 2.3.0 ++version: 2.4.0 +- amplify_core: ">=2.3.0 <2.4.0" +- amplify_flutter: ">=2.3.0 <2.4.0" ++ amplify_core: ">=2.4.0 <2.5.0" ++ amplify_flutter: ">=2.4.0 <2.5.0" +diff --git a/packages/api/amplify_api_dart/pubspec.yaml b/packages/api/amplify_api_dart/pubspec.yaml +- amplify_core: ">=2.3.0 <2.4.0" ++ amplify_core: ">=2.4.0 <2.5.0" +- aws_common: ">=0.7.1 <0.8.0" ++ aws_common: ">=0.7.2 <0.8.0" +diff --git a/packages/auth/amplify_auth_cognito/CHANGELOG.md b/packages/auth/amplify_auth_cognito/CHANGELOG.md ++## 2.4.0 ++ ++### Features ++- feat: test core/auth feat ++ ++### Fixes ++- fix: test auth fix ++ +diff --git a/packages/auth/amplify_auth_cognito/pubspec.yaml b/packages/auth/amplify_auth_cognito/pubspec.yaml +-version: 2.3.0 ++version: 2.4.0 +- amplify_analytics_pinpoint: ">=2.3.0 <2.4.0" ++ amplify_analytics_pinpoint: ">=2.4.0 <2.5.0" +- amplify_auth_cognito_dart: ">=0.11.3 <0.12.0" +- amplify_core: ">=2.3.0 <2.4.0" +- amplify_flutter: ">=2.3.0 <2.4.0" ++ amplify_auth_cognito_dart: ">=0.11.4 <0.12.0" ++ amplify_core: ">=2.4.0 <2.5.0" ++ amplify_flutter: ">=2.4.0 <2.5.0" +diff --git a/packages/auth/amplify_auth_cognito_dart/CHANGELOG.md b/packages/auth/amplify_auth_cognito_dart/CHANGELOG.md ++## 0.11.4 ++ ++### Fixes ++- fix: test auth fix ++ +diff --git a/packages/auth/amplify_auth_cognito_dart/pubspec.yaml b/packages/auth/amplify_auth_cognito_dart/pubspec.yaml +-version: 0.11.3 ++version: 0.11.4 +- amplify_core: ">=2.3.0 <2.4.0" ++ amplify_core: ">=2.4.0 <2.5.0" +- aws_common: ">=0.7.1 <0.8.0" ++ aws_common: ">=0.7.2 <0.8.0" +diff --git a/packages/authenticator/amplify_authenticator/pubspec.yaml b/packages/authenticator/amplify_authenticator/pubspec.yaml +- amplify_auth_cognito: ">=2.3.0 <2.4.0" +- amplify_core: ">=2.3.0 <2.4.0" +- amplify_flutter: ">=2.3.0 <2.4.0" ++ amplify_auth_cognito: ">=2.4.0 <2.5.0" ++ amplify_core: ">=2.4.0 <2.5.0" ++ amplify_flutter: ">=2.4.0 <2.5.0" +- aws_common: ">=0.7.1 <0.8.0" ++ aws_common: ">=0.7.2 <0.8.0" +diff --git a/packages/aws_common/CHANGELOG.md b/packages/aws_common/CHANGELOG.md ++## 0.7.2 ++ ++### Features ++- feat: test common feat ++ +diff --git a/packages/aws_common/pubspec.yaml b/packages/aws_common/pubspec.yaml +-version: 0.7.1 ++version: 0.7.2 +diff --git a/packages/aws_signature_v4/pubspec.yaml b/packages/aws_signature_v4/pubspec.yaml +- aws_common: ">=0.7.1 <0.8.0" ++ aws_common: ">=0.7.2 <0.8.0" +diff --git a/packages/common/amplify_db_common/CHANGELOG.md b/packages/common/amplify_db_common/CHANGELOG.md ++## 0.4.4 ++ ++### Fixes ++- fix: test db common fix ++ +diff --git a/packages/common/amplify_db_common/pubspec.yaml b/packages/common/amplify_db_common/pubspec.yaml +-version: 0.4.3 ++version: 0.4.4 +- amplify_db_common_dart: ">=0.4.4 <0.5.0" ++ amplify_db_common_dart: ">=0.4.5 <0.5.0" +diff --git a/packages/common/amplify_db_common_dart/CHANGELOG.md b/packages/common/amplify_db_common_dart/CHANGELOG.md ++## 0.4.5 ++ ++### Fixes ++- fix: test db common fix ++ +diff --git a/packages/common/amplify_db_common_dart/pubspec.yaml b/packages/common/amplify_db_common_dart/pubspec.yaml +-version: 0.4.4 ++version: 0.4.5 +- amplify_core: ">=2.3.0 <2.4.0" ++ amplify_core: ">=2.4.0 <2.5.0" +- aws_common: ">=0.7.1 <0.8.0" ++ aws_common: ">=0.7.2 <0.8.0" +diff --git a/packages/notifications/push/amplify_push_notifications/CHANGELOG.md b/packages/notifications/push/amplify_push_notifications/CHANGELOG.md ++## 2.4.0 ++ ++- Minor bug fixes and improvements ++ +diff --git a/packages/notifications/push/amplify_push_notifications/pubspec.yaml b/packages/notifications/push/amplify_push_notifications/pubspec.yaml +-version: 2.3.0 ++version: 2.4.0 +- amplify_core: ">=2.3.0 <2.4.0" ++ amplify_core: ">=2.4.0 <2.5.0" +diff --git a/packages/notifications/push/amplify_push_notifications_pinpoint/CHANGELOG.md b/packages/notifications/push/amplify_push_notifications_pinpoint/CHANGELOG.md ++## 2.4.0 ++ ++- Minor bug fixes and improvements ++ +diff --git a/packages/notifications/push/amplify_push_notifications_pinpoint/pubspec.yaml b/packages/notifications/push/amplify_push_notifications_pinpoint/pubspec.yaml +-version: 2.3.0 ++version: 2.4.0 +- amplify_analytics_pinpoint: ">=2.3.0 <2.4.0" ++ amplify_analytics_pinpoint: ">=2.4.0 <2.5.0" +- amplify_auth_cognito: ">=2.3.0 <2.4.0" +- amplify_core: ">=2.3.0 <2.4.0" +- amplify_flutter: ">=2.3.0 <2.4.0" +- amplify_push_notifications: ">=2.3.0 <2.4.0" ++ amplify_auth_cognito: ">=2.4.0 <2.5.0" ++ amplify_core: ">=2.4.0 <2.5.0" ++ amplify_flutter: ">=2.4.0 <2.5.0" ++ amplify_push_notifications: ">=2.4.0 <2.5.0" +- aws_common: ">=0.7.1 <0.8.0" ++ aws_common: ">=0.7.2 <0.8.0" +diff --git a/packages/secure_storage/amplify_secure_storage/CHANGELOG.md b/packages/secure_storage/amplify_secure_storage/CHANGELOG.md ++## 0.5.5 ++ ++- Minor bug fixes and improvements ++ +diff --git a/packages/secure_storage/amplify_secure_storage/pubspec.yaml b/packages/secure_storage/amplify_secure_storage/pubspec.yaml +-version: 0.5.4 ++version: 0.5.5 +diff --git a/packages/secure_storage/amplify_secure_storage_dart/pubspec.yaml b/packages/secure_storage/amplify_secure_storage_dart/pubspec.yaml +- aws_common: ">=0.7.1 <0.8.0" ++ aws_common: ">=0.7.2 <0.8.0" +diff --git a/packages/smithy/smithy/pubspec.yaml b/packages/smithy/smithy/pubspec.yaml +- aws_common: ">=0.7.1 <0.8.0" ++ aws_common: ">=0.7.2 <0.8.0" +diff --git a/packages/smithy/smithy_aws/pubspec.yaml b/packages/smithy/smithy_aws/pubspec.yaml +- aws_common: ">=0.7.1 <0.8.0" ++ aws_common: ">=0.7.2 <0.8.0" +diff --git a/packages/storage/amplify_storage_s3/CHANGELOG.md b/packages/storage/amplify_storage_s3/CHANGELOG.md ++## 2.4.0 ++ ++- Minor bug fixes and improvements ++ +diff --git a/packages/storage/amplify_storage_s3/pubspec.yaml b/packages/storage/amplify_storage_s3/pubspec.yaml +-version: 2.3.0 ++version: 2.4.0 +- amplify_core: ">=2.3.0 <2.4.0" ++ amplify_core: ">=2.4.0 <2.5.0" +- aws_common: ">=0.7.1 <0.8.0" ++ aws_common: ">=0.7.2 <0.8.0" +diff --git a/packages/storage/amplify_storage_s3_dart/pubspec.yaml b/packages/storage/amplify_storage_s3_dart/pubspec.yaml +- amplify_core: ">=2.3.0 <2.4.0" ++ amplify_core: ">=2.4.0 <2.5.0" +- aws_common: ">=0.7.1 <0.8.0" ++ aws_common: ">=0.7.2 <0.8.0" +diff --git a/packages/worker_bee/worker_bee/pubspec.yaml b/packages/worker_bee/worker_bee/pubspec.yaml +- aws_common: ">=0.7.1 <0.8.0" ++ aws_common: ">=0.7.2 <0.8.0" diff --git a/packages/aft/test/version_bump/data/snapshots/single_dart_package_breaking.diff b/packages/aft/test/version_bump/data/snapshots/single_dart_package_breaking.diff new file mode 100644 index 0000000000..3c085c05bb --- /dev/null +++ b/packages/aft/test/version_bump/data/snapshots/single_dart_package_breaking.diff @@ -0,0 +1,39 @@ +diff --git a/packages/auth/amplify_auth_cognito/CHANGELOG.md b/packages/auth/amplify_auth_cognito/CHANGELOG.md ++## 2.3.1 ++ ++- Minor bug fixes and improvements ++ +diff --git a/packages/auth/amplify_auth_cognito/pubspec.yaml b/packages/auth/amplify_auth_cognito/pubspec.yaml +-version: 2.3.0 ++version: 2.3.1 +- amplify_auth_cognito_dart: ">=0.11.3 <0.12.0" ++ amplify_auth_cognito_dart: ">=0.12.0 <0.13.0" +diff --git a/packages/auth/amplify_auth_cognito_dart/CHANGELOG.md b/packages/auth/amplify_auth_cognito_dart/CHANGELOG.md ++## 0.12.0 ++ ++### Breaking Changes ++- feat!: test ++ +diff --git a/packages/auth/amplify_auth_cognito_dart/pubspec.yaml b/packages/auth/amplify_auth_cognito_dart/pubspec.yaml +-version: 0.11.3 ++version: 0.12.0 +diff --git a/packages/authenticator/amplify_authenticator/CHANGELOG.md b/packages/authenticator/amplify_authenticator/CHANGELOG.md ++## 2.1.2 ++ ++- Minor bug fixes and improvements ++ +diff --git a/packages/authenticator/amplify_authenticator/pubspec.yaml b/packages/authenticator/amplify_authenticator/pubspec.yaml +-version: 2.1.1 ++version: 2.1.2 +- amplify_auth_cognito: ">=2.3.0 <2.4.0" ++ amplify_auth_cognito: ">=2.3.1 <2.4.0" +diff --git a/packages/notifications/push/amplify_push_notifications_pinpoint/CHANGELOG.md b/packages/notifications/push/amplify_push_notifications_pinpoint/CHANGELOG.md ++## 2.3.1 ++ ++- Minor bug fixes and improvements ++ +diff --git a/packages/notifications/push/amplify_push_notifications_pinpoint/pubspec.yaml b/packages/notifications/push/amplify_push_notifications_pinpoint/pubspec.yaml +-version: 2.3.0 ++version: 2.3.1 +- amplify_auth_cognito: ">=2.3.0 <2.4.0" ++ amplify_auth_cognito: ">=2.3.1 <2.4.0" diff --git a/packages/aft/test/version_bump/data/snapshots/single_dart_package_chore.diff b/packages/aft/test/version_bump/data/snapshots/single_dart_package_chore.diff new file mode 100644 index 0000000000..d04b8d1b0d --- /dev/null +++ b/packages/aft/test/version_bump/data/snapshots/single_dart_package_chore.diff @@ -0,0 +1,8 @@ +diff --git a/packages/auth/amplify_auth_cognito_dart/CHANGELOG.md b/packages/auth/amplify_auth_cognito_dart/CHANGELOG.md ++## 0.11.4 ++ ++- Minor bug fixes and improvements ++ +diff --git a/packages/auth/amplify_auth_cognito_dart/pubspec.yaml b/packages/auth/amplify_auth_cognito_dart/pubspec.yaml +-version: 0.11.3 ++version: 0.11.4 diff --git a/packages/aft/test/version_bump/data/snapshots/single_dart_package_feat.diff b/packages/aft/test/version_bump/data/snapshots/single_dart_package_feat.diff new file mode 100644 index 0000000000..b548b91dfa --- /dev/null +++ b/packages/aft/test/version_bump/data/snapshots/single_dart_package_feat.diff @@ -0,0 +1,12 @@ +diff --git a/packages/auth/amplify_auth_cognito/pubspec.yaml b/packages/auth/amplify_auth_cognito/pubspec.yaml +- amplify_auth_cognito_dart: ">=0.11.3 <0.12.0" ++ amplify_auth_cognito_dart: ">=0.11.4 <0.12.0" +diff --git a/packages/auth/amplify_auth_cognito_dart/CHANGELOG.md b/packages/auth/amplify_auth_cognito_dart/CHANGELOG.md ++## 0.11.4 ++ ++### Features ++- feat: test ++ +diff --git a/packages/auth/amplify_auth_cognito_dart/pubspec.yaml b/packages/auth/amplify_auth_cognito_dart/pubspec.yaml +-version: 0.11.3 ++version: 0.11.4 diff --git a/packages/aft/test/version_bump/data/snapshots/single_dart_package_fix.diff b/packages/aft/test/version_bump/data/snapshots/single_dart_package_fix.diff new file mode 100644 index 0000000000..843181d297 --- /dev/null +++ b/packages/aft/test/version_bump/data/snapshots/single_dart_package_fix.diff @@ -0,0 +1,9 @@ +diff --git a/packages/auth/amplify_auth_cognito_dart/CHANGELOG.md b/packages/auth/amplify_auth_cognito_dart/CHANGELOG.md ++## 0.11.4 ++ ++### Fixes ++- fix: test ++ +diff --git a/packages/auth/amplify_auth_cognito_dart/pubspec.yaml b/packages/auth/amplify_auth_cognito_dart/pubspec.yaml +-version: 0.11.3 ++version: 0.11.4 diff --git a/packages/aft/test/version_bump/data/snapshots/single_package_breaking.diff b/packages/aft/test/version_bump/data/snapshots/single_package_breaking.diff new file mode 100644 index 0000000000..afba779cd0 --- /dev/null +++ b/packages/aft/test/version_bump/data/snapshots/single_package_breaking.diff @@ -0,0 +1,212 @@ +diff --git a/packages/amplify/amplify_flutter/CHANGELOG.md b/packages/amplify/amplify_flutter/CHANGELOG.md ++## 3.0.0 ++ ++### Breaking Changes ++- feat!: test ++ +diff --git a/packages/amplify/amplify_flutter/pubspec.yaml b/packages/amplify/amplify_flutter/pubspec.yaml +-version: 2.3.0 ++version: 3.0.0 +- amplify_core: ">=2.3.0 <2.4.0" ++ amplify_core: ">=3.0.0 <3.1.0" +diff --git a/packages/amplify_core/CHANGELOG.md b/packages/amplify_core/CHANGELOG.md ++## 3.0.0 ++ ++- Minor bug fixes and improvements ++ +diff --git a/packages/amplify_core/pubspec.yaml b/packages/amplify_core/pubspec.yaml +-version: 2.3.0 ++version: 3.0.0 +diff --git a/packages/amplify_datastore/CHANGELOG.md b/packages/amplify_datastore/CHANGELOG.md ++## 3.0.0 ++ ++- Minor bug fixes and improvements ++ +diff --git a/packages/amplify_datastore/pubspec.yaml b/packages/amplify_datastore/pubspec.yaml +-version: 2.3.0 ++version: 3.0.0 +- amplify_datastore_plugin_interface: ">=2.3.0 <2.4.0" +- amplify_core: ">=2.3.0 <2.4.0" ++ amplify_datastore_plugin_interface: ">=3.0.0 <3.1.0" ++ amplify_core: ">=3.0.0 <3.1.0" +diff --git a/packages/amplify_datastore_plugin_interface/CHANGELOG.md b/packages/amplify_datastore_plugin_interface/CHANGELOG.md ++## 3.0.0 ++ ++- Minor bug fixes and improvements ++ +diff --git a/packages/amplify_datastore_plugin_interface/pubspec.yaml b/packages/amplify_datastore_plugin_interface/pubspec.yaml +-version: 2.3.0 ++version: 3.0.0 +- amplify_core: ">=2.3.0 <2.4.0" ++ amplify_core: ">=3.0.0 <3.1.0" +diff --git a/packages/analytics/amplify_analytics_pinpoint/CHANGELOG.md b/packages/analytics/amplify_analytics_pinpoint/CHANGELOG.md ++## 3.0.0 ++ ++- Minor bug fixes and improvements ++ +diff --git a/packages/analytics/amplify_analytics_pinpoint/pubspec.yaml b/packages/analytics/amplify_analytics_pinpoint/pubspec.yaml +-version: 2.3.0 ++version: 3.0.0 +- amplify_analytics_pinpoint_dart: ">=0.4.3 <0.5.0" +- amplify_core: ">=2.3.0 <2.4.0" +- amplify_db_common: ">=0.4.3 <0.5.0" ++ amplify_analytics_pinpoint_dart: ">=0.4.4 <0.5.0" ++ amplify_core: ">=3.0.0 <3.1.0" ++ amplify_db_common: ">=0.4.4 <0.5.0" +diff --git a/packages/analytics/amplify_analytics_pinpoint_dart/CHANGELOG.md b/packages/analytics/amplify_analytics_pinpoint_dart/CHANGELOG.md ++## 0.4.4 ++ ++- Minor bug fixes and improvements ++ +diff --git a/packages/analytics/amplify_analytics_pinpoint_dart/pubspec.yaml b/packages/analytics/amplify_analytics_pinpoint_dart/pubspec.yaml +-version: 0.4.3 ++version: 0.4.4 +- amplify_core: ">=2.3.0 <2.4.0" +- amplify_db_common_dart: ">=0.4.4 <0.5.0" ++ amplify_core: ">=3.0.0 <3.1.0" ++ amplify_db_common_dart: ">=0.4.5 <0.5.0" +diff --git a/packages/api/amplify_api/CHANGELOG.md b/packages/api/amplify_api/CHANGELOG.md ++## 3.0.0 ++ ++- Minor bug fixes and improvements ++ +diff --git a/packages/api/amplify_api/pubspec.yaml b/packages/api/amplify_api/pubspec.yaml +-version: 2.3.0 ++version: 3.0.0 +- amplify_api_dart: ">=0.5.3 <0.6.0" +- amplify_core: ">=2.3.0 <2.4.0" +- amplify_flutter: ">=2.3.0 <2.4.0" ++ amplify_api_dart: ">=0.5.4 <0.6.0" ++ amplify_core: ">=3.0.0 <3.1.0" ++ amplify_flutter: ">=3.0.0 <3.1.0" +diff --git a/packages/api/amplify_api_dart/CHANGELOG.md b/packages/api/amplify_api_dart/CHANGELOG.md ++## 0.5.4 ++ ++- Minor bug fixes and improvements ++ +diff --git a/packages/api/amplify_api_dart/pubspec.yaml b/packages/api/amplify_api_dart/pubspec.yaml +-version: 0.5.3 ++version: 0.5.4 +- amplify_core: ">=2.3.0 <2.4.0" ++ amplify_core: ">=3.0.0 <3.1.0" +diff --git a/packages/auth/amplify_auth_cognito/CHANGELOG.md b/packages/auth/amplify_auth_cognito/CHANGELOG.md ++## 3.0.0 ++ ++### Breaking Changes ++- feat!: test ++ +diff --git a/packages/auth/amplify_auth_cognito/pubspec.yaml b/packages/auth/amplify_auth_cognito/pubspec.yaml +-version: 2.3.0 ++version: 3.0.0 +- amplify_analytics_pinpoint: ">=2.3.0 <2.4.0" +- amplify_analytics_pinpoint_dart: ">=0.4.3 <0.5.0" +- amplify_auth_cognito_dart: ">=0.11.3 <0.12.0" +- amplify_core: ">=2.3.0 <2.4.0" +- amplify_flutter: ">=2.3.0 <2.4.0" ++ amplify_analytics_pinpoint: ">=3.0.0 <3.1.0" ++ amplify_analytics_pinpoint_dart: ">=0.4.4 <0.5.0" ++ amplify_auth_cognito_dart: ">=0.11.4 <0.12.0" ++ amplify_core: ">=3.0.0 <3.1.0" ++ amplify_flutter: ">=3.0.0 <3.1.0" +diff --git a/packages/auth/amplify_auth_cognito_dart/CHANGELOG.md b/packages/auth/amplify_auth_cognito_dart/CHANGELOG.md ++## 0.11.4 ++ ++- Minor bug fixes and improvements ++ +diff --git a/packages/auth/amplify_auth_cognito_dart/pubspec.yaml b/packages/auth/amplify_auth_cognito_dart/pubspec.yaml +-version: 0.11.3 ++version: 0.11.4 +- amplify_analytics_pinpoint_dart: ">=0.4.3 <0.5.0" +- amplify_core: ">=2.3.0 <2.4.0" ++ amplify_analytics_pinpoint_dart: ">=0.4.4 <0.5.0" ++ amplify_core: ">=3.0.0 <3.1.0" +diff --git a/packages/authenticator/amplify_authenticator/CHANGELOG.md b/packages/authenticator/amplify_authenticator/CHANGELOG.md ++## 2.1.2 ++ ++- Minor bug fixes and improvements ++ +diff --git a/packages/authenticator/amplify_authenticator/pubspec.yaml b/packages/authenticator/amplify_authenticator/pubspec.yaml +-version: 2.1.1 ++version: 2.1.2 +- amplify_auth_cognito: ">=2.3.0 <2.4.0" +- amplify_core: ">=2.3.0 <2.4.0" +- amplify_flutter: ">=2.3.0 <2.4.0" ++ amplify_auth_cognito: ">=3.0.0 <3.1.0" ++ amplify_core: ">=3.0.0 <3.1.0" ++ amplify_flutter: ">=3.0.0 <3.1.0" +diff --git a/packages/common/amplify_db_common/CHANGELOG.md b/packages/common/amplify_db_common/CHANGELOG.md ++## 0.4.4 ++ ++- Minor bug fixes and improvements ++ +diff --git a/packages/common/amplify_db_common/pubspec.yaml b/packages/common/amplify_db_common/pubspec.yaml +-version: 0.4.3 ++version: 0.4.4 +- amplify_db_common_dart: ">=0.4.4 <0.5.0" ++ amplify_db_common_dart: ">=0.4.5 <0.5.0" +diff --git a/packages/common/amplify_db_common_dart/CHANGELOG.md b/packages/common/amplify_db_common_dart/CHANGELOG.md ++## 0.4.5 ++ ++- Minor bug fixes and improvements ++ +diff --git a/packages/common/amplify_db_common_dart/pubspec.yaml b/packages/common/amplify_db_common_dart/pubspec.yaml +-version: 0.4.4 ++version: 0.4.5 +- amplify_core: ">=2.3.0 <2.4.0" ++ amplify_core: ">=3.0.0 <3.1.0" +diff --git a/packages/notifications/push/amplify_push_notifications/CHANGELOG.md b/packages/notifications/push/amplify_push_notifications/CHANGELOG.md ++## 3.0.0 ++ ++- Minor bug fixes and improvements ++ +diff --git a/packages/notifications/push/amplify_push_notifications/pubspec.yaml b/packages/notifications/push/amplify_push_notifications/pubspec.yaml +-version: 2.3.0 ++version: 3.0.0 +- amplify_core: ">=2.3.0 <2.4.0" ++ amplify_core: ">=3.0.0 <3.1.0" +diff --git a/packages/notifications/push/amplify_push_notifications_pinpoint/CHANGELOG.md b/packages/notifications/push/amplify_push_notifications_pinpoint/CHANGELOG.md ++## 3.0.0 ++ ++- Minor bug fixes and improvements ++ +diff --git a/packages/notifications/push/amplify_push_notifications_pinpoint/pubspec.yaml b/packages/notifications/push/amplify_push_notifications_pinpoint/pubspec.yaml +-version: 2.3.0 ++version: 3.0.0 +- amplify_analytics_pinpoint: ">=2.3.0 <2.4.0" +- amplify_analytics_pinpoint_dart: ">=0.4.3 <0.5.0" +- amplify_auth_cognito: ">=2.3.0 <2.4.0" +- amplify_core: ">=2.3.0 <2.4.0" +- amplify_flutter: ">=2.3.0 <2.4.0" +- amplify_push_notifications: ">=2.3.0 <2.4.0" ++ amplify_analytics_pinpoint: ">=3.0.0 <3.1.0" ++ amplify_analytics_pinpoint_dart: ">=0.4.4 <0.5.0" ++ amplify_auth_cognito: ">=3.0.0 <3.1.0" ++ amplify_core: ">=3.0.0 <3.1.0" ++ amplify_flutter: ">=3.0.0 <3.1.0" ++ amplify_push_notifications: ">=3.0.0 <3.1.0" +diff --git a/packages/storage/amplify_storage_s3/CHANGELOG.md b/packages/storage/amplify_storage_s3/CHANGELOG.md ++## 3.0.0 ++ ++- Minor bug fixes and improvements ++ +diff --git a/packages/storage/amplify_storage_s3/pubspec.yaml b/packages/storage/amplify_storage_s3/pubspec.yaml +-version: 2.3.0 ++version: 3.0.0 +- amplify_core: ">=2.3.0 <2.4.0" +- amplify_db_common: ">=0.4.3 <0.5.0" +- amplify_storage_s3_dart: ">=0.4.3 <0.5.0" ++ amplify_core: ">=3.0.0 <3.1.0" ++ amplify_db_common: ">=0.4.4 <0.5.0" ++ amplify_storage_s3_dart: ">=0.4.4 <0.5.0" +diff --git a/packages/storage/amplify_storage_s3_dart/CHANGELOG.md b/packages/storage/amplify_storage_s3_dart/CHANGELOG.md ++## 0.4.4 ++ ++- Minor bug fixes and improvements ++ +diff --git a/packages/storage/amplify_storage_s3_dart/pubspec.yaml b/packages/storage/amplify_storage_s3_dart/pubspec.yaml +-version: 0.4.3 ++version: 0.4.4 +- amplify_core: ">=2.3.0 <2.4.0" +- amplify_db_common_dart: ">=0.4.4 <0.5.0" ++ amplify_core: ">=3.0.0 <3.1.0" ++ amplify_db_common_dart: ">=0.4.5 <0.5.0" diff --git a/packages/aft/test/version_bump/data/snapshots/single_package_chore.diff b/packages/aft/test/version_bump/data/snapshots/single_package_chore.diff new file mode 100644 index 0000000000..18846755c9 --- /dev/null +++ b/packages/aft/test/version_bump/data/snapshots/single_package_chore.diff @@ -0,0 +1,8 @@ +diff --git a/packages/auth/amplify_auth_cognito/CHANGELOG.md b/packages/auth/amplify_auth_cognito/CHANGELOG.md ++## 2.3.1 ++ ++- Minor bug fixes and improvements ++ +diff --git a/packages/auth/amplify_auth_cognito/pubspec.yaml b/packages/auth/amplify_auth_cognito/pubspec.yaml +-version: 2.3.0 ++version: 2.3.1 diff --git a/packages/aft/test/version_bump/data/snapshots/single_package_feat.diff b/packages/aft/test/version_bump/data/snapshots/single_package_feat.diff new file mode 100644 index 0000000000..022aea4b17 --- /dev/null +++ b/packages/aft/test/version_bump/data/snapshots/single_package_feat.diff @@ -0,0 +1,138 @@ +diff --git a/packages/amplify/amplify_flutter/CHANGELOG.md b/packages/amplify/amplify_flutter/CHANGELOG.md ++## 2.4.0 ++ ++### Features ++- feat: test ++ +diff --git a/packages/amplify/amplify_flutter/pubspec.yaml b/packages/amplify/amplify_flutter/pubspec.yaml +-version: 2.3.0 ++version: 2.4.0 +- amplify_core: ">=2.3.0 <2.4.0" ++ amplify_core: ">=2.4.0 <2.5.0" +diff --git a/packages/amplify_core/CHANGELOG.md b/packages/amplify_core/CHANGELOG.md ++## 2.4.0 ++ ++- Minor bug fixes and improvements ++ +diff --git a/packages/amplify_core/pubspec.yaml b/packages/amplify_core/pubspec.yaml +-version: 2.3.0 ++version: 2.4.0 +diff --git a/packages/amplify_datastore/CHANGELOG.md b/packages/amplify_datastore/CHANGELOG.md ++## 2.4.0 ++ ++- Minor bug fixes and improvements ++ +diff --git a/packages/amplify_datastore/pubspec.yaml b/packages/amplify_datastore/pubspec.yaml +-version: 2.3.0 ++version: 2.4.0 +- amplify_datastore_plugin_interface: ">=2.3.0 <2.4.0" +- amplify_core: ">=2.3.0 <2.4.0" ++ amplify_datastore_plugin_interface: ">=2.4.0 <2.5.0" ++ amplify_core: ">=2.4.0 <2.5.0" +diff --git a/packages/amplify_datastore_plugin_interface/CHANGELOG.md b/packages/amplify_datastore_plugin_interface/CHANGELOG.md ++## 2.4.0 ++ ++- Minor bug fixes and improvements ++ +diff --git a/packages/amplify_datastore_plugin_interface/pubspec.yaml b/packages/amplify_datastore_plugin_interface/pubspec.yaml +-version: 2.3.0 ++version: 2.4.0 +- amplify_core: ">=2.3.0 <2.4.0" ++ amplify_core: ">=2.4.0 <2.5.0" +diff --git a/packages/analytics/amplify_analytics_pinpoint/CHANGELOG.md b/packages/analytics/amplify_analytics_pinpoint/CHANGELOG.md ++## 2.4.0 ++ ++- Minor bug fixes and improvements ++ +diff --git a/packages/analytics/amplify_analytics_pinpoint/pubspec.yaml b/packages/analytics/amplify_analytics_pinpoint/pubspec.yaml +-version: 2.3.0 ++version: 2.4.0 +- amplify_core: ">=2.3.0 <2.4.0" ++ amplify_core: ">=2.4.0 <2.5.0" +diff --git a/packages/analytics/amplify_analytics_pinpoint_dart/pubspec.yaml b/packages/analytics/amplify_analytics_pinpoint_dart/pubspec.yaml +- amplify_core: ">=2.3.0 <2.4.0" ++ amplify_core: ">=2.4.0 <2.5.0" +diff --git a/packages/api/amplify_api/CHANGELOG.md b/packages/api/amplify_api/CHANGELOG.md ++## 2.4.0 ++ ++- Minor bug fixes and improvements ++ +diff --git a/packages/api/amplify_api/pubspec.yaml b/packages/api/amplify_api/pubspec.yaml +-version: 2.3.0 ++version: 2.4.0 +- amplify_core: ">=2.3.0 <2.4.0" +- amplify_flutter: ">=2.3.0 <2.4.0" ++ amplify_core: ">=2.4.0 <2.5.0" ++ amplify_flutter: ">=2.4.0 <2.5.0" +diff --git a/packages/api/amplify_api_dart/pubspec.yaml b/packages/api/amplify_api_dart/pubspec.yaml +- amplify_core: ">=2.3.0 <2.4.0" ++ amplify_core: ">=2.4.0 <2.5.0" +diff --git a/packages/auth/amplify_auth_cognito/CHANGELOG.md b/packages/auth/amplify_auth_cognito/CHANGELOG.md ++## 2.4.0 ++ ++### Features ++- feat: test ++ +diff --git a/packages/auth/amplify_auth_cognito/pubspec.yaml b/packages/auth/amplify_auth_cognito/pubspec.yaml +-version: 2.3.0 ++version: 2.4.0 +- amplify_analytics_pinpoint: ">=2.3.0 <2.4.0" ++ amplify_analytics_pinpoint: ">=2.4.0 <2.5.0" +- amplify_core: ">=2.3.0 <2.4.0" +- amplify_flutter: ">=2.3.0 <2.4.0" ++ amplify_core: ">=2.4.0 <2.5.0" ++ amplify_flutter: ">=2.4.0 <2.5.0" +diff --git a/packages/auth/amplify_auth_cognito_dart/pubspec.yaml b/packages/auth/amplify_auth_cognito_dart/pubspec.yaml +- amplify_core: ">=2.3.0 <2.4.0" ++ amplify_core: ">=2.4.0 <2.5.0" +diff --git a/packages/authenticator/amplify_authenticator/pubspec.yaml b/packages/authenticator/amplify_authenticator/pubspec.yaml +- amplify_auth_cognito: ">=2.3.0 <2.4.0" +- amplify_core: ">=2.3.0 <2.4.0" +- amplify_flutter: ">=2.3.0 <2.4.0" ++ amplify_auth_cognito: ">=2.4.0 <2.5.0" ++ amplify_core: ">=2.4.0 <2.5.0" ++ amplify_flutter: ">=2.4.0 <2.5.0" +diff --git a/packages/common/amplify_db_common_dart/pubspec.yaml b/packages/common/amplify_db_common_dart/pubspec.yaml +- amplify_core: ">=2.3.0 <2.4.0" ++ amplify_core: ">=2.4.0 <2.5.0" +diff --git a/packages/notifications/push/amplify_push_notifications/CHANGELOG.md b/packages/notifications/push/amplify_push_notifications/CHANGELOG.md ++## 2.4.0 ++ ++- Minor bug fixes and improvements ++ +diff --git a/packages/notifications/push/amplify_push_notifications/pubspec.yaml b/packages/notifications/push/amplify_push_notifications/pubspec.yaml +-version: 2.3.0 ++version: 2.4.0 +- amplify_core: ">=2.3.0 <2.4.0" ++ amplify_core: ">=2.4.0 <2.5.0" +diff --git a/packages/notifications/push/amplify_push_notifications_pinpoint/CHANGELOG.md b/packages/notifications/push/amplify_push_notifications_pinpoint/CHANGELOG.md ++## 2.4.0 ++ ++- Minor bug fixes and improvements ++ +diff --git a/packages/notifications/push/amplify_push_notifications_pinpoint/pubspec.yaml b/packages/notifications/push/amplify_push_notifications_pinpoint/pubspec.yaml +-version: 2.3.0 ++version: 2.4.0 +- amplify_analytics_pinpoint: ">=2.3.0 <2.4.0" ++ amplify_analytics_pinpoint: ">=2.4.0 <2.5.0" +- amplify_auth_cognito: ">=2.3.0 <2.4.0" +- amplify_core: ">=2.3.0 <2.4.0" +- amplify_flutter: ">=2.3.0 <2.4.0" +- amplify_push_notifications: ">=2.3.0 <2.4.0" ++ amplify_auth_cognito: ">=2.4.0 <2.5.0" ++ amplify_core: ">=2.4.0 <2.5.0" ++ amplify_flutter: ">=2.4.0 <2.5.0" ++ amplify_push_notifications: ">=2.4.0 <2.5.0" +diff --git a/packages/storage/amplify_storage_s3/CHANGELOG.md b/packages/storage/amplify_storage_s3/CHANGELOG.md ++## 2.4.0 ++ ++- Minor bug fixes and improvements ++ +diff --git a/packages/storage/amplify_storage_s3/pubspec.yaml b/packages/storage/amplify_storage_s3/pubspec.yaml +-version: 2.3.0 ++version: 2.4.0 +- amplify_core: ">=2.3.0 <2.4.0" ++ amplify_core: ">=2.4.0 <2.5.0" +diff --git a/packages/storage/amplify_storage_s3_dart/pubspec.yaml b/packages/storage/amplify_storage_s3_dart/pubspec.yaml +- amplify_core: ">=2.3.0 <2.4.0" ++ amplify_core: ">=2.4.0 <2.5.0" diff --git a/packages/aft/test/version_bump/data/snapshots/single_package_fix.diff b/packages/aft/test/version_bump/data/snapshots/single_package_fix.diff new file mode 100644 index 0000000000..ffddf3fe68 --- /dev/null +++ b/packages/aft/test/version_bump/data/snapshots/single_package_fix.diff @@ -0,0 +1,9 @@ +diff --git a/packages/auth/amplify_auth_cognito/CHANGELOG.md b/packages/auth/amplify_auth_cognito/CHANGELOG.md ++## 2.3.1 ++ ++### Fixes ++- fix: test ++ +diff --git a/packages/auth/amplify_auth_cognito/pubspec.yaml b/packages/auth/amplify_auth_cognito/pubspec.yaml +-version: 2.3.0 ++version: 2.3.1 diff --git a/packages/aft/test/version_bump/version_bump_test.dart b/packages/aft/test/version_bump/version_bump_test.dart new file mode 100644 index 0000000000..2682463b0a --- /dev/null +++ b/packages/aft/test/version_bump/version_bump_test.dart @@ -0,0 +1,226 @@ +// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + +// ignore_for_file: overridden_fields + +import 'dart:io'; + +import 'package:aft/src/command_runner.dart'; +import 'package:aft/src/config/config_loader.dart'; +import 'package:aft/src/repo.dart'; +import 'package:aws_common/aws_common.dart'; +import 'package:git/git.dart'; +import 'package:path/path.dart' as p; +import 'package:test/test.dart'; + +final logger = AWSLogger().createChild('Version Bump'); + +const tests = { + 'single_package_chore': [ + Change( + title: 'chore: test', + packages: ['amplify_auth_cognito'], + ), + ], + 'single_package_fix': [ + Change( + title: 'fix: test', + packages: ['amplify_auth_cognito'], + ), + ], + 'single_package_feat': [ + Change( + title: 'feat: test', + packages: ['amplify_auth_cognito'], + ), + ], + 'single_package_breaking': [ + Change( + title: 'feat!: test', + packages: ['amplify_auth_cognito'], + ), + ], + 'single_dart_package_chore': [ + Change( + title: 'chore: test', + packages: ['amplify_auth_cognito_dart'], + ), + ], + 'single_dart_package_fix': [ + Change( + title: 'fix: test', + packages: ['amplify_auth_cognito_dart'], + ), + ], + 'single_dart_package_feat': [ + Change( + title: 'feat: test', + packages: ['amplify_auth_cognito_dart'], + ), + ], + 'single_dart_package_breaking': [ + Change( + title: 'feat!: test', + packages: ['amplify_auth_cognito_dart'], + ), + ], + 'aws_common_fix': [ + Change( + title: 'fix: test', + packages: ['aws_common'], + ), + ], + 'multi_package_update': [ + Change( + title: 'chore: test secure storage / auth chore', + packages: ['amplify_secure_storage', 'amplify_auth_cognito_dart'], + ), + Change( + title: 'fix: test auth fix', + packages: ['amplify_auth_cognito', 'amplify_auth_cognito_dart'], + ), + Change( + title: 'feat: test common feat', + packages: ['aws_common'], + ), + Change( + title: 'fix: test db common fix', + packages: ['amplify_db_common', 'amplify_db_common_dart'], + ), + Change( + title: 'feat: test core/auth feat', + packages: ['amplify_core', 'amplify_auth_cognito'], + ), + ], +}; + +// run `dart --define=generate-snapshots=true test ./test/version_bump/version_bump_test.dart --use-data-isolate-strategy` +// to regenerate snapshots +const generateSnapshots = bool.fromEnvironment('generate-snapshots'); + +void main() { + group('Version Bump', () { + final tempDirectoryPath = '/tmp/${uuid()}'; + final sourceDirectory = Directory('test/version_bump/data/repo_snapshot'); + + for (final t in tests.entries) { + final testName = t.key; + final changes = t.value; + final tempDirectory = Directory('$tempDirectoryPath/$testName'); + final diffFile = File('test/version_bump/data/snapshots/$testName.diff'); + group(testName, () { + late Repo repo; + late String baseRef; + + setUp(() async { + await copyDirectory(sourceDirectory, tempDirectory); + await GitDir.init( + tempDirectory.path, + allowContent: true, + initialBranch: 'main', + ); + repo = await Repo.open( + AftConfigLoader(workingDirectory: tempDirectory).load(), + ); + await runGit(repo, ['add', '.']); + await runGit(repo, ['commit', '-m', 'Initial commit\n']); + baseRef = await runGit(repo, ['rev-parse', 'HEAD']); + }); + + tearDown(() async { + if (generateSnapshots) { + final process = await repo.git.runCommand(['diff', '--unified=0']); + final diff = process.stdout as String; + await diffFile.writeAsString(processDiff(diff)); + } + await tempDirectory.delete(recursive: true); + }); + + test('should generate the expected diff', () async { + late String headRef; + for (final change in changes) { + headRef = await change.commit(repo); + } + + await run([ + 'version-bump', + '--directory', + (tempDirectory.path), + '--base-ref', + (baseRef), + '--head-ref', + (headRef), + '--skip-build-version', + ]); + + if (!generateSnapshots) { + final process = await repo.git.runCommand( + ['diff', '--unified=0'], + ); + final actual = processDiff(process.stdout as String); + final expected = await diffFile.readAsString(); + expect(actual, expected); + } + }); + }); + } + }); +} + +class Change { + const Change({ + required this.title, + required this.packages, + }); + + final String title; + final List packages; + + Future commit(Repo repo) async { + for (final package in packages) { + final newDir = Directory(repo[package].path).createTempSync(); + File(p.join(newDir.path, 'file.txt')).createSync(); + } + await runGit(repo, ['add', '.']); + await runGit(repo, [ + 'commit', + '-m', + '$title\n', + ]); + return runGit(repo, ['rev-parse', 'HEAD']); + } +} + +Future runGit(Repo repo, List args) async { + final result = await repo.git.runCommand(args); + final stdout = result.stdout as String; + logger.verbose('git ${args.join(' ')}:\n$stdout'); + return stdout.trim(); +} + +Future copyDirectory( + Directory source, + Directory destination, +) async { + for (final e in source.listSync(recursive: true)) { + if (!File(e.path).existsSync()) { + continue; + } + final path = e.path.replaceFirst(source.path, ''); + logger.verbose('copying to ${destination.path}/$path'); + final file = File('${destination.path}/$path'); + await file.create(recursive: true); + await file.writeAsString(await File(e.path).readAsString()); + } +} + +/// Removes non essential info from the diff +String processDiff(String input) { + return input + .split('\n') + .where((line) => !line.trimLeft().startsWith('index')) + .where((line) => !line.trimLeft().startsWith('---')) + .where((line) => !line.trimLeft().startsWith('+++')) + .where((line) => !line.trimLeft().startsWith('@@')) + .join('\n'); +} diff --git a/packages/aft/tool/repo_snapshot.sh b/packages/aft/tool/repo_snapshot.sh new file mode 100755 index 0000000000..b9f71c2c2f --- /dev/null +++ b/packages/aft/tool/repo_snapshot.sh @@ -0,0 +1,54 @@ +#!/bin/bash + +# This script copies the pubspec.yaml files and the content of *.md files up to the second H2 header from /packages to /test/snapshot. + +ROOT_DIR="../.." +PACKAGES_DIR="$ROOT_DIR/packages" +SNAPOSHOT_DIR="$PACKAGES_DIR/aft/test/version_bump/data/repo_snapshot" +DEST_DIR="$SNAPOSHOT_DIR/packages" + +# Create the destination directory if it doesn't exist +mkdir -p "$DEST_DIR" + +# Function to process markdown files +process_markdown() { + local input_file="$1" + local output_file="$2" + awk ' + BEGIN {count = 0; print_line = 1} + /^## / {count++} + { + if (count < 2 && print_line) { + print $0 > "'"$output_file"'" + } + } + count == 2 {print_line = 0} + ' "$input_file" +} + + +# Find pubspec.yaml and *.md files while skipping directories containing "example" or "test" +find "$PACKAGES_DIR" \( -name "pubspec.yaml" -o -name "CHANGELOG.md" \) | while read -r file; do + # Get the directory path of the file + DIR_PATH=$(dirname "$file") + # Skip directories containing "example", "test", "goldens", "doc", or "aft" + if [[ "$DIR_PATH" == *example* || "$DIR_PATH" == *test* || "$DIR_PATH" == *goldens* || "$DIR_PATH" == *doc* || "$DIR_PATH" == *aft* ]]; then + continue + fi + # Get the relative path of the file + RELATIVE_PATH="${file#$PACKAGES_DIR/}" + # Create the directory in the destination if it doesn't exist + mkdir -p "$DEST_DIR/$(dirname "$RELATIVE_PATH")" + + # Process the file based on its extension + if [[ "$file" == *.md ]]; then + process_markdown "$file" "$DEST_DIR/$RELATIVE_PATH" + else + # Copy non-markdown files as is + cp "$file" "$DEST_DIR/$RELATIVE_PATH" + fi +done + +cp "$ROOT_DIR/pubspec.yaml" "$SNAPOSHOT_DIR/pubspec.yaml" + +echo "Snapshot copy complete."