diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 000000000..07f70bf67 --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,31 @@ +name: Publish to pub.dev + +on: + push: + tags: + - 'v[0-9]+.[0-9]+.[0-9]+*' + +jobs: + test: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + - uses: subosito/flutter-action@v2 + with: + channel: "stable" + + - run: flutter --version + - run: flutter pub get + + - uses: axel-op/dart-package-analyzer@v3 + with: + githubToken: ${{ secrets.GITHUB_TOKEN }} + - run: flutter test + + publish: + needs: test + permissions: + id-token: write # Required for authentication using OIDC + uses: dart-lang/setup-dart/.github/workflows/publish.yml@v1 + \ No newline at end of file diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 69abd6adc..138cee976 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -22,4 +22,4 @@ jobs: - uses: axel-op/dart-package-analyzer@v3 with: githubToken: ${{ secrets.GITHUB_TOKEN }} - - run: flutter test --coverage + - run: flutter test diff --git a/.github/workflows/version-deploy.yml b/.github/workflows/version-deploy.yml deleted file mode 100644 index 1a16a30f2..000000000 --- a/.github/workflows/version-deploy.yml +++ /dev/null @@ -1,40 +0,0 @@ -name: Create Release - -# on: [push, pull_request] -on: - release: - types: [published, released] - -jobs: - test: - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v2 - - uses: subosito/flutter-action@v2 - with: - channel: "stable" - - - run: flutter --version - - run: flutter pub get - - - uses: axel-op/dart-package-analyzer@v3 - with: - githubToken: ${{ secrets.GITHUB_TOKEN }} - - run: flutter test --coverage - - release: - name: Release - needs: test - runs-on: ubuntu-latest - env: - PUB_CREDENTIALS: ${{ secrets.PUB_CREDENTIALS }} - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - steps: - - name: 'Checkout' - uses: actions/checkout@v2 # required! - - - name: '>> Dart package <<' - uses: k-paxian/dart-package-publisher@master - with: - credentialJson: ${{ secrets.PUB_CREDENTIALS }} \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index 0e344bf39..3c4beceab 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,10 +1,18 @@ +## 1.0.0-beta.1 + +- Revamped Mix API for improved functionality and developer experience. +- Enhanced performance and system responsiveness. +- Broadened test coverage for greater reliability. +- Extensive bug fixes for increased stability. + +Visit our documentation site for more information [https://fluttermix.com](https://fluttermix.com) + ## 0.0.7 - Performance improvements - Bug fixes [#59](https://github.com/leoafarias/mix/issues/59) by @bdlukaa - InheritedAttribute - Custiom Mix attributes [#94](https://github.com/leoafarias/mix/pull/94) by @pbissonho - ## 0.0.6 - Refactored MixTheme & Context Tokens diff --git a/README.md b/README.md index fffd7822e..acdcd6444 100644 --- a/README.md +++ b/README.md @@ -5,20 +5,13 @@ --- -![GitHub stars](https://img.shields.io/github/stars/fluttertools/mix?style=social) +![GitHub stars](https://img.shields.io/github/stars/conceptadev/mix?style=for-the-badge&logo=GitHub&logoColor=black&labelColor=white&color=dddddd) [![Pub Version](https://img.shields.io/pub/v/mix?label=version&style=for-the-badge)](https://pub.dev/packages/mix/changelog) ![Pub Likes](https://img.shields.io/pub/likes/mix?label=Pub%20Likes&style=for-the-badge) ![Pub Points](https://img.shields.io/pub/points/mix?label=Pub%20Points&style=for-the-badge) [![Github All Contributors](https://img.shields.io/github/all-contributors/leoafarias/mix?style=for-the-badge)](https://github.com/leoafarias/mix/graphs/contributors) [![MIT Licence](https://img.shields.io/github/license/leoafarias/mix?style=for-the-badge&longCache=true)](https://opensource.org/licenses/mit-license.php) [![Awesome Flutter](https://img.shields.io/badge/awesome-flutter-purple?longCache=true&style=for-the-badge)](https://github.com/Solido/awesome-flutter) Build Flutter design systems expressively and effortlessly. **Mix** offers primitive building blocks to help developers and designers create beautiful UI with confidence. -**Important** - -```text -Mix is currently being used internally to build design systems in Flutter. -It is still in heavy development. Major APIs are expected to change until the 1.0 release. -``` - ## Motivation Flutter favors [composition](https://docs.flutter.dev/resources/architectural-overview#composition) over inheritance when building widgets. This choice keeps Flutter API extremely easy to interact with and powerful. @@ -67,39 +60,8 @@ Box [Read our docs for more information](https://www.fluttermix.com) -## Contributors ✨ - -Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)): - - - - - - - - - - - - - - - - - - - -
Leo Farias
Leo Farias

🤔 💻 📖
Bruno D'Luka
Bruno D'Luka

💻
Rick Berger
Rick Berger

📖
Souvik Biswas
Souvik Biswas

🖋
Lucas Oliveira
Lucas Oliveira

💻
Pedro Bissonho
Pedro Bissonho

💻 🤔
Marco A. Braghim
Marco A. Braghim

💻
Eduardo M.
Eduardo M.

💻
- - - - - - -This project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome! - - -

- -

+## Contributors + +
+ diff --git a/deprecation.md b/deprecation.md deleted file mode 100644 index f8282629c..000000000 --- a/deprecation.md +++ /dev/null @@ -1,74 +0,0 @@ - -# API Changes - -## Composability - -To compose mixes we used `Mix()`, however this is confusing when dealing with resolved Mixes from context, `Mix` also is not the resolved mix and was not clear when dealing with mix Builder, and resolved mix data, therefore we have renamed the internal to `MixFactory` which is a better definition of what is doing. However we have created an alias for `Style`, and have deprecated `Mix`. The recommendation, will be to use `Style` and this will the preferred way on the documentations, and internal references. - -Keep in mind that you can create type aliases, in order to best fit your teams workflows and definitions. - -## Mix Context - -There has been some considerable changes on the inter workings of Mix Context, to support better semantics an performance improvements. - -- MixContext is now MixData - -This does not impact the current behavior of Mix, but if you were building internal widgets or using the Builder most like this will be changed. - -## Material Theme Tokens have been changed also - -## Inherit Mix has been removed - -Inheritance of Mix was turned on by default for Text and Icon widgets. However best practice now is to be explicit on which Mix to pass down, by passing the Mix itself. All inheritance has now been turn off to facilitate debugging and troubleshooting. Also we do plan better tooling for migration, and automation that makes a more explicit inheritance a much more favorable approach. - -```dart - -final boxStyle = Style(backgroundColor(Colors.red)); -final textStyle = Style(text.style(color: Colors.white)); - -return Box( - style: boxStyle, - child: StyledText('Content', style: textStyle,), -); - -``` - -## Simplified utilities - -In order to simplify the API and make documentation easier for onboarding, we decided to support a simpler utilities, that align better with the expectation from the Flutter ecosystem. - -### Removed of short utilities - -No longer shorter versions of utilities will be supported, example: - -- `p(10)` will be supported, instead we will support `padding(10)`. - -### Removed utilities APIs - -There were APIs that did redundant functionality. For example `border` and `textStyle` - -A border around all sides could be defined the following way: - -```dart -borderWidth(1) -borderColor(Colors.red) -borderStyle(BorderStyle.solid) -``` - -However we now prefer the current supported way which is: - -```dart -border(width:1, color:Colors.red, style:BorderStyle.solid) -``` - -Many text style utilities have also been deprecated in favor of the `textStyle` utility. - -```dart -textColor(Colors.white) -``` - -Will now become: - -```dart -textSyle(textColor:Colors.white) -``` diff --git a/lib/src/deprecations.dart b/lib/src/deprecations.dart index eb6dc4f15..c0001f55a 100644 --- a/lib/src/deprecations.dart +++ b/lib/src/deprecations.dart @@ -1,5 +1,3 @@ -import 'package:flutter/material.dart'; - import '../mix.dart'; const kShortAliasDeprecation = @@ -9,47 +7,43 @@ const kShortAliasDeprecation = typedef Mix = Style; extension DeprecatedMixExtension on Style { - /// Adds an Attribute to a Mix. - @Deprecated('Simplifying the mix API to avoid confusion. Use apply instead') - SpreadFunctionParams get mix => SpreadFunctionParams(addAttributes); - - @Deprecated('Use applyVariant(value:) instead') + @Deprecated('Use applyVariant(value) instead') Style withVariants(List variants) => withManyVariants(variants); - @Deprecated('Use applyVariants(value:) instead') + @Deprecated('Use applyVariants(value) instead') Style withManyVariants(Iterable variants) => applyVariants(variants); @Deprecated( - 'Use merge() or mergeMany() instead. You might have to turn into a Mix first. firstMixFactory.merge(secondMix)', + 'Use merge() instead. You might have to turn into a Mix first. firstMixFactory.merge(secondMix)', ) Style addAttributes(Iterable attributes) => merge(Style.create(attributes)); - @Deprecated('Use merge() or mergeMany() instead') + @Deprecated('Use merge() instead') SpreadFunctionParams get apply => const SpreadFunctionParams(Style.combine); - @Deprecated('Use applyVariant(value:) instead') + @Deprecated('Use applyVariant(value) instead') Style withVariant(Variant value) => applyVariant(value); @Deprecated('Use combine instead') Style combineAll(List