im即时通讯源码/uniapp即时通讯im源码附视频安装教程
即時通訊im源碼使用ThinkPHP7和Swoole構建的簡單、美觀、移動優先的即時消息漸進式 Web 應用程序。
倉庫源碼:im.jstxym.top
本文目錄:
●點擊展開
●安裝
●依賴項
●源代碼構建
●用法
●發布
? ? ? ?安裝
默認情況下,安裝將嘗試使用 npm 包中捆綁的預構建。如果失敗,它會退回到 deltachat-core-rust使用scripts/rebuild-core.js. 要從 npm 安裝,請使用:
依賴項
●節點 >=v16.0.0
●rustup(如果您不能使用預構建,則可選)
在 Windows 上,您可能還需要安裝Perl才能編譯 deltachat-c??ore。
源代碼構建
如果要從源代碼構建,請確保已rustup安裝。您可以使用npm install deltachat-node --build-from-source強制從源代碼構建或克隆此存儲庫并按照以下步驟操作:
1、git clone /deltachat/deltachat-node.git
2、cd deltachat-node
3、npm i
在 Apple 的 M1 上為 x86_64 構建的解決方法
deltachat 還不支持通用(胖)二進制文件(包含兩種 cpu 架構的構建),在它支持之前,您可以使用以下解決方法來獲取 x86_64 構建:
(當使用fnm而不是 nvm 時,您可以選擇架構)如果您的節點和電子已經為 arm64 構建,您也可以嘗試為 arm 構建:
$ fnm install 16 --arch arm64 $ fnm use 16 $ node -p process.arch # result should be arm64 $ npm_config_arch=arm64 npm run build $ npm run test用法
const { Context } = require('deltachat-node')const opts = {addr: '[email]',mail_pw: '[password]', }const contact = '[email]'async function main() {const dc = Context.open('./')dc.on('ALL', console.log.bind(null, 'core |'))try {await dc.configure(opts)} catch (err) {console.error('Failed to configure because of: ', err)dc.unref()return}dc.startIO()console.log('fully configured')const contactId = dc.createContact('Test', contact)const chatId = dc.createChatByContactId(contactId)dc.sendMessage(chatId, 'Hi!')console.log('sent message')dc.once('DC_EVENT_SMTP_MESSAGE_SENT', async () => {console.log('Message sent, shutting down...')dc.stopIO()console.log('stopped io')dc.unref()}) }main() 此示例也可以在示例文件夾示例/send_message.js中找到
生成文檔
我們目前正在遷移到自動生成的文檔。您可以在old_docs找到舊文檔。
要生成文檔,請運行:
拓展
測試和覆蓋
運行npm test以顯示代碼覆蓋率報告結束,該報告由nyc.
測試輸出
控制臺中的覆蓋率報告nyc相當有限。要獲得更詳細的覆蓋率報告,您可以運行npm run coverage-html-report. 這將從nyc數據中生成一個 html 報告,并將其顯示在本地計算機上的瀏覽器中。
要運行集成測試,您需要設置DCC_NEW_TMP_EMAIL環境變量。例如:
腳本
我們有以下用于構建、測試和覆蓋的腳本:
●npm run coverage創建覆蓋率報告并將其傳遞給coveralls. 僅由 完成Travis。
●npm run coverage-html-report從覆蓋數據生成 html 報告并在本地計算機上的瀏覽器中打開它。
●npm run generate-constants生成constants.js并events.js基于deltachat-core-rust/deltachat-ffi/deltachat.h頭文件。
●npm install安裝依賴項后,運行node-gyp-build以查看是否需要重新構建本機代碼。
●npm run build重建所有代碼。
●npm run build:core在deltachat-core-rust.
●npm run build:bindings用 重建綁定和鏈接deltachat-core-rust。
●?pm run clean刪除所有構建的代碼
●npm run prebuildify將預構建的二進制文件構建為prebuilds/$PLATFORM-$ARCH. 復制deltachat.dll自deltachat-core-rustfor windows。
●npm run download-prebuilds之前從 github 下載所有預構建的二進制文件npm publish。
●npm run submodule更新deltachat-core-rust子模塊。
●npm test運行standard,然后在test/index.js.
●npm run test-integration運行集成測試。
●npm run hallmarkhallmark在所有降價文件上運行。
發布
1、發布版本需要以下步驟:
●更新CHANGELOG.md(并運行npm run hallmark以調整降價)
●在頂部添加發布更改日志
●還要調整指向 github 的鏈接準備文件末尾的鏈接
2、package.json 中的凹凸版本號
3、提交更改的文件,提交消息應該類似于Prepare for v1.0.0-foo.number
4、標記發布git tag -a v1.0.0-foo.number
5、推送到githubgit push origin master --tags
6、等到Make Packagegithub操作完成
7、deltachat-node.tgz從 github 版本下載并運行npm publish deltachat-node.tgz以將其發布到 npm。您可能需要對 npm 的寫入權限。
總結
以上是生活随笔為你收集整理的im即时通讯源码/uniapp即时通讯im源码附视频安装教程的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: apache缓存清理_深挖 Mybati
- 下一篇: java 图片上传 预览 demo_图片