Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore!: Introduce Melos and bump versions #53

Merged
merged 4 commits into from
Sep 8, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
patreon: bluefireoss
46 changes: 46 additions & 0 deletions .github/ISSUE_TEMPLATE/1_bug.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
---
name: Bug report.
about: You are using the tiled dart library but you are noticing some strange behaviour, that it throws an unexpected exception, or that it is not working according to the specifications.
title: ''
labels: 'bug'
assignees: ''

---


<!-- When reporting a bug, please read this complete template and fill all the questions in order to get a better response -->

# Current bug behaviour
<!-- What is the current behaviour that you see? -->

# Expected behaviour
<!-- What behaviour did you expect? -->

# Steps to reproduce
<!-- This one is very important, please be very precise in how we can reproduce this bug -->
<!-- If possible please report steps based on the example from this plugin! -->

# Flutter doctor output
<!-- Execute in a terminal and put output into code block below -->
```
Output of: flutter doctor -v
```

# More environment information
<!--
Create a list of more environment information, like:
* Tiled version: 1.0.0
* Platform affected: android, ios, web
* Platform version affected: android 9, ios 13
-->

# Log information
<!-- If you have any debug / error logging, please fill it here within the code block below -->
```
Enter log information in this code block
```

# More information
<!-- Do you have any other useful information about this bug report? Please write it down here -->
<!-- Possible helpful information: references to other sites/repositories -->
<!-- Are you interested in working on a PR for this? -->
21 changes: 21 additions & 0 deletions .github/ISSUE_TEMPLATE/2_feature.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
---
name: Feature request.
about: Suggest a new feature for the Tiled library.
title: ''
labels: 'enhancement'
assignees: ''

---

<!-- When reporting a feature, please read this complete template and fill all the questions in order to get a better response -->

# Problem to solve
<!-- Which problem would be solved with this feature? -->

# Proposal
<!-- What do you propose as a solution? Add as much information as you can! -->

# More information
<!-- Do you have any other useful information about this feature report? Please write it down here -->
<!-- Possible helpful information: references to other sites/repositories -->
<!-- Are you interested in working on a PR for this? -->
24 changes: 24 additions & 0 deletions .github/ISSUE_TEMPLATE/3_improvement.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
---
name: Improvement suggestion.
about: Something in the Dart Tiled library can be improved.
title: ''
labels: 'enhancement'
assignees: ''

---

<!-- When reporting a improvement, please read this complete template and fill all the questions in order to get a better response -->

# What could be improved
<!-- What part of the code/functionality could be improved? -->

# Why should this be improved
<!-- Why is this necessary to be improved? -->

# Any risks?
<!-- Are there any risks in improving this? Will the API change? Will other functionality change? -->

# More information
<!-- Do you have any other useful information about this improvement report? Please write it down here -->
<!-- Possible helpful information: references to other sites/repositories -->
<!-- Are you interested in working on a PR for this? -->
5 changes: 5 additions & 0 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
blank_issues_enabled: true
contact_links:
- name: Join us on Discord!
url: https://discord.gg/pxrBmy4
about: Ask your questions to the community!
46 changes: 46 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# Description

<!-- Provide a description of what this PR is doing.
If you're modifying existing behavior, describe the existing behavior, how this PR is changing it,
and what motivated the change. If this is a breaking change, specify explicitly which APIs have been
changed. -->

## Checklist

<!-- Before you create this PR confirm that it meets all requirements listed below by checking the
relevant checkboxes (`[x]`). This will ensure a smooth and quick review process. -->

- [ ] The title of my PR starts with a [Conventional Commit] prefix (`fix:`, `feat:`, `docs:` etc).
- [ ] I have read the [Contributor Guide] and followed the process outlined for submitting PRs.
- [ ] I have updated/added tests for ALL new/updated/fixed functionality.
- [ ] I have updated/added relevant documentation in `docs` and added dartdoc comments with `///`.
- [ ] I have updated/added relevant examples in `examples`.

## Breaking Change

<!-- Does your PR require users of the Tiled Dart library to manually update their apps to
accommodate your change?

If the PR is a breaking change this should be indicated with suffix "!"
(for example, `feat!:`, `fix!:`). See [Conventional Commit] for details.
-->

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

<!-- ### Migration instructions

If the PR is breaking, uncomment this header and add instructions for how to migrate from the
currently released version to the new proposed way.
-->

## Related Issues

<!-- Provide a list of issues related to this PR from the [issue database].
Indicate which of these issues are resolved or fixed by this PR, i.e. Fixes #xxxx* !-->

<!-- Links -->
[issue database]: https://github.com/flame-engine/tiled.dart/issues
[Contributor Guide]: https://github.com/flame-engine/flame/blob/main/CONTRIBUTING.md
[Flame Style Guide]: https://github.com/flame-engine/flame/blob/main/STYLEGUIDE.md
[Conventional Commit]: https://conventionalcommits.org
14 changes: 14 additions & 0 deletions .github/workflows/title-validation.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: title-validation

on:
pull_request:
types: [opened, reopened, synchronize]

jobs:
validate-pr-title:
name: Validate PR title
runs-on: ubuntu-latest
steps:
- uses: amannn/action-semantic-pull-request@v4
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
37 changes: 26 additions & 11 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,14 +1,29 @@
/packages
/build

/.pub
.DS_Store
.atom/
.idea
**/*.iml
.packages
.dart_tool/
.pub/
pubspec.lock
packages/flame/doc/api/
.flutter-plugins
.vscode/
**/.flutter-plugins
**/.flutter-plugins-dependencies
**/pubspec_overrides.yaml

# IDEs
/.idea
android/
ios/
desktop/
build/
_build/
**/doc/

.packages
.dart_tool
.vscode/
coverage/
doc/
coverage
**/failures

.fvm
Makefile
!doc/_sphinx/Makefile
.bak
186 changes: 186 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,186 @@
# Contribution Guidelines

**Note:** If these contribution guidelines are not followed your issue or PR might be closed, so
please read these instructions carefully.


## Contribution types

### Bug Reports
- If you find a bug, please first report it using [Github issues].
- First check if there is not already an issue for it; duplicated issues will be closed.


### Bug Fix
- If you'd like to submit a fix for a bug, please read the [How To](#how-to-contribute) for how to
send a Pull Request.
- Indicate on the open issue that you are working on fixing the bug and the issue will be assigned
to you.
- Write `Fixes #xxxx` in your PR text, where xxxx is the issue number (if there is one).
- Include a test that isolates the bug and verifies that it was fixed.


### New Features
- If you'd like to add a feature to the library that doesn't already exist, feel free to describe
the feature in a new [GitHub issue].
- You can also join us on [Discord] to discuss some initials
thoughts.
- If you'd like to implement the new feature, please wait for feedback from the project maintainers
before spending too much time writing the code. In some cases, enhancements may not align well
with the project objectives at the time.
- Implement the code for the new feature and please read the [How To](#how-to-contribute).


### Documentation & Miscellaneous
- If you have suggestions for improvements to the documentation, tutorial or examples (or something
else), we would love to hear about it.
- As always first file a [Github issue].
- Implement the changes to the documentation, please read the [How To](#how-to-contribute).


## How To Contribute

### Requirements
For a contribution to be accepted:

- Documentation should always be updated or added.*
- Examples should always be updated or added.*
- Tests should always be updated or added.*
- Format the Dart code accordingly with `flutter format`.
- Your code should pass the analyzer checks `melos run analyze`.
- Your code should pass all tests `melos run test`.
- Start your PR title with a [conventional commit] type
(`feat:`, `fix:` etc).

*When applicable.

If the contribution doesn't meet these criteria, a maintainer will discuss it with you on the issue
or PR. You can still continue to add more commits to the branch you have sent the Pull Request from
and it will be automatically reflected in the PR.


## Open an issue and fork the repository
- If it is a bigger change or a new feature, first of all
[file a bug or feature report][GitHub issues], so that we can discuss what direction to follow.
- [Fork the project][fork guide] on GitHub.
- Clone the forked repository to your local development machine
(e.g. `git clone git@github.com:<YOUR_GITHUB_USER>/tiled.dart.git`).


### Environment Setup
The Dart Tiled library uses [Melos] to manage the project and dependencies.

To install Melos, run the following command from your terminal:

```bash
flutter pub global activate melos
```

Next, at the root of your locally cloned repository bootstrap the projects dependencies:

```bash
melos bootstrap
```

The bootstrap command locally links all dependencies within the project without having to
provide manual [`dependency_overrides`][pubspec doc]. This allows all
plugins, examples and tests to build from the local clone project. You should only need to run this
command once.

> You do not need to run `flutter pub get` once bootstrap has been completed.


### Performing changes
- Create a new local branch from `main` (e.g. `git checkout -b my-new-feature`)
- Make your changes (try to split them up with one PR per feature/fix).
- When committing your changes, make sure that each commit message is clear
(e.g. `git commit -m 'Take in an optional horizontal offset'`).
- Push your new branch to your own fork into the same remote branch
(e.g. `git push origin my-username.my-new-feature`, replace `origin` if you use another remote.)


### Breaking changes

When doing breaking changes a deprecation tag should be added when possible and contain a message
that conveys to the user what which version that the deprecated method/field will be removed in and
what method they should use instead to perform the task. The version specified should be at least
two versions after the current one, such that there will be at least one stable release where the
users get to see the deprecation warning and in the version after that (or a later version) the
deprecated entity should be removed.

Example (if the current version is v1.3.0):

```dart
@Deprecated('Will be removed in v1.5.0, use nonDeprecatedFeature() instead')
void deprecatedFeature() {}
```


### Open a pull request

Go to the [pull request page of tiled.dart][PRs] and in the top
of the page it will ask you if you want to open a pull request from your newly created branch.

The title of the pull request should start with a [conventional commit] type.

Examples of such types:
- `fix:` - patches a bug and is not a new feature.
- `feat:` - introduces a new feature.
- `docs:` - updates or adds documentation or examples.
- `test:` - updates or adds tests.
- `refactor:` - refactors code but doesn't introduce any changes or additions to the public API.

If you introduce a **breaking change** the conventional commit type MUST end with an exclamation
mark (e.g. `feat!: Remove the position argument from PositionComponent`).

Examples of PR titles:
- feat: Hexagon support
- fix: Avoid infinite loop when parsing tiles
- docs: Add a hexagon tile example
- docs: Improve the Mandarin README
- test: Add infinity test for `Layer`
- refactor: Optimize the structure of the parsing loop


# Maintainers

These instructions are for the maintainers of tiled.dart.


## Merging a pull request

When merging a pull request, make sure that the title of the merge commit has the correct
conventional commit tag and a descriptive title. This is extra important since sometimes the title
of the PR doesn't reflect what GitHub defaults to for the merge commit title (if the title has been
changed during the life time of the PR for example).

All the default text should be removed from the commit message and the PR description and the
instructions from the "Migration instruction" (if the PR is breaking) should be copied into the
commit message.


## Creating a release

There are a few things to think about when doing a release:

- Search through the codebase for `@Deprecated` methods/fields and remove the ones that are marked
for removal in the version that you are intending to release.
- Create a PR containing the changes for removing the deprecated entities.
- Run `melos version -V <package1>:<version> -V <package2>:<version>` for Melos to generate
`CHANGELOG.md` files.
- Go through the PRs with breaking changes and add migration documentation to the changelog.
There should be migration docs on each PR, if they haven't been copied to the commit message.
- Run `melos publish` to make sure that there aren't any problems with any of the packages and make
sure that all the versions are correct.
- Once you are satisfied with the result of the dry run, run `melos publish --no-dry-run`
- Create a PR containing the updated changelog and `pubspec.yaml` files.


[GitHub issue]: https://github.com/flame-engine/tiled.dart/issues/new
[GitHub issues]: https://github.com/flame-engine/tiled.dart/issues/new
[PRs]: https://github.com/flame-engine/tiled.dart/pulls
[fork guide]: https://guides.github.com/activities/forking/#fork
[Discord]: https://discord.gg/pxrBmy4
[Melos]: https://github.com/invertase/melos
[pubspec doc]: https://dart.dev/tools/pub/pubspec
[conventional commit]: https://www.conventionalcommits.org
Loading