Skip to content
This repository has been archived by the owner on Nov 29, 2020. It is now read-only.

feat: First step at the rewrite #1

Merged
merged 46 commits into from Dec 9, 2019
Merged

feat: First step at the rewrite #1

merged 46 commits into from Dec 9, 2019

Conversation

kyranet
Copy link
Member

@kyranet kyranet commented Nov 10, 2019

Tasks

  • Finish initial implementation.
  • Write documentation.
  • Write tests.

Changelog

Added

  • Added Unit Testing.
  • Added examples for a large set of methods.
  • Added bare null as an option to reset a key in SettingsFolder#{update}.
  • Added Serializer#{validate,resolve} to allow further control on how SettingsGateway handles the data.
  • Added context to the settingsUpdate and settingsCreate events, they contain the raw changes, guild, language, etc.
  • Added extraContext to the SettingsFolderResetOptions type, this value is pased in all places (Serializer#validate, SchemaEntry#filter, settingsUpdate and settingsCreate events, and more).

Changed

  • Tweaked Serializer#deserialize's arguments to (SerializableValue, SerializerUpdateContext).
  • Renamed SchemaEntry#{min,max} to SchemaEntry#{minimum,maximum}.
  • Tweaked SettingsFolder's value type to be more accurate.
  • Tweaked SettingsFolderUpdateOptions's option to produce a TypeScript compiler error when arrayAction is set to 'overwrite' and arrayIndex is defined.
  • Tweaked SettingsFolder#client to throw an error when it's uninitialized.
  • Tweaked SettingsFolder#{reset,update} to return a much more useful struct.
  • When specifying arrayIndex in SettingsFolder#update and arrayAction is defined as add, all entries will be inserted at given index.
  • When specifying arrayIndex in SettingsFolder#update and arrayAction is defined as remove, as many entries as given will be removed from given index.
  • When specifying arrayIndex in SettingsFolder#update and arrayAction is not defined or defined as auto, all entries will replace the existing ones.

Removed

  • Removed throwOnError option in SettingsFolder#{reset,update}, they will now always throw when they encounter an error.

Fixed

  • Resolved bug where Schema#get would throw an error if a path did not exist.
  • Resolved bug where Schema#{add,remove} was still callable even after being initialized.
  • Resolved bug where SettingsFolder#get would throw an error if a path did not exist.
  • Resolved type bug in SettingsFolder#pluck.
  • Resolved bug in SettingsFolder#resolve not resolving into objects when specifying a folder path.
  • Resolved bug in SettingsFolder#reset where database conditions were not handled correctly.
  • Resolved bug in SettingsFolder#update where options would sometimes type error.
  • Resolved bug in SettingsFolder's patch function not allowing non-literal objects to be used.
  • Resolved bug in SettingsFolder#{reset,update} patching after emit.
  • Fixed the types from the Provider and SQLProvider classes.

@kyranet kyranet changed the title feat: First step at the rewrite [WIP] feat: First step at the rewrite Nov 10, 2019
Copy link

@PyroTechniac PyroTechniac left a comment

Choose a reason for hiding this comment

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

Could only review parts of it, but found what I could.

src/lib/gateway/GatewayDriver.ts Show resolved Hide resolved
.eslintrc.json Outdated Show resolved Hide resolved
Copy link
Collaborator

@vladfrangu vladfrangu left a comment

Choose a reason for hiding this comment

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

For now, have these, I gotta go for a minute or so

src/lib/gateway/Gateway.ts Outdated Show resolved Hide resolved
src/lib/gateway/GatewayDriver.ts Outdated Show resolved Hide resolved
src/lib/gateway/GatewayStorage.ts Outdated Show resolved Hide resolved
src/lib/gateway/GatewayStorage.ts Outdated Show resolved Hide resolved
Copy link
Member

@favna favna left a comment

Choose a reason for hiding this comment

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

2 quick remarks, will look in more detail in mo. in the train rn.

tsconfig.json Outdated Show resolved Hide resolved
tsconfig.json Outdated Show resolved Hide resolved
@kyranet kyranet added Meta: BugFix PRs that fix bugs or issues. Meta: Cleanup Issues and PRs related to code cleanup. Meta: Refactor Issues and PRs related to refactors. SEM: Major PRs that contain breaking changes and should be released in the next major version. Status: Ready To Merge PRs that are ready to merge. Status: Review Ready PRs that are ready for author review. Type: Enhancement Issues and PRs related to feature enhancement. and removed enhancement labels Dec 9, 2019
Copy link

@PyroTechniac PyroTechniac left a comment

Choose a reason for hiding this comment

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

Just one thing, other than that it looks good.

src/lib/schema/Schema.ts Outdated Show resolved Hide resolved
Co-Authored-By: Gryffon Bellish <owenbellish@gmail.com>
src/lib/settings/Settings.ts Outdated Show resolved Hide resolved
src/lib/settings/SettingsFolder.ts Outdated Show resolved Hide resolved
src/lib/structures/ProviderStore.ts Outdated Show resolved Hide resolved
Copy link
Member

@favna favna left a comment

Choose a reason for hiding this comment

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

You did ask

src/index.ts Show resolved Hide resolved
src/lib/gateway/Gateway.ts Show resolved Hide resolved
src/lib/gateway/Gateway.ts Show resolved Hide resolved
src/lib/gateway/Gateway.ts Show resolved Hide resolved
src/lib/gateway/Gateway.ts Outdated Show resolved Hide resolved
src/lib/settings/SettingsFolder.ts Show resolved Hide resolved
src/lib/settings/SettingsFolder.ts Outdated Show resolved Hide resolved
src/lib/settings/SettingsFolder.ts Show resolved Hide resolved
tsconfig.json Show resolved Hide resolved
tsconfig.json Outdated Show resolved Hide resolved
Copy link
Member

@favna favna left a comment

Choose a reason for hiding this comment

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

You did ask

@kyranet kyranet removed the request for review from tech6hutch December 9, 2019 22:34
@kyranet kyranet merged commit bf60f41 into master Dec 9, 2019
@kyranet kyranet deleted the impl branch December 9, 2019 22:34
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Meta: BugFix PRs that fix bugs or issues. Meta: Cleanup Issues and PRs related to code cleanup. Meta: Refactor Issues and PRs related to refactors. SEM: Major PRs that contain breaking changes and should be released in the next major version. Status: Ready To Merge PRs that are ready to merge. Status: Review Ready PRs that are ready for author review. Type: Enhancement Issues and PRs related to feature enhancement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants