Skip to content

Commit

Permalink
Merge pull request #288 from conceptadev/chore/monorepo
Browse files Browse the repository at this point in the history
Create a monorepo
  • Loading branch information
tilucasoli authored Jun 11, 2024
2 parents 761c246 + bd8a04c commit bf006ab
Show file tree
Hide file tree
Showing 431 changed files with 8,715 additions and 206 deletions.
19 changes: 15 additions & 4 deletions .github/actions/test/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,31 +6,42 @@ on:
token:
required: true
type: string
run-dcm:
required: false
type: boolean
default: true
flutter-version:
required: false
default: ""

runs:
using: "composite"
steps:
- name: Checkout mix repo
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Setup Flutter
uses: subosito/flutter-action@v2
with:
channel: "stable"
flutter-version: ${{ inputs.flutter-version }}

- run: flutter pub get
shell: bash
- name: Setup Melos
uses: bluefireteam/melos-action@v3

- uses: invertase/github-action-dart-analyzer@v1
with:
fatal-infos: false

- name: Install DCM
if: ${{ inputs.run-dcm }}
uses: CQLabs/setup-dcm@v1
with:
github_token: ${{ inputs.token }}
folders: packages/*/lib

- name: Run DCM
if: ${{ inputs.run-dcm }}
uses: CQLabs/dcm-action@v1
with:
github_token: ${{ inputs.token }}
Expand All @@ -41,5 +52,5 @@ runs:
fatal_performance: true
fatal_warnings: true

- run: flutter test
- run: melos exec --ignore="mix_lint" --scope="packages/**" flutter test
shell: bash
1 change: 1 addition & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,4 @@ jobs:
with:
accessToken: ${{ secrets.OAUTH_ACCESS_TOKEN }}
refreshToken: ${{ secrets.OAUTH_REFRESH_TOKEN }}
relativePath: "packages/mix"
16 changes: 5 additions & 11 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,15 +38,9 @@ jobs:
- name: Checkout mix repo
uses: actions/checkout@v2

- name: Setup Flutter
uses: subosito/flutter-action@v2
with:
flutter-version: "3.10.6"

- run: flutter pub get

- uses: invertase/github-action-dart-analyzer@v1
- name: Run Tests
uses: ./.github/actions/test/
with:
fatal-infos: false

- run: flutter test
token: ${{ secrets.GITHUB_TOKEN }}
run-dcm: false
flutter-version: "3.10.6"
103 changes: 0 additions & 103 deletions example/README.md

This file was deleted.

43 changes: 43 additions & 0 deletions examples/themed_button/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# 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
.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
45 changes: 45 additions & 0 deletions examples/themed_button/.metadata
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# 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: "5dcb86f68f239346676ceb1ed1ea385bd215fba1"
channel: "stable"

project_type: app

# Tracks metadata for the flutter migrate command
migration:
platforms:
- platform: root
create_revision: 5dcb86f68f239346676ceb1ed1ea385bd215fba1
base_revision: 5dcb86f68f239346676ceb1ed1ea385bd215fba1
- platform: android
create_revision: 5dcb86f68f239346676ceb1ed1ea385bd215fba1
base_revision: 5dcb86f68f239346676ceb1ed1ea385bd215fba1
- platform: ios
create_revision: 5dcb86f68f239346676ceb1ed1ea385bd215fba1
base_revision: 5dcb86f68f239346676ceb1ed1ea385bd215fba1
- platform: linux
create_revision: 5dcb86f68f239346676ceb1ed1ea385bd215fba1
base_revision: 5dcb86f68f239346676ceb1ed1ea385bd215fba1
- platform: macos
create_revision: 5dcb86f68f239346676ceb1ed1ea385bd215fba1
base_revision: 5dcb86f68f239346676ceb1ed1ea385bd215fba1
- platform: web
create_revision: 5dcb86f68f239346676ceb1ed1ea385bd215fba1
base_revision: 5dcb86f68f239346676ceb1ed1ea385bd215fba1
- platform: windows
create_revision: 5dcb86f68f239346676ceb1ed1ea385bd215fba1
base_revision: 5dcb86f68f239346676ceb1ed1ea385bd215fba1

# 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'
16 changes: 16 additions & 0 deletions examples/themed_button/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# themed_button

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.
28 changes: 28 additions & 0 deletions examples/themed_button/analysis_options.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# This file configures the analyzer, which statically analyzes Dart code to
# check for errors, warnings, and lints.
#
# The issues identified by the analyzer are surfaced in the UI of Dart-enabled
# IDEs (https://dart.dev/tools#ides-and-editors). The analyzer can also be
# invoked from the command line by running `flutter analyze`.

# The following line activates a set of recommended lints for Flutter apps,
# packages, and plugins designed to encourage good coding practices.
include: package:flutter_lints/flutter.yaml

linter:
# The lint rules applied to this project can be customized in the
# section below to disable rules from the `package:flutter_lints/flutter.yaml`
# included above or to enable additional rules. A list of all available lints
# and their documentation is published at https://dart.dev/lints.
#
# Instead of disabling a lint rule for the entire project in the
# section below, it can also be suppressed for a single line of code
# or a specific dart file by using the `// ignore: name_of_lint` and
# `// ignore_for_file: name_of_lint` syntax on the line or in the file
# producing the lint.
rules:
# avoid_print: false # Uncomment to disable the `avoid_print` rule
# prefer_single_quotes: true # Uncomment to enable the `prefer_single_quotes` rule

# Additional information about this file can be found at
# https://dart.dev/guides/language/analysis-options
52 changes: 52 additions & 0 deletions examples/themed_button/lib/button/button.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
import 'package:flutter/material.dart';
import 'package:mix/mix.dart';
import 'package:themed_button/button/button.style.dart' as style;

import 'button.variants.dart';

class ThemedButton extends StatelessWidget {
const ThemedButton({
super.key,
required this.onPressed,
this.label,
this.disabled = false,
this.loading = false,
this.iconLeft,
this.type = ButtonType.primary,
this.size = ButtonSize.medium,
});

final String? label;
final bool disabled;
final bool loading;
final IconData? iconLeft;
final ButtonType type;
final ButtonSize size;
final VoidCallback? onPressed;

List<Widget> _buildDefaultChildren() => [
if (iconLeft != null)
StyledIcon(
iconLeft,
style: style.icon().applyVariant(type, size),
),
if (label != null)
StyledText(
label!,
style: style.label().applyVariant(type, size),
),
];

@override
Widget build(BuildContext context) {
// final style = buildStyle([size, type, ...variants]);

return PressableBox(
onPress: disabled || loading ? null : onPressed,
child: HBox(
style: style.container().applyVariant(type, size),
children: _buildDefaultChildren(),
),
);
}
}
Loading

0 comments on commit bf006ab

Please sign in to comment.