欢迎光临
我们一直在努力

im即时通讯源码/uniapp即时通讯im源码附视频安装教程

即时通讯im源码使用ThinkPHP7和Swoole构建的简单、美观、移动优先的即时消息渐进式 Web 应用程序。
仓库源码:im.jstxym.top
本文目录:
●点击展开
●安装
●依赖项
●源代码构建
●用法
●发布

im即时通讯源码/uniapp即时通讯im源码附视频安装教程

安装
默认情况下,安装将尝试使用 npm 包中捆绑的预构建。如果失败,它会退回到 deltachat-core-rust使用scripts/rebuild-core.js. 要从 npm 安装,请使用:

npm install deltchat-node

依赖项
●节点 >=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 install 17 --arch x64 $ fnm use 17 $ node -p process.arch # result should be x64 $ cd deltachat-core-rust && rustup target add x86_64-apple-darwin && cd - $ git apply patches/m1_build_use_x86_64.patch $ CARGO_BUILD_TARGET=x86_64-apple-darwin npm run build $ npm run test

(当使用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

用法

im即时通讯源码/uniapp即时通讯im源码附视频安装教程

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找到旧文档。
要生成文档,请运行:

npx typedoc

拓展
测试和覆盖
运行npm test以显示代码覆盖率报告结束,该报告由nyc.
测试输出
控制台中的覆盖率报告nyc相当有限。要获得更详细的覆盖率报告,您可以运行npm run coverage-html-report. 这将从nyc数据中生成一个 html 报告,并将其显示在本地计算机上的浏览器中。

im即时通讯源码/uniapp即时通讯im源码附视频安装教程

要运行集成测试,您需要设置DCC_NEW_TMP_EMAIL环境变量。例如:

$ export DCC_NEW_TMP_EMAIL=https://testrun.org/new_email?t=[token] $ npm run test

脚本
我们有以下用于构建、测试和覆盖的脚本:
●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 的写入权限。

  • 海报
海报图正在生成中...
赞(0) 打赏
声明:
1、本博客不从事任何主机及服务器租赁业务,不参与任何交易,也绝非中介。博客内容仅记录博主个人感兴趣的服务器测评结果及一些服务器相关的优惠活动,信息均摘自网络或来自服务商主动提供;所以对本博客提及的内容不作直接、间接、法定、约定的保证,博客内容也不具备任何参考价值及引导作用,访问者需自行甄别。
2、访问本博客请务必遵守有关互联网的相关法律、规定与规则;不能利用本博客所提及的内容从事任何违法、违规操作;否则造成的一切后果由访问者自行承担。
3、未成年人及不能独立承担法律责任的个人及群体请勿访问本博客。
4、一旦您访问本博客,即表示您已经知晓并接受了以上声明通告。
文章名称:《im即时通讯源码/uniapp即时通讯im源码附视频安装教程》
文章链接:https://www.456zj.com/23513.html
本站资源仅供个人学习交流,请于下载后24小时内删除,不允许用于商业用途,否则法律问题自行承担。

评论 抢沙发

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址