-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
chore(mason): feature 系のパッケージ作成の mason brick を追加
- Loading branch information
Showing
35 changed files
with
358 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# 0.1.0 | ||
|
||
- TODO: Describe initial release. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
# features_package | ||
|
||
[![Powered by Mason](https://img.shields.io/endpoint?url=https%3A%2F%2Ftinyurl.com%2Fmason-badge)](https://github.com/felangel/mason) | ||
|
||
新しい feature パッケージを作成します. | ||
|
||
## Getting Started 🚀 | ||
|
||
以下のコマンドを実行します。 | ||
|
||
```shell | ||
mason make features_package | ||
``` | ||
|
||
feature 名を尋ねられるため、回答します。 | ||
回答すると、以下の実行例のような構成のパッケージが `packages/features` 配下に作成されます。 | ||
|
||
```text | ||
❯ mason make features_package | ||
? What is feature name? (example: foo_bar) foo_bar | ||
✓ Generated 16 files. (72ms) | ||
created packages/features/foo_bar/test/foo_bar_test.dart | ||
created packages/features/foo_bar/l10n.yaml | ||
created packages/features/foo_bar/.metadata | ||
created packages/features/foo_bar/README.md | ||
created packages/features/foo_bar/pubspec.yaml | ||
created packages/features/foo_bar/.gitignore | ||
created packages/features/foo_bar/lib/ui.dart | ||
created packages/features/foo_bar/lib/l10n.dart | ||
created packages/features/foo_bar/lib/src/ui/components/foo_bar_text.dart | ||
created packages/features/foo_bar/lib/src/ui/pages/foo/components/foo_text.dart | ||
created packages/features/foo_bar/lib/src/ui/pages/foo/foo_page.dart | ||
created packages/features/foo_bar/lib/src/ui/pages/bar/bar_page.dart | ||
created packages/features/foo_bar/lib/src/ui/pages/bar/components/bar_text.dart | ||
created packages/features/foo_bar/lib/src/l10n/features_foo_bar_ja.arb | ||
created packages/features/foo_bar/lib/src/l10n/features_foo_bar_en.arb | ||
created packages/features/foo_bar/build.yaml | ||
✓ Compiled post_gen.dart (2.4s) | ||
``` |
32 changes: 32 additions & 0 deletions
32
...icks/features_package/__brick__/packages/features/{{feature_name.snakeCase()}}/.gitignore
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
# 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/ | ||
.dart_tool/ | ||
.flutter-plugins | ||
.flutter-plugins-dependencies | ||
build/ | ||
|
||
# Melos related | ||
/pubspec_overrides.yaml |
10 changes: 10 additions & 0 deletions
10
...ricks/features_package/__brick__/packages/features/{{feature_name.snakeCase()}}/.metadata
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# 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 and should not be manually edited. | ||
|
||
version: | ||
revision: "ef1af02aead6fe2414f3aafa5a61087b610e1332" | ||
channel: "stable" | ||
|
||
project_type: package |
1 change: 1 addition & 0 deletions
1
...ures_package/__brick__/packages/features/{{feature_name.snakeCase()}}/README.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
# feature_{{feature_name.snakeCase()}} package |
27 changes: 27 additions & 0 deletions
27
...icks/features_package/__brick__/packages/features/{{feature_name.snakeCase()}}/build.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
targets: | ||
$default: | ||
builders: | ||
freezed: | ||
# https://github.com/dart-lang/build/blob/master/docs/faq.md#how-do-i-avoid-running-builders-on-unnecessary-inputs | ||
generate_for: | ||
include: | ||
- lib/{model,**/model}/**.dart | ||
# https://github.com/google/json_serializable.dart/tree/master/json_serializable#build-configuration | ||
json_serializable: | ||
generate_for: | ||
include: | ||
- lib/{model,**/model}/**.dart | ||
options: | ||
field_rename: snake | ||
# json のデシリアライズ時に発生する Exception を CheckedFromJsonException にまとめる | ||
checked: true | ||
riverpod_generator: | ||
generate_for: | ||
include: | ||
- lib/{provider,**/provider}/**.dart | ||
# https://github.com/dart-lang/source_gen#ignore_for_file | ||
source_gen:combining_builder: | ||
options: | ||
ignore_for_file: | ||
- type=lint | ||
- duplicate_ignore |
12 changes: 12 additions & 0 deletions
12
...ricks/features_package/__brick__/packages/features/{{feature_name.snakeCase()}}/l10n.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
arb-dir: lib/src/l10n | ||
output-dir: lib/src/gen/l10n | ||
template-arb-file: features_{{feature_name.snakeCase()}}_ja.arb | ||
output-localization-file: l10n.dart | ||
output-class: L10n | ||
synthetic-package: false | ||
preferred-supported-locales: | ||
- ja | ||
- en | ||
header: '// ignore_for_file: type=lint' | ||
nullable-getter: false | ||
format: true |
1 change: 1 addition & 0 deletions
1
...s/features_package/__brick__/packages/features/{{feature_name.snakeCase()}}/lib/l10n.dart
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
7 changes: 7 additions & 0 deletions
7
...es/{{feature_name.snakeCase()}}/lib/src/l10n/features_{{feature_name.snakeCase()}}_en.arb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"{{feature_name.camelCase()}}Text": "{{feature_name.pascalCase()}} Text", | ||
"{{feature_name.camelCase()}}ListAppBarTitle": "{{feature_name.pascalCase()}} List", | ||
"{{feature_name.camelCase()}}ListText": "{{feature_name.pascalCase()}} List Text", | ||
"{{feature_name.camelCase()}}DetailAppBarTitle": "{{feature_name.pascalCase()}} Detail", | ||
"{{feature_name.camelCase()}}DetailText": "{{feature_name.pascalCase()}} Detail Text" | ||
} |
7 changes: 7 additions & 0 deletions
7
...es/{{feature_name.snakeCase()}}/lib/src/l10n/features_{{feature_name.snakeCase()}}_ja.arb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"{{feature_name.camelCase()}}Text": "{{feature_name.pascalCase()}} テキスト", | ||
"{{feature_name.camelCase()}}ListAppBarTitle": "{{feature_name.pascalCase()}} 一覧", | ||
"{{feature_name.camelCase()}}ListText": "{{feature_name.pascalCase()}} 一覧 テキスト", | ||
"{{feature_name.camelCase()}}DetailAppBarTitle": "{{feature_name.pascalCase()}} 詳細", | ||
"{{feature_name.camelCase()}}DetailText": "{{feature_name.pascalCase()}} 詳細 テキスト" | ||
} |
13 changes: 13 additions & 0 deletions
13
...{{feature_name.snakeCase()}}/lib/src/ui/components/{{feature_name.snakeCase()}}_text.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import 'package:features_{{feature_name.snakeCase()}}/src/gen/l10n/l10n.dart'; | ||
import 'package:flutter/material.dart'; | ||
|
||
class {{feature_name.pascalCase()}}Text extends StatelessWidget { | ||
const {{feature_name.pascalCase()}}Text({super.key}); | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
final l10n = L10n.of(context); | ||
|
||
return Text(l10n.{{feature_name.camelCase()}}Text); | ||
} | ||
} |
13 changes: 13 additions & 0 deletions
13
...Case()}}/lib/src/ui/pages/detail/components/{{feature_name.snakeCase()}}_detail_text.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import 'package:features_{{feature_name.snakeCase()}}/src/gen/l10n/l10n.dart'; | ||
import 'package:flutter/material.dart'; | ||
|
||
class {{feature_name.pascalCase()}}DetailText extends StatelessWidget { | ||
const {{feature_name.pascalCase()}}DetailText({super.key}); | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
final l10n = L10n.of(context); | ||
|
||
return Text(l10n.{{feature_name.camelCase()}}DetailText); | ||
} | ||
} |
30 changes: 30 additions & 0 deletions
30
..._name.snakeCase()}}/lib/src/ui/pages/detail/{{feature_name.snakeCase()}}_detail_page.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import 'package:features_{{feature_name.snakeCase()}}/src/gen/l10n/l10n.dart'; | ||
import 'package:features_{{feature_name.snakeCase()}}/src/ui/components/{{feature_name.snakeCase()}}_text.dart'; | ||
import 'package:features_{{feature_name.snakeCase()}}/src/ui/pages/detail/components/{{feature_name.snakeCase()}}_detail_text.dart'; | ||
import 'package:flutter/material.dart'; | ||
|
||
class {{feature_name.pascalCase()}}DetailPage extends StatelessWidget { | ||
const {{feature_name.pascalCase()}}DetailPage({super.key}); | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
final l10n = L10n.of(context); | ||
|
||
return Scaffold( | ||
appBar: AppBar( | ||
title: Text(l10n.{{feature_name.camelCase()}}DetailAppBarTitle), | ||
), | ||
body: const SafeArea( | ||
child: Center( | ||
child: Column( | ||
mainAxisSize: MainAxisSize.min, | ||
children: [ | ||
{{feature_name.pascalCase()}}Text(), | ||
{{feature_name.pascalCase()}}DetailText(), | ||
], | ||
), | ||
), | ||
), | ||
); | ||
} | ||
} |
13 changes: 13 additions & 0 deletions
13
...nakeCase()}}/lib/src/ui/pages/list/components/{{feature_name.snakeCase()}}_list_text.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import 'package:features_{{feature_name.snakeCase()}}/src/gen/l10n/l10n.dart'; | ||
import 'package:flutter/material.dart'; | ||
|
||
class {{feature_name.pascalCase()}}ListText extends StatelessWidget { | ||
const {{feature_name.pascalCase()}}ListText({super.key}); | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
final l10n = L10n.of(context); | ||
|
||
return Text(l10n.{{feature_name.camelCase()}}ListText); | ||
} | ||
} |
Oops, something went wrong.