feat: upgrade wyatt_package_template
This commit is contained in:
parent
c00ebcdb4a
commit
0d2605717a
@ -17,7 +17,7 @@
|
|||||||
name: wyatt_app_template
|
name: wyatt_app_template
|
||||||
description: New app template for Wyatt Studio projects.
|
description: New app template for Wyatt Studio projects.
|
||||||
|
|
||||||
version: 0.2.0
|
version: 0.2.1
|
||||||
|
|
||||||
vars:
|
vars:
|
||||||
display_name:
|
display_name:
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
// Copyright (C) 2022 WYATT GROUP
|
// Copyright (C) 2023 WYATT GROUP
|
||||||
// Please see the AUTHORS file for details.
|
// Please see the AUTHORS file for details.
|
||||||
//
|
//
|
||||||
// This program is free software: you can redistribute it and/or modify
|
// This program is free software: you can redistribute it and/or modify
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
{
|
{
|
||||||
|
"dart.runPubGetOnPubspecChanges": "never",
|
||||||
"bloc.newCubitTemplate.type": "equatable",
|
"bloc.newCubitTemplate.type": "equatable",
|
||||||
"psi-header.config": {
|
"psi-header.config": {
|
||||||
"blankLinesAfter": 0,
|
"blankLinesAfter": 0,
|
||||||
|
@ -2,9 +2,9 @@ include: package:wyatt_analysis/analysis_options.flutter.yaml
|
|||||||
|
|
||||||
analyzer:
|
analyzer:
|
||||||
plugins:
|
plugins:
|
||||||
- dart_code_metrics
|
- dart_code_linter
|
||||||
|
|
||||||
dart_code_metrics:
|
dart_code_linter:
|
||||||
anti-patterns:
|
anti-patterns:
|
||||||
- long-method
|
- long-method
|
||||||
- long-parameter-list
|
- long-parameter-list
|
||||||
|
@ -45,17 +45,14 @@ dependencies:
|
|||||||
|
|
||||||
dev_dependencies:
|
dev_dependencies:
|
||||||
build_runner: ^2.4.6
|
build_runner: ^2.4.6
|
||||||
dart_code_metrics:
|
dart_code_linter: ^1.1.1
|
||||||
git:
|
|
||||||
url: ssh://git@git.wyatt-studio.fr:993/Wyatt-FOSS/dart-code-metrics.git
|
|
||||||
ref: master
|
|
||||||
flutter_launcher_icons: ^0.13.1
|
flutter_launcher_icons: ^0.13.1
|
||||||
freezed: ^2.4.2
|
freezed: ^2.4.2
|
||||||
json_serializable: ^6.7.1
|
json_serializable: ^6.7.1
|
||||||
flutter_test:
|
flutter_test:
|
||||||
sdk: flutter
|
sdk: flutter
|
||||||
wyatt_analysis:
|
wyatt_analysis:
|
||||||
version: ^2.5.0
|
version: ^2.6.1
|
||||||
hosted:
|
hosted:
|
||||||
name: wyatt_analysis
|
name: wyatt_analysis
|
||||||
url: https://git.wyatt-studio.fr/api/packages/Wyatt-FOSS/pub/
|
url: https://git.wyatt-studio.fr/api/packages/Wyatt-FOSS/pub/
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
name: wyatt_package_template
|
name: wyatt_package_template
|
||||||
description: New package template for Wyatt Studio projects.
|
description: New package template for Wyatt Studio projects.
|
||||||
|
|
||||||
version: 0.2.0
|
version: 0.2.1
|
||||||
|
|
||||||
vars:
|
vars:
|
||||||
package_name:
|
package_name:
|
||||||
|
@ -35,5 +35,17 @@ void removeGitKeepFiles(String targetPath) {
|
|||||||
|
|
||||||
Future<void> run(HookContext context) async {
|
Future<void> run(HookContext context) async {
|
||||||
final workingDirectory = Directory.current.path;
|
final workingDirectory = Directory.current.path;
|
||||||
|
|
||||||
|
/// Remove .gitkeep files
|
||||||
|
print('Removing .gitkeep files');
|
||||||
removeGitKeepFiles(workingDirectory);
|
removeGitKeepFiles(workingDirectory);
|
||||||
|
|
||||||
|
/// dart pub get
|
||||||
|
print('Running `dart pub get`');
|
||||||
|
await Process.run('dart', ['pub', 'get'], runInShell: true);
|
||||||
|
|
||||||
|
/// dart format . --fix && dart fix . --apply
|
||||||
|
print('Running `dart format . --fix && dart fix . --apply`');
|
||||||
|
await Process.run('dart', ['format', '.', '--fix'], runInShell: true);
|
||||||
|
await Process.run('dart', ['fix', '.', '--apply'], runInShell: true);
|
||||||
}
|
}
|
||||||
|
@ -1,24 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright (C) 2022 WYATT GROUP
|
|
||||||
* Please see the AUTHORS file for details.
|
|
||||||
*
|
|
||||||
* This program is free software: you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU General Public License as published by
|
|
||||||
* the Free Software Foundation, either version 3 of the License, or
|
|
||||||
* any later version.
|
|
||||||
*
|
|
||||||
* This program is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
* GNU General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU General Public License
|
|
||||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
{
|
|
||||||
"recommendations": [
|
|
||||||
"psioniq.psi-header",
|
|
||||||
"blaugold.melos-code"
|
|
||||||
]
|
|
||||||
}
|
|
@ -7,17 +7,17 @@ include: package:wyatt_analysis/analysis_options.yaml
|
|||||||
|
|
||||||
analyzer:
|
analyzer:
|
||||||
plugins:
|
plugins:
|
||||||
- dart_code_metrics
|
- dart_code_linter
|
||||||
|
|
||||||
dart_code_metrics:
|
dart_code_linter:
|
||||||
anti-patterns:
|
anti-patterns:
|
||||||
- long-method
|
- long-method
|
||||||
- long-parameter-list
|
- long-parameter-list
|
||||||
metrics:
|
metrics:
|
||||||
cyclomatic-complexity: 20
|
cyclomatic-complexity: 20
|
||||||
maximum-nesting-level: 5
|
maximum-nesting-level: 5
|
||||||
number-of-parameters: 4
|
number-of-parameters: 10
|
||||||
source-lines-of-code: 50
|
source-lines-of-code: 400
|
||||||
metrics-exclude:
|
metrics-exclude:
|
||||||
- test/**
|
- test/**
|
||||||
rules:
|
rules:
|
||||||
|
@ -4,7 +4,7 @@ repository: https://git.wyatt-studio.fr/Wyatt-FOSS/wyatt-packages/src/branch/mas
|
|||||||
version: 1.0.0
|
version: 1.0.0
|
||||||
|
|
||||||
environment:
|
environment:
|
||||||
sdk: ">=2.19.0 <3.0.0"
|
sdk: ">=3.0.0 <4.0.0"
|
||||||
|
|
||||||
dependencies:
|
dependencies:
|
||||||
### {{#flutter}}
|
### {{#flutter}}
|
||||||
@ -16,13 +16,13 @@ dev_dependencies:
|
|||||||
### {{#flutter}}
|
### {{#flutter}}
|
||||||
### flutter_test: { sdk: flutter }
|
### flutter_test: { sdk: flutter }
|
||||||
### {{/flutter}}
|
### {{/flutter}}
|
||||||
dart_code_metrics: ^5.5.1
|
dart_code_linter: ^1.1.1
|
||||||
### {{^flutter}}
|
### {{^flutter}}
|
||||||
test: ^1.21.0
|
test: ^1.21.0
|
||||||
### {{/flutter}}
|
### {{/flutter}}
|
||||||
wyatt_analysis:
|
wyatt_analysis:
|
||||||
hosted: https://git.wyatt-studio.fr/api/packages/Wyatt-FOSS/pub
|
hosted: https://git.wyatt-studio.fr/api/packages/Wyatt-FOSS/pub
|
||||||
version: ^2.4.0
|
version: ^2.6.1
|
||||||
|
|
||||||
###{{#flutter}}
|
###{{#flutter}}
|
||||||
#### The following section is specific to Flutter.
|
#### The following section is specific to Flutter.
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
{
|
{
|
||||||
|
"dart.runPubGetOnPubspecChanges": "never",
|
||||||
"bloc.newCubitTemplate.type": "equatable",
|
"bloc.newCubitTemplate.type": "equatable",
|
||||||
"psi-header.config": {
|
"psi-header.config": {
|
||||||
"blankLinesAfter": 0,
|
"blankLinesAfter": 0,
|
||||||
|
@ -2,9 +2,9 @@ include: package:wyatt_analysis/analysis_options.flutter.yaml
|
|||||||
|
|
||||||
analyzer:
|
analyzer:
|
||||||
plugins:
|
plugins:
|
||||||
- dart_code_metrics
|
- dart_code_linter
|
||||||
|
|
||||||
dart_code_metrics:
|
dart_code_linter:
|
||||||
anti-patterns:
|
anti-patterns:
|
||||||
- long-method
|
- long-method
|
||||||
- long-parameter-list
|
- long-parameter-list
|
||||||
|
@ -45,17 +45,14 @@ dependencies:
|
|||||||
|
|
||||||
dev_dependencies:
|
dev_dependencies:
|
||||||
build_runner: ^2.4.6
|
build_runner: ^2.4.6
|
||||||
dart_code_metrics:
|
dart_code_linter: ^1.1.1
|
||||||
git:
|
|
||||||
url: ssh://git@git.wyatt-studio.fr:993/Wyatt-FOSS/dart-code-metrics.git
|
|
||||||
ref: master
|
|
||||||
flutter_launcher_icons: ^0.13.1
|
flutter_launcher_icons: ^0.13.1
|
||||||
freezed: ^2.4.2
|
freezed: ^2.4.2
|
||||||
json_serializable: ^6.7.1
|
json_serializable: ^6.7.1
|
||||||
flutter_test:
|
flutter_test:
|
||||||
sdk: flutter
|
sdk: flutter
|
||||||
wyatt_analysis:
|
wyatt_analysis:
|
||||||
version: ^2.5.0
|
version: ^2.6.1
|
||||||
hosted:
|
hosted:
|
||||||
name: wyatt_analysis
|
name: wyatt_analysis
|
||||||
url: https://git.wyatt-studio.fr/api/packages/Wyatt-FOSS/pub/
|
url: https://git.wyatt-studio.fr/api/packages/Wyatt-FOSS/pub/
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
name: wyatt_app_template
|
name: wyatt_app_template
|
||||||
description: New app template for Wyatt Studio projects.
|
description: New app template for Wyatt Studio projects.
|
||||||
|
|
||||||
version: 0.2.0
|
version: 0.2.1
|
||||||
|
|
||||||
vars:
|
vars:
|
||||||
display_name:
|
display_name:
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
// Copyright (C) 2022 WYATT GROUP
|
// Copyright (C) 2023 WYATT GROUP
|
||||||
// Please see the AUTHORS file for details.
|
// Please see the AUTHORS file for details.
|
||||||
//
|
//
|
||||||
// This program is free software: you can redistribute it and/or modify
|
// This program is free software: you can redistribute it and/or modify
|
||||||
|
@ -1,24 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright (C) 2022 WYATT GROUP
|
|
||||||
* Please see the AUTHORS file for details.
|
|
||||||
*
|
|
||||||
* This program is free software: you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU General Public License as published by
|
|
||||||
* the Free Software Foundation, either version 3 of the License, or
|
|
||||||
* any later version.
|
|
||||||
*
|
|
||||||
* This program is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
* GNU General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU General Public License
|
|
||||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
{
|
|
||||||
"recommendations": [
|
|
||||||
"psioniq.psi-header",
|
|
||||||
"blaugold.melos-code"
|
|
||||||
]
|
|
||||||
}
|
|
@ -11,17 +11,17 @@ include: package:wyatt_analysis/analysis_options.yaml
|
|||||||
|
|
||||||
analyzer:
|
analyzer:
|
||||||
plugins:
|
plugins:
|
||||||
- dart_code_metrics
|
- dart_code_linter
|
||||||
|
|
||||||
dart_code_metrics:
|
dart_code_linter:
|
||||||
anti-patterns:
|
anti-patterns:
|
||||||
- long-method
|
- long-method
|
||||||
- long-parameter-list
|
- long-parameter-list
|
||||||
metrics:
|
metrics:
|
||||||
cyclomatic-complexity: 20
|
cyclomatic-complexity: 20
|
||||||
maximum-nesting-level: 5
|
maximum-nesting-level: 5
|
||||||
number-of-parameters: 4
|
number-of-parameters: 10
|
||||||
source-lines-of-code: 50
|
source-lines-of-code: 400
|
||||||
metrics-exclude:
|
metrics-exclude:
|
||||||
- test/**
|
- test/**
|
||||||
rules:
|
rules:
|
||||||
|
@ -4,7 +4,7 @@ repository: https://git.wyatt-studio.fr/Wyatt-FOSS/wyatt-packages/src/branch/mas
|
|||||||
version: 1.0.0
|
version: 1.0.0
|
||||||
|
|
||||||
environment:
|
environment:
|
||||||
sdk: ">=2.19.0 <3.0.0"
|
sdk: ">=3.0.0 <4.0.0"
|
||||||
|
|
||||||
dependencies:
|
dependencies:
|
||||||
{{#flutter}}
|
{{#flutter}}
|
||||||
@ -20,7 +20,7 @@ dev_dependencies:
|
|||||||
|
|
||||||
{{/flutter}}
|
{{/flutter}}
|
||||||
|
|
||||||
dart_code_metrics: ^5.5.1
|
dart_code_linter: ^1.1.1
|
||||||
{{^flutter}}
|
{{^flutter}}
|
||||||
test: ^1.21.0
|
test: ^1.21.0
|
||||||
|
|
||||||
@ -28,7 +28,7 @@ dev_dependencies:
|
|||||||
|
|
||||||
wyatt_analysis:
|
wyatt_analysis:
|
||||||
hosted: https://git.wyatt-studio.fr/api/packages/Wyatt-FOSS/pub
|
hosted: https://git.wyatt-studio.fr/api/packages/Wyatt-FOSS/pub
|
||||||
version: ^2.4.0
|
version: ^2.6.1
|
||||||
|
|
||||||
{{#flutter}}
|
{{#flutter}}
|
||||||
# The following section is specific to Flutter.
|
# The following section is specific to Flutter.
|
||||||
@ -36,3 +36,4 @@ flutter:
|
|||||||
uses-material-design: true
|
uses-material-design: true
|
||||||
|
|
||||||
{{/flutter}}
|
{{/flutter}}
|
||||||
|
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
name: wyatt_package_template
|
name: wyatt_package_template
|
||||||
description: New package template for Wyatt Studio projects.
|
description: New package template for Wyatt Studio projects.
|
||||||
|
|
||||||
version: 0.2.0
|
version: 0.2.1
|
||||||
|
|
||||||
vars:
|
vars:
|
||||||
package_name:
|
package_name:
|
||||||
|
@ -35,5 +35,17 @@ void removeGitKeepFiles(String targetPath) {
|
|||||||
|
|
||||||
Future<void> run(HookContext context) async {
|
Future<void> run(HookContext context) async {
|
||||||
final workingDirectory = Directory.current.path;
|
final workingDirectory = Directory.current.path;
|
||||||
|
|
||||||
|
/// Remove .gitkeep files
|
||||||
|
print('Removing .gitkeep files');
|
||||||
removeGitKeepFiles(workingDirectory);
|
removeGitKeepFiles(workingDirectory);
|
||||||
|
|
||||||
|
/// dart pub get
|
||||||
|
print('Running `dart pub get`');
|
||||||
|
await Process.run('dart', ['pub', 'get'], runInShell: true);
|
||||||
|
|
||||||
|
/// dart format . --fix && dart fix . --apply
|
||||||
|
print('Running `dart format . --fix && dart fix . --apply`');
|
||||||
|
await Process.run('dart', ['format', '.', '--fix'], runInShell: true);
|
||||||
|
await Process.run('dart', ['fix', '.', '--apply'], runInShell: true);
|
||||||
}
|
}
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
#!/usr/bin/env sh
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
# Copyright (C) 2023 WYATT GROUP
|
# Copyright (C) 2023 WYATT GROUP
|
||||||
# Please see the AUTHORS file for details.
|
# Please see the AUTHORS file for details.
|
||||||
@ -16,16 +16,31 @@
|
|||||||
# You should have received a copy of the GNU General Public License
|
# You should have received a copy of the GNU General Public License
|
||||||
# along with this program. If not, see <https://www.gnu.org/licenses/>.
|
# along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
# This tool is used to build all bricks. Execute this script from the
|
# This tool is used to build all bricks.
|
||||||
# root of the project.
|
|
||||||
|
SCRIPT=$(readlink -f "$0")
|
||||||
|
SCRIPTPATH=$(dirname "$SCRIPT")
|
||||||
|
|
||||||
|
# Go to the brick generator directory
|
||||||
|
cd $SCRIPTPATH/brick_generator
|
||||||
|
|
||||||
|
# Build the brick generator
|
||||||
|
echo "🍺 Building brick generator"
|
||||||
|
dart pub get
|
||||||
|
mkdir -p ./build
|
||||||
|
dart compile exe ./bin/brickgen.dart -o ./build/brickgen
|
||||||
|
|
||||||
|
# Go to the root directory
|
||||||
|
cd $SCRIPTPATH/..
|
||||||
|
|
||||||
# List all folders in apps folder
|
# List all folders in apps folder
|
||||||
for d in ./apps/*/
|
app_lst=$(ls -d ./apps/* | cut -f3 -d'/')
|
||||||
do
|
|
||||||
|
# Build all bricks
|
||||||
|
for app in $app_lst; do
|
||||||
# Get the name of the folder
|
# Get the name of the folder
|
||||||
name=${d%*/}
|
name=$(basename $app)
|
||||||
name=${name##*/}
|
|
||||||
# Build the brick
|
|
||||||
echo "🍺 Building $name"
|
echo "🍺 Building $name"
|
||||||
dart ./tools/brick_generator/bin/brickgen.dart ./apps/$name/ ./bricks/
|
# Build the brick
|
||||||
|
./tools/brick_generator/build/brickgen ./apps/$name/ ./bricks/
|
||||||
done
|
done
|
||||||
|
Loading…
x
Reference in New Issue
Block a user