Skip to content
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

refactor: remove ckb-sdk-core and replace with lumos #2843

Merged
merged 16 commits into from
Oct 20, 2023

Conversation

zhangyouxin
Copy link
Contributor

Description

remove ckb-sdk-core

Resolve: Magickbase/neuron-public-issues#202

@silySuper
Copy link
Collaborator

silySuper commented Sep 19, 2023

/package.
Packaging for test is done in 6232725050. @silySuper

@silySuper
Copy link
Collaborator

This package https://github.com/nervosnetwork/neuron/actions/runs/6232725050 pop up an error when I click the app icon.
截屏2023-09-19 17 12 19

Uncaught Exception:
Error: Cannot find module '@nervosnetwork/ckb-sdk-rpc'
Require stack:

  • /private/var/folders/0g/2f1xzp_x46d7kr74mybk85jc0000gn/T/AppTranslocation/3D6339A8-5D53-4ECB-88B7-2D65BBC6DDEE/d/Neuron.app/Contents/Resources/app.asar/dist/utils/ckb-rpc.js
  • /private/var/folders/0g/2f1xzp_x46d7kr74mybk85jc0000gn/T/AppTranslocation/3D6339A8-5D53-4ECB-88B7-2D65BBC6DDEE/d/Neuron.app/Contents/Resources/app.asar/dist/services/networks.js
  • /private/var/folders/0g/2f1xzp_x46d7kr74mybk85jc0000gn/T/AppTranslocation/3D6339A8-5D53-4ECB-88B7-2D65BBC6DDEE/d/Neuron.app/Contents/Resources/app.asar/dist/controllers/export-debug.js
  • /private/var/folders/0g/2f1xzp_x46d7kr74mybk85jc0000gn/T/AppTranslocation/3D6339A8-5D53-4ECB-88B7-2D65BBC6DDEE/d/Neuron.app/Contents/Resources/app.asar/dist/controllers/app/menu.js
  • /private/var/folders/0g/2f1xzp_x46d7kr74mybk85jc0000gn/T/AppTranslocation/3D6339A8-5D53-4ECB-88B7-2D65BBC6DDEE/d/Neuron.app/Contents/Resources/app.asar/dist/controllers/app/index.js
  • /private/var/folders/0g/2f1xzp_x46d7kr74mybk85jc0000gn/T/AppTranslocation/3D6339A8-5D53-4ECB-88B7-2D65BBC6DDEE/d/Neuron.app/Contents/Resources/app.asar/dist/main.js

at Module._resolveFilename (node:internal/modules/cjs/loader:1054:15)
at n._resolveFilename (node:electron/js2c/browser_init:2:109960)
at Module._load (node:internal/modules/cjs/loader:900:27)
at f._load (node:electron/js2c/asar_bundle:2:13330)
at Module.require (node:internal/modules/cjs/loader:1120:19)
at require (node:internal/modules/cjs/helpers:103:18)
at Object. (/private/var/folders/0g/2f1xzp_x46d7kr74mybk85jc0000gn/T/AppTranslocation/3D6339A8-5D53-4ECB-88B7-2D65BBC6DDEE/d/Neuron.app/Contents/Resources/app.asar/dist/utils/ckb-rpc.js:13:39)
at Module._compile (node:internal/modules/cjs/loader:1241:14)
at Module._extensions..js (node:internal/modules/cjs/loader:1296:10)
at Module.load (node:internal/modules/cjs/loader:1096:32)

@zhangyouxin
Copy link
Contributor Author

This package https://github.com/nervosnetwork/neuron/actions/runs/6232725050 pop up an error when I click the app icon. 截屏2023-09-19 17 12 19

Uncaught Exception: Error: Cannot find module '@nervosnetwork/ckb-sdk-rpc' Require stack:

  • /private/var/folders/0g/2f1xzp_x46d7kr74mybk85jc0000gn/T/AppTranslocation/3D6339A8-5D53-4ECB-88B7-2D65BBC6DDEE/d/Neuron.app/Contents/Resources/app.asar/dist/utils/ckb-rpc.js
  • /private/var/folders/0g/2f1xzp_x46d7kr74mybk85jc0000gn/T/AppTranslocation/3D6339A8-5D53-4ECB-88B7-2D65BBC6DDEE/d/Neuron.app/Contents/Resources/app.asar/dist/services/networks.js
  • /private/var/folders/0g/2f1xzp_x46d7kr74mybk85jc0000gn/T/AppTranslocation/3D6339A8-5D53-4ECB-88B7-2D65BBC6DDEE/d/Neuron.app/Contents/Resources/app.asar/dist/controllers/export-debug.js
  • /private/var/folders/0g/2f1xzp_x46d7kr74mybk85jc0000gn/T/AppTranslocation/3D6339A8-5D53-4ECB-88B7-2D65BBC6DDEE/d/Neuron.app/Contents/Resources/app.asar/dist/controllers/app/menu.js
  • /private/var/folders/0g/2f1xzp_x46d7kr74mybk85jc0000gn/T/AppTranslocation/3D6339A8-5D53-4ECB-88B7-2D65BBC6DDEE/d/Neuron.app/Contents/Resources/app.asar/dist/controllers/app/index.js
  • /private/var/folders/0g/2f1xzp_x46d7kr74mybk85jc0000gn/T/AppTranslocation/3D6339A8-5D53-4ECB-88B7-2D65BBC6DDEE/d/Neuron.app/Contents/Resources/app.asar/dist/main.js

at Module._resolveFilename (node:internal/modules/cjs/loader:1054:15) at n._resolveFilename (node:electron/js2c/browser_init:2:109960) at Module._load (node:internal/modules/cjs/loader:900:27) at f._load (node:electron/js2c/asar_bundle:2:13330) at Module.require (node:internal/modules/cjs/loader:1120:19) at require (node:internal/modules/cjs/helpers:103:18) at Object. (/private/var/folders/0g/2f1xzp_x46d7kr74mybk85jc0000gn/T/AppTranslocation/3D6339A8-5D53-4ECB-88B7-2D65BBC6DDEE/d/Neuron.app/Contents/Resources/app.asar/dist/utils/ckb-rpc.js:13:39) at Module._compile (node:internal/modules/cjs/loader:1241:14) at Module._extensions..js (node:internal/modules/cjs/loader:1296:10) at Module.load (node:internal/modules/cjs/loader:1096:32)

looks like there was a phatom dep, I'll fix this later

_typos.toml Show resolved Hide resolved
packages/neuron-wallet/src/types/ckbComponents.d.ts Outdated Show resolved Hide resolved
@zhangyouxin zhangyouxin requested a review from homura September 21, 2023 00:05
@zhangyouxin
Copy link
Contributor Author

zhangyouxin commented Sep 22, 2023

/package

Packaging for test is done in 6269758509. @zhangyouxin

@silySuper
Copy link
Collaborator

Another bug pop up in package 6269758509.
截屏2023-09-22 15 02 06

Uncaught Exception:
Error: Cannot find module 'jsbi'
Require stack:

  • /private/var/folders/0g/2f1xzp_x46d7kr74mybk85jc0000gn/T/AppTranslocation/FE6BD158-2555-49B5-B920-D2086C3CD470/d/Neuron 2.app/Contents/Resources/app.asar/node_modules/@ckb-lumos/toolkit/lib/normalizers.js
  • /private/var/folders/0g/2f1xzp_x46d7kr74mybk85jc0000gn/T/AppTranslocation/FE6BD158-2555-49B5-B920-D2086C3CD470/d/Neuron 2.app/Contents/Resources/app.asar/node_modules/@ckb-lumos/toolkit/lib/index.js
  • /private/var/folders/0g/2f1xzp_x46d7kr74mybk85jc0000gn/T/AppTranslocation/FE6BD158-2555-49B5-B920-D2086C3CD470/d/Neuron 2.app/Contents/Resources/app.asar/node_modules/@ckb-lumos/base/lib/indexer.js
  • /private/var/folders/0g/2f1xzp_x46d7kr74mybk85jc0000gn/T/AppTranslocation/FE6BD158-2555-49B5-B920-D2086C3CD470/d/Neuron 2.app/Contents/Resources/app.asar/node_modules/@ckb-lumos/base/lib/index.js
  • /private/var/folders/0g/2f1xzp_x46d7kr74mybk85jc0000gn/T/AppTranslocation/FE6BD158-2555-49B5-B920-D2086C3CD470/d/Neuron 2.app/Contents/Resources/app.asar/node_modules/@ckb-lumos/config-manager/lib/manager.js
  • /private/var/folders/0g/2f1xzp_x46d7kr74mybk85jc0000gn/T/AppTranslocation/FE6BD158-2555-49B5-B920-D2086C3CD470/d/Neuron 2.app/Contents/Resources/app.asar/node_modules/@ckb-lumos/config-manager/lib/index.js
  • /private/var/folders/0g/2f1xzp_x46d7kr74mybk85jc0000gn/T/AppTranslocation/FE6BD158-2555-49B5-B920-D2086C3CD470/d/Neuron 2.app/Contents/Resources/app.asar/dist/utils/scriptAndAddress.js
  • /private/var/folders/0g/2f1xzp_x46d7kr74mybk85jc0000gn/T/AppTranslocation/FE6BD158-2555-49B5-B920-D2086C3CD470/d/Neuron 2.app/Contents/Resources/app.asar/dist/models/keys/address.js
  • /private/var/folders/0g/2f1xzp_x46d7kr74mybk85jc0000gn/T/AppTranslocation/FE6BD158-2555-49B5-B920-D2086C3CD470/d/Neuron 2.app/Contents/Resources/app.asar/dist/models/keys/key.js
  • /private/var/folders/0g/2f1xzp_x46d7kr74mybk85jc0000gn/T/AppTranslocation/FE6BD158-2555-49B5-B920-D2086C3CD470/d/Neuron 2.app/Contents/Resources/app.asar/dist/services/addresses.js
  • /private/var/folders/0g/2f1xzp_x46d7kr74mybk85jc0000gn/T/AppTranslocation/FE6BD158-2555-49B5-B920-D2086C3CD470/d/Neuron 2.app/Contents/Resources/app.asar/dist/controllers/export-debug.js
  • /private/var/folders/0g/2f1xzp_x46d7kr74mybk85jc0000gn/T/AppTranslocation/FE6BD158-2555-49B5-B920-D2086C3CD470/d/Neuron 2.app/Contents/Resources/app.asar/dist/controllers/app/menu.js
  • /private/var/folders/0g/2f1xzp_x46d7kr74mybk85jc0000gn/T/AppTranslocation/FE6BD158-2555-49B5-B920-D2086C3CD470/d/Neuron 2.app/Contents/Resources/app.asar/dist/controllers/app/index.js
  • /private/var/folders/0g/2f1xzp_x46d7kr74mybk85jc0000gn/T/AppTranslocation/FE6BD158-2555-49B5-B920-D2086C3CD470/d/Neuron 2.app/Contents/Resources/app.asar/dist/main.js

