Skip to content

Releases: upfrontjs/framework

Release 0.10.0

17 Feb 14:23
34385e9
Compare
Choose a tag to compare

Feature

  • feat(collection): added chunkBy method

Fix

  • fix(services)(BREAKING CHANGE): updated default arrayFormat
    • previous configuration caused query string structure issues by not specifying array indexes
  • fix(model): removed unnecessary resetQueryParameters in findMany

Documentation

  • docs(collection): documented chunkBy method

Chore

Performance

  • perf(collection): removed redundant construct calls

Continuous Integration

  • ci: added remote before pushing
  • ci: run build test on PRs going into main too

Release 0.9.1

15 Feb 11:23
2eaedb8
Compare
Choose a tag to compare

Continuous Integration

  • ci: added git identification configuration

Fix

  • fix(attributes): updated toJSON to use getRawAttributes

Chore

  • chore: incremented version

Release 0.9.0

14 Feb 11:27
fa29d20
Compare
Choose a tag to compare

Refactor

  • refactor(internal): renamed memorised ids name in factory
    • This will reduce the likelihood of clashing with user's code

Performance

  • perf(internal): removed repeated calls in factory builder getKey method

Fix

  • fix(internal): prevent losing error name when mangling code
  • fix(factory): ensured states are only called once
  • fix(model)(BREAKING CHANGE): exists now accepts any string id as valid
    • So long the string has length
  • fix(factory)(BREAKING CHANGE): factory now respects the model's key type
  • fix(attributes)(BREAKING CHANGE): recursively transform keys on mass-assignment
    • On outgoing object keys were recursively set back to serverAttributeCasing.
    • Now the incoming object keys behave the same way and are set to attributeCasing.
    • Bringing it the behaviour in line with expectations.
  • fix(attributes): added SimpleAttributes type
    • This type is same as Attributes except it does not include Models and ModelCollections
      Resolves #183
  • fix(timestamps): added missing deletedAt value in FormData
  • fix(attributes)(BREAKING CHANGE): updated attributeCasing modifier type to protected
    • just like serverAttributeCasing this isn't expected to be used outside of the class.
  • fix(model-collection): fixed toJSON return type
    • Type information got lost when using return type of model type argument's toJSON

Feature

  • feat(factory): added factory type argument to factory builder
  • feat(model): added keyType getter
    • This change allows for custom string ids that are not uuids and the factory to set keys as string
  • feat(model): improved getKey typing
    • It now returns the correct type based on the type argument or keyType return value
  • feat(model-collection): improved modelKeys return value
  • feat(api-calls): improved call method signature with overrides
  • feat(attributes): added RawAttributes type
    • This utility type helps describe the raw json version of the model.
  • feat(factory): improved raw method typings
  • feat(factory): added attributes method
  • feat(collection): added missing array methods
  • feat(factory): added missing type export
  • feat: added PartialSome utility type

Documentation

  • docs(factory): give more helpful error messages in case of mangling
  • docs(factory): added tip for factory files and improved interface doc
  • docs(model): updated examples to use create
    • Missed updating when moved to the create method
  • docs(model): updated documentation around mass assignment
  • docs: simplified custom collection extending recipe
  • docs(api-calls): fixed wording
  • docs(attributes): formatted inline comment
  • docs(timestamps): added comment

Testing

  • test(factory): added test for states application order
  • test: improved test helpers
  • test(model-collection): fixed typing error in test
  • test(factory): reset state after testing
  • test(attributes): corrected test block name

Chore

  • chore: incremented version
  • chore: updated test tsconfig
  • chore: removed unused type import
  • chore(deps-dev): updated dependencies
    • @commitlint/config-conventional
    • @commitlint/prompt-cli
    • @commitlint/types
    • @typescript-eslint/eslint-plugin
    • @typescript-eslint/parser
    • commitlint
    • eslint
    • lint-staged
    • rollup

Continuous Integration

  • ci: ensure .nojekyll exists

Refactor

  • refactor(api-calls): customHeaders type DRY-ed by adding a type

Style

  • style: fixed code style issues

Release 0.8.2

28 Jan 07:47
8828051
Compare
Choose a tag to compare

Fix

  • fix(attributes)(BREAKING CHANGE): moved constructor logic into create
    • This will allow setting up descriptors for default values
    • Resolves #186

