-
Notifications
You must be signed in to change notification settings - Fork 0
feat(service-meta): Schema-first service system with MockDevTools #22
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
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## Core Features
- defineServiceMeta for Schema-first service definitions
- Type-safe .impl() for platform implementations (web/dweb/mock)
- Middleware pattern for cross-cutting concerns
## MockDevTools Enhancements
- Unified spring position algorithm for button/panel
- Breakpoint system with pause/resume/inject capabilities
- Console panel with expression execution (, $_, $p{id})
- Settings system (global delay, error simulation)
- IndexedDB persistence for breakpoints
## Services Migrated
- clipboard, biometric, storage, toast, camera
- haptics, currency-exchange, staking, transaction, authorize
## Documentation
- Updated whitebook with settings and breakpoint system docs
- Added unit tests for settings functionality
Whitebook: - Add chain config management service documentation (07-链配置管理) - Document subscription source management, multi-source priority - Update 服务篇 index with new chapters Config: - Add Ethereum, BSC, Tron, Bitcoin to default-chains.json - Add rpcUrl and explorerUrl for BFMeta and external chains Test: - Update schema.test.ts to expect 12 chains (8 bioforest + 4 external) - Add chain type verification tests
…lementation Whitebook: - Add chain service implementation spec (实现规范) - Document BioForest/EVM/Tron/Bitcoin specific requirements - Update 链服务 index with implementation spec link Code: - Create chain-adapter service with unified interface - Implement IChainAdapter, IAdapterRegistry interfaces - Add BioforestAdapter with Identity/Asset/Transaction/Chain services - Add ChainServiceError with typed error codes Test: - Add bioforest-adapter.test.ts with 12 test cases - Test adapter creation, services, lifecycle, registry
- Add whitebook documentation for wallet storage architecture - Implement WalletStorageService with IndexedDB (idb package) - Support encrypted mnemonic/private key storage (AES-GCM) - Add stores: walleter, wallets, chainAddresses, addressBook - Support localStorage migration for backward compatibility - Add 41 unit tests covering all service methods
- Update BioforestTransactionService to use real Ed25519 signing - Export bytesToHex and hexToBytes from crypto module - Add 6 new tests for transaction service (fee, build, sign, verify) - Signature verification passes with reconstructed message
BREAKING CHANGE: walletActions.createWallet/importWallet now require mnemonic and password arguments for secure encryption. - Migrate wallet store to use WalletStorageService (IndexedDB) - Update wallet creation pages to use new API signature - Update password change to use new encryption flow - Update migration service to directly save to IndexedDB - Remove direct localStorage usage for wallet persistence
- Add _testAddWallet and _testReset helpers for test isolation - Update authorize tests to use test helpers instead of createWallet - Update migration tests to check walletStorageService calls - Update change-password tests for new updateWalletEncryptedMnemonic API
- Create indexeddb-helper utility for e2e tests - Update wallet-import, wallet-create, bioforest-chains tests - Remaining e2e tests need similar updates
- Update chain-config-subscription tests - Update wallet-recover-arbitrary tests - Update migration tests - All e2e tests now read from IndexedDB instead of localStorage
The clipboard test expects window.__CLIPBOARD__ to be set, but clipboardService uses native navigator.clipboard API. This is a pre-existing issue that also fails on main branch.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
This PR introduces a Schema-first service definition system with enhanced MockDevTools for debugging.
Core Features
Service Meta System (
src/lib/service-meta/)defineServiceMetafor Schema-first service definitions with Zod.impl()for platform implementations (web/dweb/mock)MockDevTools Enhancements
Console Commands
/help/clear/vars/copy <expr>Services Migrated (10 total)
Documentation
Testing