at Module._resolveFilename (node:internal/modules/cjs/loader:1054:15)
at n._resolveFilename (node:electron/js2c/browser_init:2:109960)
at Module._load (node:internal/modules/cjs/loader:900:27)
at f._load (node:electron/js2c/asar_bundle:2:13330)
at Module.require (node:internal/modules/cjs/loader:1120:19)
at require (node:internal/modules/cjs/helpers:103:18)
at Object. (/private/var/folders/0g/2f1xzp_x46d7kr74mybk85jc0000gn/T/AppTranslocation/FE6BD158-2555-49B5-B920-D2086C3CD470/d/Neuron 2.app/Contents/Resources/app.asar/node_modules/@ckb-lumos/toolkit/lib/normalizers.js:20:36)
at Module._compile (node:internal/modules/cjs/loader:1241:14)
at Module._extensions..js (node:internal/modules/cjs/loader:1296:10)
at Module.load (node:internal/modules/cjs/loader:1096:32)

@zhangyouxin
Copy link
Contributor Author

weird, peerDependency of @ckb-lumos/toolkit: jsbi@^4.1 is not installed in neuron

@Keith-CY
Copy link
Collaborator

Keith-CY commented Sep 22, 2023

weird, peerDependency of @ckb-lumos/toolkit: jsbi@^4.1 is not installed in neuron

peerDependency is not installed automatically when npm is of some old versions.

Ref: https://nodejs.org/en/blog/npm/peer-dependencies


Update:

I found that Neuron is using yarn, which doesn't install peerDependency automatically too

Ref: https://yarnpkg.com/cli/add

@zhangyouxin
Copy link
Contributor Author

zhangyouxin commented Sep 22, 2023

/package

Packaging for test is done in 6274719391. @zhangyouxin

@zhangyouxin
Copy link
Contributor Author

/package

Packaging for test is done in 6274719391. @zhangyouxin

The jsbi problem still exists, I find the peerDep is not a necessary in @ckb-lumos/toolkit, I would like to remove the peerDep in @ckb-lumos/toolkit and then the problem will be gone for all projects using @ckb-lumos/toolkit.

@homura
Copy link
Collaborator

homura commented Oct 13, 2023

The jsbi problem still exists, I find the peerDep is not a necessary in @ckb-lumos/toolkit, I would like to remove the peerDep in @ckb-lumos/toolkit and then the problem will be gone for all projects using @ckb-lumos/toolkit.

The next release has been released as 0.21.0-next.1, and it should solve the problem

@zhangyouxin
Copy link
Contributor Author

zhangyouxin commented Oct 13, 2023

/package
Packageing failed in 6505870188. @zhangyouxin
Packaging for test is done in 6505870188. @zhangyouxin

@silySuper
Copy link
Collaborator

silySuper commented Oct 16, 2023

/package
Packaging for test is done in 6527846838. @silySuper

@silySuper
Copy link
Collaborator

Verified.

@Keith-CY Keith-CY merged commit f3cc18a into nervosnetwork:develop Oct 20, 2023
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Refactor ckb-sdk-core by lumos
6 participants