feat: add brickgen template
This commit is contained in:
parent
43b3df453f
commit
9638a23345
23
apps/wyatt_brick_template/README.md
Normal file
23
apps/wyatt_brick_template/README.md
Normal file
@ -0,0 +1,23 @@
|
||||
<!--
|
||||
* 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/>.
|
||||
-->
|
||||
|
||||
# Wyatt - Brick Template
|
||||
|
||||
> Brickception
|
||||
|
||||
Generated with `Brickgen`... to generate other `Brickgen` bricks.
|
36
apps/wyatt_brick_template/brickgen.yaml
Normal file
36
apps/wyatt_brick_template/brickgen.yaml
Normal file
@ -0,0 +1,36 @@
|
||||
name: wyatt_brick_template
|
||||
description: Template to create a compilable project that can be converted with Brickgen
|
||||
|
||||
version: 0.1.0
|
||||
|
||||
vars:
|
||||
brick_name:
|
||||
compilable: brick_name
|
||||
type: string
|
||||
description: Name of the brick
|
||||
default: brick_name
|
||||
prompt: "What is the brick name?"
|
||||
|
||||
brick_description:
|
||||
compilable: brick_description
|
||||
type: string
|
||||
description: Description of the brick
|
||||
default: brick_description
|
||||
prompt: "What is the brick description?"
|
||||
|
||||
hooks:
|
||||
type: boolean
|
||||
description: Enables hooks for this brick.
|
||||
default: false
|
||||
prompt: "Do you want to enable `hooks` for this brick ?"
|
||||
|
||||
brickgen:
|
||||
path_to_brickify: wyatt_brick_template
|
||||
hooks: true
|
||||
ignore:
|
||||
- .env
|
||||
boolean_file_system:
|
||||
hooks:
|
||||
folders:
|
||||
on_true:
|
||||
- hooks
|
39
apps/wyatt_brick_template/hooks/post_gen.dart
Normal file
39
apps/wyatt_brick_template/hooks/post_gen.dart
Normal file
@ -0,0 +1,39 @@
|
||||
// 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/>.
|
||||
|
||||
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<File>()
|
||||
.forEach((file) {
|
||||
if (file.path.contains('.gitkeep')) {
|
||||
file.deleteSync(recursive: true);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
Future<void> run(HookContext context) async {
|
||||
final workingDirectory = Directory.current.path;
|
||||
removeGitKeepFiles(workingDirectory);
|
||||
}
|
7
apps/wyatt_brick_template/hooks/pubspec.yaml
Normal file
7
apps/wyatt_brick_template/hooks/pubspec.yaml
Normal file
@ -0,0 +1,7 @@
|
||||
name: hooks
|
||||
|
||||
environment:
|
||||
sdk: ">=2.18.0 <3.0.0"
|
||||
|
||||
dependencies:
|
||||
mason: any
|
@ -0,0 +1,3 @@
|
||||
# display_name
|
||||
|
||||
Brick generated with `Brickgen`.
|
@ -0,0 +1,18 @@
|
||||
<!--
|
||||
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/>.
|
||||
-->
|
||||
|
@ -0,0 +1,16 @@
|
||||
// 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/>.
|
||||
|
@ -0,0 +1,18 @@
|
||||
<!--
|
||||
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/>.
|
||||
-->
|
||||
|
39
apps/wyatt_brick_template/wyatt_brick_template/brickgen.yaml
Normal file
39
apps/wyatt_brick_template/wyatt_brick_template/brickgen.yaml
Normal file
@ -0,0 +1,39 @@
|
||||
name: brick_name
|
||||
description: brick_description
|
||||
|
||||
version: 0.1.0
|
||||
|
||||
vars:
|
||||
display_name:
|
||||
compilable: display_name
|
||||
type: string
|
||||
description: The display name
|
||||
default: Display Name
|
||||
prompt: "What is the display name?"
|
||||
|
||||
product_name:
|
||||
compilable: product_name
|
||||
type: string
|
||||
description: The product name
|
||||
default: product_name
|
||||
prompt: "What is the product name?"
|
||||
|
||||
flutter:
|
||||
type: boolean
|
||||
description: If this app is a Flutter or Dart application.
|
||||
default: false
|
||||
prompt: "Is this a Flutter appplication ?"
|
||||
|
||||
brickgen:
|
||||
path_to_brickify: brick_name
|
||||
hooks: true
|
||||
ignore:
|
||||
- .env
|
||||
boolean_file_system:
|
||||
flutter:
|
||||
folders:
|
||||
on_true:
|
||||
- android
|
||||
- ios
|
||||
on_false:
|
||||
- bin
|
@ -0,0 +1,39 @@
|
||||
// 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/>.
|
||||
|
||||
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<File>()
|
||||
.forEach((file) {
|
||||
if (file.path.contains('.gitkeep')) {
|
||||
file.deleteSync(recursive: true);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
Future<void> run(HookContext context) async {
|
||||
final workingDirectory = Directory.current.path;
|
||||
removeGitKeepFiles(workingDirectory);
|
||||
}
|
@ -0,0 +1,7 @@
|
||||
name: hooks
|
||||
|
||||
environment:
|
||||
sdk: ">=2.18.0 <3.0.0"
|
||||
|
||||
dependencies:
|
||||
mason: any
|
39
bricks/wyatt_brick_template/__brick__/brickgen.yaml
Normal file
39
bricks/wyatt_brick_template/__brick__/brickgen.yaml
Normal file
@ -0,0 +1,39 @@
|
||||
name: {{#snakeCase}}{{brick_name}}{{/snakeCase}}
|
||||
description: {{#snakeCase}}{{brick_description}}{{/snakeCase}}
|
||||
|
||||
version: 0.1.0
|
||||
|
||||
vars:
|
||||
display_name:
|
||||
compilable: display_name
|
||||
type: string
|
||||
description: The display name
|
||||
default: Display Name
|
||||
prompt: "What is the display name?"
|
||||
|
||||
product_name:
|
||||
compilable: product_name
|
||||
type: string
|
||||
description: The product name
|
||||
default: product_name
|
||||
prompt: "What is the product name?"
|
||||
|
||||
flutter:
|
||||
type: boolean
|
||||
description: If this app is a Flutter or Dart application.
|
||||
default: false
|
||||
prompt: "Is this a Flutter appplication ?"
|
||||
|
||||
brickgen:
|
||||
path_to_brickify: {{#snakeCase}}{{brick_name}}{{/snakeCase}}
|
||||
hooks: true
|
||||
ignore:
|
||||
- .env
|
||||
boolean_file_system:
|
||||
flutter:
|
||||
folders:
|
||||
on_true:
|
||||
- android
|
||||
- ios
|
||||
on_false:
|
||||
- bin
|
@ -0,0 +1,39 @@
|
||||
// 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/>.
|
||||
|
||||
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<File>()
|
||||
.forEach((file) {
|
||||
if (file.path.contains('.gitkeep')) {
|
||||
file.deleteSync(recursive: true);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
Future<void> run(HookContext context) async {
|
||||
final workingDirectory = Directory.current.path;
|
||||
removeGitKeepFiles(workingDirectory);
|
||||
}
|
@ -0,0 +1,7 @@
|
||||
name: hooks
|
||||
|
||||
environment:
|
||||
sdk: ">=2.18.0 <3.0.0"
|
||||
|
||||
dependencies:
|
||||
mason: any
|
@ -0,0 +1,3 @@
|
||||
# display_name
|
||||
|
||||
Brick generated with `Brickgen`.
|
@ -0,0 +1,18 @@
|
||||
<!--
|
||||
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/>.
|
||||
-->
|
||||
|
@ -0,0 +1,16 @@
|
||||
// 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/>.
|
||||
|
@ -0,0 +1,18 @@
|
||||
<!--
|
||||
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/>.
|
||||
-->
|
||||
|
24
bricks/wyatt_brick_template/brick.yaml
Normal file
24
bricks/wyatt_brick_template/brick.yaml
Normal file
@ -0,0 +1,24 @@
|
||||
name: wyatt_brick_template
|
||||
description: Template to create a compilable project that can be converted with Brickgen
|
||||
|
||||
version: 0.1.0
|
||||
|
||||
vars:
|
||||
brick_name:
|
||||
type: string
|
||||
description: Name of the brick
|
||||
default: brick_name
|
||||
prompt: What is the brick name?
|
||||
|
||||
brick_description:
|
||||
type: string
|
||||
description: Description of the brick
|
||||
default: brick_description
|
||||
prompt: What is the brick description?
|
||||
|
||||
hooks:
|
||||
type: boolean
|
||||
description: Enables hooks for this brick.
|
||||
default: false
|
||||
prompt: Do you want to enable `hooks` for this brick ?
|
||||
|
39
bricks/wyatt_brick_template/hooks/post_gen.dart
Normal file
39
bricks/wyatt_brick_template/hooks/post_gen.dart
Normal file
@ -0,0 +1,39 @@
|
||||
// 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/>.
|
||||
|
||||
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<File>()
|
||||
.forEach((file) {
|
||||
if (file.path.contains('.gitkeep')) {
|
||||
file.deleteSync(recursive: true);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
Future<void> run(HookContext context) async {
|
||||
final workingDirectory = Directory.current.path;
|
||||
removeGitKeepFiles(workingDirectory);
|
||||
}
|
7
bricks/wyatt_brick_template/hooks/pubspec.yaml
Normal file
7
bricks/wyatt_brick_template/hooks/pubspec.yaml
Normal file
@ -0,0 +1,7 @@
|
||||
name: hooks
|
||||
|
||||
environment:
|
||||
sdk: ">=2.18.0 <3.0.0"
|
||||
|
||||
dependencies:
|
||||
mason: any
|
Loading…
x
Reference in New Issue
Block a user