Docs

  • docs(model): added missing create documentation
  • docs: simplified pagination recipe
  • docs(model): fixed grammar

Refactor

  • refactor(collection): updated _newInstance typing to not use any
  • refactor(relations): moved relations into its handling class
  • refactor(internal): added response handling method overrides

Chore

  • chore: incremented package version
  • chore(deps-dev): updated lint-staged

Style

  • style(api-calls): moved method call to new line
  • style(api-calls): fixed eslint issue
  • style(api-calls): fixed eslint issue in test

Continuous Integration

  • ci: wrapped dotfile in quotes

Release 0.8.1

26 Jan 20:04
56c00d5
Compare
Choose a tag to compare

Fix

Chore

  • chore: incremented package version

Test

  • test(services): removed content type test when using form data
    • fetch mock doesn't implement automatic header setting

Release 0.8.0

26 Jan 11:11
Compare
Choose a tag to compare

Docs

  • docs: updated pagination recipe
  • docs: corrected pagination example
    • The exists method has taken the _lastSyncedAt property into account and here it was not set before
  • docs: adjust wording in doc blocks
  • docs(services): noted handleError is now async
  • docs(query-builder): added documentation for resetQueryParameters
  • docs: fixed grammar mistakes
  • docs(factory): updated examples to be in-line with mocks
  • docs(api-calls): updated methods to preferred uppercase
  • docs: updated recipe to use the new typing
  • docs(timestamps): updated attribute name getter method names
  • docs: fixed typo in test name
  • docs: updated pagination recipe to handle model constructors
  • docs(api-calls): updated to uppercase method names
    • Updated all method argument to call to uppercase for consistency
  • docs: fixed examples
  • docs(api-calls): updated method name to uppercase

Perf

  • perf(query-builder): simplified withs deduplication

Feature

  • feat(services): made handleError async on ApiResponseHandler
  • feat(api-calls): added default type argument
    • While this is invalid, from the outside TS still figures the current this correctly
  • feat(query-builder): changed resetQueryParameters access to public
  • feat(api-calls): export Method type
  • feat(services): widened request type on ApiResponse
  • feat(services): added HEAD request handling
  • feat(services): improve typings of services call and handle method
  • feat(attributes): improved Attributes type inference
  • feat(attributes): improved only method's typing
  • feat(attributes): improved except typing
  • feat(attributes): improved typings on attribute management methods
    • Following have been updated:
      getOriginal
      getRawOriginal
      getChanges
      getDeletedAttributes
      getNewAttributes
  • feat: updated static methods returning models to infer type from this
  • feat: updated some static inference to not use error ignoring
  • feat(model): added create method
    • This allows to constructing a model more fluently

Fix

  • fix(model): updated missed distinctBy in the clone method
  • fix(attributes): fixed casting methods typing to accept mixed values
  • fix(api-calls): pass the response attributes to the constructor
    • This also cleans up the code a little
  • fix(services): normalised fetch methods
    • patch could failed with lowercase method name
  • fix(api-calls): updated typing to be inclusive of each other on get
  • fix(relations): fixed addRelation typing to accept subclass of a model
  • fix: fixed outstanding eslint and typing errors
  • fix(model-collection): fixed wrong typing of toJSON
  • fix(BREAKING CHANGE): renamed timestamp name methods
    • Renamed the following:
      getDeletedAtColumn -> getDeletedAtName
      getCreatedAtColumn -> getCreatedAtName
      getUpdatedAtColumn -> getUpdatedAtName

Test

  • test(timestamps): tested restore accepting server deletedAt value
  • test: added initial baseEndpoint in testing
  • test(services): added missing test updates
  • test(attributes): fixed failing guarding tests
  • test(services): added missing test updates
  • test(relations): updated testing to use the new typings
  • test(model): updated to use new typings
  • test(api-calls): added missing data unwrap test
  • test(api-calls): added missing endpoint getter test

Refactor

  • refactor(services): simplified handleError in response handler
  • refactor(attributes): simplified getAttribute override typing
  • refactor(factory): update return types of mock factories
  • refactor(model-collection): updated toJSON typing
    • updated toJSON typing to track the model's toJSON

