From 66e091d20752a116757ea0a3b3aedf374e11c43f Mon Sep 17 00:00:00 2001 From: luongvo Date: Fri, 30 Dec 2022 10:05:05 +0000 Subject: [PATCH 1/5] Bump version to 1.4.0 --- .template/pubspec.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.template/pubspec.yaml b/.template/pubspec.yaml index 35c20a9f..e588cd2b 100644 --- a/.template/pubspec.yaml +++ b/.template/pubspec.yaml @@ -15,7 +15,7 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev # In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion. # Read more about iOS versioning at # https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html -version: 1.3.0+12 +version: 1.4.0+13 environment: sdk: ">=2.17.5 <3.0.0" From 66e29db83d22b01d21f1ba9a294f873f71620a49 Mon Sep 17 00:00:00 2001 From: "Luong Vo (Lucas)" Date: Fri, 30 Dec 2022 17:09:20 +0700 Subject: [PATCH 2/5] [Chore] Update PR templates --- .github/CODEOWNERS | 2 +- .github/PULL_REQUEST_TEMPLATE.md | 7 ++++++- .github/PULL_REQUEST_TEMPLATE/release_template.md | 12 ++++++------ 3 files changed, 13 insertions(+), 8 deletions(-) diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 0c80cf2b..986d168d 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -1,5 +1,5 @@ # Team -# @manh-t is the Team Lead +# @luongvo is the Team Lead * @manh-t @doannimble @luongvo @markgravity # Engineering Leads diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index bf553ce5..cebc58c5 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -1,4 +1,9 @@ -https://github.com/nimblehq/flutter_templates/issues/?? +Note: for a release PR, append this parameter `?template=release_template.md` to the current URL to apply the release PR +template, e.g. `{Github PR URL}?template=release_template.md` + +-- + +- Solves # ## What happened 👀 diff --git a/.github/PULL_REQUEST_TEMPLATE/release_template.md b/.github/PULL_REQUEST_TEMPLATE/release_template.md index 81bfc7c9..1f5e5ad6 100644 --- a/.github/PULL_REQUEST_TEMPLATE/release_template.md +++ b/.github/PULL_REQUEST_TEMPLATE/release_template.md @@ -1,15 +1,15 @@ -Link to the milestone on Github e.g. https://github.com/nimblehq/flutter_templates/milestone/41?closed=1 -or Link to the project management tool for the release +https://github.com/nimblehq/flutter_templates/milestone/? ## Features Provide the ID and title of the issue in the section for each type (feature, chore and bug). The link is optional. -- [#1] As a user, I can log in or -- [[#1](https://github.com/nimblehq/flutter_templates/issues/1)] As a user, I can log in +- # ## Chores -- Same structure as in ## Feature + +- # ## Bugs -- Same structure as in ## Feature + +- # From 9896064756084c7d747cece73b81790b89f30aa4 Mon Sep 17 00:00:00 2001 From: "Luong Vo (Lucas)" Date: Wed, 4 Jan 2023 21:30:13 +0700 Subject: [PATCH 3/5] [#137] Add CI steps to verify generated project by the script --- .github/workflows/test.yml | 20 ++++++++++++++++++++ .template/.github/workflows/test.yml | 2 +- 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 6565e67b..56c63b49 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -23,3 +23,23 @@ jobs: - name: Set new project run: make run PACKAGE_NAME=co.nimblehq.flutter.template PROJECT_NAME=flutter_templates APP_NAME="Flutter Templates" + + - uses: subosito/flutter-action@v1 + with: + channel: 'stable' # 'dev', 'alpha', default to: 'stable' + flutter-version: '3.3.10' + + - name: Get flutter dependencies. + run: flutter pub get + + - name: Run code generator + run: flutter packages pub run build_runner build --delete-conflicting-outputs + + - name: Check for any formatting issues in the code. + run: flutter format --set-exit-if-changed . + + - name: Statically analyze the Dart code for any errors. + run: flutter analyze . + + - name: Run widget tests, unit tests. + run: flutter test --machine --coverage diff --git a/.template/.github/workflows/test.yml b/.template/.github/workflows/test.yml index 9d4da733..05abca60 100644 --- a/.template/.github/workflows/test.yml +++ b/.template/.github/workflows/test.yml @@ -20,7 +20,7 @@ jobs: - uses: subosito/flutter-action@v1 with: channel: 'stable' # 'dev', 'alpha', default to: 'stable' - flutter-version: '2.10.3' + flutter-version: '3.3.10' - name: Get flutter dependencies. run: flutter pub get From cae40dbdcfde789ecee618c2689dbf1e3f2a56a3 Mon Sep 17 00:00:00 2001 From: "Luong Vo (Lucas)" Date: Wed, 4 Jan 2023 23:21:49 +0700 Subject: [PATCH 4/5] [#137] Add analysis-options exclusion config --- .template/analysis_options.yaml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.template/analysis_options.yaml b/.template/analysis_options.yaml index 61b6c4de..e8856d81 100644 --- a/.template/analysis_options.yaml +++ b/.template/analysis_options.yaml @@ -27,3 +27,10 @@ linter: # Additional information about this file can be found at # https://dart.dev/guides/language/analysis-options + +analyzer: + exclude: [ + lib/**.g.dart, + lib/**.freezed.dart, + test/**.mocks.dart + ] From a7b5be2ad32c59daf9947b72c399b81f0b99bebb Mon Sep 17 00:00:00 2001 From: Tran Manh Date: Fri, 13 Jan 2023 16:12:14 +0700 Subject: [PATCH 5/5] [#135] Remove type hinting in clean_up method and add try except block --- scripts/setup.py | 82 +++++++++++++++++++++++++----------------------- 1 file changed, 43 insertions(+), 39 deletions(-) diff --git a/scripts/setup.py b/scripts/setup.py index 20156395..b74eb8b0 100644 --- a/scripts/setup.py +++ b/scripts/setup.py @@ -391,7 +391,7 @@ def move_project_to_root(project): cur_dir = os.getcwd() shutil.copytree(project.project_path, cur_dir, copy_function=shutil.move, dirs_exist_ok=True) -def clean_up(files: list[str]): +def clean_up(files): cur_dir = os.getcwd() for file in files: file_path = cur_dir + os.sep + file @@ -402,41 +402,45 @@ def clean_up(files: list[str]): os.remove(file_path) if __name__ == "__main__": - args = handleParameters() - - project = Project( - args.project_path, - args.package_name, - args.app_name, - args.project_name, - args.app_version, - args.build_number - ) - validate_parameters(project) - - if os.environ.get("CI") != "true": - options = { - 'none': 'none', - 'kebab (kebab-case)': 'kebab', - 'snake (snake_case)': 'snake', - 'pascal (PascalCase)': 'pascal' - } - choice = enquiries.choose('Choose default json_serializable.field_rename: ', options.keys()) - project.json_serializable = JsonSerializable(options[choice]) - else: - # Skip enquiries on CI - project.json_serializable = JsonSerializable('snake') - - print(f"=> 🐢 Starting init {project.new_project_name} with {project.new_package}...") - android = Android(project) - android.run() - ios = Ios(project) - ios.run() - flutter = Flutter(project) - flutter.run() - print('🤖 Generating project...') - # Remove the `.github` folder to avoid redundant workflow - clean_up(['.github']) - move_project_to_root(project) - clean_up(['.template', 'LICENSE', 'Makefile']) - print("=> 🚀 Done! Project is ready for the next development 🙌") + try: + args = handleParameters() + + project = Project( + args.project_path, + args.package_name, + args.app_name, + args.project_name, + args.app_version, + args.build_number + ) + validate_parameters(project) + + if os.environ.get("CI") != "true": + options = { + 'none': 'none', + 'kebab (kebab-case)': 'kebab', + 'snake (snake_case)': 'snake', + 'pascal (PascalCase)': 'pascal' + } + choice = enquiries.choose('Choose default json_serializable.field_rename: ', options.keys()) + project.json_serializable = JsonSerializable(options[choice]) + else: + # Skip enquiries on CI + project.json_serializable = JsonSerializable('snake') + + print(f"=> 🐢 Starting init {project.new_project_name} with {project.new_package}...") + android = Android(project) + android.run() + ios = Ios(project) + ios.run() + flutter = Flutter(project) + flutter.run() + print('🤖 Generating project...') + # Remove the `.github` folder to avoid redundant workflow + clean_up(['.github']) + move_project_to_root(project) + clean_up(['.template', 'LICENSE', 'Makefile']) + print("=> 🚀 Done! Project is ready for the next development 🙌") + except: + print("❌ There is something wrong! Please try again.") + sys.exit()