feat: upgrade wyatt_package_template

This commit is contained in:
Hugo Pointcheval 2023-11-14 16:36:55 +01:00
parent c00ebcdb4a
commit 0d2605717a
Signed by: hugo
GPG Key ID: 3AAC487E131E00BC
23 changed files with 113 additions and 125 deletions

View File

@ -17,7 +17,7 @@
name: wyatt_app_template
description: New app template for Wyatt Studio projects.
version: 0.2.0
version: 0.2.1
vars:
display_name:

View File

@ -1,4 +1,4 @@
// Copyright (C) 2022 WYATT GROUP
// Copyright (C) 2023 WYATT GROUP
// Please see the AUTHORS file for details.
//
// This program is free software: you can redistribute it and/or modify

View File

@ -1,15 +1,16 @@
{
"bloc.newCubitTemplate.type": "equatable",
"psi-header.config": {
"blankLinesAfter": 0,
"forceToTop": true,
},
"psi-header.templates": [
{
"language": "*",
"template": [
"Display Name Copyright (c) <<year>>"
]
}
],
}
"dart.runPubGetOnPubspecChanges": "never",
"bloc.newCubitTemplate.type": "equatable",
"psi-header.config": {
"blankLinesAfter": 0,
"forceToTop": true,
},
"psi-header.templates": [
{
"language": "*",
"template": [
"Display Name Copyright (c) <<year>>"
]
}
],
}

View File

@ -2,9 +2,9 @@ include: package:wyatt_analysis/analysis_options.flutter.yaml
analyzer:
plugins:
- dart_code_metrics
- dart_code_linter
dart_code_metrics:
dart_code_linter:
anti-patterns:
- long-method
- long-parameter-list

View File

@ -45,17 +45,14 @@ dependencies:
dev_dependencies:
build_runner: ^2.4.6
dart_code_metrics:
git:
url: ssh://git@git.wyatt-studio.fr:993/Wyatt-FOSS/dart-code-metrics.git
ref: master
dart_code_linter: ^1.1.1
flutter_launcher_icons: ^0.13.1
freezed: ^2.4.2
json_serializable: ^6.7.1
flutter_test:
sdk: flutter
wyatt_analysis:
version: ^2.5.0
version: ^2.6.1
hosted:
name: wyatt_analysis
url: https://git.wyatt-studio.fr/api/packages/Wyatt-FOSS/pub/

View File

@ -1,7 +1,7 @@
name: wyatt_package_template
description: New package template for Wyatt Studio projects.
version: 0.2.0
version: 0.2.1
vars:
package_name:

View File

@ -35,5 +35,17 @@ void removeGitKeepFiles(String targetPath) {
Future<void> run(HookContext context) async {
final workingDirectory = Directory.current.path;
/// Remove .gitkeep files
print('Removing .gitkeep files');
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);
}

View File

@ -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"
]
}

View File

@ -69,4 +69,4 @@
],
}
],
}
}

View File

