-
Notifications
You must be signed in to change notification settings - Fork 22
fix: example #610
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
base: onekey
Are you sure you want to change the base?
fix: example #610
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,33 @@ | ||||||||||||||||||||||||||||||||||||||||||||||
| // Axios wrapper to fix module.exports.default for rollup compatibility | ||||||||||||||||||||||||||||||||||||||||||||||
| // eslint-disable-next-line @typescript-eslint/no-var-requires | ||||||||||||||||||||||||||||||||||||||||||||||
| const axios = require('axios'); | ||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||
| // Create a proper wrapper that satisfies rollup's _interopDefaultLegacy expectations | ||||||||||||||||||||||||||||||||||||||||||||||
| // The compiled code uses: axios__default["default"].interceptors.request.use() | ||||||||||||||||||||||||||||||||||||||||||||||
| // So we need to ensure that when webpack resolves this, it has the right structure | ||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||
| // Ensure axios has a .default property pointing to itself | ||||||||||||||||||||||||||||||||||||||||||||||
| if (!axios.default) { | ||||||||||||||||||||||||||||||||||||||||||||||
| axios.default = axios; | ||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||
| // Also ensure interceptors exist | ||||||||||||||||||||||||||||||||||||||||||||||
| if (!axios.interceptors) { | ||||||||||||||||||||||||||||||||||||||||||||||
| // This shouldn't happen, but just in case, create a mock | ||||||||||||||||||||||||||||||||||||||||||||||
| axios.interceptors = { | ||||||||||||||||||||||||||||||||||||||||||||||
| request: { | ||||||||||||||||||||||||||||||||||||||||||||||
| use: fn => { | ||||||||||||||||||||||||||||||||||||||||||||||
| console.warn('axios.interceptors.request.use mock called'); | ||||||||||||||||||||||||||||||||||||||||||||||
| return 0; | ||||||||||||||||||||||||||||||||||||||||||||||
| }, | ||||||||||||||||||||||||||||||||||||||||||||||
| }, | ||||||||||||||||||||||||||||||||||||||||||||||
| response: { | ||||||||||||||||||||||||||||||||||||||||||||||
| use: fn => { | ||||||||||||||||||||||||||||||||||||||||||||||
| console.warn('axios.interceptors.response.use mock called'); | ||||||||||||||||||||||||||||||||||||||||||||||
| return 0; | ||||||||||||||||||||||||||||||||||||||||||||||
| }, | ||||||||||||||||||||||||||||||||||||||||||||||
| }, | ||||||||||||||||||||||||||||||||||||||||||||||
| }; | ||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+14
to
+31
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Mock interceptors hide real problems instead of failing fast. If Replace the mock with an error: -// Also ensure interceptors exist
-if (!axios.interceptors) {
- // This shouldn't happen, but just in case, create a mock
- axios.interceptors = {
- request: {
- use: fn => {
- console.warn('axios.interceptors.request.use mock called');
- return 0;
- },
- },
- response: {
- use: fn => {
- console.warn('axios.interceptors.response.use mock called');
- return 0;
- },
- },
- };
-}
+// Verify interceptors exist (they should always be present in real axios)
+if (!axios.interceptors) {
+ throw new Error('axios.interceptors is missing - axios module may be corrupted');
+}📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||
| module.exports = axios; | ||||||||||||||||||||||||||||||||||||||||||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,3 @@ | ||
| // eslint-disable-next-line import/no-relative-packages | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Remove orphaned eslint-disable comment. No relative imports exist in this file. The comment serves no purpose. -// eslint-disable-next-line import/no-relative-packages
-
export const CONNECT_SRC = process.env.CONNECT_SRC || `https://jssdk.onekey.so/1.1.17/`;🤖 Prompt for AI Agents |
||
| import { getConnectSrc } from '@onekey-internal/shared-constants'; | ||
|
|
||
| export const CONNECT_SRC = getConnectSrc(); | ||
| export const CONNECT_SRC = process.env.CONNECT_SRC || `https://jssdk.onekey.so/1.1.17/`; | ||
This file was deleted.
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -6041,6 +6041,17 @@ | |
| dependencies: | ||
| "@rollup/pluginutils" "^3.0.8" | ||
|
|
||
| "@rollup/plugin-node-resolve@^16.0.3": | ||
| version "16.0.3" | ||
| resolved "https://registry.yarnpkg.com/@rollup/plugin-node-resolve/-/plugin-node-resolve-16.0.3.tgz#0988e6f2cbb13316b0f5e7213f757bc9ed44928f" | ||
| integrity sha512-lUYM3UBGuM93CnMPG1YocWu7X802BrNF3jW2zny5gQyLQgRFJhV1Sq0Zi74+dh/6NBx1DxFC4b4GXg9wUCG5Qg== | ||
| dependencies: | ||
| "@rollup/pluginutils" "^5.0.1" | ||
| "@types/resolve" "1.20.2" | ||
| deepmerge "^4.2.2" | ||
| is-module "^1.0.0" | ||
| resolve "^1.22.1" | ||
|
|
||
| "@rollup/plugin-typescript@^8.3.2": | ||
| version "8.3.2" | ||
| resolved "https://registry.yarnpkg.com/@rollup/plugin-typescript/-/plugin-typescript-8.3.2.tgz#e1b719e2ed3e752bbc092001656c48378f2d15f0" | ||
|
|
@@ -6058,6 +6069,15 @@ | |
| estree-walker "^1.0.1" | ||
| picomatch "^2.2.2" | ||
|
|
||
| "@rollup/pluginutils@^5.0.1": | ||
| version "5.3.0" | ||
| resolved "https://registry.yarnpkg.com/@rollup/pluginutils/-/pluginutils-5.3.0.tgz#57ba1b0cbda8e7a3c597a4853c807b156e21a7b4" | ||
| integrity sha512-5EdhGZtnu3V88ces7s53hhfK5KSASnJZv8Lulpc04cWO3REESroJXg73DFsOmgbU2BhwV0E20bu2IDZb3VKW4Q== | ||
| dependencies: | ||
| "@types/estree" "^1.0.0" | ||
| estree-walker "^2.0.2" | ||
| picomatch "^4.0.2" | ||
|
|
||
| "@rtsao/scc@^1.1.0": | ||
| version "1.1.0" | ||
| resolved "https://registry.npmjs.org/@rtsao/scc/-/scc-1.1.0.tgz#927dd2fae9bc3361403ac2c7a00c32ddce9ad7e8" | ||
|
|
@@ -8283,6 +8303,11 @@ | |
| "@types/scheduler" "*" | ||
| csstype "^3.0.2" | ||
|
|
||
| "@types/[email protected]": | ||
| version "1.20.2" | ||
| resolved "https://registry.yarnpkg.com/@types/resolve/-/resolve-1.20.2.tgz#97d26e00cd4a0423b4af620abecf3e6f442b7975" | ||
| integrity sha512-60BCwRFOZCQhDncwQdxxeOEEkbc5dIMccYLwbxsS4TUNeVECQ/pBJ0j09mrHOl/JJvpRPGwO9SvE4nR2Nb/a4Q== | ||
|
|
||
| "@types/responselike@^1.0.0": | ||
| version "1.0.3" | ||
| resolved "https://registry.yarnpkg.com/@types/responselike/-/responselike-1.0.3.tgz#cc29706f0a397cfe6df89debfe4bf5cea159db50" | ||
|
|
@@ -11068,7 +11093,7 @@ ci-info@^3.7.0: | |
|
|
||
| [email protected], cipher-base@^1.0.0, cipher-base@^1.0.1, cipher-base@^1.0.3: | ||
| version "1.0.5" | ||
| resolved "https://registry.npmjs.org/cipher-base/-/cipher-base-1.0.5.tgz#749f80731c7821e9a5fabd51f6998b696f296686" | ||
| resolved "https://registry.yarnpkg.com/cipher-base/-/cipher-base-1.0.5.tgz#749f80731c7821e9a5fabd51f6998b696f296686" | ||
| integrity sha512-xq7ICKB4TMHUx7Tz1L9O2SGKOhYMOTR32oir45Bq28/AQTpHogKgHcoYFSdRbMtddl+ozNXfXY9jWcgYKmde0w== | ||
| dependencies: | ||
| inherits "^2.0.4" | ||
|
|
@@ -13827,7 +13852,7 @@ estree-walker@^1.0.1: | |
| resolved "https://registry.yarnpkg.com/estree-walker/-/estree-walker-1.0.1.tgz#31bc5d612c96b704106b477e6dd5d8aa138cb700" | ||
| integrity sha512-1fMXF3YP4pZZVozF8j/ZLfvnR8NSIljt56UhbZ5PeeDmmGHpgpdwQt7ITlGvYaQukCvuBRMLEiKiYC+oeIg4cg== | ||
|
|
||
| estree-walker@^2.0.1: | ||
| estree-walker@^2.0.1, estree-walker@^2.0.2: | ||
| version "2.0.2" | ||
| resolved "https://registry.yarnpkg.com/estree-walker/-/estree-walker-2.0.2.tgz#52f010178c2a4c117a7757cfe942adb7d2da4cac" | ||
| integrity sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w== | ||
|
|
@@ -14138,9 +14163,9 @@ expo@^50.0.20: | |
| whatwg-url-without-unicode "8.0.0-3" | ||
|
|
||
| exponential-backoff@^3.1.1: | ||
| version "3.1.2" | ||
| resolved "https://registry.yarnpkg.com/exponential-backoff/-/exponential-backoff-3.1.2.tgz#a8f26adb96bf78e8cd8ad1037928d5e5c0679d91" | ||
| integrity sha512-8QxYTVXUkuy7fIIoitQkPwGonB8F3Zj8eEO8Sqg9Zv/bkI7RJAzowee4gr81Hak/dUTpA2Z7VfQgoijjPNlUZA== | ||
| version "3.1.3" | ||
| resolved "https://registry.yarnpkg.com/exponential-backoff/-/exponential-backoff-3.1.3.tgz#51cf92c1c0493c766053f9d3abee4434c244d2f6" | ||
| integrity sha512-ZgEeZXj30q+I0EN+CbSSpIyPaJ5HVQD18Z1m+u1FXbAeT94mr1zw50q4q6jiiC447Nl/YTcIYSAftiGqetwXCA== | ||
|
|
||
| express@^4.17.3: | ||
| version "4.18.2" | ||
|
|
@@ -15742,7 +15767,7 @@ http2-wrapper@^1.0.0-beta.5.2: | |
|
|
||
| https-browserify@^1.0.0: | ||
| version "1.0.0" | ||
| resolved "https://registry.npmjs.org/https-browserify/-/https-browserify-1.0.0.tgz#ec06c10e0a34c0f2faf199f7fd7fc78fffd03c73" | ||
| resolved "https://registry.yarnpkg.com/https-browserify/-/https-browserify-1.0.0.tgz#ec06c10e0a34c0f2faf199f7fd7fc78fffd03c73" | ||
| integrity sha512-J+FkSdyD+0mA0N+81tMotaRMfSL9SGi+xpD3T6YApKsc3bGSXJlfXri3VyFOeYkfLRQisDk1W+jIFFKBeUBbBg== | ||
|
|
||
| https-proxy-agent@^5.0.0, https-proxy-agent@^5.0.1: | ||
|
|
@@ -16047,9 +16072,9 @@ invariant@^2.2.4: | |
| loose-envify "^1.0.0" | ||
|
|
||
| ip-address@^10.0.1: | ||
| version "10.0.1" | ||
| resolved "https://registry.yarnpkg.com/ip-address/-/ip-address-10.0.1.tgz#a8180b783ce7788777d796286d61bce4276818ed" | ||
| integrity sha512-NWv9YLW4PoW2B7xtzaS3NCot75m6nK7Icdv0o3lfMceJVRfSoQwqD4wEH5rLwoKJwUiZ/rfpiVBhnaF0FK4HoA== | ||
| version "10.1.0" | ||
| resolved "https://registry.yarnpkg.com/ip-address/-/ip-address-10.1.0.tgz#d8dcffb34d0e02eb241427444a6e23f5b0595aa4" | ||
| integrity sha512-XXADHxXmvT9+CRxhXg56LJovE+bmWnEWB78LB83VZTprKTmaC5QfruXocxzTZ2Kl0DNwKuBdlIhjL8LeY8Sf8Q== | ||
|
|
||
| ip-regex@^2.1.0: | ||
| version "2.1.0" | ||
|
|
@@ -16374,6 +16399,11 @@ is-map@^2.0.3: | |
| resolved "https://registry.npmjs.org/is-map/-/is-map-2.0.3.tgz#ede96b7fe1e270b3c4465e3a465658764926d62e" | ||
| integrity sha512-1Qed0/Hr2m+YqxnM09CjA2d/i6YZNfF6R2oRAOj36eUdS6qIV/huPJNSEpKbupewFs+ZsJlxsjjPbc0/afW6Lw== | ||
|
|
||
| is-module@^1.0.0: | ||
| version "1.0.0" | ||
| resolved "https://registry.yarnpkg.com/is-module/-/is-module-1.0.0.tgz#3258fb69f78c14d5b815d664336b4cffb6441591" | ||
| integrity sha512-51ypPSPCoTEIN9dy5Oy+h4pShgJmPCygKfyRCISBI+JoWT/2oJvK8QPxmwv7b/p239jXrm9M1mlQbyKJ5A152g== | ||
|
|
||
| is-nan@^1.2.1: | ||
| version "1.3.2" | ||
| resolved "https://registry.yarnpkg.com/is-nan/-/is-nan-1.3.2.tgz#043a54adea31748b55b6cd4e09aadafa69bd9e1d" | ||
|
|
@@ -22495,6 +22525,15 @@ resolve@^1.1.7, resolve@^1.22.10, resolve@^1.22.8: | |
| path-parse "^1.0.7" | ||
| supports-preserve-symlinks-flag "^1.0.0" | ||
|
|
||
| resolve@^1.22.1: | ||
| version "1.22.11" | ||
| resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.22.11.tgz#aad857ce1ffb8bfa9b0b1ac29f1156383f68c262" | ||
| integrity sha512-RfqAvLnMl313r7c9oclB1HhUEAezcpLjz95wFH4LVuhk9JF/r22qmVP9AMmOU4vMX7Q8pN8jwNg/CSpdFnMjTQ== | ||
| dependencies: | ||
| is-core-module "^2.16.1" | ||
| path-parse "^1.0.7" | ||
| supports-preserve-symlinks-flag "^1.0.0" | ||
|
|
||
| resolve@^2.0.0-next.4, resolve@^2.0.0-next.5: | ||
| version "2.0.0-next.5" | ||
| resolved "https://registry.yarnpkg.com/resolve/-/resolve-2.0.0-next.5.tgz#6b0ec3107e671e52b68cd068ef327173b90dc03c" | ||
|
|
@@ -23633,7 +23672,7 @@ [email protected]: | |
|
|
||
| stream-http@^3.2.0: | ||
| version "3.2.0" | ||
| resolved "https://registry.npmjs.org/stream-http/-/stream-http-3.2.0.tgz#1872dfcf24cb15752677e40e5c3f9cc1926028b5" | ||
| resolved "https://registry.yarnpkg.com/stream-http/-/stream-http-3.2.0.tgz#1872dfcf24cb15752677e40e5c3f9cc1926028b5" | ||
| integrity sha512-Oq1bLqisTyK3TSCXpPbT4sdeYNdmyZJv1LxpEm2vu1ZhK89kSE5YXwZc3cWk0MagGaKriBh9mCFbVGtO+vY29A== | ||
| dependencies: | ||
| builtin-status-codes "^3.0.0" | ||
|
|
||
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.
🧩 Analysis chain
Verify @rollup/plugin-node-resolve is needed at root level.
Check if this plugin is used by packages other than expo-example. If only expo-example needs it, move it there.
🏁 Script executed:
Length of output: 624
🏁 Script executed:
Length of output: 514
🏁 Script executed:
Length of output: 396
🏁 Script executed:
Length of output: 609
🏁 Script executed:
Length of output: 717
🏁 Script executed:
Length of output: 620
Remove @rollup/plugin-node-resolve from root devDependencies—it's unused.
The plugin doesn't appear in
./build/rollup.config.jsor anywhere else in the codebase. The rollup config only uses typescript, json, dts, and commonjs plugins. Also, expo-example doesn't exist as a package, so the original assumption was incorrect. This is dead code that should be removed.🤖 Prompt for AI Agents