-
-
Notifications
You must be signed in to change notification settings - Fork 3
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
Consider adding package exports #151
Labels
enhancement
New feature or request
Comments
nandi95
added a commit
to nandi95/framework-1
that referenced
this issue
Dec 2, 2021
linked @upfrontjs/frameworkupfrontjs#151
nandi95
added a commit
that referenced
this issue
Dec 7, 2021
## 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 * 7cf3ca6 * 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
nandi95
added a commit
that referenced
this issue
Dec 7, 2021
## 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 * 7cf3ca6 * 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
Draft
7 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Search terms
package exports
esm
cjs
Is your feature request related to a problem? Please describe.
The user currently have to import their helpers like
import '@upfrontjs/framework/string.es.min.js';
What would be ideal if
import '@upfrontjs/framework/string
was enough to specify and the rest can be figured out by the bundlers.Describe the solution you'd like
A clear and concise description of what you want to happen.
Describe how this would benefit the project/others
better discoverability for IDEs, less things to type
Describe alternatives you've considered
not applicable
Additional context
microsoft/TypeScript#33079
The text was updated successfully, but these errors were encountered: