-
Notifications
You must be signed in to change notification settings - Fork 88
feat: module improvements #96
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
Conversation
Co-authored-by: Daniel Roe <[email protected]>
Co-authored-by: Daniel Roe <[email protected]>
…s into a Record type
…declaration imports
Great stuff here! I'm more than happy to help on this. Just started going through the changes, specifically the ones regarding the type system. May I suggest other changes as I come across other issues? I could also help on the new docs, if needed. |
Sure thing 😄
That would be awesome 🔥 |
I updated the PR description based on my last commit: flattening the props (removing |
One suggestion, can we pass option to Example: await this.$strapi.login({
identifier: form.identifier,
password: form.password,
expires: form.rememberMe && 31 * 24 * 3600 * 1000
}) Or alrternatively with a default value of expires: await this.$strapi.login({
identifier: form.identifier,
password: form.password,
rememberMe : !!form.rememberMe
}) |
After talking with Ben, we will go with |
ts-loader is suddenly required as dev-dep
…/strapi-module into feat/improvements
I refactored a bunch of the type declarations and the way the |
Tomorrow I might work on some of the new docs. |
@LuckeeDev you should be able to push on this branch now :) |
Awesome! I'll commit later this evening. |
I've rewritten the type definitions to be extracted directly from the |
Thank you @LuckeeDev What do you mean by the module doesn't work with the current version of the example? |
I added the options in the documentation, do we need to change anything regarding https://github.com/nuxt-community/strapi-module/blob/master/docs/content/en/typescript.md @LuckeeDev ? |
Codecov Report
@@ Coverage Diff @@
## master #96 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 1 1
Lines 14 17 +3
Branches 3 4 +1
=========================================
+ Hits 14 17 +3
Continue to review full report at Codecov.
|
I'll be checking tomorrow! |
Thank you @LuckeeDev, waiting for you last feedback before merging |
I think We're good to go... anything else to do? |
Co-authored-by: Luca Zoppetti <[email protected]>
Co-authored-by: Luca Zoppetti <[email protected]>
Thank you so much guys for your precious help 💚 |
TypeScript
The module has been rewritten with TypeScript and using Siroc as bundler.
Session options
This PR also add a properties into the module to configure the session:
Resolves #92 and #85
key
String
'strapi_jwt'
Key used for the cookie name as well as LocalStorage/SessionStorage key.
expires
String
orNumber
or'session'
When
expires === 'session'
, the sessionStorage will be used to act like the cookie.Otherwise, the value is a string, it will be parsed using ms, ex:
expires: '7d'
A number can also be provided as milliseconds, ex:
expires: 7 * 24 * 3600 * 1000
It would be possible also to configure during runtime the expiration, example:
cookie
Object
{}
Options to forward to the cookie#options module, the
expires
property will be overwritten.Resolved #70
Misc
$strapi
also include.original
to list the error code, resolves How can I translate error message? #89Help needed
dist/runtime.mjs
, I had to list it intopeerDependencies
but I am not found of this solution (NPM like to warn if no direct dependencies of the user project), any hint @danielroe?dist/types.d.ts
, they are missing the one declared intosrc/types
types/strapi.ts
, I think it is not optimal, would love some feedback from @pi0 and @LuckeeDevyarn link @nuxtjs/strapi
Checklist: