-
Notifications
You must be signed in to change notification settings - Fork 280
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
chore(shared): Exports match
utility from the path-to-regexp
lib
#4187
Conversation
🦋 Changeset detectedLatest commit: 061c555 The changes in this PR will be included in the next version bump. This PR includes changesets to release 15 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
packages/shared/src/pathToRegexp.ts
Outdated
/** | ||
* A match is either `false` (no match) or a match result. | ||
*/ | ||
export type Match<P extends object = object> = false | MatchResult<P>; |
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.
I pulled in the input and output types for match, and all the types they depend on.
On another note, I wonder if we could import the types into the compiled version - in the Next.js repo I see types being exported without needing to be redeclared. |
Co-authored-by: Laura Beatris <[email protected]>
Specifically, running `tsup` with the `--dts-resolve` flag, and then copying over the .d. file
Good idea - I found the |
I think the pre-commit hook stripped these, so i'm re-adding them so as not to create an unnecessary diff, but I don't think they're strictly necessary?
} catch (e: any) { | ||
throw new Error( | ||
`Invalid path: ${path}.\nConsult the documentation of path-to-regexp here: https://github.com/pillarjs/path-to-regexp\n${e.message}`, | ||
`Invalid path: ${path}.\nConsult the documentation of path-to-regexp here: https://github.com/pillarjs/path-to-regexp/tree/6.x\n${e.message}`, |
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.
Calling this out: I think it's more useful to point people toward the docs for the specific version that we've embedded, because the syntax on latest is different.
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.
Good point!
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.
LGTM :)
match
utility from the path-to-regexp
lib
Description
What changed?
This surfaces a new path-to-regexp function, match, that upcoming functionality depends on.
How did you generate the minified js?
Thanks to @nikosdouvlis for giving me the run-down. The procedure goes:
To create the new minified code (high-level)
More details for internal folks here: https://clerkinc.slack.com/archives/C07LN8YS9HB/p1726666913614259?thread_ts=1726240424.533199&cid=C07LN8YS9HB
Type of change