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

v2.0.0 #13

Open
wants to merge 42 commits into
base: main
Choose a base branch
from
Open

v2.0.0 #13

wants to merge 42 commits into from

Conversation

jonathangomz
Copy link
Owner

@jonathangomz jonathangomz commented Jul 30, 2021

Update at 24/Feb/2022 at the 02:53 am, because why not:
I'm doing a huuuuuge update for this package and I will be using this version (2.0.0) for that update. Practically I'm going to break all (even me) and do it again. I'm going to reuse a lot of code but I HAVE TO update and fix a lot of logic bugs. I don't know when I'm going to finish but to say something let say 31/03/2022.

If someone read this please wish me luck.

See my notes here in Notion of course.

  • Update default versioning usage: always will work with only the last version. If any other version is needed then should install a previous version of the package for that version to avoid errors on differences between versions.
  • Access child type from parent
    • Properties
      • Database properties
      • Page properties
    • Blocks
    • Objects
  • Refactor sections
    • Utils
      • Extension for enums to have a toString() (and maybe toType()) built-in instead of fromXTypeToString and that stuff.
    • Properties
      • Database properties (Properties objects)
      • Page properties (Properties value)
      • Properties items
    • Databases
      • Create
      • Update
      • Retrieve
    • Pages
      • Retrieve
      • Create
      • Update
      • Archive (Delete)
      • Retrieve a page property
    • Blocks
      • Children
        • Retrieve a block children
        • Append block children
      • Delete
  • Fix GitHub issues.

Important:
Some of the changes bellow will be canceled even they where accomplished just in the name of YAGNI (You Ain't Gonna Need It), and other will be added... actually a lot of things will change and even me, who is making them, don't know how is going to end, so yeah, don't pay attention to the list bellow.


This PR will be open until the next release (tentative date 04/08/2021). It will contain any pre-release update for this version.

New feature: 🐣
Breaking change: 🍗

  • 🐣 Add constructor for empty Database.✅
  • 🐣 Add parameter blocks for Children constructor. ✅
  • 🍗 Remove deprecated code: ✅
    • textSeparation
    • Parameter constructors for Children:
      • heading
      • paragraph
      • toDo
  • 🍗 Add suggestions on issue #11: ✅
    • Copy some terminologies from notion-sdk-js
    • Update exports to improve usage
    • Add private folder (src/)
  • 🐣 Add constructors with only single text content with default style for: ✅
    • Paragraph: Paragraph.text('some text here...')
    • ToDo: ToDo.text('some text here...', checked: true)
    • Heading: Heading.text('some text here...', type: 2)
    • BulletedListItem: BulletedListItem.text('some text here...')
    • NumberedListItem: NumberedListItem.text('some text here...')
    • Toggle: Toggle.text('some text here...', children: [])
  • [CANCELED] 🐣 Add more constructors for Heading class:
    • one: Heading with type 1 by default.
    • two: Heading with type 2 by default.
    • three: Heading with type 3 by default.
  • 🐣 Add more constructors for Text class: ✅
    • code: Text with code style by default.
    • italic: Text with italic style by default.
    • bold: Text with bold style by default.
    • underline: Text with underline style by default.
    • color: Text with different color of default.
  • 🐣 Add list(List<Text> texts, String separator, String lastSeparator): ✅

Constructor for blocks with single `Text` instance in content.
Also refactor blocks main constructors to make it shorter.
Add `bold`: Set text to bold.
Add `italic`: Set text to italic.
Add `underline`: Set text to underline.
Add `code`: Set text to code style.
Add `color`: Set a different color for the text.
Add static list method to generate textual lists with `Text` instances.
Add `src/` directory
Add exports to improve usage
Remove base fields class
Change from public to private the token, version and dateVersion variables for clients
@codecov
Copy link

codecov bot commented Jul 30, 2021

Codecov Report

Patch coverage: 78.03% and project coverage change: -8.00% ⚠️

Comparison is base (706e9b3) 96.84% compared to head (b1cba99) 88.85%.

❗ Current head b1cba99 differs from pull request most recent head e4bfacf. Consider uploading reports for the commit e4bfacf to get more accurate results

Additional details and impacted files
@@            Coverage Diff             @@
##             main      #13      +/-   ##
==========================================
- Coverage   96.84%   88.85%   -8.00%     
==========================================
  Files          24       26       +2     
  Lines         698      951     +253     
==========================================
+ Hits          676      845     +169     
- Misses         22      106      +84     
Files Changed Coverage Δ
lib/src/notion/general/notion_types.dart 100.00% <ø> (ø)
lib/src/notion/lists/pagination.dart 97.91% <ø> (ø)
lib/src/notion/lists/properties.dart 86.95% <0.00%> (ø)
lib/src/notion/objects/parent.dart 100.00% <ø> (ø)
lib/src/responses/notion_response.dart 96.66% <ø> (ø)
lib/src/notion/new/properties.dart 56.25% <56.25%> (ø)
lib/src/notion/rich_text.dart 61.20% <61.20%> (ø)
lib/src/notion/new/database/database_property.dart 72.97% <72.97%> (ø)
lib/src/notion_databases.dart 82.60% <82.60%> (ø)
lib/src/notion/objects/database.dart 91.89% <91.89%> (ø)
... and 16 more

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@jonathangomz
Copy link
Owner Author

Publish successfully version 2.0.0-beta1 🎉

@jonathangomz
Copy link
Owner Author

Publish successfully version 2.0.0-beta2 🎉

Updates documentation
Removes unused code
- empty constructor
- addPropertiesFromJson
Improves `withDefaults` constructor & rename it to `simple`
And mark as deprecated list databases method
and add name as a base field of properties
and adds more expectations for retrieve a database
and DateTime errors
Adds missing url field from `toJSON`
Removes `this` for usage of class member when is obvious
Improves database test (logic and style)
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.

1 participant