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

Refactor config parser with json_serialization #76

Merged
merged 14 commits into from
Feb 6, 2021

Conversation

lcdsmao
Copy link
Member

@lcdsmao lcdsmao commented Feb 6, 2021

What does this change?

  • Use json_serialization to model config, so we don't need to interact with the YAML map directly.
    • This also enables us to easily add/edit the config option.
  • Merge user's pubspec.yaml into a default config before parsing, so we don't need to handle null case.

PS

We can not use build_runner directly inside a builder project.
So we need to create another project (_internal) for running build_runner.
See: #dart-lang/build#2982

What is the value of this and can you measure success?

Pass test

@lcdsmao lcdsmao requested a review from wasabeef February 6, 2021 04:47
@codecov
Copy link

codecov bot commented Feb 6, 2021

Codecov Report

Merging #76 (cd2335c) into main (c2cb180) will decrease coverage by 1.23%.
The diff coverage is 95.41%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main      #76      +/-   ##
==========================================
- Coverage   99.34%   98.11%   -1.24%     
==========================================
  Files          17       16       -1     
  Lines         458      477      +19     
==========================================
+ Hits          455      468      +13     
- Misses          3        9       +6     
Impacted Files Coverage Δ
lib/src/settings/pubspec.dart 83.87% <83.87%> (ø)
lib/src/flutter_generator.dart 93.33% <95.65%> (-6.67%) ⬇️
lib/src/generators/assets_generator.dart 100.00% <100.00%> (ø)
lib/src/generators/colors_generator.dart 98.21% <100.00%> (-0.04%) ⬇️
lib/src/generators/fonts_generator.dart 100.00% <100.00%> (ø)
lib/src/settings/config.dart 100.00% <100.00%> (ø)
lib/src/settings/pubspec.g.dart 100.00% <100.00%> (ø)
lib/src/utils/cast.dart

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update c2cb180...cd2335c. Read the comment docs.

@lcdsmao lcdsmao changed the title Refactor config parser Refactor config parser with json_serialization Feb 6, 2021
Copy link
Member

@wasabeef wasabeef left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Leo Clap

@lcdsmao lcdsmao merged commit e1e54ed into main Feb 6, 2021
@lcdsmao lcdsmao deleted the refactor-config-parser] branch February 6, 2021 14:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants