diff --git a/apps/wyatt_clean_code/.vscode/settings.json b/apps/wyatt_clean_code/.vscode/settings.json index fa6f612..855293b 100644 --- a/apps/wyatt_clean_code/.vscode/settings.json +++ b/apps/wyatt_clean_code/.vscode/settings.json @@ -1,5 +1,4 @@ { - "dart.flutterSdkPath": ".fvm/flutter_sdk", "bloc.newCubitTemplate.type": "equatable", "psi-header.config": { "blankLinesAfter": 0, diff --git a/apps/wyatt_clean_code/lib/core/routes/router.dart b/apps/wyatt_clean_code/lib/core/routes/router.dart index ee99f64..d908c25 100644 --- a/apps/wyatt_clean_code/lib/core/routes/router.dart +++ b/apps/wyatt_clean_code/lib/core/routes/router.dart @@ -16,8 +16,8 @@ abstract class AppRouter { static final List routes = [ GoRoute( - path: '/', name: InitialPage.pageName, + path: '/', pageBuilder: (context, state) => defaultTransition( context, state, diff --git a/apps/wyatt_package_template/brickgen.yaml b/apps/wyatt_package_template/brickgen.yaml new file mode 100644 index 0000000..a952fd8 --- /dev/null +++ b/apps/wyatt_package_template/brickgen.yaml @@ -0,0 +1,48 @@ +name: wyatt_package_template +description: New package template for Wyatt Studio projects. + +version: 0.1.0 + +vars: + package_name: + compilable: package_name + type: string + description: The package name + default: package_name + prompt: "What is the package name?" + formats: + - snake_case + - title_case + - pascal_case + + description: + compilable: A short package description + type: string + description: A short package description + default: A package by Wyatt Studio. + prompt: "What is the package description?" + formats: + - sentence_case + + flutter: + type: boolean + description: Should generate a plugin (Flutter only) or a package (Dart and Flutter). + default: false + prompt: "Should generate Flutter only plugin ?" + +brickgen: + path_to_brickify: wyatt_package_template + hooks: true + ignore: + - .env + - .dart_tool/ + - .idea/ + - example/.dart_tool/ + - example/.idea/ + boolean_file_system: + flutter: + folders: + on_true: + - example/web + on_false: + - example/bin diff --git a/apps/wyatt_package_template/hooks/post_gen.dart b/apps/wyatt_package_template/hooks/post_gen.dart new file mode 100644 index 0000000..babd1b7 --- /dev/null +++ b/apps/wyatt_package_template/hooks/post_gen.dart @@ -0,0 +1,39 @@ +// 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 . + +import 'dart:io'; + +import 'package:mason/mason.dart'; + +void removeGitKeepFiles(String targetPath) { + if (!FileSystemEntity.isDirectorySync(targetPath)) { + throw ArgumentError('Target must be a directory', 'targetPath'); + } + + Directory(targetPath) + .listSync(recursive: true) + .whereType() + .forEach((file) { + if (file.path.contains('.gitkeep')) { + file.deleteSync(recursive: true); + } + }); +} + +Future run(HookContext context) async { + final workingDirectory = Directory.current.path; + removeGitKeepFiles(workingDirectory); +} diff --git a/apps/wyatt_package_template/hooks/pre_gen.dart b/apps/wyatt_package_template/hooks/pre_gen.dart new file mode 100644 index 0000000..ea2f0c7 --- /dev/null +++ b/apps/wyatt_package_template/hooks/pre_gen.dart @@ -0,0 +1,21 @@ +// 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 . + +import 'package:mason/mason.dart'; + +void run(HookContext context) { + context.vars = {...context.vars, 'year': DateTime.now().year.toString()}; +} \ No newline at end of file diff --git a/apps/wyatt_package_template/hooks/pubspec.yaml b/apps/wyatt_package_template/hooks/pubspec.yaml new file mode 100644 index 0000000..454f6df --- /dev/null +++ b/apps/wyatt_package_template/hooks/pubspec.yaml @@ -0,0 +1,7 @@ +name: hooks + +environment: + sdk: ">=2.18.0 <3.0.0" + +dependencies: + mason: any \ No newline at end of file diff --git a/apps/wyatt_package_template/wyatt_package_template/.gitignore b/apps/wyatt_package_template/wyatt_package_template/.gitignore new file mode 100644 index 0000000..3cceda5 --- /dev/null +++ b/apps/wyatt_package_template/wyatt_package_template/.gitignore @@ -0,0 +1,7 @@ +# https://dart.dev/guides/libraries/private-files +# Created by `dart pub` +.dart_tool/ + +# Avoid committing pubspec.lock for library packages; see +# https://dart.dev/guides/libraries/private-files#pubspeclock. +pubspec.lock diff --git a/apps/wyatt_package_template/wyatt_package_template/.vscode/extensions.json b/apps/wyatt_package_template/wyatt_package_template/.vscode/extensions.json new file mode 100644 index 0000000..30cd223 --- /dev/null +++ b/apps/wyatt_package_template/wyatt_package_template/.vscode/extensions.json @@ -0,0 +1,24 @@ +/* + * 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 . + */ + +{ + "recommendations": [ + "psioniq.psi-header", + "blaugold.melos-code" + ] +} \ No newline at end of file diff --git a/apps/wyatt_package_template/wyatt_package_template/.vscode/launch.json b/apps/wyatt_package_template/wyatt_package_template/.vscode/launch.json new file mode 100644 index 0000000..653eabc --- /dev/null +++ b/apps/wyatt_package_template/wyatt_package_template/.vscode/launch.json @@ -0,0 +1,34 @@ +/* + * 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 . + */ + +{ + // Use IntelliSense to learn about possible attributes. + // Hover to view descriptions of existing attributes. + // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 + "version": "0.2.0", + "configurations": [ + { + "name": "Launch Example", + "request": "launch", + "type": "dart", + "cwd": "example/", + "program": "lib/main.dart", + "flutterMode": "debug" + }, + ] +} \ No newline at end of file diff --git a/apps/wyatt_package_template/wyatt_package_template/.vscode/settings.json b/apps/wyatt_package_template/wyatt_package_template/.vscode/settings.json new file mode 100644 index 0000000..a729c46 --- /dev/null +++ b/apps/wyatt_package_template/wyatt_package_template/.vscode/settings.json @@ -0,0 +1,72 @@ +{ + "dart.runPubGetOnPubspecChanges": "never", + "bloc.newCubitTemplate.type": "equatable", + "psi-header.changes-tracking": { + "isActive": true + }, + "psi-header.config": { + "blankLinesAfter": 1, + "forceToTop": true + }, + "psi-header.lang-config": [ + { + "beforeHeader": [ + "# -*- coding:utf-8 -*-", + "#!/usr/bin/env python3" + ], + "begin": "###", + "end": "###", + "language": "python", + "prefix": "# " + }, + { + "beforeHeader": [ + "#!/usr/bin/env sh", + "" + ], + "language": "shellscript", + "begin": "", + "end": "", + "prefix": "# " + }, + { + "begin": "", + "end": "", + "language": "dart", + "prefix": "// " + }, + { + "begin": "", + "end": "", + "language": "yaml", + "prefix": "# " + }, + { + "begin": "", + "language": "markdown", + }, + ], + "psi-header.templates": [ + { + "language": "*", + "template": [ + "Copyright (C) <> 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 ." + ], + } + ], +} \ No newline at end of file diff --git a/apps/wyatt_package_template/wyatt_package_template/CHANGELOG.md b/apps/wyatt_package_template/wyatt_package_template/CHANGELOG.md new file mode 100644 index 0000000..effe43c --- /dev/null +++ b/apps/wyatt_package_template/wyatt_package_template/CHANGELOG.md @@ -0,0 +1,3 @@ +## 1.0.0 + +- Initial version. diff --git a/apps/wyatt_package_template/wyatt_package_template/README.md b/apps/wyatt_package_template/wyatt_package_template/README.md new file mode 100644 index 0000000..6576b4e --- /dev/null +++ b/apps/wyatt_package_template/wyatt_package_template/README.md @@ -0,0 +1,65 @@ + + +{{#flutter}} + +# Flutter - Package Name + +

+ Style: Wyatt Analysis + SDK: Flutter +

+ +{{/flutter}} + +{{^flutter}} + +# Dart - Package Name + +

+ Style: Wyatt Analysis + SDK: Dart & Flutter +

+ +{{/flutter}} + +A short package description + +## Features + +TODO: List what your package can do. Maybe include images, gifs, or videos. + +## Getting started + +TODO: List prerequisites and provide or point to information on how to +start using the package. + +## Usage + +TODO: Include short and useful examples for package users. Add longer examples +to `/example` folder. + +```dart +const like = 'sample'; +``` + +## Additional information + +TODO: Tell users more about the package: where to find more information, how to +contribute to the package, how to file issues, what response they can expect +from the package authors, and more. diff --git a/apps/wyatt_package_template/wyatt_package_template/analysis_options.yaml b/apps/wyatt_package_template/wyatt_package_template/analysis_options.yaml new file mode 100644 index 0000000..8773f69 --- /dev/null +++ b/apps/wyatt_package_template/wyatt_package_template/analysis_options.yaml @@ -0,0 +1,6 @@ +### {{#flutter}} +###include: package:wyatt_analysis/analysis_options.flutter.yaml +### {{/flutter}} +### {{^flutter}} +include: package:wyatt_analysis/analysis_options.yaml +### {{/flutter}} diff --git a/apps/wyatt_package_template/wyatt_package_template/example/.gitignore b/apps/wyatt_package_template/wyatt_package_template/example/.gitignore new file mode 100644 index 0000000..24476c5 --- /dev/null +++ b/apps/wyatt_package_template/wyatt_package_template/example/.gitignore @@ -0,0 +1,44 @@ +# Miscellaneous +*.class +*.log +*.pyc +*.swp +.DS_Store +.atom/ +.buildlog/ +.history +.svn/ +migrate_working_dir/ + +# IntelliJ related +*.iml +*.ipr +*.iws +.idea/ + +# The .vscode folder contains launch configuration and tasks you configure in +# VS Code which you may wish to be included in version control, so this line +# is commented out by default. +#.vscode/ + +# Flutter/Dart/Pub related +**/doc/api/ +**/ios/Flutter/.last_build_id +.dart_tool/ +.flutter-plugins +.flutter-plugins-dependencies +.packages +.pub-cache/ +.pub/ +/build/ + +# Symbolication related +app.*.symbols + +# Obfuscation related +app.*.map.json + +# Android Studio will place build artifacts here +/android/app/debug +/android/app/profile +/android/app/release diff --git a/apps/wyatt_package_template/wyatt_package_template/example/.metadata b/apps/wyatt_package_template/wyatt_package_template/example/.metadata new file mode 100644 index 0000000..30e0d3c --- /dev/null +++ b/apps/wyatt_package_template/wyatt_package_template/example/.metadata @@ -0,0 +1,30 @@ +# This file tracks properties of this Flutter project. +# Used by Flutter tool to assess capabilities and perform upgrades etc. +# +# This file should be version controlled. + +version: + revision: b06b8b2710955028a6b562f5aa6fe62941d6febf + channel: stable + +project_type: app + +# Tracks metadata for the flutter migrate command +migration: + platforms: + - platform: root + create_revision: b06b8b2710955028a6b562f5aa6fe62941d6febf + base_revision: b06b8b2710955028a6b562f5aa6fe62941d6febf + - platform: web + create_revision: b06b8b2710955028a6b562f5aa6fe62941d6febf + base_revision: b06b8b2710955028a6b562f5aa6fe62941d6febf + + # User provided section + + # List of Local paths (relative to this file) that should be + # ignored by the migrate tool. + # + # Files that are not part of the templates will be ignored by default. + unmanaged_files: + - 'lib/main.dart' + - 'ios/Runner.xcodeproj/project.pbxproj' diff --git a/apps/wyatt_package_template/wyatt_package_template/example/README.md b/apps/wyatt_package_template/wyatt_package_template/example/README.md new file mode 100644 index 0000000..2b3fce4 --- /dev/null +++ b/apps/wyatt_package_template/wyatt_package_template/example/README.md @@ -0,0 +1,16 @@ +# example + +A new Flutter project. + +## Getting Started + +This project is a starting point for a Flutter application. + +A few resources to get you started if this is your first Flutter project: + +- [Lab: Write your first Flutter app](https://docs.flutter.dev/get-started/codelab) +- [Cookbook: Useful Flutter samples](https://docs.flutter.dev/cookbook) + +For help getting started with Flutter development, view the +[online documentation](https://docs.flutter.dev/), which offers tutorials, +samples, guidance on mobile development, and a full API reference. diff --git a/apps/wyatt_package_template/wyatt_package_template/example/analysis_options.yaml b/apps/wyatt_package_template/wyatt_package_template/example/analysis_options.yaml new file mode 100644 index 0000000..8773f69 --- /dev/null +++ b/apps/wyatt_package_template/wyatt_package_template/example/analysis_options.yaml @@ -0,0 +1,6 @@ +### {{#flutter}} +###include: package:wyatt_analysis/analysis_options.flutter.yaml +### {{/flutter}} +### {{^flutter}} +include: package:wyatt_analysis/analysis_options.yaml +### {{/flutter}} diff --git a/apps/wyatt_package_template/wyatt_package_template/example/bin/package_name_example.dart b/apps/wyatt_package_template/wyatt_package_template/example/bin/package_name_example.dart new file mode 100644 index 0000000..de74ad7 --- /dev/null +++ b/apps/wyatt_package_template/wyatt_package_template/example/bin/package_name_example.dart @@ -0,0 +1,24 @@ +// Copyright (C) {{year}} 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 . + +import 'dart:io'; + +import 'package:package_name_example/main.dart'; + +void main(List args) { + PackageNameExample.run(args); + exit(0); +} diff --git a/apps/wyatt_package_template/wyatt_package_template/example/lib/main.dart b/apps/wyatt_package_template/wyatt_package_template/example/lib/main.dart new file mode 100644 index 0000000..0afee77 --- /dev/null +++ b/apps/wyatt_package_template/wyatt_package_template/example/lib/main.dart @@ -0,0 +1,56 @@ +// Copyright (C) {{year}} 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 . + +///{{#flutter}} +import 'package:flutter/material.dart'; + +///{{/flutter}} +import 'package:package_name/package_name.dart'; + +///{{^flutter}} +class PackageNameExample { + static void run(List args) { + print(PackageName.testString); + } +} + +///{{/flutter}} + +///{{#flutter}} +void main(List args) { + runApp(const App()); +} + +class App extends StatelessWidget { + const App({super.key}); + + static const String title = 'Package Name Example'; + + @override + Widget build(BuildContext context) => MaterialApp( + title: title, + theme: ThemeData( + primarySwatch: Colors.blue, + ), + home: Scaffold( + appBar: AppBar( + title: const Text(title), + ), + body: Center(child: Text(PackageName.testString)), + ), + ); +} +///{{/flutter}} diff --git a/apps/wyatt_package_template/wyatt_package_template/example/pubspec.yaml b/apps/wyatt_package_template/wyatt_package_template/example/pubspec.yaml new file mode 100644 index 0000000..a8d3f00 --- /dev/null +++ b/apps/wyatt_package_template/wyatt_package_template/example/pubspec.yaml @@ -0,0 +1,34 @@ +name: package_name_example +description: A new Flutter project. +version: 1.0.0 + +publish_to: 'none' + +environment: + sdk: ">=2.19.0 <3.0.0" + +dependencies: +### {{#flutter}} + flutter: { sdk: flutter } +### {{/flutter}} + + package_name: + path: "../" + +dev_dependencies: +### {{#flutter}} + flutter_test: { sdk: flutter } +### {{/flutter}} +### {{^flutter}} +### test: ^1.21.0 +### {{/flutter}} + + wyatt_analysis: + hosted: https://git.wyatt-studio.fr/api/packages/Wyatt-FOSS/pub + version: ^2.3.0 + +###{{#flutter}} +#### The following section is specific to Flutter. +###flutter: +### uses-material-design: true +###{{/flutter}} \ No newline at end of file diff --git a/apps/wyatt_package_template/wyatt_package_template/example/test/widget_test.dart b/apps/wyatt_package_template/wyatt_package_template/example/test/widget_test.dart new file mode 100644 index 0000000..e69de29 diff --git a/apps/wyatt_package_template/wyatt_package_template/example/web/favicon.png b/apps/wyatt_package_template/wyatt_package_template/example/web/favicon.png new file mode 100644 index 0000000..8aaa46a Binary files /dev/null and b/apps/wyatt_package_template/wyatt_package_template/example/web/favicon.png differ diff --git a/apps/wyatt_package_template/wyatt_package_template/example/web/icons/Icon-192.png b/apps/wyatt_package_template/wyatt_package_template/example/web/icons/Icon-192.png new file mode 100644 index 0000000..b749bfe Binary files /dev/null and b/apps/wyatt_package_template/wyatt_package_template/example/web/icons/Icon-192.png differ diff --git a/apps/wyatt_package_template/wyatt_package_template/example/web/icons/Icon-512.png b/apps/wyatt_package_template/wyatt_package_template/example/web/icons/Icon-512.png new file mode 100644 index 0000000..88cfd48 Binary files /dev/null and b/apps/wyatt_package_template/wyatt_package_template/example/web/icons/Icon-512.png differ diff --git a/apps/wyatt_package_template/wyatt_package_template/example/web/icons/Icon-maskable-192.png b/apps/wyatt_package_template/wyatt_package_template/example/web/icons/Icon-maskable-192.png new file mode 100644 index 0000000..eb9b4d7 Binary files /dev/null and b/apps/wyatt_package_template/wyatt_package_template/example/web/icons/Icon-maskable-192.png differ diff --git a/apps/wyatt_package_template/wyatt_package_template/example/web/icons/Icon-maskable-512.png b/apps/wyatt_package_template/wyatt_package_template/example/web/icons/Icon-maskable-512.png new file mode 100644 index 0000000..d69c566 Binary files /dev/null and b/apps/wyatt_package_template/wyatt_package_template/example/web/icons/Icon-maskable-512.png differ diff --git a/apps/wyatt_package_template/wyatt_package_template/example/web/index.html b/apps/wyatt_package_template/wyatt_package_template/example/web/index.html new file mode 100644 index 0000000..be820e8 --- /dev/null +++ b/apps/wyatt_package_template/wyatt_package_template/example/web/index.html @@ -0,0 +1,59 @@ + + + + + + + + + + + + + + + + + + + + example + + + + + + + + + + diff --git a/apps/wyatt_package_template/wyatt_package_template/example/web/manifest.json b/apps/wyatt_package_template/wyatt_package_template/example/web/manifest.json new file mode 100644 index 0000000..096edf8 --- /dev/null +++ b/apps/wyatt_package_template/wyatt_package_template/example/web/manifest.json @@ -0,0 +1,35 @@ +{ + "name": "example", + "short_name": "example", + "start_url": ".", + "display": "standalone", + "background_color": "#0175C2", + "theme_color": "#0175C2", + "description": "A new Flutter project.", + "orientation": "portrait-primary", + "prefer_related_applications": false, + "icons": [ + { + "src": "icons/Icon-192.png", + "sizes": "192x192", + "type": "image/png" + }, + { + "src": "icons/Icon-512.png", + "sizes": "512x512", + "type": "image/png" + }, + { + "src": "icons/Icon-maskable-192.png", + "sizes": "192x192", + "type": "image/png", + "purpose": "maskable" + }, + { + "src": "icons/Icon-maskable-512.png", + "sizes": "512x512", + "type": "image/png", + "purpose": "maskable" + } + ] +} diff --git a/apps/wyatt_package_template/wyatt_package_template/lib/package_name.dart b/apps/wyatt_package_template/wyatt_package_template/lib/package_name.dart new file mode 100644 index 0000000..3a091f9 --- /dev/null +++ b/apps/wyatt_package_template/wyatt_package_template/lib/package_name.dart @@ -0,0 +1,20 @@ +// Copyright (C) {{year}} 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 . + +/// A short package description +library package_name; + +export 'src/package_name.dart'; diff --git a/apps/wyatt_package_template/wyatt_package_template/lib/src/package_name.dart b/apps/wyatt_package_template/wyatt_package_template/lib/src/package_name.dart new file mode 100644 index 0000000..23b30c3 --- /dev/null +++ b/apps/wyatt_package_template/wyatt_package_template/lib/src/package_name.dart @@ -0,0 +1,19 @@ +// Copyright (C) {{year}} 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 . + +abstract class PackageName { + static String get testString => 'Package: Package Name'; +} diff --git a/apps/wyatt_package_template/wyatt_package_template/pubspec.yaml b/apps/wyatt_package_template/wyatt_package_template/pubspec.yaml new file mode 100644 index 0000000..f9f6e4a --- /dev/null +++ b/apps/wyatt_package_template/wyatt_package_template/pubspec.yaml @@ -0,0 +1,32 @@ +name: package_name +description: A short package description. +repository: https://git.wyatt-studio.fr/Wyatt-FOSS/wyatt-packages/src/branch/master/packages/package_name +version: 1.0.0 + +environment: + sdk: ">=2.19.0 <3.0.0" + +dependencies: +### {{#flutter}} +### flutter: { sdk: flutter } +### {{/flutter}} + path: ^1.8.0 + +dev_dependencies: +### {{#flutter}} +### flutter_test: { sdk: flutter } +### {{/flutter}} + +### {{^flutter}} + test: ^1.21.0 +### {{/flutter}} + + wyatt_analysis: + hosted: https://git.wyatt-studio.fr/api/packages/Wyatt-FOSS/pub + version: ^2.3.0 + +###{{#flutter}} +#### The following section is specific to Flutter. +###flutter: +### uses-material-design: true +###{{/flutter}} \ No newline at end of file diff --git a/apps/wyatt_package_template/wyatt_package_template/test/package_name_test.dart b/apps/wyatt_package_template/wyatt_package_template/test/package_name_test.dart new file mode 100644 index 0000000..771213c --- /dev/null +++ b/apps/wyatt_package_template/wyatt_package_template/test/package_name_test.dart @@ -0,0 +1 @@ +// TODO(wyatt): add some tests \ No newline at end of file diff --git a/bricks/wyatt_package_template/__brick__/.gitignore b/bricks/wyatt_package_template/__brick__/.gitignore new file mode 100644 index 0000000..3cceda5 --- /dev/null +++ b/bricks/wyatt_package_template/__brick__/.gitignore @@ -0,0 +1,7 @@ +# https://dart.dev/guides/libraries/private-files +# Created by `dart pub` +.dart_tool/ + +# Avoid committing pubspec.lock for library packages; see +# https://dart.dev/guides/libraries/private-files#pubspeclock. +pubspec.lock diff --git a/bricks/wyatt_package_template/__brick__/.vscode/extensions.json b/bricks/wyatt_package_template/__brick__/.vscode/extensions.json new file mode 100644 index 0000000..30cd223 --- /dev/null +++ b/bricks/wyatt_package_template/__brick__/.vscode/extensions.json @@ -0,0 +1,24 @@ +/* + * 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 . + */ + +{ + "recommendations": [ + "psioniq.psi-header", + "blaugold.melos-code" + ] +} \ No newline at end of file diff --git a/bricks/wyatt_package_template/__brick__/.vscode/launch.json b/bricks/wyatt_package_template/__brick__/.vscode/launch.json new file mode 100644 index 0000000..653eabc --- /dev/null +++ b/bricks/wyatt_package_template/__brick__/.vscode/launch.json @@ -0,0 +1,34 @@ +/* + * 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 . + */ + +{ + // Use IntelliSense to learn about possible attributes. + // Hover to view descriptions of existing attributes. + // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 + "version": "0.2.0", + "configurations": [ + { + "name": "Launch Example", + "request": "launch", + "type": "dart", + "cwd": "example/", + "program": "lib/main.dart", + "flutterMode": "debug" + }, + ] +} \ No newline at end of file diff --git a/bricks/wyatt_package_template/__brick__/.vscode/settings.json b/bricks/wyatt_package_template/__brick__/.vscode/settings.json new file mode 100644 index 0000000..a729c46 --- /dev/null +++ b/bricks/wyatt_package_template/__brick__/.vscode/settings.json @@ -0,0 +1,72 @@ +{ + "dart.runPubGetOnPubspecChanges": "never", + "bloc.newCubitTemplate.type": "equatable", + "psi-header.changes-tracking": { + "isActive": true + }, + "psi-header.config": { + "blankLinesAfter": 1, + "forceToTop": true + }, + "psi-header.lang-config": [ + { + "beforeHeader": [ + "# -*- coding:utf-8 -*-", + "#!/usr/bin/env python3" + ], + "begin": "###", + "end": "###", + "language": "python", + "prefix": "# " + }, + { + "beforeHeader": [ + "#!/usr/bin/env sh", + "" + ], + "language": "shellscript", + "begin": "", + "end": "", + "prefix": "# " + }, + { + "begin": "", + "end": "", + "language": "dart", + "prefix": "// " + }, + { + "begin": "", + "end": "", + "language": "yaml", + "prefix": "# " + }, + { + "begin": "", + "language": "markdown", + }, + ], + "psi-header.templates": [ + { + "language": "*", + "template": [ + "Copyright (C) <> 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 ." + ], + } + ], +} \ No newline at end of file diff --git a/bricks/wyatt_package_template/__brick__/CHANGELOG.md b/bricks/wyatt_package_template/__brick__/CHANGELOG.md new file mode 100644 index 0000000..effe43c --- /dev/null +++ b/bricks/wyatt_package_template/__brick__/CHANGELOG.md @@ -0,0 +1,3 @@ +## 1.0.0 + +- Initial version. diff --git a/bricks/wyatt_package_template/__brick__/README.md b/bricks/wyatt_package_template/__brick__/README.md new file mode 100644 index 0000000..754f2d7 --- /dev/null +++ b/bricks/wyatt_package_template/__brick__/README.md @@ -0,0 +1,65 @@ + + +{{#flutter}} + +# Flutter - {{#titleCase}}{{package_name}}{{/titleCase}} + +

+ Style: Wyatt Analysis + SDK: Flutter +

+ +{{/flutter}} + +{{^flutter}} + +# Dart - {{#titleCase}}{{package_name}}{{/titleCase}} + +

+ Style: Wyatt Analysis + SDK: Dart & Flutter +

+ +{{/flutter}} + +{{#sentenceCase}}{{description}}{{/sentenceCase}} + +## Features + +TODO: List what your package can do. Maybe include images, gifs, or videos. + +## Getting started + +TODO: List prerequisites and provide or point to information on how to +start using the package. + +## Usage + +TODO: Include short and useful examples for package users. Add longer examples +to `/example` folder. + +```dart +const like = 'sample'; +``` + +## Additional information + +TODO: Tell users more about the package: where to find more information, how to +contribute to the package, how to file issues, what response they can expect +from the package authors, and more. diff --git a/bricks/wyatt_package_template/__brick__/analysis_options.yaml b/bricks/wyatt_package_template/__brick__/analysis_options.yaml new file mode 100644 index 0000000..405eea1 --- /dev/null +++ b/bricks/wyatt_package_template/__brick__/analysis_options.yaml @@ -0,0 +1,10 @@ +{{#flutter}} +include: package:wyatt_analysis/analysis_options.flutter.yaml + +{{/flutter}} + +{{^flutter}} +include: package:wyatt_analysis/analysis_options.yaml + +{{/flutter}} + diff --git a/bricks/wyatt_package_template/__brick__/example/.gitignore b/bricks/wyatt_package_template/__brick__/example/.gitignore new file mode 100644 index 0000000..24476c5 --- /dev/null +++ b/bricks/wyatt_package_template/__brick__/example/.gitignore @@ -0,0 +1,44 @@ +# Miscellaneous +*.class +*.log +*.pyc +*.swp +.DS_Store +.atom/ +.buildlog/ +.history +.svn/ +migrate_working_dir/ + +# IntelliJ related +*.iml +*.ipr +*.iws +.idea/ + +# The .vscode folder contains launch configuration and tasks you configure in +# VS Code which you may wish to be included in version control, so this line +# is commented out by default. +#.vscode/ + +# Flutter/Dart/Pub related +**/doc/api/ +**/ios/Flutter/.last_build_id +.dart_tool/ +.flutter-plugins +.flutter-plugins-dependencies +.packages +.pub-cache/ +.pub/ +/build/ + +# Symbolication related +app.*.symbols + +# Obfuscation related +app.*.map.json + +# Android Studio will place build artifacts here +/android/app/debug +/android/app/profile +/android/app/release diff --git a/bricks/wyatt_package_template/__brick__/example/.metadata b/bricks/wyatt_package_template/__brick__/example/.metadata new file mode 100644 index 0000000..30e0d3c --- /dev/null +++ b/bricks/wyatt_package_template/__brick__/example/.metadata @@ -0,0 +1,30 @@ +# This file tracks properties of this Flutter project. +# Used by Flutter tool to assess capabilities and perform upgrades etc. +# +# This file should be version controlled. + +version: + revision: b06b8b2710955028a6b562f5aa6fe62941d6febf + channel: stable + +project_type: app + +# Tracks metadata for the flutter migrate command +migration: + platforms: + - platform: root + create_revision: b06b8b2710955028a6b562f5aa6fe62941d6febf + base_revision: b06b8b2710955028a6b562f5aa6fe62941d6febf + - platform: web + create_revision: b06b8b2710955028a6b562f5aa6fe62941d6febf + base_revision: b06b8b2710955028a6b562f5aa6fe62941d6febf + + # User provided section + + # List of Local paths (relative to this file) that should be + # ignored by the migrate tool. + # + # Files that are not part of the templates will be ignored by default. + unmanaged_files: + - 'lib/main.dart' + - 'ios/Runner.xcodeproj/project.pbxproj' diff --git a/bricks/wyatt_package_template/__brick__/example/README.md b/bricks/wyatt_package_template/__brick__/example/README.md new file mode 100644 index 0000000..2b3fce4 --- /dev/null +++ b/bricks/wyatt_package_template/__brick__/example/README.md @@ -0,0 +1,16 @@ +# example + +A new Flutter project. + +## Getting Started + +This project is a starting point for a Flutter application. + +A few resources to get you started if this is your first Flutter project: + +- [Lab: Write your first Flutter app](https://docs.flutter.dev/get-started/codelab) +- [Cookbook: Useful Flutter samples](https://docs.flutter.dev/cookbook) + +For help getting started with Flutter development, view the +[online documentation](https://docs.flutter.dev/), which offers tutorials, +samples, guidance on mobile development, and a full API reference. diff --git a/bricks/wyatt_package_template/__brick__/example/analysis_options.yaml b/bricks/wyatt_package_template/__brick__/example/analysis_options.yaml new file mode 100644 index 0000000..405eea1 --- /dev/null +++ b/bricks/wyatt_package_template/__brick__/example/analysis_options.yaml @@ -0,0 +1,10 @@ +{{#flutter}} +include: package:wyatt_analysis/analysis_options.flutter.yaml + +{{/flutter}} + +{{^flutter}} +include: package:wyatt_analysis/analysis_options.yaml + +{{/flutter}} + diff --git a/bricks/wyatt_package_template/__brick__/example/lib/main.dart b/bricks/wyatt_package_template/__brick__/example/lib/main.dart new file mode 100644 index 0000000..54165c0 --- /dev/null +++ b/bricks/wyatt_package_template/__brick__/example/lib/main.dart @@ -0,0 +1,62 @@ +// Copyright (C) {{year}} 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 . + +{{#flutter}} +import 'package:flutter/material.dart'; + + +{{/flutter}} + +import 'package:{{#snakeCase}}{{package_name}}{{/snakeCase}}/{{#snakeCase}}{{package_name}}{{/snakeCase}}.dart'; + +{{^flutter}} +class {{#pascalCase}}{{package_name}}{{/pascalCase}}Example { + static void run(List args) { + print({{#pascalCase}}{{package_name}}{{/pascalCase}}.testString); + } +} + + +{{/flutter}} + + +{{#flutter}} +void main(List args) { + runApp(const App()); +} + +class App extends StatelessWidget { + const App({super.key}); + + static const String title = '{{#titleCase}}{{package_name}}{{/titleCase}} Example'; + + @override + Widget build(BuildContext context) => MaterialApp( + title: title, + theme: ThemeData( + primarySwatch: Colors.blue, + ), + home: Scaffold( + appBar: AppBar( + title: const Text(title), + ), + body: Center(child: Text({{#pascalCase}}{{package_name}}{{/pascalCase}}.testString)), + ), + ); +} + +{{/flutter}} + diff --git a/bricks/wyatt_package_template/__brick__/example/pubspec.yaml b/bricks/wyatt_package_template/__brick__/example/pubspec.yaml new file mode 100644 index 0000000..bc37e2a --- /dev/null +++ b/bricks/wyatt_package_template/__brick__/example/pubspec.yaml @@ -0,0 +1,41 @@ +name: {{#snakeCase}}{{package_name}}{{/snakeCase}}_example +description: A new Flutter project. +version: 1.0.0 + +publish_to: 'none' + +environment: + sdk: ">=2.19.0 <3.0.0" + +dependencies: +{{#flutter}} + flutter: { sdk: flutter } + +{{/flutter}} + + + {{#snakeCase}}{{package_name}}{{/snakeCase}}: + path: "../" + +dev_dependencies: +{{#flutter}} + flutter_test: { sdk: flutter } + +{{/flutter}} + +{{^flutter}} + test: ^1.21.0 + +{{/flutter}} + + + wyatt_analysis: + hosted: https://git.wyatt-studio.fr/api/packages/Wyatt-FOSS/pub + version: ^2.3.0 + +{{#flutter}} +# The following section is specific to Flutter. +flutter: + uses-material-design: true + +{{/flutter}} diff --git a/bricks/wyatt_package_template/__brick__/example/test/widget_test.dart b/bricks/wyatt_package_template/__brick__/example/test/widget_test.dart new file mode 100644 index 0000000..e69de29 diff --git a/bricks/wyatt_package_template/__brick__/example/{{#flutter}}web{{/flutter}}/favicon.png b/bricks/wyatt_package_template/__brick__/example/{{#flutter}}web{{/flutter}}/favicon.png new file mode 100644 index 0000000..8aaa46a Binary files /dev/null and b/bricks/wyatt_package_template/__brick__/example/{{#flutter}}web{{/flutter}}/favicon.png differ diff --git a/bricks/wyatt_package_template/__brick__/example/{{#flutter}}web{{/flutter}}/icons/Icon-192.png b/bricks/wyatt_package_template/__brick__/example/{{#flutter}}web{{/flutter}}/icons/Icon-192.png new file mode 100644 index 0000000..b749bfe Binary files /dev/null and b/bricks/wyatt_package_template/__brick__/example/{{#flutter}}web{{/flutter}}/icons/Icon-192.png differ diff --git a/bricks/wyatt_package_template/__brick__/example/{{#flutter}}web{{/flutter}}/icons/Icon-512.png b/bricks/wyatt_package_template/__brick__/example/{{#flutter}}web{{/flutter}}/icons/Icon-512.png new file mode 100644 index 0000000..88cfd48 Binary files /dev/null and b/bricks/wyatt_package_template/__brick__/example/{{#flutter}}web{{/flutter}}/icons/Icon-512.png differ diff --git a/bricks/wyatt_package_template/__brick__/example/{{#flutter}}web{{/flutter}}/icons/Icon-maskable-192.png b/bricks/wyatt_package_template/__brick__/example/{{#flutter}}web{{/flutter}}/icons/Icon-maskable-192.png new file mode 100644 index 0000000..eb9b4d7 Binary files /dev/null and b/bricks/wyatt_package_template/__brick__/example/{{#flutter}}web{{/flutter}}/icons/Icon-maskable-192.png differ diff --git a/bricks/wyatt_package_template/__brick__/example/{{#flutter}}web{{/flutter}}/icons/Icon-maskable-512.png b/bricks/wyatt_package_template/__brick__/example/{{#flutter}}web{{/flutter}}/icons/Icon-maskable-512.png new file mode 100644 index 0000000..d69c566 Binary files /dev/null and b/bricks/wyatt_package_template/__brick__/example/{{#flutter}}web{{/flutter}}/icons/Icon-maskable-512.png differ diff --git a/bricks/wyatt_package_template/__brick__/example/{{#flutter}}web{{/flutter}}/index.html b/bricks/wyatt_package_template/__brick__/example/{{#flutter}}web{{/flutter}}/index.html new file mode 100644 index 0000000..be820e8 --- /dev/null +++ b/bricks/wyatt_package_template/__brick__/example/{{#flutter}}web{{/flutter}}/index.html @@ -0,0 +1,59 @@ + + + + + + + + + + + + + + + + + + + + example + + + + + + + + + + diff --git a/bricks/wyatt_package_template/__brick__/example/{{#flutter}}web{{/flutter}}/manifest.json b/bricks/wyatt_package_template/__brick__/example/{{#flutter}}web{{/flutter}}/manifest.json new file mode 100644 index 0000000..096edf8 --- /dev/null +++ b/bricks/wyatt_package_template/__brick__/example/{{#flutter}}web{{/flutter}}/manifest.json @@ -0,0 +1,35 @@ +{ + "name": "example", + "short_name": "example", + "start_url": ".", + "display": "standalone", + "background_color": "#0175C2", + "theme_color": "#0175C2", + "description": "A new Flutter project.", + "orientation": "portrait-primary", + "prefer_related_applications": false, + "icons": [ + { + "src": "icons/Icon-192.png", + "sizes": "192x192", + "type": "image/png" + }, + { + "src": "icons/Icon-512.png", + "sizes": "512x512", + "type": "image/png" + }, + { + "src": "icons/Icon-maskable-192.png", + "sizes": "192x192", + "type": "image/png", + "purpose": "maskable" + }, + { + "src": "icons/Icon-maskable-512.png", + "sizes": "512x512", + "type": "image/png", + "purpose": "maskable" + } + ] +} diff --git a/bricks/wyatt_package_template/__brick__/example/{{^flutter}}bin{{/flutter}}/{{package_name.snakeCase()}}_example.dart b/bricks/wyatt_package_template/__brick__/example/{{^flutter}}bin{{/flutter}}/{{package_name.snakeCase()}}_example.dart new file mode 100644 index 0000000..979ae75 --- /dev/null +++ b/bricks/wyatt_package_template/__brick__/example/{{^flutter}}bin{{/flutter}}/{{package_name.snakeCase()}}_example.dart @@ -0,0 +1,24 @@ +// Copyright (C) {{year}} 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 . + +import 'dart:io'; + +import 'package:{{#snakeCase}}{{package_name}}{{/snakeCase}}_example/main.dart'; + +void main(List args) { + {{#pascalCase}}{{package_name}}{{/pascalCase}}Example.run(args); + exit(0); +} diff --git a/bricks/wyatt_package_template/__brick__/lib/src/{{package_name.snakeCase()}}.dart b/bricks/wyatt_package_template/__brick__/lib/src/{{package_name.snakeCase()}}.dart new file mode 100644 index 0000000..cdd5368 --- /dev/null +++ b/bricks/wyatt_package_template/__brick__/lib/src/{{package_name.snakeCase()}}.dart @@ -0,0 +1,19 @@ +// Copyright (C) {{year}} 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 . + +abstract class {{#pascalCase}}{{package_name}}{{/pascalCase}} { + static String get testString => 'Package: {{#titleCase}}{{package_name}}{{/titleCase}}'; +} diff --git a/bricks/wyatt_package_template/__brick__/lib/{{package_name.snakeCase()}}.dart b/bricks/wyatt_package_template/__brick__/lib/{{package_name.snakeCase()}}.dart new file mode 100644 index 0000000..708ca9c --- /dev/null +++ b/bricks/wyatt_package_template/__brick__/lib/{{package_name.snakeCase()}}.dart @@ -0,0 +1,20 @@ +// Copyright (C) {{year}} 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 . + +/// {{#sentenceCase}}{{description}}{{/sentenceCase}} +library {{#snakeCase}}{{package_name}}{{/snakeCase}}; + +export 'src/{{#snakeCase}}{{package_name}}{{/snakeCase}}.dart'; diff --git a/bricks/wyatt_package_template/__brick__/pubspec.yaml b/bricks/wyatt_package_template/__brick__/pubspec.yaml new file mode 100644 index 0000000..09ebfcb --- /dev/null +++ b/bricks/wyatt_package_template/__brick__/pubspec.yaml @@ -0,0 +1,39 @@ +name: {{#snakeCase}}{{package_name}}{{/snakeCase}} +description: {{#sentenceCase}}{{description}}{{/sentenceCase}}. +repository: https://git.wyatt-studio.fr/Wyatt-FOSS/wyatt-packages/src/branch/master/packages/{{#snakeCase}}{{package_name}}{{/snakeCase}} +version: 1.0.0 + +environment: + sdk: ">=2.19.0 <3.0.0" + +dependencies: +{{#flutter}} + flutter: { sdk: flutter } + +{{/flutter}} + + path: ^1.8.0 + +dev_dependencies: +{{#flutter}} + flutter_test: { sdk: flutter } + +{{/flutter}} + + +{{^flutter}} + test: ^1.21.0 + +{{/flutter}} + + + wyatt_analysis: + hosted: https://git.wyatt-studio.fr/api/packages/Wyatt-FOSS/pub + version: ^2.3.0 + +{{#flutter}} +# The following section is specific to Flutter. +flutter: + uses-material-design: true + +{{/flutter}} diff --git a/bricks/wyatt_package_template/__brick__/test/{{package_name.snakeCase()}}_test.dart b/bricks/wyatt_package_template/__brick__/test/{{package_name.snakeCase()}}_test.dart new file mode 100644 index 0000000..771213c --- /dev/null +++ b/bricks/wyatt_package_template/__brick__/test/{{package_name.snakeCase()}}_test.dart @@ -0,0 +1 @@ +// TODO(wyatt): add some tests \ No newline at end of file diff --git a/bricks/wyatt_package_template/brick.yaml b/bricks/wyatt_package_template/brick.yaml new file mode 100644 index 0000000..7f9cdd1 --- /dev/null +++ b/bricks/wyatt_package_template/brick.yaml @@ -0,0 +1,24 @@ +name: wyatt_package_template +description: New package template for Wyatt Studio projects. + +version: 0.1.0 + +vars: + package_name: + type: string + description: The package name + default: package_name + prompt: What is the package name? + + description: + type: string + description: A short package description + default: A package by Wyatt Studio. + prompt: What is the package description? + + flutter: + type: boolean + description: Should generate a plugin (Flutter only) or a package (Dart and Flutter). + default: false + prompt: Should generate Flutter only plugin ? + diff --git a/bricks/wyatt_package_template/hooks/post_gen.dart b/bricks/wyatt_package_template/hooks/post_gen.dart new file mode 100644 index 0000000..babd1b7 --- /dev/null +++ b/bricks/wyatt_package_template/hooks/post_gen.dart @@ -0,0 +1,39 @@ +// 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 . + +import 'dart:io'; + +import 'package:mason/mason.dart'; + +void removeGitKeepFiles(String targetPath) { + if (!FileSystemEntity.isDirectorySync(targetPath)) { + throw ArgumentError('Target must be a directory', 'targetPath'); + } + + Directory(targetPath) + .listSync(recursive: true) + .whereType() + .forEach((file) { + if (file.path.contains('.gitkeep')) { + file.deleteSync(recursive: true); + } + }); +} + +Future run(HookContext context) async { + final workingDirectory = Directory.current.path; + removeGitKeepFiles(workingDirectory); +} diff --git a/bricks/wyatt_package_template/hooks/pre_gen.dart b/bricks/wyatt_package_template/hooks/pre_gen.dart new file mode 100644 index 0000000..ea2f0c7 --- /dev/null +++ b/bricks/wyatt_package_template/hooks/pre_gen.dart @@ -0,0 +1,21 @@ +// 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 . + +import 'package:mason/mason.dart'; + +void run(HookContext context) { + context.vars = {...context.vars, 'year': DateTime.now().year.toString()}; +} \ No newline at end of file diff --git a/bricks/wyatt_package_template/hooks/pubspec.yaml b/bricks/wyatt_package_template/hooks/pubspec.yaml new file mode 100644 index 0000000..454f6df --- /dev/null +++ b/bricks/wyatt_package_template/hooks/pubspec.yaml @@ -0,0 +1,7 @@ +name: hooks + +environment: + sdk: ">=2.18.0 <3.0.0" + +dependencies: + mason: any \ No newline at end of file diff --git a/mason.yaml b/mason.yaml index 7c67dd0..c62a7fd 100644 --- a/mason.yaml +++ b/mason.yaml @@ -10,4 +10,6 @@ bricks: wyatt_brick_template: path: bricks/wyatt_brick_template wyatt_app_template: - path: bricks/wyatt_app_template \ No newline at end of file + path: bricks/wyatt_app_template + wyatt_package_template: + path: bricks/wyatt_package_template \ No newline at end of file