diff --git a/package-lock.json b/package-lock.json index f8a676da..3b8e2a8b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -55,7 +55,7 @@ "prettier": "^3.0.3", "react": "18.3.1", "react-native": "0.77.1", - "react-native-builder-bob": "^0.37.0", + "react-native-builder-bob": "^0.40.6", "react-native-svg-transformer": "^1.5.0", "release-it": "^15.0.0", "semver": "^6.3.0", @@ -109,6 +109,23 @@ "node": ">=6.0.0" } }, + "node_modules/@ark/schema": { + "version": "0.46.0", + "resolved": "https://registry.npmjs.org/@ark/schema/-/schema-0.46.0.tgz", + "integrity": "sha512-c2UQdKgP2eqqDArfBqQIJppxJHvNNXuQPeuSPlDML4rjw+f1cu0qAlzOG4b8ujgm9ctIDWwhpyw6gjG5ledIVQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@ark/util": "0.46.0" + } + }, + "node_modules/@ark/util": { + "version": "0.46.0", + "resolved": "https://registry.npmjs.org/@ark/util/-/util-0.46.0.tgz", + "integrity": "sha512-JPy/NGWn/lvf1WmGCPw2VGpBg5utZraE84I7wli18EDF3p3zc/e9WolT35tINeZO3l7C77SjqRJeAUoT0CvMRg==", + "dev": true, + "license": "MIT" + }, "node_modules/@babel/code-frame": { "version": "7.26.2", "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.26.2.tgz", @@ -7799,6 +7816,17 @@ "node": ">= 0.4" } }, + "node_modules/arktype": { + "version": "2.1.20", + "resolved": "https://registry.npmjs.org/arktype/-/arktype-2.1.20.tgz", + "integrity": "sha512-IZCEEXaJ8g+Ijd59WtSYwtjnqXiwM8sWQ5EjGamcto7+HVN9eK0C4p0zDlCuAwWhpqr6fIBkxPuYDl4/Mcj/+Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "@ark/schema": "0.46.0", + "@ark/util": "0.46.0" + } + }, "node_modules/array-buffer-byte-length": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/array-buffer-byte-length/-/array-buffer-byte-length-1.0.2.tgz", @@ -17710,27 +17738,6 @@ "lightningcss-win32-x64-msvc": "1.27.0" } }, - "node_modules/lightningcss-darwin-arm64": { - "version": "1.27.0", - "resolved": "https://registry.npmjs.org/lightningcss-darwin-arm64/-/lightningcss-darwin-arm64-1.27.0.tgz", - "integrity": "sha512-Gl/lqIXY+d+ySmMbgDf0pgaWSqrWYxVHoc88q+Vhf2YNzZ8DwoRzGt5NZDVqqIW5ScpSnmmjcgXP87Dn2ylSSQ==", - "cpu": [ - "arm64" - ], - "dev": true, - "license": "MPL-2.0", - "optional": true, - "os": [ - "darwin" - ], - "engines": { - "node": ">= 12.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/parcel" - } - }, "node_modules/lightningcss-darwin-x64": { "version": "1.27.0", "resolved": "https://registry.npmjs.org/lightningcss-darwin-x64/-/lightningcss-darwin-x64-1.27.0.tgz", @@ -17752,174 +17759,6 @@ "url": "https://opencollective.com/parcel" } }, - "node_modules/lightningcss-freebsd-x64": { - "version": "1.27.0", - "resolved": "https://registry.npmjs.org/lightningcss-freebsd-x64/-/lightningcss-freebsd-x64-1.27.0.tgz", - "integrity": "sha512-n1sEf85fePoU2aDN2PzYjoI8gbBqnmLGEhKq7q0DKLj0UTVmOTwDC7PtLcy/zFxzASTSBlVQYJUhwIStQMIpRA==", - "cpu": [ - "x64" - ], - "dev": true, - "license": "MPL-2.0", - "optional": true, - "os": [ - "freebsd" - ], - "engines": { - "node": ">= 12.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/parcel" - } - }, - "node_modules/lightningcss-linux-arm-gnueabihf": { - "version": "1.27.0", - "resolved": "https://registry.npmjs.org/lightningcss-linux-arm-gnueabihf/-/lightningcss-linux-arm-gnueabihf-1.27.0.tgz", - "integrity": "sha512-MUMRmtdRkOkd5z3h986HOuNBD1c2lq2BSQA1Jg88d9I7bmPGx08bwGcnB75dvr17CwxjxD6XPi3Qh8ArmKFqCA==", - "cpu": [ - "arm" - ], - "dev": true, - "license": "MPL-2.0", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">= 12.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/parcel" - } - }, - "node_modules/lightningcss-linux-arm64-gnu": { - "version": "1.27.0", - "resolved": "https://registry.npmjs.org/lightningcss-linux-arm64-gnu/-/lightningcss-linux-arm64-gnu-1.27.0.tgz", - "integrity": "sha512-cPsxo1QEWq2sfKkSq2Bq5feQDHdUEwgtA9KaB27J5AX22+l4l0ptgjMZZtYtUnteBofjee+0oW1wQ1guv04a7A==", - "cpu": [ - "arm64" - ], - "dev": true, - "license": "MPL-2.0", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">= 12.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/parcel" - } - }, - "node_modules/lightningcss-linux-arm64-musl": { - "version": "1.27.0", - "resolved": "https://registry.npmjs.org/lightningcss-linux-arm64-musl/-/lightningcss-linux-arm64-musl-1.27.0.tgz", - "integrity": "sha512-rCGBm2ax7kQ9pBSeITfCW9XSVF69VX+fm5DIpvDZQl4NnQoMQyRwhZQm9pd59m8leZ1IesRqWk2v/DntMo26lg==", - "cpu": [ - "arm64" - ], - "dev": true, - "license": "MPL-2.0", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">= 12.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/parcel" - } - }, - "node_modules/lightningcss-linux-x64-gnu": { - "version": "1.27.0", - "resolved": "https://registry.npmjs.org/lightningcss-linux-x64-gnu/-/lightningcss-linux-x64-gnu-1.27.0.tgz", - "integrity": "sha512-Dk/jovSI7qqhJDiUibvaikNKI2x6kWPN79AQiD/E/KeQWMjdGe9kw51RAgoWFDi0coP4jinaH14Nrt/J8z3U4A==", - "cpu": [ - "x64" - ], - "dev": true, - "license": "MPL-2.0", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">= 12.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/parcel" - } - }, - "node_modules/lightningcss-linux-x64-musl": { - "version": "1.27.0", - "resolved": "https://registry.npmjs.org/lightningcss-linux-x64-musl/-/lightningcss-linux-x64-musl-1.27.0.tgz", - "integrity": "sha512-QKjTxXm8A9s6v9Tg3Fk0gscCQA1t/HMoF7Woy1u68wCk5kS4fR+q3vXa1p3++REW784cRAtkYKrPy6JKibrEZA==", - "cpu": [ - "x64" - ], - "dev": true, - "license": "MPL-2.0", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">= 12.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/parcel" - } - }, - "node_modules/lightningcss-win32-arm64-msvc": { - "version": "1.27.0", - "resolved": "https://registry.npmjs.org/lightningcss-win32-arm64-msvc/-/lightningcss-win32-arm64-msvc-1.27.0.tgz", - "integrity": "sha512-/wXegPS1hnhkeG4OXQKEMQeJd48RDC3qdh+OA8pCuOPCyvnm/yEayrJdJVqzBsqpy1aJklRCVxscpFur80o6iQ==", - "cpu": [ - "arm64" - ], - "dev": true, - "license": "MPL-2.0", - "optional": true, - "os": [ - "win32" - ], - "engines": { - "node": ">= 12.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/parcel" - } - }, - "node_modules/lightningcss-win32-x64-msvc": { - "version": "1.27.0", - "resolved": "https://registry.npmjs.org/lightningcss-win32-x64-msvc/-/lightningcss-win32-x64-msvc-1.27.0.tgz", - "integrity": "sha512-/OJLj94Zm/waZShL8nB5jsNj3CfNATLCTyFxZyouilfTmSoLDX7VlVAmhPHoZWVFp4vdmoiEbPEYC8HID3m6yw==", - "cpu": [ - "x64" - ], - "dev": true, - "license": "MPL-2.0", - "optional": true, - "os": [ - "win32" - ], - "engines": { - "node": ">= 12.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/parcel" - } - }, "node_modules/lines-and-columns": { "version": "1.2.4", "resolved": "https://registry.npmjs.org/lines-and-columns/-/lines-and-columns-1.2.4.tgz", @@ -21509,9 +21348,9 @@ } }, "node_modules/react-native-builder-bob": { - "version": "0.37.0", - "resolved": "https://registry.npmjs.org/react-native-builder-bob/-/react-native-builder-bob-0.37.0.tgz", - "integrity": "sha512-CkM4csFrYtdGJoRLbPY6V8LBbOxgPZIuM0MkPaiOI2F/ASwxMAzoJu9wBw8Pyvx1p27XnrIEKPyDiTqimJ7xbA==", + "version": "0.40.6", + "resolved": "https://registry.npmjs.org/react-native-builder-bob/-/react-native-builder-bob-0.40.6.tgz", + "integrity": "sha512-SZM1CcDDSI4nMIxcABgwm/TLhzO3BemKsbvujgQM8friYoWJvpP/VpLBSpljHVXzcvtA1PMKRCj68zddZru+hQ==", "dev": true, "license": "MIT", "dependencies": { @@ -21521,9 +21360,9 @@ "@babel/preset-flow": "^7.24.7", "@babel/preset-react": "^7.24.7", "@babel/preset-typescript": "^7.24.7", + "arktype": "^2.1.15", "babel-plugin-module-resolver": "^5.0.2", "browserslist": "^4.20.4", - "cosmiconfig": "^9.0.0", "cross-spawn": "^7.0.3", "dedent": "^0.7.0", "del": "^6.1.1", @@ -21542,7 +21381,7 @@ "bob": "bin/bob" }, "engines": { - "node": ">= 20.0.0" + "node": "^20.19.0 || ^22.12.0 || >= 23.4.0" } }, "node_modules/react-native-builder-bob/node_modules/aggregate-error": { @@ -21586,6 +21425,22 @@ "node": ">=6" } }, + "node_modules/react-native-builder-bob/node_modules/cosmiconfig": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-5.2.1.tgz", + "integrity": "sha512-H65gsXo1SKjf8zmrJ67eJk8aIRKV5ff2D4uKZIBZShbhGSpEmsQOPW/SKMKYhSTrqR7ufy6RP69rPogdaPh/kA==", + "dev": true, + "license": "MIT", + "dependencies": { + "import-fresh": "^2.0.0", + "is-directory": "^0.3.1", + "js-yaml": "^3.13.1", + "parse-json": "^4.0.0" + }, + "engines": { + "node": ">=4" + } + }, "node_modules/react-native-builder-bob/node_modules/debug": { "version": "2.6.9", "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", @@ -21874,22 +21729,6 @@ "node": ">=18" } }, - "node_modules/react-native-builder-bob/node_modules/metro-config/node_modules/cosmiconfig": { - "version": "5.2.1", - "resolved": "https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-5.2.1.tgz", - "integrity": "sha512-H65gsXo1SKjf8zmrJ67eJk8aIRKV5ff2D4uKZIBZShbhGSpEmsQOPW/SKMKYhSTrqR7ufy6RP69rPogdaPh/kA==", - "dev": true, - "license": "MIT", - "dependencies": { - "import-fresh": "^2.0.0", - "is-directory": "^0.3.1", - "js-yaml": "^3.13.1", - "parse-json": "^4.0.0" - }, - "engines": { - "node": ">=4" - } - }, "node_modules/react-native-builder-bob/node_modules/metro-core": { "version": "0.80.12", "resolved": "https://registry.npmjs.org/metro-core/-/metro-core-0.80.12.tgz", diff --git a/package.json b/package.json index b808f126..15c4d130 100644 --- a/package.json +++ b/package.json @@ -3,26 +3,17 @@ "title": "React Native Auth0", "version": "4.4.0", "description": "React Native toolkit for Auth0 API", - "source": "./src/index.ts", - "main": "./lib/commonjs/index.js", - "module": "./lib/module/index.js", - "types": "./lib/typescript/commonjs/src/index.d.ts", - "react-native": "./src/index.ts", - "exports": { - ".": { - "import": { - "types": "./lib/typescript/module/src/index.d.ts", - "default": "./lib/module/index.js" - }, - "require": { - "types": "./lib/typescript/commonjs/src/index.d.ts", - "default": "./lib/commonjs/index.js" - } - } - }, + "main": "lib/commonjs/index.js", + "module": "lib/module/index.js", + "types": "lib/typescript/index.d.ts", + "react-native": "src/index.ts", + "source": "src/index.ts", "files": [ "src", "lib", + "!**/__tests__", + "!**/__fixtures__", + "!**/__mocks__", "android", "ios", "cpp", @@ -35,9 +26,6 @@ "!android/gradlew", "!android/gradlew.bat", "!android/local.properties", - "!**/__tests__", - "!**/__fixtures__", - "!**/__mocks__", "!**/.*" ], "scripts": { @@ -125,7 +113,7 @@ "prettier": "^3.0.3", "react": "18.3.1", "react-native": "0.77.1", - "react-native-builder-bob": "^0.37.0", + "react-native-builder-bob": "^0.40.6", "react-native-svg-transformer": "^1.5.0", "release-it": "^15.0.0", "semver": "^6.3.0", @@ -211,25 +199,9 @@ "source": "src", "output": "lib", "targets": [ - [ - "commonjs", - { - "esm": true - } - ], - [ - "module", - { - "esm": true - } - ], - [ - "typescript", - { - "project": "tsconfig.build.json", - "esm": true - } - ] + "commonjs", + "module", + "typescript" ] }, "husky": { diff --git a/src/credentials-manager/credentialsManagerError.ts b/src/credentials-manager/credentialsManagerError.ts index e4f54f4d..fced75ef 100644 --- a/src/credentials-manager/credentialsManagerError.ts +++ b/src/credentials-manager/credentialsManagerError.ts @@ -3,12 +3,12 @@ import type { Auth0Response } from '../networking'; import BaseError from '../utils/baseError'; export default class CredentialsManagerError< - CredentialsManagerErrorDetails + CredentialsManagerErrorDetails, > extends BaseError { public json; public status; public invalid_parameter; - public type; + public override type; constructor(response: Auth0Response) { const { status, json, text } = response; diff --git a/tsconfig.json b/tsconfig.json index 5291e19d..968b88da 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,30 +1,28 @@ { "compilerOptions": { - "rootDir": ".", - "paths": { - "react-native-auth0": ["./src/index"] - }, + "module": "ESNext", + "target": "ES2017", + "lib": ["DOM", "ES2017"], + "jsx": "react-native", + "moduleResolution": "Node", + + "allowJs": false, + "strict": true, + "declaration": true, + "sourceMap": true, + "stripInternal": true, + "skipLibCheck": true, + "allowUnreachableCode": false, "allowUnusedLabels": false, - "esModuleInterop": true, - "forceConsistentCasingInFileNames": true, - "jsx": "react-jsx", - "lib": ["ESNext"], - "module": "ESNext", - "moduleResolution": "Bundler", - "noEmit": true, + "allowSyntheticDefaultImports": true, "noFallthroughCasesInSwitch": true, - "noImplicitReturns": true, - "noImplicitUseStrict": false, - "noStrictGenericChecks": false, + "noImplicitOverride": true, + "noImplicitReturns": false, "noUncheckedIndexedAccess": true, "noUnusedLocals": true, - "noUnusedParameters": true, - "resolveJsonModule": true, - "resolvePackageJsonImports": false, - "skipLibCheck": true, - "strict": true, - "target": "ESNext", - "verbatimModuleSyntax": true - } + "noUnusedParameters": true + }, + "include": ["src"], + "exclude": ["example", "node_modules"] }