Skip to content

Add support for melos #1136

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

Closed
wants to merge 8 commits into from
Closed
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
23 changes: 19 additions & 4 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,28 @@
version: 2.1
orbs:
codecov: codecov/codecov@1.0.2
executors:
default-executor:
docker:
- image: sub6resources/flutter-melos:1.0.1
resource_class: large
shell: /bin/bash
jobs:
build:
docker:
- image: cirrusci/flutter
executor: default-executor
steps:
- checkout
- run: flutter --version
- run: flutter test --coverage
- run:
name: Setup melos
command: |
melos --version
melos bootstrap
- run:
name: Run Test Suite
command: melos run test
- run:
name: Generate Coverage Report
command: melos run gen_coverage
- codecov/upload:
file: coverage/lcov.info
file: coverage_report/lcov.info
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -151,3 +151,6 @@ modules.xml
**/flutter_export_environment.sh

/example/ios/Flutter/Flutter.podspec

packages/**/pubspec_overrides.yaml
pubspec_overrides.yaml
68 changes: 45 additions & 23 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,31 +1,53 @@
## [3.0.0-alpha.5] - June 9, 2022:
## 3.0.0-alpha.8

- **FIX**: Add meta as dev dependency for flutter_html_svg.

## 3.0.0-alpha.7

- **FIX**: Add meta as a dev dependency.
- **DOCS**: Update CHANGELOG.md for 3.0.0-alpha.6.

## 3.0.0-alpha.6

- **FIX** #731 Resolve newline `<br>` issue
- **FIX** Align the baseline of inline content with the baseline of its parent flow, even if it has padding or borders
- **FIX** Improved fontSize inheritance when cascading styles
- **FIX** `auto` margins now work for any `Display.BLOCK` element.
- **FIX** `auto` width and height is now the default, rather than `null`
- **FIX** New CSSBoxWidget that handles calculations of child sizes for a more accurate HTML/CSS layout
- **BREAKING** New `Margin`, `Height`, and `Width` classes that allow `em`, `rem`, `px`, `auto`, and `%` values to be given
- **FEAT** Negative margins are now allowed
- **FIX** Updated default `p` and `h1-6` styles to use `em` for better font scaling
- **BREAKING** Package now requires Dart sdk >= Dart 2.17

## 3.0.0-alpha.5 - June 9, 2022:
* Fixed hot reloads, thanks @arjenmels
* Fixed link taps not working
* Improvements in README

## [3.0.0-alpha.3] - April 14, 2022:
## 3.0.0-alpha.3 - April 14, 2022:
* Fixed styling not being applied to list item markers
* [video] Fixed crash when iframe or video tags used unsupported/incorrect height or width

## [3.0.0-alpha.2] - January 5, 2022:
## 3.0.0-alpha.2 - January 5, 2022:
* **BREAKING** Full modularization using split packages; see our upgrade guide or use flutter_html_all

## [3.0.0-alpha.1] - December 21, 2021:
## 3.0.0-alpha.1 - December 21, 2021:
* **BREAKING** Reworked custom renders pending full modularation in 3.0.0
* Extended support custom render when using SelectableHtml
* Updated flutter_svg to 1.0.0
* Support flutter_webview 3.x
* Automatic disposal of video and audio controllers
* Fix block elements bottom spacing in table cells

## [2.2.1] - December 8, 2021:
## 2.2.1 - December 8, 2021:
* Allow styling on ruby tags
* Allow width/height/alignment styling on table/tr/td tags
* Prevent images causing rebuilding and leaking memory
* Fixes display of list items on iOS with font weights below 400
* Prevent crash on negative margins or paddings

## [2.2.0] - November 29, 2021:
## 2.2.0 - November 29, 2021:
* Explicitly declare multiplatform support
* Extended and fixed list-style (marker) support
* Basic support for height/width css properties
Expand All @@ -38,34 +60,34 @@
* Prevent crash on empty <table> tag and tables with both colspan/rowspan
* Prevent crash on use of negative margins in css

## [2.1.5] - October 7, 2021:
## 2.1.5 - October 7, 2021:
* Ignore unsupported custom style selectors when using fromCss
* Fix SVG tag usage inside tables
* Properly fix regression in usage of line breaks

## [2.1.4] - October 3, 2021:
## 2.1.4 - October 3, 2021:
* Fix regression in usage of line breaks in body being stripped

## [2.1.3] - October 1, 2021:
## 2.1.3 - October 1, 2021:
* Update minimum versions of dependencies for Flutter 2.5 compatibility
* Extended and fixed support for css shadow
* Fix block tags with explicit whitespace from being stripped