Chore

  • chore: incremented package version
  • chore: added new eslint rule
  • chore: moved todos into github
  • chore(deps): updated non-breaking dependencies
    • @commitlint/prompt-cli
    • @types/uuid
    • @typescript-eslint/eslint-plugin
    • @typescript-eslint/parser
    • commitlint
    • eslint
    • eslint-plugin-jest
    • lint-staged
    • qs
    • rollup
    • typedoc
    • typescript
  • chore(deps-dev): updated breaking change dependencies
    • semantic-release

Style

  • style: fixed eslint issues

Continuous Integration

  • ci: added matrix values explanation

Release 0.7.2

04 Jan 12:06
Compare
Choose a tag to compare

Fix

  • fix: updated distinct to match sql syntax

Chore

  • chore(deps-dev): updated non-breaking dependencies
    • @typescript-eslint/eslint-plugin
    • @typescript-eslint/parser
    • eslint
    • eslint-plugin-import
    • eslint-plugin-jest
    • lint-staged
    • rollup
  • chore(deps-dev): updated breaking dependencies
  • chore: incremented package version

Style

  • style: fixed eslint warnings

Performance

  • perf(model): removed redundant object in assignment

Docs

  • docs: fixed example's return type
  • docs(query-builder): updated distinct documentation

Release 0.7.1

20 Dec 16:45
9a4292b
Compare
Choose a tag to compare

Docs

  • docs: fix/add missing updates
  • docs: small updates

Chore

  • chore: updated issue templates
  • chore(deps-dev): updated typescript version
  • chore(deps-dev): updated dependencies
    • @typescript-eslint/eslint-plugin
    • @typescript-eslint/parser
    • eslint
    • lint-staged
    • rollup
    • typescript
  • chore: incremented package version

Fix

  • fix(api-calls)!: updated multi word model endpoint guessing
  • fix(global-config): fixed set typing
    • Overloads also greatly simplified the signature

CI

  • ci: force staging of files

Release 0.7.0

09 Dec 15:26
Compare
Choose a tag to compare

Feature

  • feat(model): added clone method

Fix

  • fix(model): added missing argument type to the new method
  • fix(model): added missing deep clones to clone method

Documentaion

  • docs: fixed documentation inaccuracies
  • docs: added missing call documentation
  • docs(relations): updated wording of internal property
  • docs: added missing type arguments in examples

Chore

  • chore(deps-dev): updated dependencies
    • @types/lodash
    • rollup
  • chore: incremented version
  • chore: fix bug_report yml

Release 0.6.0

07 Dec 17:33
Compare
Choose a tag to compare

Docs

  • docs: fix incorrect info
  • docs: added recipe
    • Example on how to extend the model
  • docs(services): updated ApiResponseHandler signatures
    Changes missed in:
    1e0b58f
  • docs: added remote pagination to recipes
  • docs: clarified back-end compatibility
  • docs: extended recipe with static method
  • docs: simplified examples
  • docs: added supporter section
  • docs: added clarifications
  • docs: added typescript tip for ApiResponse
    • Showed how to use module augmentation to extend the ApiResponse
  • docs: added reference to module augmentation docs
  • docs: added clarification
  • docs(attributes): added missing comma
  • docs: updated cookbook example to be more comprehensive

Chore

  • chore: converted todo into an issue
  • chore: fixed .gitignore targeting
  • chore(deps-dev): updated dependencies
    • @semantic-release/git
    • @types/semantic-release
    • eslint-plugin-import
    • rollup
    • typedoc
  • chore: incremented version
  • chore: fixed incorrect bug report yml file
  • chore: added pull request template
  • chore: added search terms to the bug report template
  • chore: moved todo out into an issue
    • linked @upfrontjs/framework#151
  • chore(deps-dev): updated non breaking dependencies
    • typescript
    • typedoc
    • rollup
    • semantic-release
    • @types/lodash
    • @types/uuid
  • chore(deps-dev): updated breaking dependencies
    • @typescript-eslint/eslint-plugin
    • @typescript-eslint/parser
    • eslint
    • eslint-plugin-jest
    • @commitlint/config-conventional
    • @commitlint/prompt-cli
    • @commitlint/types
    • lint-staged
  • chore(deps-dev): updated dependencies
    • @typescript-eslint/eslint-plugin
    • @typescript-eslint/parser
    • eslint
    • qs
    • rollup
    • commitlint
  • chore(deps-dev): lock typescript to 4.4.4
    • Locking for the time being as 4.5.2 breaks the global config set typing.
    • The type is meant to be widened by the passed in value but,
    • on get it reckons it's an unknown value

