-
Notifications
You must be signed in to change notification settings - Fork 4k
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
fix(root): Replace shortid with nanoid #7720
base: next
Are you sure you want to change the base?
Conversation
✅ Deploy Preview for dev-web-novu ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
commit: |
@@ -149,7 +149,7 @@ export class CreateIntegration { | |||
const defaultName = | |||
providers.find((provider) => provider.id === command.providerId)?.displayName ?? providerIdCapitalized; | |||
const name = command.name ?? defaultName; | |||
const identifier = command.identifier ?? `${slugify(name)}-${shortid.generate()}`; | |||
const identifier = command.identifier ?? `${slugify(name)}-${nanoid()}`; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we need a longer id here as the default length is 4.
❌ Deploy Preview for dashboard-v2-novu-staging failed. Why did it fail? →
|
@@ -94,7 +94,6 @@ | |||
"rrule": "^2.7.2", | |||
"rxjs": "7.8.1", | |||
"sanitize-html": "^2.4.0", | |||
"shortid": "^2.2.16", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👏
@@ -149,7 +149,7 @@ export class CreateIntegration { | |||
const defaultName = | |||
providers.find((provider) => provider.id === command.providerId)?.displayName ?? providerIdCapitalized; | |||
const name = command.name ?? defaultName; | |||
const identifier = command.identifier ?? `${slugify(name)}-${shortid.generate()}`; | |||
const identifier = command.identifier ?? `${slugify(name)}-${nanoid()}`; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
const identifier = command.identifier ?? `${slugify(name)}-${nanoid()}`; | |
const identifier = command.identifier ?? `${slugify(name)}-${shortId()}`; |
the default is length of 21
FYI for the future workflow and steps short id we had length of 6 #7029
regardless please use shortId from libs/application-generic/src/utils/generate-id.ts
so we will have the same alphabet on our identifiers.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me, we just need to update the last place to use the internal shortId func
59a7874
to
3cc8299
Compare
a6472cd
to
e88cc98
Compare
e88cc98
to
9c004d2
Compare
9c004d2
to
efa448d
Compare
cb4279e
to
f59156d
Compare
Shortid is deprecated and marked as unsafe
f59156d
to
242e813
Compare
What changed? Why was the change needed?
Shortid is deprecated and marked as unsafe. https://www.npmjs.com/package/shortid
See also https://github.com/novuhq/packages-enterprise/pull/267