## [2.1.2] - September 2, 2021:
## 2.1.2 - September 2, 2021:
* Allow setting selectionControls with SelectableHtml
* Fix onLinkTap not working with SelectableHtml
* Don't crash when parsing unsupported :hover
* Prevent endless loading when using animated images

## [2.1.1] - July 28, 2021:
## 2.1.1 - July 28, 2021:
* Stable release with all 2.1.1-preview.X changes

## [2.1.1-preview.0] - July 27, 2021:
## 2.1.1-preview.0 - July 27, 2021:
* Improves hr tag support
* Fixes a leading whitespace issue
* Fixes some crashes with CSS parsing

## [2.1.0] - June 3, 2021:
## 2.1.0 - June 3, 2021:
* SelectableHtml widget (supporting a subset of tags) which allow text selection
* Fixed shrinkWrap to actually shrink the horizontal space
* Support style tags to apply styling from inline css
Expand All @@ -81,10 +103,10 @@
* Updates external dependencies
* Raised minimum Flutter version to 2.2.0

## [2.0.0] - April 29, 2021:
## 2.0.0 - April 29, 2021:
* Stable release with all 2.0.0-nullsafety.X changes

## [2.0.0-nullsafety.1] - April 29, 2021:
## 2.0.0-nullsafety.1 - April 29, 2021:
* Support basic MathML
* Support inner links
* Supply full context tree to custom render
Expand All @@ -98,7 +120,7 @@
* Fixed `failed assertion` error when tap-scrolling on any link
* Updated dependencies

## [2.0.0-nullsafety.0] - March 5, 2021:
## 2.0.0-nullsafety.0 - March 5, 2021:
* Nullsafety support
* Official Flutter Web support
* New features & fixes for lists:
Expand All @@ -111,7 +133,7 @@
* Fixed `<audio>` on iOS ("_duration called on null" exception)
* Updated dependencies

## [1.3.0] - February 16, 2021:
## 1.3.0 - February 16, 2021:
* New image loading API
* Image loading with request headers, from relative paths and custom loading widget
* SVG image support from network or local assets
Expand All @@ -126,25 +148,25 @@
* Fixed issue where iframes would not update when their `src`s changed in the HTML data
* Updated dependencies for Flutter 1.26+

## [1.2.0] - January 14, 2021:
## 1.2.0 - January 14, 2021:
* Support irregular table sizes
* Allow for returning `null` from a customRender function to disable the widget

## [1.1.1] - November 22, 2020:
## 1.1.1 - November 22, 2020:
* Update dependencies

## [1.1.0] - November 22, 2020:
## 1.1.0 - November 22, 2020:
* Add support for inline styles
* Update dependencies

## [1.0.2] - August 8, 2020:
## 1.0.2 - August 8, 2020:
* Fix text scaling issues
* Update dependencies

## [1.0.1] - August 8, 2020:
## 1.0.1 - August 8, 2020:
* Fixed flutter_svg: ^0.18.0

# [1.0.0]
# 1.0.0
* BREAKING CHANGES (see the [Migration Guide](https://github.com/Sub6Resources/flutter_html/wiki/1.0.0-Migration-Guide) for a full overview of breaking changes.):
* The default parser has been completely rewritten and the RichText parser has been removed.
* `useRichText` no longer is necessary (The new parser uses RichText under the hood)
Expand Down
29 changes: 29 additions & 0 deletions analysis_options.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# 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-lang.github.io/linter/lints/index.html.
#
# 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
14 changes: 14 additions & 0 deletions combine_coverage.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/usr/bin/env bash

escapedPath="$(echo `pwd` | sed 's/\//\\\//g')"

if grep flutter pubspec.yaml > /dev/null; then
if [ -d "coverage" ]; then
# combine line coverage info from package tests to a common file
if [ ! -d "$MELOS_ROOT_PATH/coverage_report" ]; then
mkdir "$MELOS_ROOT_PATH/coverage_report"
fi
sed "s/^SF:lib/SF:$escapedPath\/lib/g" coverage/lcov.info >> "$MELOS_ROOT_PATH/coverage_report/lcov.info"
rm -rf "coverage"
fi
fi
1 change: 1 addition & 0 deletions example/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ dependencies:
dev_dependencies:
flutter_test:
sdk: flutter
flutter_lints: ^2.0.1

flutter:

Expand Down
17 changes: 17 additions & 0 deletions example/pubspec_overrides.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
dependency_overrides:
flutter_html:
path: ..
flutter_html_all:
path: ../packages/flutter_html_all
flutter_html_audio:
path: ../packages/flutter_html_audio
flutter_html_iframe:
path: ../packages/flutter_html_iframe
flutter_html_math:
path: ../packages/flutter_html_math
flutter_html_svg:
path: ../packages/flutter_html_svg
flutter_html_table:
path: ../packages/flutter_html_table
flutter_html_video:
path: ../packages/flutter_html_video
1 change: 0 additions & 1 deletion lib/src/styled_element.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import 'package:flutter/material.dart';
import 'package:flutter_html/src/css_parser.dart';
import 'package:flutter_html/src/style/margin.dart';
import 'package:flutter_html/style.dart';
import 'package:html/dom.dart' as dom;
//TODO(Sub6Resources): don't use the internal code of the html package as it may change unexpectedly.
Expand Down
32 changes: 32 additions & 0 deletions melos.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: flutter_html
repository: https://github.com/sub6resources/flutter_html

packages:
- .
- packages/**

ignore:
- './example'
- 'packages/**/example'

command:
bootstrap:
usePubspecOverrides: true
runPubGetInParallel: false

scripts:
analyze:
exec: flutter analyze .

test:selective_unit_test:
run: melos exec --dir-exists="test" --fail-fast -- flutter test --no-pub --coverage
description: Run Flutter tests for a specific package in this project.
select-package:
flutter: true
dir-exists: test

test:
run: melos run test:selective_unit_test --no-select
description: Run all Flutter tests in this project.

gen_coverage: melos exec -- "\$MELOS_ROOT_PATH/combine_coverage.sh"
12 changes: 12 additions & 0 deletions packages/flutter_html_all/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,14 @@
## 3.0.0-alpha.8

- Update a dependency to the latest release.

## 3.0.0-alpha.7

- Update a dependency to the latest release.

## 3.0.0-alpha.6

- Update a dependency to the latest release.

## [3.0.0-alpha.2] - January 5, 2022:
* Initial modularized flutter_html release; use flutter_html_all for full tag support or flutter_html for just the basics
16 changes: 8 additions & 8 deletions packages/flutter_html_all/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: flutter_html_all
description: All optional flutter_html widgets, bundled into a single package.
version: 3.0.0-alpha.5
version: 3.0.0-alpha.8
homepage: https://github.com/Sub6Resources/flutter_html

environment:
Expand All @@ -11,13 +11,13 @@ dependencies:
flutter:
sdk: flutter
html: '>=0.15.0 <1.0.0'
flutter_html: '>=3.0.0-alpha.5 <4.0.0'
flutter_html_audio: '>=3.0.0-alpha.3 <4.0.0'
flutter_html_iframe: '>=3.0.0-alpha.3 <4.0.0'
flutter_html_math: '>=3.0.0-alpha.3 <4.0.0'
flutter_html_svg: '>=3.0.0-alpha.3 <4.0.0'
flutter_html_table: '>=3.0.0-alpha.3 <4.0.0'
flutter_html_video: '>=3.0.0-alpha.3 <4.0.0'
flutter_html: ^3.0.0-alpha.8
flutter_html_audio: ^3.0.0-alpha.6
flutter_html_iframe: ^3.0.0-alpha.6
flutter_html_math: ^3.0.0-alpha.6
flutter_html_svg: ^3.0.0-alpha.6
flutter_html_table: ^3.0.0-alpha.6
flutter_html_video: ^3.0.0-alpha.7
# flutter_html_audio:
# path: ../flutter_html_audio
# flutter_html_iframe:
Expand Down
12 changes: 12 additions & 0 deletions packages/flutter_html_audio/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,14 @@
## 3.0.0-alpha.6

- Update a dependency to the latest release.

## 3.0.0-alpha.5

- Update a dependency to the latest release.

## 3.0.0-alpha.4

- Update a dependency to the latest release.

## [3.0.0-alpha.2] - January 5, 2022:
* Initial modularized flutter_html release; use flutter_html_audio if you need support for the `<audio>` tag
4 changes: 2 additions & 2 deletions packages/flutter_html_audio/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: flutter_html_audio
description: This extension package allows the <audio> tag to be rendered using the flutter_html package
version: 3.0.0-alpha.3
version: 3.0.0-alpha.6
homepage: https://github.com/Sub6Resources/flutter_html

environment:
Expand All @@ -11,7 +11,7 @@ dependencies:
flutter:
sdk: flutter
html: '>=0.15.0 <1.0.0'
flutter_html: '>=3.0.0-alpha.3 <4.0.0'
flutter_html: ^3.0.0-alpha.8
# flutter_html:
# path: ../..

Expand Down
Loading