@clerk/upgrade 0.0.3 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/app.js +10 -2
- package/dist/cli.js +19 -9
- package/dist/img/alternativemethods-backlink.png +0 -0
- package/dist/img/button-to-organizationlistcreateorganizationactionbutton.png +0 -0
- package/dist/img/connected-accounts-dropdown.png +0 -0
- package/dist/img/mfa-dropdown.png +0 -0
- package/dist/img/organizationprofile-settings.png +0 -0
- package/dist/img/remove-identitypreview-avatar.png +0 -0
- package/dist/img/remove-socialbuttonsblockbuttonarrow.png +0 -0
- package/dist/img/userbuttonpopoveractionbuttontext-removed.png +0 -0
- package/dist/img/userprofile-security.png +0 -0
- package/dist/scan.js +19 -7
- package/dist/util/expandable-list.js +3 -3
- package/dist/util/generate-export-change.js +10 -0
- package/dist/util/guess-framework.js +8 -3
- package/dist/util/load-change.js +2 -1
- package/dist/versions/v5/backend/api-url-value-changed.md +7 -0
- package/dist/versions/v5/backend/authenticaterequest-params-change.md +12 -0
- package/dist/versions/v5/backend/buildrequesturl-removed.md +7 -0
- package/dist/versions/v5/backend/clerk-import.md +2 -2
- package/dist/versions/v5/backend/client-unstableoptions-removed.md +15 -0
- package/dist/versions/v5/backend/clockskewinseconds.md +10 -2
- package/dist/versions/v5/backend/constants-import-path-move.md +13 -0
- package/dist/versions/v5/backend/createauthenticaterequest-import-path-move.md +13 -0
- package/dist/versions/v5/backend/createclerkclient-apikey.md +8 -11
- package/dist/versions/v5/backend/createclerkclient-frontendapi.md +7 -10
- package/dist/versions/v5/backend/createemail-removed.md +7 -0
- package/dist/versions/v5/backend/createisomorphicrequest-import-path-move.md +13 -0
- package/dist/versions/v5/backend/createisomorphicrequest-removed.md +13 -0
- package/dist/versions/v5/backend/decodeJwt-import-path-move.md +13 -0
- package/dist/versions/v5/backend/externalaccount-picture.md +6 -0
- package/dist/versions/v5/backend/externalaccountjson-avatarurl.md +6 -0
- package/dist/versions/v5/backend/getorganizationinvitationlist-return-signature.md +14 -0
- package/dist/versions/v5/backend/getorganizationlist-return-signature.md +14 -0
- package/dist/versions/v5/backend/getorganizationmembershiplist-return-signature.md +14 -0
- package/dist/versions/v5/backend/getpendingorganizationinvitationlist.md +5 -5
- package/dist/versions/v5/backend/httpoptions-removed.md +15 -0
- package/dist/versions/v5/backend/membershiprole.md +21 -0
- package/dist/versions/v5/backend/organization-logourl.md +6 -0
- package/dist/versions/v5/backend/organizationjson-logourl.md +6 -0
- package/dist/versions/v5/backend/organizationmembershippublicuserdata-profileimageurl.md +6 -0
- package/dist/versions/v5/backend/organizationmembershippublicuserdatajson-profileimageurl.md +6 -0
- package/dist/versions/v5/backend/pkgversion.md +15 -0
- package/dist/versions/v5/backend/redirect-import-path-move.md +13 -0
- package/dist/versions/v5/backend/return-signature-change.md +14 -0
- package/dist/versions/v5/backend/signjwt-import-path-move +0 -0
- package/dist/versions/v5/backend/signjwt-import-path-move.md +13 -0
- package/dist/versions/v5/backend/signjwterror-import-move.md +13 -0
- package/dist/versions/v5/backend/tokenverificationerror-import-move.md +13 -0
- package/dist/versions/v5/backend/tokenverificationerroraction-import-move.md +13 -0
- package/dist/versions/v5/backend/tokenverificationerrorcode-import-move.md +13 -0
- package/dist/versions/v5/backend/tokenverificationerrorreason-import-move.md +13 -0
- package/dist/versions/v5/backend/user-profileimageurl.md +6 -0
- package/dist/versions/v5/backend/userjson-profileimageurl.md +6 -0
- package/dist/versions/v5/backend/verifyjwt-import-path-move.md +13 -0
- package/dist/versions/v5/common/aftersigninouturl-behavior-change.md +7 -0
- package/dist/versions/v5/common/aftersigninurl-behavior-change +7 -0
- package/dist/versions/v5/common/aftersigninurl-behavior-change-2.md +7 -0
- package/dist/versions/v5/common/aftersigninurl-behavior-change.md +7 -0
- package/dist/versions/v5/common/aftersignouturl-behavior-change.md +7 -0
- package/dist/versions/v5/common/aftersignupurl-behavior-change.md +7 -0
- package/dist/versions/v5/common/afterswitchorganizationurl.md +2 -1
- package/dist/versions/v5/common/alternativemethods-backlink.md +18 -0
- package/dist/versions/v5/common/api-key-to-secret-key.md +1 -1
- package/dist/versions/v5/common/button-to-organizationlistcreateorganizationactionbutton.md +11 -0
- package/dist/versions/v5/common/card-changes.md +14 -0
- package/dist/versions/v5/common/changed-localization-keys.md +179 -0
- package/dist/versions/v5/common/clerkprovider-frontendapi-2.md +7 -0
- package/dist/versions/v5/common/clerkprovideroptionswrapper-dropped.md +6 -0
- package/dist/versions/v5/common/connected-accounts-dropdown.md +15 -0
- package/dist/versions/v5/common/emaillinkerrorcode-import-change.md +13 -0
- package/dist/versions/v5/common/external-account-avatarurl.md +7 -0
- package/dist/versions/v5/common/frontend-api-to-publishable-key.md +1 -1
- package/dist/versions/v5/common/isclerkapiresponserror-import-change.md +13 -0
- package/dist/versions/v5/common/isemaillinkerror-import-change.md +13 -0
- package/dist/versions/v5/common/isknownerror-import-change.md +13 -0
- package/dist/versions/v5/common/ismetamaskerror-import-change.md +13 -0
- package/dist/versions/v5/common/mfa-dropdown.md +11 -0
- package/dist/versions/v5/common/multi-session-ui-changes.md +0 -0
- package/dist/versions/v5/common/multisessionappsupport-import-change.md +12 -0
- package/dist/versions/v5/common/new-localization-keys.md +133 -0
- package/dist/versions/v5/common/organization-getdomains-arguments-change.md +20 -0
- package/dist/versions/v5/common/organization-getmembershiprequests-arguments-changed.md +20 -0
- package/dist/versions/v5/common/organization-getroles-arguments-changed.md +20 -0
- package/dist/versions/v5/common/organization-getroles-return-type.md +0 -0
- package/dist/versions/v5/common/organizationprofile-general.md +0 -0
- package/dist/versions/v5/common/organizationprofile-settings.md +12 -0
- package/dist/versions/v5/common/organizationswitcherpopoveractionbuttontext-removed.md +14 -0
- package/dist/versions/v5/common/remove-identitypreview-avatar.md +12 -0
- package/dist/versions/v5/common/remove-socialbuttonsblockbuttonarrow.md +10 -0
- package/dist/versions/v5/common/removed-localization-keys.md +166 -0
- package/dist/versions/v5/common/signoutcallback-to-redirecturl.md +22 -0
- package/dist/versions/v5/common/useorganization-invitationlist.md +1 -1
- package/dist/versions/v5/common/useorganization-membershiplist.md +2 -1
- package/dist/versions/v5/common/userbuttonpopoveractionbuttontext-removed.md +14 -0
- package/dist/versions/v5/common/userbuttonpopoveractionbuttontext.md +7 -0
- package/dist/versions/v5/common/userbuttontrigger-userbuttonbox-invert.md +12 -0
- package/dist/versions/v5/common/userprofile-prop.md +2 -1
- package/dist/versions/v5/common/userprofile-security.md +8 -0
- package/dist/versions/v5/common/withclerk-hof-removed.md +29 -0
- package/dist/versions/v5/common/withclerk-removed.md +16 -0
- package/dist/versions/v5/common/withsession-hof-removed.md +29 -0
- package/dist/versions/v5/common/withsession-removed.md +16 -0
- package/dist/versions/v5/common/withuser-hof-removed.md +29 -0
- package/dist/versions/v5/common/withuser-removed-2.md +18 -0
- package/dist/versions/v5/common/withuser-removed.md +16 -0
- package/dist/versions/v5/expo/apikey-to-publishable-key.md +1 -1
- package/dist/versions/v5/gatsby/apikey-to-publishable-key.md +1 -1
- package/dist/versions/v5/index.js +11 -22
- package/dist/versions/v5/js/aftersigninout-behavior-change.md +7 -0
- package/dist/versions/v5/js/aftersigninouturl-behavior-change.md +7 -0
- package/dist/versions/v5/js/aftersigninurl-behavior-change.md +0 -0
- package/dist/versions/v5/js/clerk-isready-removed.md +6 -0
- package/dist/versions/v5/js/organization-getdomains-arguments-change.md +20 -0
- package/dist/versions/v5/js/organization-getinvitations-arguments-changed.md +20 -0
- package/dist/versions/v5/js/organization-getmembershiprequests-arguments-changed.md +20 -0
- package/dist/versions/v5/js/organization-getmemberships-arguments-changed.md +20 -0
- package/dist/versions/v5/js/organization-getroles-arguments-changed.md +20 -0
- package/dist/versions/v5/js/user-getorganizationinvitations-arguments-chanaged.md +20 -0
- package/dist/versions/v5/js/user-getorganizationmemberships-arguments-chanaged +0 -0
- package/dist/versions/v5/js/user-getorganizationmemberships-arguments-chanaged.md +20 -0
- package/dist/versions/v5/js/user-getorganizationsuggestions-arguments-chanaged.md +20 -0
- package/dist/versions/v5/next/api-url-value-change.md +1 -0
- package/dist/versions/v5/next/auth-import-change.md +13 -0
- package/dist/versions/v5/next/auth-middleware-deprecated.md +43 -4
- package/dist/versions/v5/next/authmiddleware-import-change.md +13 -0
- package/dist/versions/v5/next/buildclerkprops-import-change.md +13 -0
- package/dist/versions/v5/next/clerk-import-change.md +12 -0
- package/dist/versions/v5/next/clerk-js-version-next-public.md +1 -1
- package/dist/versions/v5/next/constants-import-change.md +13 -0
- package/dist/versions/v5/next/createauthenticaterequest-import-change.md +13 -0
- package/dist/versions/v5/next/createisomorphicrequest-import-change.md +13 -0
- package/dist/versions/v5/next/currentuser-import-change.md +13 -0
- package/dist/versions/v5/next/decodejwt-import-change.md +13 -0
- package/dist/versions/v5/next/emaillinkerrorcode-import-change.md +13 -0
- package/dist/versions/v5/next/import-sign-up-url.md +1 -0
- package/dist/versions/v5/next/isclerkapiresponserror-import-change.md +13 -0
- package/dist/versions/v5/next/isemaillinkerror-import-change.md +13 -0
- package/dist/versions/v5/next/isknownerror-import-change.md +13 -0
- package/dist/versions/v5/next/ismetamaskerror-import-change.md +13 -0
- package/dist/versions/v5/next/min-nextjs-version.md +9 -0
- package/dist/versions/v5/next/multisessionappsupport-import-change.md +13 -0
- package/dist/versions/v5/next/next-public-clerk-js-url.md +6 -0
- package/dist/versions/v5/next/redirect-import-change.md +13 -0
- package/dist/versions/v5/next/signjwt-import-change.md +13 -0
- package/dist/versions/v5/next/verify +0 -0
- package/dist/versions/v5/next/verifyjwt-import-change.md +13 -0
- package/dist/versions/v5/next/verifytoken-import-change.md +13 -0
- package/dist/versions/v5/next/withclerk-removed.md +15 -0
- package/dist/versions/v5/next/withsession-removed.md +15 -0
- package/dist/versions/v5/next/withuser-removed.md +0 -0
- package/dist/versions/v5/node/legacyauthobject-removed.md +26 -0
- package/dist/versions/v5/react/router-navigate.md +18 -0
- package/dist/versions/v5/react/signoutcallback-to- +0 -0
- package/dist/versions/v5/react/signoutcallback-to-redirecturl.md +22 -0
- package/dist/versions/v5/remix/clerkerrorboundary-removed.md +22 -0
- package/dist/versions/v5/remix/clerkprovider-frontendapi.md +0 -0
- package/dist/versions/v5/remix/createclerkclient-apikey.md +14 -0
- package/dist/versions/v5/remix/getauth-apikey.md +16 -0
- package/dist/versions/v5/remix/rootauthloader-apikey.md +14 -0
- package/dist/versions/v5/remix/rootauthloader-frontendapi.md +14 -0
- package/dist/versions/v5/shared/buildrequesturl.md +6 -8
- package/dist/versions/v5/shared/getrequesturl.md +6 -0
- package/package.json +1 -1
package/dist/app.js
CHANGED
|
@@ -13,8 +13,11 @@ export default function App({
|
|
|
13
13
|
_toVersion,
|
|
14
14
|
_sdk,
|
|
15
15
|
_dir = false,
|
|
16
|
-
_ignore = []
|
|
16
|
+
_ignore = [],
|
|
17
|
+
_yolo = false,
|
|
18
|
+
noWarnings = false
|
|
17
19
|
}) {
|
|
20
|
+
const [yolo, setYolo] = useState(_yolo);
|
|
18
21
|
const [sdks, setSdks] = useState(_sdk ? [_sdk] : []);
|
|
19
22
|
const [sdkGuesses, setSdkGuesses] = useState([]);
|
|
20
23
|
const [sdkGuessConfirmed, setSdkGuessConfirmed] = useState(false);
|
|
@@ -27,6 +30,10 @@ export default function App({
|
|
|
27
30
|
const [configComplete, setConfigComplete] = useState(false);
|
|
28
31
|
const [configVerified, setConfigVerified] = useState(false);
|
|
29
32
|
let fromVersionGuess = false;
|
|
33
|
+
if (yolo) {
|
|
34
|
+
setSdks(SDKS.map(s => s.value));
|
|
35
|
+
setYolo(false);
|
|
36
|
+
}
|
|
30
37
|
|
|
31
38
|
// We try to guess which SDK they are using
|
|
32
39
|
if (isEmpty(sdks) && isEmpty(sdkGuesses) && !sdkGuessAttempted) {
|
|
@@ -126,7 +133,8 @@ export default function App({
|
|
|
126
133
|
toVersion,
|
|
127
134
|
sdks,
|
|
128
135
|
dir,
|
|
129
|
-
ignore
|
|
136
|
+
ignore,
|
|
137
|
+
noWarnings
|
|
130
138
|
})));
|
|
131
139
|
}
|
|
132
140
|
|
package/dist/cli.js
CHANGED
|
@@ -9,15 +9,15 @@ const cli = meow(`
|
|
|
9
9
|
$ clerk-upgrade
|
|
10
10
|
|
|
11
11
|
Options
|
|
12
|
-
--from
|
|
13
|
-
--to
|
|
14
|
-
--sdk
|
|
15
|
-
--dir
|
|
16
|
-
--ignore
|
|
12
|
+
--from Major version number you're upgrading from
|
|
13
|
+
--to Major version number you're upgrading to
|
|
14
|
+
--sdk Name of the SDK you're upgrading
|
|
15
|
+
--dir Directory you'd like to scan for files
|
|
16
|
+
--ignore Any files or directories you'd like to ignore
|
|
17
|
+
--noWarnings Do not print warnings, only items that must be fixed
|
|
17
18
|
|
|
18
19
|
Examples
|
|
19
|
-
$ clerk-upgrade --
|
|
20
|
-
Hello, Jane
|
|
20
|
+
$ clerk-upgrade --sdk=nextjs --dir=src/**
|
|
21
21
|
`, {
|
|
22
22
|
importMeta: import.meta,
|
|
23
23
|
flags: {
|
|
@@ -39,6 +39,12 @@ const cli = meow(`
|
|
|
39
39
|
ignore: {
|
|
40
40
|
type: 'string',
|
|
41
41
|
isMultiple: true
|
|
42
|
+
},
|
|
43
|
+
yolo: {
|
|
44
|
+
type: 'boolean'
|
|
45
|
+
},
|
|
46
|
+
noWarnings: {
|
|
47
|
+
type: 'boolean'
|
|
42
48
|
}
|
|
43
49
|
}
|
|
44
50
|
});
|
|
@@ -46,5 +52,9 @@ render( /*#__PURE__*/React.createElement(App, {
|
|
|
46
52
|
_fromVersion: cli.flags.from,
|
|
47
53
|
_toVersion: cli.flags.to,
|
|
48
54
|
_sdk: cli.flags.sdk,
|
|
49
|
-
_dir: cli.flags.dir
|
|
50
|
-
|
|
55
|
+
_dir: cli.flags.dir,
|
|
56
|
+
_yolo: cli.flags.yolo,
|
|
57
|
+
noWarnings: cli.flags.noWarnings
|
|
58
|
+
})
|
|
59
|
+
// { debug: true }, if having issues with errors being swallowed, uncomment this
|
|
60
|
+
);
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/dist/scan.js
CHANGED
|
@@ -11,7 +11,8 @@ export default function Scan({
|
|
|
11
11
|
toVersion,
|
|
12
12
|
sdks,
|
|
13
13
|
dir,
|
|
14
|
-
ignore
|
|
14
|
+
ignore,
|
|
15
|
+
noWarnings
|
|
15
16
|
}) {
|
|
16
17
|
// NOTE: if the difference between fromVersion and toVersion is greater than 1
|
|
17
18
|
// we need to do a little extra work here and import two matchers,
|
|
@@ -73,18 +74,29 @@ export default function Scan({
|
|
|
73
74
|
// then we run each of the matchers against the file contents
|
|
74
75
|
for (const sdk in matchers) {
|
|
75
76
|
// returns [{ ...matcher, instances: [{sdk, file, position}] }]
|
|
76
|
-
matchers[sdk].map(
|
|
77
|
+
matchers[sdk].map(matcherConfig => {
|
|
77
78
|
// run regex against file content, return array of matches
|
|
78
|
-
|
|
79
|
+
// matcher can be an array or string
|
|
80
|
+
let matches = [];
|
|
81
|
+
if (Array.isArray(matcherConfig.matcher)) {
|
|
82
|
+
matcherConfig.matcher.map(m => {
|
|
83
|
+
matches = matches.concat(Array.from(content.matchAll(m)));
|
|
84
|
+
});
|
|
85
|
+
} else {
|
|
86
|
+
matches = Array.from(content.matchAll(matcherConfig.matcher));
|
|
87
|
+
}
|
|
79
88
|
if (matches.length < 1) return;
|
|
80
89
|
|
|
81
90
|
// for each match, add to `instances` array of a key, create if not exists
|
|
82
91
|
matches.map(match => {
|
|
83
|
-
if (
|
|
92
|
+
if (noWarnings && matcherConfig.warning) return;
|
|
93
|
+
if (!allResults[matcherConfig.title]) allResults[matcherConfig.title] = {
|
|
84
94
|
instances: [],
|
|
85
|
-
...
|
|
95
|
+
...matcherConfig
|
|
86
96
|
};
|
|
87
|
-
|
|
97
|
+
|
|
98
|
+
// TODO: there's a small bug where we can see multiple instances of the same position
|
|
99
|
+
allResults[matcherConfig.title].instances.push({
|
|
88
100
|
sdk,
|
|
89
101
|
file: path.relative(process.cwd(), file),
|
|
90
102
|
position: indexToPosition(content, match.index, {
|
|
@@ -99,7 +111,7 @@ export default function Scan({
|
|
|
99
111
|
})).then(() => {
|
|
100
112
|
setResults([...results, ...Object.keys(allResults).map(k => allResults[k])]);
|
|
101
113
|
setComplete(true);
|
|
102
|
-
if (
|
|
114
|
+
if (Object.keys(allResults).length < 1) {
|
|
103
115
|
setStatus('It looks like you have nothing you need to change, upgrade away!');
|
|
104
116
|
} else {
|
|
105
117
|
setStatus('File scan complete. See results below!');
|
|
@@ -59,9 +59,9 @@ export default function ExpandableList({
|
|
|
59
59
|
borderColor: item.focused ? 'blue' : 'white',
|
|
60
60
|
paddingX: 1,
|
|
61
61
|
key: item.title
|
|
62
|
-
}, /*#__PURE__*/React.createElement(Markdown, null, item.title), locations.length > 1 ? /*#__PURE__*/React.createElement(Text, null, "Found ", locations.length, " instances, expand for detail") : /*#__PURE__*/React.createElement(Text, null, "Location: ", locations[0]), item.expanded && /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Line, null), locations.length > 1 && /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Text, null, "Locations:"), locations.map(loc => /*#__PURE__*/React.createElement(Text, null, ' ', "- ", loc))
|
|
63
|
-
|
|
64
|
-
}, /*#__PURE__*/React.createElement(
|
|
62
|
+
}, /*#__PURE__*/React.createElement(Markdown, null, item.title), locations.length > 1 ? /*#__PURE__*/React.createElement(Text, null, "Found ", locations.length, " instances, expand for detail") : /*#__PURE__*/React.createElement(Text, null, "Location: ", locations[0]), item.expanded && /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Line, null), locations.length > 1 && /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Text, null, "Locations:"), locations.map(loc => /*#__PURE__*/React.createElement(Text, null, ' ', "- ", loc)), /*#__PURE__*/React.createElement(Line, null)), item.warning && /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Text, {
|
|
63
|
+
color: "yellow"
|
|
64
|
+
}, "\u26A0\uFE0F This is a WARNING and will still match even if you corrected the issue or if no correction is necessary. To dismiss warnings, pass the `--noWarnings` flag to the CLI when running."), /*#__PURE__*/React.createElement(Line, null)), /*#__PURE__*/React.createElement(Newline, null), /*#__PURE__*/React.createElement(Markdown, null, item.content))));
|
|
65
65
|
return memo;
|
|
66
66
|
}, []), state.all.length > state.numberVisible && /*#__PURE__*/React.createElement(Text, null, "Showing ", state.visible[0] + 1, " - ", Math.min(state.visible[1], state.all.length), " of ", state.all.length));
|
|
67
67
|
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import fs from 'fs';
|
|
2
|
+
import path from 'path';
|
|
3
|
+
|
|
4
|
+
// WIP, a util script used for quickly generating a large number of nearly identical change files
|
|
5
|
+
const movedToServer = ['MultisessionAppSupport', 'auth', 'currentUser', 'authMiddleware',
|
|
6
|
+
// deprecated
|
|
7
|
+
'clerkMiddleware',
|
|
8
|
+
// new
|
|
9
|
+
'redirectToSignIn', 'redirectToSignUp', 'buildClerkProps', 'verifyToken', 'isClerkAPIResponseError', 'isEmailLinkError', 'isKnownError', 'isMetamaskError', 'EmailLinkErrorCode', 'withClerk', 'withSession', 'withUser', 'WithClerk', 'WithSession', 'WithUser'];
|
|
10
|
+
const clerkBackendExports = ['createClerkClient', 'verifyToken'];
|
|
@@ -1,9 +1,14 @@
|
|
|
1
1
|
import { readPackageSync } from 'read-pkg';
|
|
2
2
|
import SDKS from '../constants/sdks.js';
|
|
3
3
|
export default function guessFrameworks(dir) {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
4
|
+
let pkg;
|
|
5
|
+
try {
|
|
6
|
+
pkg = readPackageSync({
|
|
7
|
+
cwd: dir
|
|
8
|
+
});
|
|
9
|
+
} catch (err) {
|
|
10
|
+
return [];
|
|
11
|
+
}
|
|
7
12
|
|
|
8
13
|
// no guessing if there are no deps
|
|
9
14
|
if (!pkg.dependencies && !pkg.devDependencies) return [];
|
package/dist/util/load-change.js
CHANGED
|
@@ -19,11 +19,12 @@ export default function createLoader({
|
|
|
19
19
|
const fm = parsed.data;
|
|
20
20
|
return {
|
|
21
21
|
title: fm.title,
|
|
22
|
-
matcher: new RegExp(fm.matcher, `g${fm.matcherFlags ? fm.matcherFlags : ''}`),
|
|
22
|
+
matcher: Array.isArray(fm.matcher) ? fm.matcher.map(m => new RegExp(m, `g${fm.matcherFlags ? fm.matcherFlags : ''}`)) : new RegExp(fm.matcher, `g${fm.matcherFlags ? fm.matcherFlags : ''}`),
|
|
23
23
|
replaceWithString: fm.replaceWithString,
|
|
24
24
|
slug,
|
|
25
25
|
sdk: sdk,
|
|
26
26
|
content: parsed.content,
|
|
27
|
+
warning: fm.warning,
|
|
27
28
|
link: `${baseUrl}#${slug}`
|
|
28
29
|
};
|
|
29
30
|
});
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: '`API_URL` value has changed'
|
|
3
|
+
matcher: "API_URL[\\s\\S]*?from\\s+['\"]@clerk\\/backend\\/constants['\"]"
|
|
4
|
+
matcherFlags: 'm'
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
The value of this export has changed from `https://api.clerk.dev` to `https://api.clerk.com`. If you were relying on the text content of this value not changing, you may need to make adjustments.
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: '`request` separated from `options` as params to `authenticateRequest`'
|
|
3
|
+
warning: true
|
|
4
|
+
matcher: "authenticateRequest\\("
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
There has been a change to the way the params of the `authenticateRequest` function are structured. The `request` param, formerly included in an `options` object, has been moved to stand on its own as the first param to the function, while the `options` object remains as the second param. Example below:
|
|
8
|
+
|
|
9
|
+
```diff
|
|
10
|
+
- clerkClient.authenticateRequest({ ...opts, request })
|
|
11
|
+
+ clerkClient.authenticateRequest(request, { ...opts })
|
|
12
|
+
```
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: '`buildRequestUrl` import removed'
|
|
3
|
+
matcher: "import\\s+{[\\s\\S]*?buildRequestUrl[\\s\\S]*?}\\s+from\\s+['\"]@clerk\/backend['\"]"
|
|
4
|
+
matcherFlags: 'm'
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
The `buildRequestUrl` import was intended for those building custom Clerk integrations for frameworks and has been removed in favor of other methods internally. If you were relying on this function and this is an issue, please [reach out to Clerk support](https://clerk.com/support).
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
title: '`Clerk` -> `createClerkClient`'
|
|
3
|
-
matcher: "import\\s+{[\\s\\S]*?Clerk[\\s\\S]*?}
|
|
3
|
+
matcher: "import\\s+{*[\\s\\S]*?Clerk[\\s\\S]*?}*\\s+from\\s+['\"]@clerk\\/backend['\"]"
|
|
4
4
|
matcherFlags: 'm'
|
|
5
5
|
---
|
|
6
6
|
|
|
@@ -8,7 +8,7 @@ The top level `Clerk` import was renamed to `createClerkClient`. This is just a
|
|
|
8
8
|
|
|
9
9
|
```js
|
|
10
10
|
// before
|
|
11
|
-
import
|
|
11
|
+
import Clerk from '@clerk/backend';
|
|
12
12
|
|
|
13
13
|
// after
|
|
14
14
|
import { createClerkClient } from '@clerk/backend';
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: '`clerkClient.__unstable_options` removed'
|
|
3
|
+
matcher: "\\.__unstable_options"
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
The `clerkClient.__unstable_options` property was removed. Previously, you could use it to update the internal options. Instead, create a new ` clerkClient` instance using `createClerkClient` and pass the options in this way. For example:
|
|
7
|
+
|
|
8
|
+
```diff
|
|
9
|
+
import { createClerkClient } from "@clerk/backend"
|
|
10
|
+
|
|
11
|
+
const clerkClient = createClerkClient({ secretKey: "old" })
|
|
12
|
+
|
|
13
|
+
- clerkClient.__unstable_options.secretKey = "new"
|
|
14
|
+
+ const newClerkClient = createClerkClient({ secretKey: "new" })
|
|
15
|
+
```
|
|
@@ -1,7 +1,15 @@
|
|
|
1
1
|
---
|
|
2
2
|
title: '`clockSkewInSeconds` -> `clockSkewInMs`'
|
|
3
|
-
matcher:
|
|
3
|
+
matcher:
|
|
4
|
+
- "verifyJwt\\([\\s\\S]*?(clockSkewInSeconds):[\\s\\S]*?\\)"
|
|
5
|
+
- "verifyToken\\([\\s\\S]*?(clockSkewInSeconds):[\\s\\S]*?\\)"
|
|
6
|
+
- "authenticateRequest\\([\\s\\S]*?(clockSkewInSeconds):[\\s\\S]*?\\)"
|
|
7
|
+
matcherFlags: 'm'
|
|
4
8
|
replaceWithString: 'clockSkewInMs'
|
|
5
9
|
---
|
|
6
10
|
|
|
7
|
-
The value
|
|
11
|
+
The `clockSkewInSeconds` option has been renamed to `clockSkewInMs` in order to accurately reflect that its value is expected to be in milliseconds rather than seconds. The value does not need to change here, only the name. This change affects the following imports:
|
|
12
|
+
|
|
13
|
+
- `verifyJwt`
|
|
14
|
+
- `verifyToken`
|
|
15
|
+
- `Clerk.authenticateRequest`
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: '`constants` import moved to `@clerk/backend/internal`'
|
|
3
|
+
matcher: "import\\s+{[\\s\\S]*?constants[\\s\\S]*?}\\s+from\\s+['\"]@clerk\\/(backend)['\"]"
|
|
4
|
+
matcherFlags: 'm'
|
|
5
|
+
replaceWithString: 'backend/internal'
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
The `constants` import path has changed from `@clerk/backend` to `@clerk/backend/internal`. You must update your import path in order for it to work correctly. Note that internal imports are not intended for usage and are outside the scope of semver. Example below of the fix that needs to be made:
|
|
9
|
+
|
|
10
|
+
```diff
|
|
11
|
+
- import { constants } from "@clerk/backend"
|
|
12
|
+
+ import { constants } from "@clerk/backend/internal"
|
|
13
|
+
```
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: '`createAuthenticateRequest` import moved to `@clerk/backend/internal`'
|
|
3
|
+
matcher: "import\\s+{[\\s\\S]*?createAuthenticateRequest[\\s\\S]*?}\\s+from\\s+['\"]@clerk\\/(backend)['\"]"
|
|
4
|
+
matcherFlags: 'm'
|
|
5
|
+
replaceWithString: 'backend/internal'
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
The `createAuthenticateRequest` import path has changed from `@clerk/backend` to `@clerk/backend/internal`. You must update your import path in order for it to work correctly. Note that internal imports are not intended for usage and are outside the scope of semver. Example below of the fix that needs to be made:
|
|
9
|
+
|
|
10
|
+
```diff
|
|
11
|
+
- import { createAuthenticateRequest } from "@clerk/backend"
|
|
12
|
+
+ import { createAuthenticateRequest } from "@clerk/backend/internal"
|
|
13
|
+
```
|
|
@@ -1,21 +1,18 @@
|
|
|
1
1
|
---
|
|
2
2
|
title: '`apiKey` -> `secretKey` as param to createClerkClient'
|
|
3
|
-
matcher: "
|
|
3
|
+
matcher: "(?:createClerkClient|Clerk)\\(\\s*{[\\s\\S]*?frontendApi:[\\s\\S]*?\\)"
|
|
4
4
|
matcherFlags: 'm'
|
|
5
5
|
---
|
|
6
6
|
|
|
7
7
|
The `apiKey` argument passed to `createClerkClient` must be changed to `secretKey`. Also note that the import value has changed for creating a new Clerk client, which will be addressed by a separate line item if relevant to your codebase.
|
|
8
8
|
|
|
9
|
-
```
|
|
10
|
-
|
|
11
|
-
import {
|
|
9
|
+
```diff
|
|
10
|
+
- import { Clerk } from '@clerk/backend';
|
|
11
|
+
+ import { createClerkClient } from '@clerk/backend';
|
|
12
12
|
|
|
13
|
-
const clerkClient = Clerk({ apiKey: '...' });
|
|
14
|
-
clerkClient
|
|
13
|
+
- const clerkClient = Clerk({ apiKey: '...' });
|
|
14
|
+
+ const clerkClient = createClerkClient({ secretKey: '...' });
|
|
15
15
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
const clerkClient = createClerkClient({ secretKey: '...' });
|
|
20
|
-
clerkClient.authenticateRequest({ secretKey: '...' });
|
|
16
|
+
- clerkClient.authenticateRequest({ apiKey: '...' });
|
|
17
|
+
+ clerkClient.authenticateRequest({ secretKey: '...' });
|
|
21
18
|
```
|
|
@@ -6,16 +6,13 @@ matcherFlags: 'm'
|
|
|
6
6
|
|
|
7
7
|
The `frontendApi` argument passed to `createClerkClient` must be changed to `publishableKey`. Note that the values of the two keys are different, so both keys and values need to be changed. You can find your application's publishable key in the Clerk dashboard. Also note that the import value has changed for creating a new Clerk client, which will be addressed by a separate line item if relevant to your codebase.
|
|
8
8
|
|
|
9
|
-
```
|
|
10
|
-
|
|
11
|
-
import {
|
|
9
|
+
```diff
|
|
10
|
+
- import { Clerk } from '@clerk/backend';
|
|
11
|
+
+ import { createClerkClient } from '@clerk/backend';
|
|
12
12
|
|
|
13
|
-
const clerkClient = Clerk({ frontendApi: '...' });
|
|
14
|
-
clerkClient
|
|
13
|
+
- const clerkClient = Clerk({ frontendApi: '...' });
|
|
14
|
+
+ const clerkClient = createClerkClient({ publishableKey: '...' });
|
|
15
15
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
const clerkClient = createClerkClient({ publishableKey: '...' });
|
|
20
|
-
clerkClient.authenticateRequest({ publishableKey: '...' });
|
|
16
|
+
- clerkClient.authenticateRequest({ frontendApi: '...' });
|
|
17
|
+
+ clerkClient.authenticateRequest({ publishableKey: '...' });
|
|
21
18
|
```
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: '`createEmail` import removed'
|
|
3
|
+
matcher: "import\\s+{[\\s\\S]*?createEmail[\\s\\S]*?}\\s+from\\s+['\"]@clerk\/backend['\"]"
|
|
4
|
+
matcherFlags: 'm'
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
The `createEmail` import has been removed. There is no replacement at this time because we need to rethink how `createEmail` behaves and align it with the newer `sendSms` method. If this is an issue for your implementation, please contact [Clerk support](https://clerk.com/contact).
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: '`createIsomorphicRequest` import moved to `@clerk/backend/internal`'
|
|
3
|
+
matcher: "import\\s+{[\\s\\S]*?createIsomorphicRequest[\\s\\S]*?}\\s+from\\s+['\"]@clerk\\/(backend)['\"]"
|
|
4
|
+
matcherFlags: 'm'
|
|
5
|
+
replaceWithString: 'backend/internal'
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
The `createIsomorphicRequest` import path has changed from `@clerk/backend` to `@clerk/backend/internal`. You must update your import path in order for it to work correctly. Note that internal imports are not intended for usage and are outside the scope of semver. Example below of the fix that needs to be made:
|
|
9
|
+
|
|
10
|
+
```diff
|
|
11
|
+
- import { createIsomorphicRequest } from "@clerk/backend"
|
|
12
|
+
+ import { createIsomorphicRequest } from "@clerk/backend/internal"
|
|
13
|
+
```
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: '`createIsomorphicRequest` import moved to `/internal`'
|
|
3
|
+
matcher: "import\\s+{[\\s\\S]*?createIsomorphicRequest[\\s\\S]*?}\\s+from\\s+['\"]@clerk\/(backend)['\"]"
|
|
4
|
+
replaceWithString: 'backend/internal'
|
|
5
|
+
matcherFlags: 'm'
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
The `createIsomorphicRequest` import was intended for those building custom Clerk integrations for frameworks and has been moved to `@clerk/backend/internal` to reflect this. Please use caution when using internal imports as they are outside the bounds of semver.
|
|
9
|
+
|
|
10
|
+
```diff
|
|
11
|
+
- import { createIsomorphicRequest } from "@clerk/backend"
|
|
12
|
+
+ import { createIsomorphicRequest } from "@clerk/backend/internal"
|
|
13
|
+
```
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: '`decodeJwt` import moved to `@clerk/backend/tokens`'
|
|
3
|
+
matcher: "import\\s+{[\\s\\S]*?decodeJwt[\\s\\S]*?}\\s+from\\s+['\"]@clerk\\/(backend)['\"]"
|
|
4
|
+
matcherFlags: 'm'
|
|
5
|
+
replaceWithString: 'backend/tokens'
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
The `decodeJwt` import path has changed from `@clerk/backend` to `@clerk/backend/tokens`. You must update your import path in order for it to work correctly. Example below of the fix that needs to be made
|
|
9
|
+
|
|
10
|
+
```diff
|
|
11
|
+
- import { decodeJwt } from "@clerk/backend"
|
|
12
|
+
+ import { decodeJwt } from "@clerk/backend/tokens"
|
|
13
|
+
```
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: '`Users.getOrganizationInvitationList` return signature changed'
|
|
3
|
+
matcher: "\\.users\\.getOrganizationInvitationList\\("
|
|
4
|
+
warning: true
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
The response payload of `Users.getOrganizationInvitationList` was changed as part of the v5 release. Rather than directly returning ` data`, the return signature is now `{ data, totalCount }`. Since backend API responses are paginated, the `totalCount` property is helpful in determining the total number of items in the response easily, and this change in the backend SDK aligns the response shape with what the backend API returns directly.
|
|
8
|
+
|
|
9
|
+
Here's an example of how the response shape would change with this modification:
|
|
10
|
+
|
|
11
|
+
```diff
|
|
12
|
+
- const data = await clerkClient.users.getOrganizationInvitationList()
|
|
13
|
+
+ const { data, totalCount } = await clerkClient.users.getOrganizationInvitationList()
|
|
14
|
+
```
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: '`Users.getOrganizationList` return signature changed'
|
|
3
|
+
matcher: "\\.users\\.getOrganizationList\\("
|
|
4
|
+
warning: true
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
The response payload of `Users.getOrganizationList` was changed as part of the v5 release. Rather than directly returning ` data`, the return signature is now `{ data, totalCount }`. Since backend API responses are paginated, the `totalCount` property is helpful in determining the total number of items in the response easily, and this change in the backend SDK aligns the response shape with what the backend API returns directly.
|
|
8
|
+
|
|
9
|
+
Here's an example of how the response shape would change with this modification:
|
|
10
|
+
|
|
11
|
+
```diff
|
|
12
|
+
- const data = await clerkClient.users.getOrganizationList()
|
|
13
|
+
+ const { data, totalCount } = await clerkClient.users.getOrganizationList()
|
|
14
|
+
```
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: '`Users.getOrganizationMembershipList` return signature changed'
|
|
3
|
+
matcher: "\\.users\\.getOrganizationMembershipList\\("
|
|
4
|
+
warning: true
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
The response payload of `Users.getOrganizationMembershipList` was changed as part of the v5 release. Rather than directly returning ` data`, the return signature is now `{ data, totalCount }`. Since backend API responses are paginated, the `totalCount` property is helpful in determining the total number of items in the response easily, and this change in the backend SDK aligns the response shape with what the backend API returns directly.
|
|
8
|
+
|
|
9
|
+
Here's an example of how the response shape would change with this modification:
|
|
10
|
+
|
|
11
|
+
```diff
|
|
12
|
+
- const data = await clerkClient.users.getOrganizationMembershipList()
|
|
13
|
+
+ const { data, totalCount } = await clerkClient.users.getOrganizationMembershipList()
|
|
14
|
+
```
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
---
|
|
2
|
-
title: '`getPendingOrganizationInvitationList` -> `getOrganizationInvitationList`'
|
|
3
|
-
matcher:
|
|
2
|
+
title: '`Organizations.getPendingOrganizationInvitationList` -> `getOrganizationInvitationList`'
|
|
3
|
+
matcher: "\\.(getPendingOrganizationInvitationList)\\("
|
|
4
4
|
replaceWithString: 'getOrganizationInvitationList'
|
|
5
5
|
---
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
The `Organizations.getPendingOrganizationInvitationList` method has been removed. To match the same functionality, use `Organizations.getOrganizationInvitationList` and pass in `status` option as "pending" instead.
|
|
8
8
|
|
|
9
9
|
```diff
|
|
10
|
-
- getPendingOrganizationInvitationList(
|
|
11
|
-
+ getOrganizationInvitationList({
|
|
10
|
+
- clerkClient.organizations.getPendingOrganizationInvitationList()
|
|
11
|
+
+ clerkClient.organizations.getOrganizationInvitationList({ status: "pending" })
|
|
12
12
|
```
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: '`httpOptions` parameter removed'
|
|
3
|
+
matcher: "\\([\\s\\S]*?httpOptions:\\s\\S]*?\\)"
|
|
4
|
+
matcherFlags: 'm'
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
The `httpOptions` parameter was removed from the internal `buildRequest` function but it is used by most public facing APIs. Hence you were able to pass `httpOptions` to some functions which is not possible anymore. If you're currently relying on this functionality and wish to update, please reach out to Clerk's support.
|
|
8
|
+
|
|
9
|
+
The internal change looks like this:
|
|
10
|
+
|
|
11
|
+
```diff
|
|
12
|
+
- const r = buildRequest({ httpsOptions: { headers: {} }})
|
|
13
|
+
+ const request = buildRequest()
|
|
14
|
+
+ request({ headerParams: {} })
|
|
15
|
+
```
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: '`MembershipRole` type replaced by `OrganizationCustomRoleKey` type'
|
|
3
|
+
matcher: "(?:\\.orgRole|\\.org_role)"
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
The `MembershipRole` type was replaced with `OrganizationCustomRoleKey` (related to [roles and permissions](https://clerk.com/docs/organizations/roles-permissions)). An example of where this type might be found:
|
|
7
|
+
|
|
8
|
+
```js
|
|
9
|
+
import { useAuth } from '@clerk/clerk-react';
|
|
10
|
+
|
|
11
|
+
const { orgRole } = useAuth();
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
To support the existing roles `admin`, `basic_member`, and `guest_member` apply interface merging using the following snippet:
|
|
15
|
+
|
|
16
|
+
```js
|
|
17
|
+
interface ClerkAuthorization {
|
|
18
|
+
permission: ''
|
|
19
|
+
role: 'admin' | 'basic_member' | 'guest_member'
|
|
20
|
+
}
|
|
21
|
+
```
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: '`pkgVersion` -> `clerkJSVersion`'
|
|
3
|
+
matcher:
|
|
4
|
+
- "loadInterstitialFromLocal\\([\\s\\S]*?pkgVersion:"
|
|
5
|
+
- "loadInterstitialFromBAPI\\([\\s\\S]*?pkgVersion:"
|
|
6
|
+
- "buildPublicInterstitialUrl\\([\\s\\S]*?pkgVersion:"
|
|
7
|
+
matcherFlags: 'm'
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
The `pkgVersion` parameter was removed from the `loadInterstitialFromLocal`, `loadInterstitialFromBAPI`, and `buildPublicInterstitialUrl` functions. Use `clerkJSVersion` instead. Example:
|
|
11
|
+
|
|
12
|
+
```diff
|
|
13
|
+
- loadInterstitialFromLocal({ pkgVersion: "..." })
|
|
14
|
+
+ loadInterstitialFromLocal({ clerkJSVersion: "..." })
|
|
15
|
+
```
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: '`redirect` import moved to `@clerk/backend/internal`'
|
|
3
|
+
matcher: "import\\s+{[\\s\\S]*?redirect[\\s\\S]*?}\\s+from\\s+['\"]@clerk\\/(backend)['\"]"
|
|
4
|
+
matcherFlags: 'm'
|
|
5
|
+
replaceWithString: 'backend/internal'
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
The `redirect` import path has changed from `@clerk/backend` to `@clerk/backend/internal`. You must update your import path in order for it to work correctly. Note that internal imports are not intended for usage and are outside the scope of semver. Example below of the fix that needs to be made:
|
|
9
|
+
|
|
10
|
+
```diff
|
|
11
|
+
- import { redirect } from "@clerk/backend"
|
|
12
|
+
+ import { redirect } from "@clerk/backend/internal"
|
|
13
|
+
```
|