@clerk/upgrade 0.0.1 → 0.0.3

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.
Files changed (29) hide show
  1. package/dist/cli.js +0 -0
  2. package/dist/scan.js +35 -20
  3. package/dist/util/expandable-list.js +12 -5
  4. package/dist/versions/v5/common/afterswitchorganizationurl.md +15 -0
  5. package/dist/versions/v5/common/appearance-organizationpreview-organizationswitcher.md +8 -0
  6. package/dist/versions/v5/common/useorganization-invitationlist.md +25 -0
  7. package/dist/versions/v5/common/useorganization-membershiplist.md +24 -0
  8. package/dist/versions/v5/common/useorganizations.md +26 -0
  9. package/dist/versions/v5/common/userprofile-prop.md +7 -0
  10. package/dist/versions/v5/index.js +3 -11
  11. package/dist/versions/v5/js/lastorganizationinvitation-member.md +1 -1
  12. package/dist/versions/v5/next/import-api-url.md +1 -1
  13. package/dist/versions/v5/next/import-api-version.md +1 -1
  14. package/dist/versions/v5/next/import-clerk-js-url.md +1 -1
  15. package/dist/versions/v5/next/import-clerk-js-version.md +1 -1
  16. package/dist/versions/v5/next/import-domain.md +1 -1
  17. package/dist/versions/v5/next/import-is-satellite.md +1 -1
  18. package/dist/versions/v5/next/import-proxy-url.md +1 -1
  19. package/dist/versions/v5/next/import-publishable-key.md +1 -1
  20. package/dist/versions/v5/next/import-secret-key.md +1 -1
  21. package/dist/versions/v5/next/import-sign-in-url.md +1 -1
  22. package/dist/versions/v5/next/import-sign-up-url.md +1 -1
  23. package/dist/versions/v5/react/afterswitchorganizationurl.md +15 -0
  24. package/dist/versions/v5/react/appearance-organizationpreview-organizationswitcher.md +8 -0
  25. package/dist/versions/v5/react/useorganization-invitationlist.md +25 -0
  26. package/dist/versions/v5/react/useorganization-membershiplist.md +24 -0
  27. package/dist/versions/v5/react/useorganizations.md +26 -0
  28. package/dist/versions/v5/react/userprofile-prop.md +7 -0
  29. package/package.json +2 -2
package/dist/cli.js CHANGED
File without changes
package/dist/scan.js CHANGED
@@ -2,6 +2,7 @@ import React, { useState, useEffect } from 'react';
2
2
  import { Text, Newline, Box } from 'ink';
3
3
  import { globby } from 'globby';
4
4
  import fs from 'fs/promises';
5
+ import path from 'path';
5
6
  import { ProgressBar } from '@inkjs/ui';
6
7
  import indexToPosition from 'index-to-position';
7
8
  import ExpandableList from './util/expandable-list.js';
@@ -45,10 +46,16 @@ export default function Scan({
45
46
  // result = `files` set to format: ['/filename', '/other/filename']
46
47
  useEffect(() => {
47
48
  setStatus('Collecting files to scan');
48
- ignore.push('node_modules/**', '**/node_modules/**', '.git/**', 'package.json', 'package-lock.json', 'yarn.lock', 'pnpm-lock.yaml');
49
- globby(dir, {
49
+ ignore.push('node_modules/**', '**/node_modules/**', '.git/**', 'package.json', '**/package.json', 'package-lock.json', '**/package-lock.json', 'yarn.lock', '**/yarn.lock', 'pnpm-lock.yaml', '**/pnpm-lock.yaml', '**/*.(png|webp|svg|gif|jpg|jpeg)+',
50
+ // common image files
51
+ '**/*.(mp4|mkv|wmv|m4v|mov|avi|flv|webm|flac|mka|m4a|aac|ogg)+' // common video files
52
+ );
53
+
54
+ globby(path.resolve(dir), {
50
55
  ignore: [...ignore.filter(x => x)]
51
- }).then(files => setFiles(files));
56
+ }).then(files => {
57
+ setFiles(files);
58
+ });
52
59
  }, [dir, ignore]);
53
60
 
54
61
  // Read files and scan regexes
@@ -57,32 +64,40 @@ export default function Scan({
57
64
  //
58
65
  useEffect(() => {
59
66
  if (!matchers || !files) return;
67
+ const allResults = {};
60
68
  Promise.all(
61
69
  // first we read all the files
62
70
  files.map(async (file, idx) => {
63
- setStatus(`Scanning ${file}`);
64
- setProgress(Math.ceil(idx / files.length * 100));
65
71
  const content = await fs.readFile(file, 'utf8');
66
72
 
67
73
  // then we run each of the matchers against the file contents
68
- // TODO: combine results on the same match, add multiple file/positions
69
74
  for (const sdk in matchers) {
75
+ // returns [{ ...matcher, instances: [{sdk, file, position}] }]
70
76
  matchers[sdk].map(matcher => {
71
- const matches = content.matchAll(matcher.matcher);
72
- if (!matches) return;
73
- Array.from(matches).map(match => {
74
- // TODO: index should be converted to line/col
75
- results.push({
76
- sdk,
77
- file,
78
- position: indexToPosition(content, match.index),
77
+ // run regex against file content, return array of matches
78
+ const matches = Array.from(content.matchAll(matcher.matcher));
79
+ if (matches.length < 1) return;
80
+
81
+ // for each match, add to `instances` array of a key, create if not exists
82
+ matches.map(match => {
83
+ if (!allResults[matcher.title]) allResults[matcher.title] = {
84
+ instances: [],
79
85
  ...matcher
86
+ };
87
+ allResults[matcher.title].instances.push({
88
+ sdk,
89
+ file: path.relative(process.cwd(), file),
90
+ position: indexToPosition(content, match.index, {
91
+ oneBased: true
92
+ })
80
93
  });
81
- setResults(results);
82
94
  });
83
95
  });
84
96
  }
97
+ setStatus(`Scanning ${file}`);
98
+ setProgress(Math.ceil(idx / files.length * 100));
85
99
  })).then(() => {
100
+ setResults([...results, ...Object.keys(allResults).map(k => allResults[k])]);
86
101
  setComplete(true);
87
102
  if (results.length < 1) {
88
103
  setStatus('It looks like you have nothing you need to change, upgrade away!');
@@ -93,11 +108,11 @@ export default function Scan({
93
108
  console.error(err);
94
109
  });
95
110
  }, [matchers, files]);
96
- return /*#__PURE__*/React.createElement(React.Fragment, null, complete ? /*#__PURE__*/React.createElement(Text, {
111
+ return /*#__PURE__*/React.createElement(React.Fragment, null, complete ? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Text, {
97
112
  color: "green"
98
- }, "\u2713 ", status) : /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(ProgressBar, {
99
- value: progress
100
- }), /*#__PURE__*/React.createElement(Text, null, status)), /*#__PURE__*/React.createElement(Newline, null), !!results.length && /*#__PURE__*/React.createElement(ExpandableList, {
113
+ }, "\u2713 ", status), /*#__PURE__*/React.createElement(Newline, null), !!results.length && /*#__PURE__*/React.createElement(ExpandableList, {
101
114
  items: results
102
- }));
115
+ })) : /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(ProgressBar, {
116
+ value: progress
117
+ }), /*#__PURE__*/React.createElement(Text, null, status)));
103
118
  }
@@ -1,7 +1,7 @@
1
1
  import React, { useReducer, useMemo } from 'react';
2
2
  import { Text, Newline, useInput, Box } from 'ink';
3
3
  import Link from 'ink-link';
4
- import Markdown from 'ink-markdown';
4
+ import Markdown from '@jescalan/ink-markdown';
5
5
 
6
6
  // A listing of items which can be navigated with arrow keys and expanded/contracted
7
7
  // with space bar. Limits the number visible at a time to prevent rendering issues with
@@ -52,19 +52,25 @@ export default function ExpandableList({
52
52
  color: "blue"
53
53
  }, "Navigation Instructions:"), /*#__PURE__*/React.createElement(Text, null, "Navigate through items with \u2191 and \u2193 arrow keys. Expand the details of any item with space bar. \u2193 key on the last item goes to the next page, \u2191 on the first item goes to the previous page. To exit this interface, use \"control + c\"."), /*#__PURE__*/React.createElement(Newline, null), state.all.reduce((memo, item, idx) => {
54
54
  if (idx < state.visible[0] || idx >= state.visible[1]) return memo;
55
- const loc = `${item.file}:${item.position.line}:${item.position.column}`;
55
+ const locations = item.instances.map(instance => `${instance.file}:${instance.position.line}:${instance.position.column}`);
56
56
  memo.push( /*#__PURE__*/React.createElement(Box, {
57
57
  borderStyle: item.focused ? 'double' : 'single',
58
58
  flexDirection: "column",
59
59
  borderColor: item.focused ? 'blue' : 'white',
60
60
  paddingX: 1,
61
- key: loc
62
- }, /*#__PURE__*/React.createElement(Markdown, null, item.title), /*#__PURE__*/React.createElement(Text, null, "Location: ", loc), item.expanded && /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Newline, null), /*#__PURE__*/React.createElement(Markdown, null, item.content), /*#__PURE__*/React.createElement(Link, {
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))), /*#__PURE__*/React.createElement(Newline, null), /*#__PURE__*/React.createElement(Markdown, null, item.content), /*#__PURE__*/React.createElement(Line, null), /*#__PURE__*/React.createElement(Link, {
63
63
  url: item.link
64
- }, /*#__PURE__*/React.createElement(Text, null, "See in migration guide \xBB")))));
64
+ }, /*#__PURE__*/React.createElement(Text, null, "Open in migration guide \xBB")))));
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
  }
68
+ const Line = () => /*#__PURE__*/React.createElement(Box, {
69
+ borderStyle: "single",
70
+ borderRight: false,
71
+ borderLeft: false,
72
+ borderBottom: false
73
+ });
68
74
 
69
75
  // I'd like to recognize that this logic is kinda crazy, but it works 💖
70
76
  function reducer(state, action) {
@@ -134,6 +140,7 @@ function reducer(state, action) {
134
140
  }
135
141
  return item;
136
142
  });
143
+ console.log(''); // this is strange but seems to solve a rendering bug
137
144
  return {
138
145
  all,
139
146
  visible: state.visible,
@@ -0,0 +1,15 @@
1
+ ---
2
+ title: '`afterSwitchOrganizationUrl` -> `afterSelectOrganizationUrl` in `OrganizationSwitcher`'
3
+ matcher: '<OrganizationSwitcher.*?(afterSwitchOrganizationUrl)=.*?>'
4
+ replaceWithString: 'afterSelectOrganizationUrl'
5
+ ---
6
+
7
+ The `afterSwitchOrganizationUrl` prop on the `<OrganizationSwitcher />` component has been renamed to `afterSelectOrganizationUrl`. This is a quick and simple rename.
8
+
9
+ ```js
10
+ // before
11
+ <OrganizationSwitcher afterSwitchOrganizationUrl='...' />
12
+
13
+ // after
14
+ <OrganizationSwitcher afterSelectOrganizationUrl='...' />
15
+ ```
@@ -0,0 +1,8 @@
1
+ ---
2
+ title: '`elements.organizationPreview__organizationSwitcher` -> `elements.organizationPreview__organizationSwitcherTrigger` in `<OrganizationSwitcher />` appearance prop'
3
+ matcher: "<OrganizationSwitcher[\\s\\S]*?appearance={\\s*{\\s*elements:\\s*{\\s*(organizationPreview__organizationSwitcher)[\\s\\S]*?>"
4
+ matcherFlags: 'm'
5
+ replaceWithString: 'organizationPreview__organizationSwitcherTrigger'
6
+ ---
7
+
8
+ If you are using `organizationPreview__organizationSwitcher` as an [appearance prop](https://clerk.com/docs/components/customization/overview#appearance-prop) value to the [`<OrganizationSwitcher />` component](https://clerk.com/docs/references/javascript/clerk/organization-switcher#organization-switcher-component), it must be updated to `organizationPreview__organizationSwitcherTrigger` instead. This is a simple text replacement. However, it should be noted that component designs have been updated as part of v5, so you may need to make adjustments to any appearance prop customizations that have been implemented as a whole.
@@ -0,0 +1,25 @@
1
+ ---
2
+ title: '`invitationList` -> `invitations` as param to `useOrganizations`'
3
+ matcher: "useOrganizations\\(\\s*{\\.*?invitationList:"
4
+ matcherFlags: 'm'
5
+ ---
6
+
7
+ The `invitationList` param to the `useOrganizations` hook has been replaced by `invitations`. This param also has a slightly different way of working, examples included below. Note also that `useOrganizations` is deprecated and should be updated to `useOrganization` instead.
8
+
9
+ ```js
10
+ // before
11
+ const { invitationList } = useOrganization({
12
+ invitationList: { limit: 10, offset: 1 },
13
+ });
14
+
15
+ // after
16
+ const { invitations } = useOrganization({
17
+ invitations: {
18
+ initialPage: 1,
19
+ pageSize: 10,
20
+ },
21
+ });
22
+
23
+ // you can also simply return all invitations
24
+ const { invitations } = useOrganization({ invitations: true });
25
+ ```
@@ -0,0 +1,24 @@
1
+ ---
2
+ title: '`membershipList` -> `members` as param to `useOrganization`'
3
+ matcher: "useOrganizations\\(\\s*{\\.*?membershipList:"
4
+ ---
5
+
6
+ The `membershipList` param from the `useOrganization` hook has been removed. Instead, [use the `memberships` param](https://clerk.com/docs/references/react/use-organization#parameters). Examples of each can be seen here:
7
+
8
+ ```js
9
+ // before
10
+ const { membershipList } = useOrganization({
11
+ membershipList: { limit: 10, offset: 1 },
12
+ });
13
+
14
+ // after
15
+ const { memberships } = useOrganization({
16
+ memberships: {
17
+ initialPage: 1,
18
+ pageSize: 10,
19
+ },
20
+ });
21
+
22
+ // you can also simply return all memberships
23
+ const { memberships } = useOrganization({ memberships: true });
24
+ ```
@@ -0,0 +1,26 @@
1
+ ---
2
+ title: '`useOrganizations` -> `useOrganizationList`'
3
+ matcher: "useOrganizations\\("
4
+ ---
5
+
6
+ Any place where `useOrganizations` is used should be switched to [`useOrganizationList`](https://clerk.com/docs/references/react/use-organization-list) or [`useOrganization`](https://clerk.com/docs/references/react/use-organization) instead. The return signature has also changed, so take note of this when making the upgrade.
7
+
8
+ ```js
9
+ // before: useOrganizations return values
10
+ {
11
+ isLoaded: boolean,
12
+ createOrganization: clerk.createOrganization,
13
+ getOrganizationMemberships: clerk.getOrganizationMemberships,
14
+ getOrganization: clerk.getOrganization,
15
+ }
16
+
17
+ // after: useOrganizationList return values
18
+ {
19
+ isLoaded: boolean,
20
+ createOrganization: clerk.createOrganization,
21
+ userMemberships: PaginatedResourcesWithDefault<...> | PaginatedResources<...>,
22
+ userInvitations: PaginatedResourcesWithDefault<...> | PaginatedResources<...>,
23
+ userSuggestions: PaginatedResourcesWithDefault<...> | PaginatedResources<...>,
24
+ setActive: clerk.setActive,
25
+ }
26
+ ```
@@ -0,0 +1,7 @@
1
+ ---
2
+ title: '`userProfile` -> `userProfileProps` for `UserButton`'
3
+ matcher: '<UserButton.*?(userProfile)=.*?>'
4
+ replaceWithString: 'userProfileProps'
5
+ ---
6
+
7
+ The `userProfile` prop on [the `UserButton` component](https://clerk.com/docs/references/javascript/clerk/user-button#user-button-component) has been changed to `userProfileProps`. This is purely a name change, none of the values need to be updated
@@ -3,7 +3,7 @@ const load = createLoader({
3
3
  version: '5',
4
4
  baseUrl: 'https://clerk.com/docs/upgrade-guides/v5'
5
5
  });
6
- const reactChangesList = ['magiclinkerrorcode', 'usemagiclink', 'ismagiclinkerror', 'magiclinkerror', 'handlemagiclinkverification', 'clerkprovider-frontendapi', 'setsession', 'navigate-to-routerpush-routerreplace'];
6
+ const reactChangesList = ['magiclinkerrorcode', 'usemagiclink', 'ismagiclinkerror', 'magiclinkerror', 'handlemagiclinkverification', 'clerkprovider-frontendapi', 'setsession', 'navigate-to-routerpush-routerreplace', 'afterswitchorganizationurl', 'appearance-organizationpreview-organizationswitcher', 'useorganization-invitationlist', 'useorganization-membershiplist', 'useorganizations', 'userprofile-prop'];
7
7
  export default {
8
8
  nextjs: load('next', ['api-key-to-secret-key', 'frontend-api-to-publishable-key', 'with-clerk-middleware-removed', 'auth-middleware-deprecated', 'clerk-js-version-next-public', 'authmiddleware-apikey', 'authmiddleware-frontendapi', 'createclerkclient-apikey', 'createclerkclient-frontendapi', 'getauth-apikey', 'clerkprovider-frontendapi', 'import-nextjs-app-beta', 'import-nextjs-ssr', 'import-nextjs-edge-middleware', 'import-nextjs-edge-middlewarefiles', 'import-api-url', 'import-api-version', 'import-clerk-js-url', 'import-clerk-js-version', 'import-domain', 'import-is-satellite', 'import-proxy-url', 'import-publishable-key', 'import-secret-key', 'import-sign-in-url', 'import-sign-up-url', 'import-nextjs-api', 'api-url-value-change', 'ismagiclinkerror', 'usemagiclink', 'magiclinkerrorcode', 'setsession']),
9
9
  // since we export clerk-react at the top level from the gatsby plugin
@@ -19,23 +19,15 @@ export default {
19
19
  // shared w/ all
20
20
  'user-orgpublicdata-profileimageurl',
21
21
  // shared w/ all
22
- 'useorganizations', 'userprofile-prop', 'setsession', 'user-update-password',
23
- // shared w/ all
24
- 'afterswitchorganizationurl',
22
+ 'setsession', 'user-update-password',
25
23
  // shared w/ all
26
24
  'experimental-canusecaptcha', 'experimental-captchaurl', 'experimental-captchasitekey', 'getorganizationmemberships', 'lastorganizationinvitation-member', 'unstable-invitationupdate', 'unstable-membershipupdate', 'organization-create-string',
27
25
  // maybe shared with all?
28
26
  'organization-getpendinginvitations',
29
27
  // maybe shared with all?
30
- 'useorganization-invitationlist',
31
- // maybe shared with all?
32
- 'useorganization-membershiplist',
33
- // maybe shared with all?
34
28
  'user-createexternalaccount-redirecturl',
35
29
  // maybe shared with all?
36
- 'signup-attemptweb3walletverification-generatedsignature', 'appearance-organizationpreview-organizationswitcher',
37
- // shared w/ all
38
- 'redirecttohome']),
30
+ 'signup-attemptweb3walletverification-generatedsignature', 'redirecttohome']),
39
31
  shared: load('shared', ['magiclinkerror', 'ismagiclinkerror', 'magiclinkerrorcode', 'usemagiclink', 'buildrequesturl', 'organizationcontext', 'useorganizationlist-organizationlist' // shared outside this pkg?
40
32
  ]),
41
33
 
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  title: '`lastOrganizationInvitation` and `lastOrganizationMember` dropped from event emitter'
3
- matcher: "[\\.lastOrganizationInvitation|\\.lastOrganizationMember]"
3
+ matcher: "(?:\\.lastOrganizationInvitation|\\.lastOrganizationMember)"
4
4
  ---
5
5
 
6
6
  If you are using [`Clerk.addListener`](https://clerk.com/docs/references/javascript/clerk/clerk#add-listener) or `OrganizationContext` and utilizing either the `lastOrganizationInvitation` and/or `lastOrganizationMember` emitted events, these properties have been removed, as they were only relevant for internal use. We are not providing a way to backfill this functionality at the moment. If you are using it and this is an issue for you, please [reach out to Clerk support](https://clerk.com/support) and we can find a way to resolve the issue!
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  title: '`API_URL` constant removed'
3
- matcher: "API_URL[\\s\\S]*?from\\s+['\"]@clerk\\/nextjs[\\s\\S]*?['\"]"
3
+ matcher: "import\\s+{[\\s\\S]*?API_URL[\\s\\S]*?from\\s+['\"]@clerk\\/nextjs[\\s\\S]*?['\"]"
4
4
  matcherFlags: 'm'
5
5
  ---
6
6
 
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  title: '`API_VERSION` constant removed'
3
- matcher: "API_VERSION[\\s\\S]*?from\\s+['\"]@clerk\\/nextjs[\\s\\S]*?['\"]"
3
+ matcher: "import\\s+{[\\s\\S]*?API_VERSION[\\s\\S]*?from\\s+['\"]@clerk\\/nextjs[\\s\\S]*?['\"]"
4
4
  matcherFlags: 'm'
5
5
  ---
6
6
 
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  title: '`CLERK_JS_URL` constant removed'
3
- matcher: "CLERK_JS_URL[\\s\\S]*?from\\s+['\"]@clerk\\/nextjs[\\s\\S]*?['\"]"
3
+ matcher: "import\\s+{[\\s\\S]*?CLERK_JS_URL[\\s\\S]*?from\\s+['\"]@clerk\\/nextjs[\\s\\S]*?['\"]"
4
4
  matcherFlags: 'm'
5
5
  ---
6
6
 
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  title: '`CLERK_JS_VERSION` constant removed'
3
- matcher: "CLERK_JS_VERSION[\\s\\S]*?from\\s+['\"]@clerk\\/nextjs[\\s\\S]*?['\"]"
3
+ matcher: "import\\s+{[\\s\\S]*?CLERK_JS_VERSION[\\s\\S]*?from\\s+['\"]@clerk\\/nextjs[\\s\\S]*?['\"]"
4
4
  matcherFlags: 'm'
5
5
  ---
6
6
 
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  title: '`DOMAIN` constant removed'
3
- matcher: "DOMAIN[\\s\\S]*?from\\s+['\"]@clerk\\/nextjs[\\s\\S]*?['\"]"
3
+ matcher: "import\\s+{[\\s\\S]*?DOMAIN[\\s\\S]*?from\\s+['\"]@clerk\\/nextjs[\\s\\S]*?['\"]"
4
4
  matcherFlags: 'm'
5
5
  ---
6
6
 
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  title: '`IS_SATELLITE` constant removed'
3
- matcher: "IS_SATELLITE[\\s\\S]*?from\\s+['\"]@clerk\\/nextjs[\\s\\S]*?['\"]"
3
+ matcher: "import\\s+{[\\s\\S]*?IS_SATELLITE[\\s\\S]*?from\\s+['\"]@clerk\\/nextjs[\\s\\S]*?['\"]"
4
4
  matcherFlags: 'm'
5
5
  ---
6
6
 
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  title: '`PROXY_URL` constant removed'
3
- matcher: "PROXY_URL[\\s\\S]*?from\\s+['\"]@clerk\\/nextjs[\\s\\S]*?['\"]"
3
+ matcher: "import\\s+{[\\s\\S]*?PROXY_URL[\\s\\S]*?from\\s+['\"]@clerk\\/nextjs[\\s\\S]*?['\"]"
4
4
  matcherFlags: 'm'
5
5
  ---
6
6
 
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  title: '`PUBLISHABLE_KEY` constant removed'
3
- matcher: "PUBLISHABLE_KEY[\\s\\S]*?from\\s+['\"]@clerk\\/nextjs[\\s\\S]*?['\"]"
3
+ matcher: "import\\s+{[\\s\\S]*?PUBLISHABLE_KEY[\\s\\S]*?from\\s+['\"]@clerk\\/nextjs[\\s\\S]*?['\"]"
4
4
  matcherFlags: 'm'
5
5
  ---
6
6
 
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  title: '`SECRET_KEY` constant removed'
3
- matcher: "SECRET_KEY[\\s\\S]*?from\\s+['\"]@clerk\\/nextjs[\\s\\S]*?['\"]"
3
+ matcher: "import\\s+{[\\s\\S]*?SECRET_KEY[\\s\\S]*?from\\s+['\"]@clerk\\/nextjs[\\s\\S]*?['\"]"
4
4
  matcherFlags: 'm'
5
5
  ---
6
6
 
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  title: '`SIGN_IN_URL` constant removed'
3
- matcher: "SIGN_IN_URL[\\s\\S]*?from\\s+['\"]@clerk\\/nextjs[\\s\\S]*?['\"]"
3
+ matcher: "import\\s+{[\\s\\S]*?SIGN_IN_URL[\\s\\S]*?from\\s+['\"]@clerk\\/nextjs[\\s\\S]*?['\"]"
4
4
  matcherFlags: 'm'
5
5
  ---
6
6
 
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  title: '`SIGN_UP_URL` constant removed'
3
- matcher: "SIGN_UP_URL[\\s\\S]*?from\\s+['\"]@clerk\\/nextjs[\\s\\S]*?['\"]"
3
+ matcher: "import\\s+{[\\s\\S]*?SIGN_UP_URL[\\s\\S]*?from\\s+['\"]@clerk\\/nextjs[\\s\\S]*?['\"]"
4
4
  ---
5
5
 
6
6
  This deprecated constant has been removed as an export from `@clerk/nextjs`. We recommend setting the `NEXT_PUBLIC_CLERK_SIGN_UP_URL` environment variable and using this instead.
@@ -0,0 +1,15 @@
1
+ ---
2
+ title: '`afterSwitchOrganizationUrl` -> `afterSelectOrganizationUrl` in `OrganizationSwitcher`'
3
+ matcher: '<OrganizationSwitcher.*?(afterSwitchOrganizationUrl)=.*?>'
4
+ replaceWithString: 'afterSelectOrganizationUrl'
5
+ ---
6
+
7
+ The `afterSwitchOrganizationUrl` prop on the `<OrganizationSwitcher />` component has been renamed to `afterSelectOrganizationUrl`. This is a quick and simple rename.
8
+
9
+ ```js
10
+ // before
11
+ <OrganizationSwitcher afterSwitchOrganizationUrl='...' />
12
+
13
+ // after
14
+ <OrganizationSwitcher afterSelectOrganizationUrl='...' />
15
+ ```
@@ -0,0 +1,8 @@
1
+ ---
2
+ title: '`elements.organizationPreview__organizationSwitcher` -> `elements.organizationPreview__organizationSwitcherTrigger` in `<OrganizationSwitcher />` appearance prop'
3
+ matcher: "<OrganizationSwitcher[\\s\\S]*?appearance={\\s*{\\s*elements:\\s*{\\s*(organizationPreview__organizationSwitcher)[\\s\\S]*?>"
4
+ matcherFlags: 'm'
5
+ replaceWithString: 'organizationPreview__organizationSwitcherTrigger'
6
+ ---
7
+
8
+ If you are using `organizationPreview__organizationSwitcher` as an [appearance prop](https://clerk.com/docs/components/customization/overview#appearance-prop) value to the [`<OrganizationSwitcher />` component](https://clerk.com/docs/references/javascript/clerk/organization-switcher#organization-switcher-component), it must be updated to `organizationPreview__organizationSwitcherTrigger` instead. This is a simple text replacement. However, it should be noted that component designs have been updated as part of v5, so you may need to make adjustments to any appearance prop customizations that have been implemented as a whole.
@@ -0,0 +1,25 @@
1
+ ---
2
+ title: '`invitationList` -> `invitations` as param to `useOrganizations`'
3
+ matcher: "useOrganizations\\(\\s*{\\.*?invitationList:"
4
+ matcherFlags: 'm'
5
+ ---
6
+
7
+ The `invitationList` param to the `useOrganizations` hook has been replaced by `invitations`. This param also has a slightly different way of working, examples included below. Note also that `useOrganizations` is deprecated and should be updated to `useOrganization` instead.
8
+
9
+ ```js
10
+ // before
11
+ const { invitationList } = useOrganization({
12
+ invitationList: { limit: 10, offset: 1 },
13
+ });
14
+
15
+ // after
16
+ const { invitations } = useOrganization({
17
+ invitations: {
18
+ initialPage: 1,
19
+ pageSize: 10,
20
+ },
21
+ });
22
+
23
+ // you can also simply return all invitations
24
+ const { invitations } = useOrganization({ invitations: true });
25
+ ```
@@ -0,0 +1,24 @@
1
+ ---
2
+ title: '`membershipList` -> `members` as param to `useOrganization`'
3
+ matcher: "useOrganizations\\(\\s*{\\.*?membershipList:"
4
+ ---
5
+
6
+ The `membershipList` param from the `useOrganization` hook has been removed. Instead, [use the `memberships` param](https://clerk.com/docs/references/react/use-organization#parameters). Examples of each can be seen here:
7
+
8
+ ```js
9
+ // before
10
+ const { membershipList } = useOrganization({
11
+ membershipList: { limit: 10, offset: 1 },
12
+ });
13
+
14
+ // after
15
+ const { memberships } = useOrganization({
16
+ memberships: {
17
+ initialPage: 1,
18
+ pageSize: 10,
19
+ },
20
+ });
21
+
22
+ // you can also simply return all memberships
23
+ const { memberships } = useOrganization({ memberships: true });
24
+ ```
@@ -0,0 +1,26 @@
1
+ ---
2
+ title: '`useOrganizations` -> `useOrganizationList`'
3
+ matcher: "useOrganizations\\("
4
+ ---
5
+
6
+ Any place where `useOrganizations` is used should be switched to [`useOrganizationList`](https://clerk.com/docs/references/react/use-organization-list) or [`useOrganization`](https://clerk.com/docs/references/react/use-organization) instead. The return signature has also changed, so take note of this when making the upgrade.
7
+
8
+ ```js
9
+ // before: useOrganizations return values
10
+ {
11
+ isLoaded: boolean,
12
+ createOrganization: clerk.createOrganization,
13
+ getOrganizationMemberships: clerk.getOrganizationMemberships,
14
+ getOrganization: clerk.getOrganization,
15
+ }
16
+
17
+ // after: useOrganizationList return values
18
+ {
19
+ isLoaded: boolean,
20
+ createOrganization: clerk.createOrganization,
21
+ userMemberships: PaginatedResourcesWithDefault<...> | PaginatedResources<...>,
22
+ userInvitations: PaginatedResourcesWithDefault<...> | PaginatedResources<...>,
23
+ userSuggestions: PaginatedResourcesWithDefault<...> | PaginatedResources<...>,
24
+ setActive: clerk.setActive,
25
+ }
26
+ ```
@@ -0,0 +1,7 @@
1
+ ---
2
+ title: '`userProfile` -> `userProfileProps` for `UserButton`'
3
+ matcher: '<UserButton.*?(userProfile)=.*?>'
4
+ replaceWithString: 'userProfileProps'
5
+ ---
6
+
7
+ The `userProfile` prop on [the `UserButton` component](https://clerk.com/docs/references/javascript/clerk/user-button#user-button-component) has been changed to `userProfileProps`. This is purely a name change, none of the values need to be updated
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@clerk/upgrade",
3
- "version": "0.0.1",
3
+ "version": "0.0.3",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "bin": "dist/cli.js",
@@ -27,6 +27,7 @@
27
27
  },
28
28
  "dependencies": {
29
29
  "@inkjs/ui": "^1.0.0",
30
+ "@jescalan/ink-markdown": "^2.0.0",
30
31
  "globby": "^14.0.0",
31
32
  "gray-matter": "^4.0.3",
32
33
  "index-to-position": "^0.1.2",
@@ -34,7 +35,6 @@
34
35
  "ink-big-text": "^2.0.0",
35
36
  "ink-gradient": "^3.0.0",
36
37
  "ink-link": "^3.0.0",
37
- "ink-markdown": "jescalan/ink-markdown#release",
38
38
  "marked": "^11.1.1",
39
39
  "meow": "^11.0.0",
40
40
  "react": "^18.2.0",