@clerk/upgrade 1.2.3 → 1.2.4-canary.v20250212112940

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 CHANGED
@@ -5,7 +5,6 @@ import { Header } from './components/Header.js';
5
5
  import { Scan } from './components/Scan.js';
6
6
  import { SDKWorkflow } from './components/SDKWorkflow.js';
7
7
  import SDKS from './constants/sdks.js';
8
- import { getClerkMajorVersion } from './util/get-clerk-version.js';
9
8
  import guessFrameworks from './util/guess-framework.js';
10
9
 
11
10
  /**
@@ -37,14 +36,12 @@ export default function App(props) {
37
36
  const [sdkGuessConfirmed, setSdkGuessConfirmed] = useState(false);
38
37
  const [sdkGuessAttempted, setSdkGuessAttempted] = useState(false);
39
38
  const [fromVersion, setFromVersion] = useState(props.fromVersion);
40
- const [fromVersionGuessAttempted, setFromVersionGuessAttempted] = useState(false);
41
39
  const [toVersion, setToVersion] = useState(props.toVersion);
42
40
  const [dir, setDir] = useState(props.dir);
43
41
  const [ignore, setIgnore] = useState(props.ignore ?? []);
44
42
  const [configComplete, setConfigComplete] = useState(false);
45
43
  const [configVerified, setConfigVerified] = useState(false);
46
44
  const [uuid, setUuid] = useState();
47
- let fromVersionGuess = false;
48
45
  if (yolo) {
49
46
  setSdks(SDKS.map(s => s.value));
50
47
  setYolo(false);
@@ -81,12 +78,6 @@ export default function App(props) {
81
78
  setSdkGuessAttempted(true);
82
79
  }
83
80
 
84
- // We try to guess which version of Clerk they are using
85
- if (isEmpty(sdks) && !fromVersion && !fromVersionGuess && !fromVersionGuessAttempted) {
86
- fromVersionGuess = getClerkMajorVersion();
87
- setFromVersionGuessAttempted(true);
88
- }
89
-
90
81
  // No support for v3 or below, sadly
91
82
  if (parseInt(fromVersion) < 4) {
92
83
  return /*#__PURE__*/React.createElement(Text, {
package/dist/cli.js CHANGED
File without changes
@@ -8,11 +8,10 @@
8
8
  * @returns {string|undefined} - The transformed source code if modifications were made, otherwise undefined
9
9
  */
10
10
  module.exports = function transformAsyncRequest({
11
- path,
12
11
  source
13
12
  }, {
14
13
  jscodeshift: j
15
- }, _options) {
14
+ }) {
16
15
  const root = j(source);
17
16
  let dirtyFlag = false;
18
17
 
@@ -7,11 +7,10 @@
7
7
  * @returns {string|undefined} - The transformed source code if modifications were made, otherwise undefined
8
8
  */
9
9
  module.exports = function transformClerkProviderDynamic({
10
- _path,
11
10
  source
12
11
  }, {
13
12
  jscodeshift: j
14
- }, _options) {
13
+ }) {
15
14
  const root = j(source);
16
15
  let dirtyFlag = false;
17
16
 
@@ -26,9 +26,7 @@ export function SDKWorkflow(props) {
26
26
  const [done, setDone] = useState(false);
27
27
  const [runCodemod, setRunCodemod] = useState(false);
28
28
  const [upgradeComplete, setUpgradeComplete] = useState(false);
29
-
30
- // eslint-disable-next-line no-unused-vars
31
- const [version, setVersion] = useState(getClerkSdkVersion(sdk));
29
+ const [version] = useState(getClerkSdkVersion(sdk));
32
30
  if (sdk !== 'nextjs') {
33
31
  return /*#__PURE__*/React.createElement(StatusMessage, {
34
32
  variant: "error"
File without changes
@@ -68,6 +68,8 @@ export const accordionForCategory = partial((categories, options, {
68
68
  if (options.additionalItems) {
69
69
  items.push(...[].concat(options.additionalItems));
70
70
  }
71
+
72
+ // eslint-disable-next-line @typescript-eslint/no-base-to-string
71
73
  return `<Accordion titles={[${items.map(i => `"${parseInline(i.title)}"`).join(', ')}]}>
72
74
  ${items.map(i => ` <AccordionPanel>${indent('\n' + i.content.trim(), 4)}\n </AccordionPanel>`).join('\n')}
73
75
  </Accordion>`;
@@ -12,7 +12,9 @@ async function generate() {
12
12
  // Note: make sure to add a custom anchor link here to match the cli output
13
13
  // anchor should be `entry.slug`
14
14
  output += `<details>
15
- <summary>${parseInline(entry.title)}</summary>
15
+ <summary>${
16
+ // eslint-disable-next-line @typescript-eslint/no-base-to-string
17
+ parseInline(entry.title)}</summary>
16
18
 
17
19
  Regex matcher: \`${entry.matcher}\`
18
20
 
@@ -1,10 +1,5 @@
1
1
  import { readPackageSync } from 'read-pkg';
2
2
  import semverRegex from 'semver-regex';
3
- export function getClerkMajorVersion() {
4
- const pkg = readPackageSync();
5
- const clerk = pkg.dependencies.clerk;
6
- return clerk ? semverRegex().exec(clerk)[0][0] : false;
7
- }
8
3
  export function getClerkSdkVersion(sdk) {
9
4
  const pkg = readPackageSync();
10
5
  const clerkSdk = pkg.dependencies[`@clerk/${sdk}`];
@@ -21,7 +21,7 @@ export default function guessFrameworks(dir, disableTelemetry) {
21
21
  pkg = readPackageSync({
22
22
  cwd: dir
23
23
  });
24
- } catch (err) {
24
+ } catch {
25
25
  const tmpPath = path.join(tempDir, 'clerk-upgrade-uuid');
26
26
  let uuid;
27
27
  if (!disableTelemetry) {
@@ -5,7 +5,7 @@ matcherFlags: 'm'
5
5
  category: 'skip'
6
6
  ---
7
7
 
8
- The `tokenCache` prop has been renamed to `storageCache` in order to accomodate the new [WebSSO feature](https://github.com/clerk/javascript/pull/2277). With the prop change from `tokenCache` to `storageCache`, the interface has been expanded to allow for more flexibility. The new interface is as follows:
8
+ The `tokenCache` prop has been renamed to `storageCache` in order to accommodate the new [WebSSO feature](https://github.com/clerk/javascript/pull/2277). With the prop change from `tokenCache` to `storageCache`, the interface has been expanded to allow for more flexibility. The new interface is as follows:
9
9
 
10
10
  ```ts
11
11
  type StorageCache = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@clerk/upgrade",
3
- "version": "1.2.3",
3
+ "version": "1.2.4-canary.v20250212112940",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/clerk/javascript.git",
@@ -15,14 +15,6 @@
15
15
  "files": [
16
16
  "dist"
17
17
  ],
18
- "scripts": {
19
- "build": "npm run clean && NODE_ENV=production babel --keep-file-extension --out-dir=dist src --copy-files",
20
- "clean": "rm -rf dist/*",
21
- "dev": "babel --keep-file-extension --out-dir=dist --watch src --copy-files",
22
- "lint": "eslint src/",
23
- "lint:publint": "publint",
24
- "test": "vitest"
25
- },
26
18
  "babel": {
27
19
  "presets": [
28
20
  "@babel/preset-react"
@@ -43,7 +35,7 @@
43
35
  "jscodeshift": "^17.0.0",
44
36
  "marked": "^11.1.1",
45
37
  "meow": "^11.0.0",
46
- "react": "^18.3.1",
38
+ "react": "18.3.1",
47
39
  "read-pkg": "^9.0.1",
48
40
  "semver-regex": "^4.0.5",
49
41
  "temp-dir": "^3.0.0"
@@ -51,13 +43,21 @@
51
43
  "devDependencies": {
52
44
  "@babel/cli": "^7.24.7",
53
45
  "@babel/preset-react": "^7.24.7",
54
- "@types/jscodeshift": "^0.12.0",
55
- "eslint-config-custom": "*"
46
+ "@types/jscodeshift": "^0.12.0"
56
47
  },
57
48
  "engines": {
58
49
  "node": ">=18.17.0"
59
50
  },
60
51
  "publishConfig": {
61
52
  "access": "public"
53
+ },
54
+ "scripts": {
55
+ "build": "pnpm clean && NODE_ENV=production babel --keep-file-extension --out-dir=dist src --copy-files",
56
+ "clean": "rm -rf dist/*",
57
+ "dev": "babel --keep-file-extension --out-dir=dist --watch src --copy-files",
58
+ "lint": "eslint src/",
59
+ "lint:publint": "publint",
60
+ "test": "vitest run",
61
+ "test:watch": "vitest watch"
62
62
  }
63
- }
63
+ }