Feature

  • feat(query-builder): widened formatQueryParameters argument's type
    • added string indexing to allow arbitrary values to be assigned to parameters argument
  • feat(api-calls): added type argument to handle and call methods
  • feat(services)!: updated handling of non 200 responses
    • Throw response/error on client and server errors
    • Ignore informational, redirect and no content responses
  • feat(api-calls): added data unwrapping
  • feat(query-builder): added page method
  • feat(query-builder): hardened type handling of numeric query parameters
  • feat: added more utility types
    • Added KeysMatching and KeysNotMatching types
  • feat(global-config): updated type argument to accept arbitrary values
  • feat(attributes): added type support for keys defined on the model
  • feat(attributes): added missing type arguments
  • feat(api-calls)!: set _lastSyncedAt to cast to the set datetime value
  • feat: wip - worked on type inference of attributes
  • feat: added type arguments where applicable
  • feat!: updated Jsonable to return a json as opposed to string
    • The naming intended to return a json not a string.
    • Stringified version is only meant for saving or transferring data
  • feat(internal): added type arguments to methods in ModelCollection
  • feat(model): added toString method to the model
    • This will give a understandable format when juggling types
  • feat: added UnionToIntersection helper type
  • feat(query-builder): added type argument for static methods
  • feat(attributes): added setServerStringCase internal helper
  • feat(api-calls)!: moved data unwrapping into dedicated method
    • This way the user gets the the raw response exposed while utilising the model's call method
    • Furthermore as this is now public and all methods called them anyways,
    • moved the resetEndpoint and resetQueryParameters methods into the call method
  • feat(model): added new method
    • With this the user don't have to leave the model to construct a new instance.

Test

  • test(internal): simplified test response customisation
  • test: increased test coverage
  • test(events): increased test coverage of EventEmitter
  • test: fixed type-hinting in test
  • test: fixed failing query building tests
  • test: fixed failing type in test

Refactor

  • refactor(internal): simplified getting the response model
  • refactor(attributes)!: from casting method removed attributes argument
    • Technically breaking change but it's is considered an internal method.
  • refactor(attributes): simplified date time casting
    • casting to date time logic has been moved into a single method
    • Furthermore, when using the built in Date, an error will be thrown on invalid values
  • refactor(helpers)!: renamed isConstructableUserClass function
    • isUserLandClass seems shorter while keeping the meaning
  • refactor(events): updated to use built-in Parameters type

Fix

  • fix(services)!: removed data unwrapping from ApiResponseHandler
    • Response may include other keys such as links, meta
      and with the previous logic this would have been lost
  • fix(timestamps): access attribute name dynamically
    • Updated accessing timestamp names from class reference to constructor reference
  • fix(attributes): set on AttributeCaster have to return a value
    • This isn't a breaking change as void is assignable to unknown
  • fix(attributes)!: set index signature to unknown
    • Harden the user's type safety by updating from any to unknown
  • fix(attributes): resolved remaining typing issues
    • Fixed lingering issues missed in:
    • 66f5631
  • fix!: fix getName returning wrong value after mangling for production
    • This isn't a breaking change but marking as such so people who do keep up with the release notes
      will not accidentally skim over it.
  • fix: removed unnecessary properties from ApiResponse type
    • This might be breaking typing for people using non-null assertion on Response properties
  • fix!: remove redundant ExtractArguments type
    • This is can be replaced by the built-in Parameters type
  • fix(query-builder)!: updated built-in column name casting
    • Fixed the column names to be in the expected serverAttributeCasing

Continuous Integration

  • ci: adjust names and remove redundant cache actions
  • ci: ensure package is tested on the latest and LTS versions
  • ci: removed unnecessary argument
  • ci: run tests run on package updates too
  • ci: renamed action's name
  • ci: added api docs deployment action
  • ci: ensure both commit messages and PR titles are linted

Performance

  • perf(model): improved replicate logic
    • with 1 warm up run, over 4 tries with 100,000 loops the average time:
    • with arguments: decreased by 177ms
    • without arguments: increased 20.75ms

Style

  • style(attributes): removed unused code