59 Commits

Author SHA1 Message Date
27a8fd61cb refactor: Enable DCM linting (#2667)
This is a first step towards enabling DCM for Flame. Though I have tested with all rules, and am working on selecting, assessing, and fixing violations, as a first step, we can merge the infrastructural changes to flame_lint to and GitHub actions.
As a proof of concept, I am enabling two rules for which we have no violations.
I will followup with enabling more rules, adding discussions for controversial changes, and fixing non-controversial violations.
2023-08-24 13:09:26 +02:00
34f69b953c refactor!: Simplify text rendering pipeline (#2663)
While studying the existing text rendering pipeline and infrastructure, in order to better document it and add some easier user-facing ways to render rich text, I found it to be on a slightly overcomplicated state that seems to me to be an artifact of a migration.

Let me first briefly describe how it works with some diagrams (I am writing docs for everything and will re-use this content but wanted to propose this PR first as it will change how things look like).

We have 3 hierarchies related to rendering:

    renderers: children of TextRenderer, these define how to render text (style). do not include text
    formatters: children of TextFormatter, this also define how to render text (style), but a bit more higher level than TextRenderer.
    elements: these are laid-out, styled and ready-render pieces of text (style + string), created by formatters

Note that the renderers and formatters kinda serve the same purpose, but the renderers are a more low-level API. Here is how it it looks like today:

Not only that but all of our TextRenderer are actually FormatterTextRenderer, which just use a formatter to "comply" with the "renderer" interface. There are no "raw" TextRenderers anymore.

This current structure seems to clearly derive from an unfinished transition into the new, higher level and more flexible "formatter" structure while still supporting the "renderers" while we transition. That transition, though, seems to have completed.

The current state makes things more complicated as our current versions of components (TextComponent and TextBoxComponent), specifically the former, have branching code to support both the raw TextRenderer and the specific FormatterTextRenderer implementation, which breaks the inheritance encapsulation and voids its purpose in the first place.

The purpose of this PR is to simplify this class structure by:

    remove the base TextRenderer
    rename FormatterTextRenderer to TextRenderer: all renderers are formatter-based now
    update all references
    simplify the code of the components by only dealing with (former FormatterTextRenderer) TextRenderers

This is what it looks like now:

Note that while this is a breaking change, it should not affect most users as they should be using much more user-facing classes, like the aforementioned components, instead of the backing implementations. In fact even if they use the renderers, they probably use one of the concrete implementations anyway, TextPaint or SpriteFontRenderer. Notwithstanding, I added migration instructions below.

This is a small step towards a world where we completely combine the converts of renderers and formatters, as, in my eyes, they do the same thing (carry the style information w/o the text).

Possible future (but definitely breaking) changes:

    remove renderers entirely and use formatters directly
    consider renaming formatters to renderers (or not)
    rename TextPaint as the name does not make sense in any hierarchical model we use
    (what I am really interested in): allow the creation of text_ and text_box_ components directly from renderers + elements
2023-08-24 09:58:52 +02:00
b26700df7e chore(release): Publish Flame 1.8.2 (#2643)
- flame@1.8.2
 - flame_lint@1.1.0
 - flame_rive@1.9.1
 - flame_tiled@1.13.0
 - flame_isolate@0.4.0+2
 - flame_audio@2.0.5
 - flame_spine@0.1.1+1
 - flame_svg@1.8.1
 - flame_test@1.12.1
 - flame_oxygen@0.1.8+5
 - flame_bloc@1.10.1
 - flame_fire_atlas@1.3.8
 - flame_forge2d@0.14.1+1
 - flame_noise@0.1.1+4
 - flame_network_assets@0.2.0+4
 - flame_lottie@0.2.1+1
2023-08-08 22:17:03 +02:00
c11fdb9940 chore(release): Publish flame v1.8.1 et. al (#2599)
- flame@1.8.1
 - flame_test@1.12.0
 - flame_audio@2.0.4
 - flame_bloc@1.10.0
 - flame_fire_atlas@1.3.7
 - flame_forge2d@0.14.1
 - flame_isolate@0.4.0+1
 - flame_lottie@0.2.1
 - flame_noise@0.1.1+3
 - flame_oxygen@0.1.8+4
 - flame_rive@1.9.0
 - flame_spine@0.1.1
 - flame_svg@1.8.0
 - flame_tiled@1.12.0
 - jenny@1.0.4
 - flame_network_assets@0.2.0+3
2023-07-02 13:40:15 +00:00
973b5808dd chore(publish): Publish Flame v1.8.0 and bridge packages (#2557)
flame@1.8.0
flame_rive@1.8.0
flame_test@1.11.0
flame_audio@2.0.3
flame_bloc@1.9.0
flame_fire_atlas@1.3.6
flame_forge2d@0.14.0
flame_isolate@0.4.0
flame_lint@1.0.0
flame_lottie@0.2.0+3
flame_network_assets@0.2.0+2
flame_noise@0.1.1+2
flame_oxygen@0.1.8+3
flame_spine@0.1.0+1
flame_svg@1.7.4
flame_tiled@1.10.2
jenny@1.0.3
2023-05-28 18:55:47 +00:00
a54f19a405 chore(release): Publish packages (#2555)
- flame@1.8.0
 - flame_rive@1.8.0
 - flame_test@1.11.0
 - flame_audio@2.0.3
 - flame_bloc@1.9.0
 - flame_fire_atlas@1.3.6
 - flame_forge2d@0.14.0
 - flame_isolate@0.4.0
 - flame_lint@0.2.0+3
 - flame_lottie@0.2.0+3
 - flame_network_assets@0.2.0+2
 - flame_noise@0.1.1+2
 - flame_oxygen@0.1.8+3
 - flame_spine@0.1.0+1
 - flame_svg@1.7.4
 - flame_tiled@1.10.2
 - jenny@1.0.3
2023-05-28 18:24:36 +00:00
2f71e06eb8 fix: Update sdk constraints to >=3.0.0 (#2554)
Update the SDK constraint to use >= 3.0.0
2023-05-28 20:09:45 +02:00
b41622db8f fix: Solve warnings from 3.10.0 analyzer (#2532)
Just solves the warnings that the new Flutter version complains about (which makes us lose 10 points on pub).
2023-05-14 16:25:23 +02:00
9591e28541 chore(release): Publish packages (#2504)
- flame@1.7.3
 - flame_audio@2.0.1
 - flame_bloc@1.8.4
 - flame_fire_atlas@1.3.5
 - flame_flare@1.5.4
 - flame_forge2d@0.13.0+1
 - flame_isolate@0.3.0+1
 - flame_lint@0.2.0+2
 - flame_oxygen@0.1.8+2
 - flame_rive@1.7.1
 - flame_svg@1.7.3
 - flame_test@1.10.1
 - flame_tiled@1.10.1
 - jenny@1.0.2
 - flame_noise@0.1.1+1
 - flame_network_assets@0.2.0+1
 - flame_lottie@0.2.0+2
2023-04-16 01:18:03 +02:00
dbda37b81a refactor: Add new lint rules (#2477)
This PR adds the following lint rules to our list:

```
always_put_required_named_parameters_first
avoid_multiple_declarations_per_line
avoid_positional_boolean_parameters
avoid_returning_null_for_void
avoid_returning_this
avoid_unnecessary_containers
enable_null_safety
library_private_types_in_public_api
no_leading_underscores_for_library_prefixes
no_leading_underscores_for_local_identifiers
prefer_null_aware_method_calls
tighten_type_of_initializing_formals
unnecessary_late
use_setters_to_change_properties
```

And these rules were considered, and some changes were made according to
them as a clean-up, but in many places they didn't make sense
(`prefer_asserts_with_message` I would have included, but there were too
many places that needed to be changes):

```
collection_methods_unrelated_type
prefer_asserts_with_message
avoid_renaming_method_parameters
```
2023-04-13 19:42:00 +00:00
ac878d8edf chore(release): Publish packages (#2462) 2023-04-02 20:06:47 +02:00
8294a2a156 docs: Update funding links (#2420)
This just updates the funding links and adds OpenCollective first everywhere and removing BuyMeACoffee.
2023-03-21 07:14:11 +00:00
426b312402 docs: Fix non-markdown section of README files (#2406)
Apparently my previous change broke a lot of the README files because I used markdown on the HTML-only zone. It started all right but at some point after I started testing I accidentally switched.

The backticks also don't work well with links, so I removed them.
2023-03-14 08:36:12 +01:00
5e8ecf5450 docs: Update all README files for the bridge packages to be consistent and not broken (#2402)
While taking a stroll through our pub.dev publishers, I noticed that all
our bridge packages were sorely inconsistent w.r.t their README files.

While some were just special in their own way, a lot of them were just
broken, incorrect, outdated, or otherwise unsuitable. I found:

* broken GitHub badges
* links to the old, non-monorepo versions of the packages
* hardcoded old versions of packages
* lacking bare minimum of details
* references to flame v1/pre v1

But the main thing bugging me was the inconsistency. So, instead of
pursuing fixing each individual mistake, I thought it would be much more
valuable and professional to keep them under a standard template.

This is my proposal, based on the current monorepo main README (which is
shared with the main `flame` package):


![image](https://user-images.githubusercontent.com/882703/224600122-23bc01b0-8df0-4a14-908e-5625808bea49.png)

It includes:

* the flame logo if we have it for a package we own (can be replaced by
a more-specific logo, like for the flame_forge2d package)
* brief 1/2-liner describing what this bridges to, including at least
one link to the relevant library (GitHub preferred) and ending with "to
Flame games" where Flame links to the monorepo main
* badges:
* * pub version _of that package_ (not `flame`)
* * build of the monorepo (not old repos)
* * discord (all the same)
* * melos (all the same)
* a horizontal line
* package name written as `flame_x` in a 1-header (`# flame_x`)
* rest of the description
* other subsections as 2-headers
2023-03-13 09:46:28 -04:00
7de8fe9b6a chore: Standardize and unify SDK versions across packages (#2374)
# Description

This does two things:

## Use double quotes for SDK constraints

Standardize the usage of single or double quotes to specify sdk
constraints across pubspecs
I see no reason this should not be kept consistent
I also see no reason to prefer one over the other, so I searched the
code base and there are 7 instances of single quote vs 32 of double
quotes, so I favored the later

## Update all SDK constraints to 2.18

Let me know if there are any issues with it, but I believe we should
keep this consistent across all packages.
Also there is a pubspec on root which imply all should be on 2.18
anyway.

## Checklist

- [x] I have followed the [Contributor Guide] when preparing my PR.
- [x] I have updated/added tests for ALL new/updated/fixed
functionality.
- [x] I have updated/added relevant documentation in `docs` and added
dartdoc comments with `///`.
- [x] I have updated/added relevant examples in `examples` or `docs`.

## Breaking Change?

- [ ] Yes, this PR is a breaking change.
- [x] No, this PR is not a breaking change.

<!-- Links -->
[Contributor Guide]:
https://github.com/flame-engine/flame/blob/main/CONTRIBUTING.md
[Conventional Commit]: https://conventionalcommits.org/
[CHANGELOG]:
https://github.com/flame-engine/flame/blob/main/CHANGELOG.md

Co-authored-by: Lukas Klingsbo <me@lukas.fyi>
2023-03-01 18:08:13 +00:00
7662118d14 chore(release): Publish flame_lint 0.2.0 (#2301)
- flame_lint@0.2.0
2023-01-28 00:44:29 +00:00
ce7f1110b5 chore(release): Publish packages (#2275)
- flame@1.6.0
 - flame_forge2d@0.12.5
 - flame_jenny@1.0.0
 - flame_rive@1.6.0
 - jenny@1.0.0
 - flame_oxygen@0.1.8
 - flame_bloc@1.8.2
 - flame_isolate@0.2.0
 - flame_lottie@0.2.0
 - flame_test@1.9.2
 - flame_tiled@1.9.1
 - flame_audio@1.3.5
 - flame_flare@1.5.2
 - flame_svg@1.7.1
 - flame_fire_atlas@1.3.3
2023-01-14 19:59:42 +01:00
b003372a74 chore(release): Publish Flame v1.5.0 (and all bridge packages) (#2197)
* chore(release): publish packages

 - flame@1.5.0
 - flame_bloc@1.8.1
 - flame_forge2d@0.12.4
 - flame_lottie@0.1.1
 - flame_rive@1.5.3
 - flame_svg@1.7.0
 - flame_test@1.9.0
 - flame_tiled@1.9.0
 - flame_isolate@0.1.1
 - flame_audio@1.3.3
 - flame_flare@1.5.1
 - flame_oxygen@0.1.7
 - flame_fire_atlas@1.3.2

* Depend on version of test
2022-11-27 19:22:37 -03:00
4542966901 chore: Remove all .gitignore files but one (#2150)
The root level .gitignore file already works for all sub-repositories, so they are all actually unnecessary.
This PR leaves only the gitignore at the root of the repo, removing all others.
2022-11-06 21:22:19 +00:00
3b056c57c5 chore(release): publish packages
- flame@1.4.0
 - flame_test@1.8.0
 - flame_oxygen@0.1.6
 - flame_bloc@1.8.0
 - flame_flare@1.5.0
 - flame_forge2d@0.12.3
 - flame_lint@0.1.3
 - flame_svg@1.6.0
 - flame_tiled@1.8.0
 - flame_rive@1.5.2
 - flame_audio@1.3.2
 - flame_fire_atlas@1.3.1
2022-10-01 15:22:41 +02:00
de04514e29 ci: Markdown linting (#1920)
Adds markdown linting to the CI and fixes up all the current files.
2022-09-19 21:17:50 +00:00
3a9e0023be chore: Add funding links (patreon + buy me a coffee) (#1875)
Adds the links to our patreon and buy me a coffee in the pubspec files so that pub.dev can show them.
2022-09-01 16:45:54 +00:00
9c5709fba1 chore: Upgrade the sdk and dartdoc versions to work with the current Flutter stable (#1881) 2022-09-01 16:26:33 +00:00
b96432d002 chore(release): publish packages (#1852) 2022-08-19 23:22:21 +02:00
c7c4480d79 chore(release): publish packages (#1789)
* chore(release): publish packages

 - flame@1.2.1
 - flame_audio@1.3.0
 - flame_test@1.6.0
 - flame_bloc@1.6.0
 - flame_fire_atlas@1.2.0
 - flame_flare@1.3.0
 - flame_forge2d@0.12.1
 - flame_lint@0.1.1
 - flame_oxygen@0.1.4
 - flame_rive@1.5.0
 - flame_svg@1.4.0
 - flame_tiled@1.6.0

* Update packages/flame/CHANGELOG.md
2022-07-08 13:41:14 +02:00
5225a4ebd5 refactor: Game is now a class, not a mixin (#1751)
This simple refactor allows us to write class MyGame extends Game, instead of a more awkward class MyGame with Game. However, using ... with Game still continues to work, so no changes necessary for the users.
2022-06-25 21:32:32 +00:00
c738384314 fix: Correct flutter constraint (#1731)
Pub gives a warning when using ^3.0.0 since that also implies less than 4.0.0, which your Flutter dependency shouldn't be.
With >= it is an open range instead.
2022-06-14 19:59:01 -04:00
2a41d0d683 feat: Move to Flutter 3.0.0 and Dart 2.17.0 (#1713)
This upgrades all packages to Flutter 3.0.0 and fixes all analyze issues that came from that.
2022-06-08 06:04:40 +00:00
ad602ff963 chore: v1.2.0 changelogs (#1712)
* chore(release): publish packages

 - flame@1.2.0
 - flame_audio@1.1.0
 - flame_bloc@1.5.0
 - flame_fire_atlas@1.1.0
 - flame_flare@1.2.0
 - flame_forge2d@0.12.0
 - flame_oxygen@0.1.3
 - flame_rive@1.3.0
 - flame_svg@1.3.0
 - flame_test@1.5.0
 - flame_tiled@1.5.0
2022-06-07 16:52:55 +02:00
49252f8ef2 feat: Add more lint rules (#1703)
Adds some more lint rules and fixes the issues those rules pointed out.
2022-06-06 19:23:25 +00:00
843ddc3624 refactor: Move to package imports (#1625)
* refactor: Move to package imports

* Fix local imports

* Removed unused imports
2022-05-15 15:04:35 +00:00
beac901313 feat: Bump to Flutter 2.10.0 (#1617) 2022-05-13 12:50:08 +02:00
4c68c2b0a2 feat: Add FpsComponent and FpsTextComponent (#1595) 2022-05-11 19:49:14 +02:00
b1fae2976e fix: Fix setter in Oxygen's SizeComponent (#1557) 2022-04-20 17:53:34 +02:00
c79d5638b7 chore(release): publish packages
- flame@1.1.1
 - flame_oxygen@0.1.2
 - flame_bloc@1.3.0
 - flame_forge2d@0.11.0
 - flame_rive@1.2.0
 - flame_svg@1.2.0
 - flame_test@1.4.0
 - flame_tiled@1.4.0
 - flame_audio@1.0.2
 - flame_flare@1.1.1
 - flame_fire_atlas@1.0.2
2022-04-12 18:08:43 +02:00
3b80c767fe chore: Release 1.1 (#1496)
* chore(release): publish packages

 - flame@1.1.0
 - flame_audio@1.0.1
 - flame_bloc@1.2.0
 - flame_fire_atlas@1.0.1
 - flame_flare@1.1.0
 - flame_forge2d@0.9.0
 - flame_oxygen@0.1.1
 - flame_rive@1.1.0
 - flame_svg@1.1.0
 - flame_test@1.2.0
 - flame_tiled@1.3.0

* feat: Bump forge2d

* chore: Bump Forge2D to 0.10.0

* docs: Update Forge2D examples to 0.10.0
2022-03-28 00:28:20 +02:00
e0125ad482 chore(release): publish packages (#1480)
- flame_audio@1.0.1-releasecandidate.1
 - flame_fire_atlas@1.0.1-releasecandidate.1
 - flame_flare@1.1.0-releasecandidate.1
 - flame_oxygen@0.1.1-releasecandidate.1
 - flame@1.1.0-releasecandidate.6
 - flame_bloc@1.2.0-releasecandidate.6
 - flame_forge2d@0.9.0-releasecandidate.6
 - flame_svg@1.1.0-releasecandidate.5
 - flame_test@1.2.0-releasecandidate.6
 - flame_rive@1.1.0-releasecandidate.6
 - flame_tiled@1.3.0-releasecandidate.6
2022-03-22 10:56:01 -03:00
e32dd326f5 chore: Remove publish_to: none where not needed (#1453) 2022-03-14 20:59:42 +00:00
6a32dc341d chore(release): publish packages (#1446)
- flame@1.1.0-releasecandidate.5
 - flame_forge2d@0.9.0-releasecandidate.5
 - flame_svg@1.1.0-releasecandidate.4
 - flame_test@1.2.0-releasecandidate.5
 - flame_rive@1.1.0-releasecandidate.5
 - flame_tiled@1.3.0-releasecandidate.5
 - flame_bloc@1.2.0-releasecandidate.5
2022-03-13 14:37:45 +00:00
0ac748e158 chore(release): publish packages (#1440)
- flame@1.1.0-releasecandidate.4
 - flame_forge2d@0.9.0-releasecandidate.4
 - flame_svg@1.1.0-releasecandidate.3
 - flame_test@1.2.0-releasecandidate.4
 - flame_rive@1.1.0-releasecandidate.4
 - flame_tiled@1.3.0-releasecandidate.4
 - flame_bloc@1.2.0-releasecandidate.4
2022-03-11 14:37:46 -03:00
6016330a68 chore(release): publish packages (#1436)
- flame@1.1.0-releasecandidate.3
 - flame_bloc@1.2.0-releasecandidate.3
 - flame_svg@1.1.0-releasecandidate.2
 - flame_test@1.2.0-releasecandidate.3
 - flame_rive@1.1.0-releasecandidate.3
 - flame_forge2d@0.9.0-releasecandidate.3
 - flame_tiled@1.3.0-releasecandidate.3
2022-03-10 14:21:30 +00:00
e30bf520e6 chore(release): publish packages (#1427)
- flame_svg@1.1.0-releasecandidate.1
 - flame@1.1.0-releasecandidate.2
 - flame_bloc@1.2.0-releasecandidate.2
 - flame_forge2d@0.9.0-releasecandidate.2
 - flame_rive@1.1.0-releasecandidate.2
 - flame_test@1.2.0-releasecandidate.2
 - flame_tiled@1.3.0-releasecandidate.2
2022-03-08 17:35:26 -03:00
aedb30be8e chore(release): publish packages (#1407)
- flame@1.1.0-releasecandidate.1
 - flame_bloc@1.2.0-releasecandidate.1
 - flame_rive@1.1.0-releasecandidate.1
 - flame_test@1.2.0-releasecandidate.1
 - flame_tiled@1.3.0-releasecandidate.1
2022-02-28 15:09:17 -03:00
0ddf6d094a remove "test" dependency (#1367) 2022-02-12 08:05:51 -03:00
9935a5024c chore: Add melos-action to cicd (#1354) 2022-02-10 22:49:40 +01:00
9f096053fd docs: Fix various dartdoc warnings (#1353) 2022-02-04 14:00:47 +01:00
05f7a4c3d6 refactor: Remove Loadable, optional onLoads (#1333) 2022-01-24 23:23:12 +01:00
a0cf56ee0c chore: Ensure unique names for all flame sub-packages (#1214)
Co-authored-by: Lukas Klingsbo <lukas.klingsbo@gmail.com>
2021-12-14 13:22:12 -03:00
5c47d7f6d7 chore: analyze issues introduced from new dart version (#1196)
* Added Component.childrenFactory

* fix some of the lint warnings

* more lint warnings

* remove changelog entry

* more analyzer warnings

* one more warning

* one more warning

* remove more unused imports

* fix more warnings

* another warning

* one more warning

* a lot more warnings

* some more warnings

* fix warnings in flame_svg

* fix warnings in flame_bloc

* Remove OrderedSet override feature

* Remove testRandom change

* Remove unnecessary type checks

* Re-remove deprecated argument in random_test

Co-authored-by: Pasha Stetsenko <stpasha@google.com>
2021-12-09 15:40:43 +01:00
080fb958fe Publish flame oxygen 0.1.1 (#1189) 2021-12-08 21:07:09 +00:00