@ -7,17 +7,17 @@ include: package:wyatt_analysis/analysis_options.yaml
analyzer:
plugins:
- dart_code_metrics
- dart_code_linter
dart_code_metrics:
dart_code_linter:
anti-patterns:
- long-method
- long-parameter-list
metrics:
cyclomatic-complexity: 20
maximum-nesting-level: 5
number-of-parameters: 4
source-lines-of-code: 50
number-of-parameters: 10
source-lines-of-code: 400
metrics-exclude:
- test/**
rules:

View File

@ -4,7 +4,7 @@ repository: https://git.wyatt-studio.fr/Wyatt-FOSS/wyatt-packages/src/branch/mas
version: 1.0.0
environment:
sdk: ">=2.19.0 <3.0.0"
sdk: ">=3.0.0 <4.0.0"
dependencies:
### {{#flutter}}
@ -16,16 +16,16 @@ dev_dependencies:
### {{#flutter}}
### flutter_test: { sdk: flutter }
### {{/flutter}}
dart_code_metrics: ^5.5.1
dart_code_linter: ^1.1.1
### {{^flutter}}
test: ^1.21.0
### {{/flutter}}
wyatt_analysis:
hosted: https://git.wyatt-studio.fr/api/packages/Wyatt-FOSS/pub
version: ^2.4.0
version: ^2.6.1
###{{#flutter}}
#### The following section is specific to Flutter.
###flutter:
### uses-material-design: true
###{{/flutter}}
###{{/flutter}}

View File

@ -1,15 +1,16 @@
{
"bloc.newCubitTemplate.type": "equatable",
"psi-header.config": {
"blankLinesAfter": 0,
"forceToTop": true,
},
"psi-header.templates": [
{
"language": "*",
"template": [
"{{#titleCase}}{{display_name}}{{/titleCase}} Copyright (c) <<year>>"
]
}
],
}
"dart.runPubGetOnPubspecChanges": "never",
"bloc.newCubitTemplate.type": "equatable",
"psi-header.config": {
"blankLinesAfter": 0,
"forceToTop": true,
},
"psi-header.templates": [
{
"language": "*",
"template": [
"{{#titleCase}}{{display_name}}{{/titleCase}} Copyright (c) <<year>>"
]
}
],
}

View File

@ -2,9 +2,9 @@ include: package:wyatt_analysis/analysis_options.flutter.yaml
analyzer:
plugins:
- dart_code_metrics
- dart_code_linter
dart_code_metrics:
dart_code_linter:
anti-patterns:
- long-method
- long-parameter-list

View File

@ -45,17 +45,14 @@ dependencies:
dev_dependencies:
build_runner: ^2.4.6
dart_code_metrics:
git:
url: ssh://git@git.wyatt-studio.fr:993/Wyatt-FOSS/dart-code-metrics.git
ref: master
dart_code_linter: ^1.1.1
flutter_launcher_icons: ^0.13.1
freezed: ^2.4.2
json_serializable: ^6.7.1
flutter_test:
sdk: flutter
wyatt_analysis:
version: ^2.5.0
version: ^2.6.1
hosted:
name: wyatt_analysis
url: https://git.wyatt-studio.fr/api/packages/Wyatt-FOSS/pub/

View File

@ -1,7 +1,7 @@
name: wyatt_app_template
description: New app template for Wyatt Studio projects.
version: 0.2.0
version: 0.2.1
vars:
display_name:

View File

@ -1,4 +1,4 @@
// Copyright (C) 2022 WYATT GROUP
// Copyright (C) 2023 WYATT GROUP
// Please see the AUTHORS file for details.
//
// This program is free software: you can redistribute it and/or modify

View File

@ -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"
]
}

View File

@ -69,4 +69,4 @@
],
}
],
}
}

View File

@ -11,17 +11,17 @@ include: package:wyatt_analysis/analysis_options.yaml
analyzer:
plugins:
- dart_code_metrics
- dart_code_linter
dart_code_metrics:
dart_code_linter:
anti-patterns:
- long-method
- long-parameter-list
metrics:
cyclomatic-complexity: 20
maximum-nesting-level: 5
number-of-parameters: 4
source-lines-of-code: 50
number-of-parameters: 10
source-lines-of-code: 400
metrics-exclude:
- test/**
rules:

View File

@ -4,7 +4,7 @@ repository: https://git.wyatt-studio.fr/Wyatt-FOSS/wyatt-packages/src/branch/mas
version: 1.0.0
environment:
sdk: ">=2.19.0 <3.0.0"
sdk: ">=3.0.0 <4.0.0"
dependencies:
{{#flutter}}
@ -20,7 +20,7 @@ dev_dependencies:
{{/flutter}}
dart_code_metrics: ^5.5.1
dart_code_linter: ^1.1.1
{{^flutter}}
test: ^1.21.0
@ -28,7 +28,7 @@ dev_dependencies:
wyatt_analysis:
hosted: https://git.wyatt-studio.fr/api/packages/Wyatt-FOSS/pub
version: ^2.4.0
version: ^2.6.1
{{#flutter}}
# The following section is specific to Flutter.
@ -36,3 +36,4 @@ flutter:
uses-material-design: true
{{/flutter}}

View File

@ -1,7 +1,7 @@
name: wyatt_package_template
description: New package template for Wyatt Studio projects.
version: 0.2.0
version: 0.2.1
vars:
package_name:

View File

@ -35,5 +35,17 @@ void removeGitKeepFiles(String targetPath) {
Future<void> run(HookContext context) async {
final workingDirectory = Directory.current.path;
/// Remove .gitkeep files
print('Removing .gitkeep files');
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);
}

View File

@ -1,31 +1,46 @@
#!/usr/bin/env sh
#!/usr/bin/env bash
# Copyright (C) 2023 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/>.
# This tool is used to build all bricks. Execute this script from the
# root of the project.
# This tool is used to build all bricks.
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
for d in ./apps/*/
do
app_lst=$(ls -d ./apps/* | cut -f3 -d'/')
# Build all bricks
for app in $app_lst; do
# Get the name of the folder
name=${d%*/}
name=${name##*/}
# Build the brick
name=$(basename $app)
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