@abancu/explorer-core-plugins 中文文档教程

发布于 4年前 浏览 20 项目主页 更新于 3年前

explorer-core-plugins

Alethio Explorer

Project structure

的核心插件该项目包含 3 个核心插件,它们提供基本的资源管理器功能并且共享相同的代码库、依赖项和构建过程。 每个插件在 packages/ 中都有一个文件夹,从中创建一个单独的 npm 包:

  • eth-common - common pages and modules that should be available regardless of what data source is used
  • eth-extended - pages, modules and data sources specific to the "full" explorer. This plugin uses the Alethio explorer API endpoints and a Deepstream connection
  • eth-lite - a "lite" explorer plugin, using web3 as a data source. It only offers what can be directly fetched from an eth node, without the aggregations provided by the Alethio API.

Development

Install (Linux, MacOS)

npm install

Install (Windows)

npm --add-python-to- path='true' --debug install --global windows-build-tools npm install 与 Linux

Build

npm run watchnpm run build-dev 一样。

Link to an explorer installation

您可以acp link 任何插件文件夹到您的区块浏览器安装中。

$ npm i -g @alethio/cms-plugin-tool $ cd

$ acp link ../explorer-core-plugins/packages/eth-common \
    ../explorer-core-plugins/packages/eth-extended \
    ../explorer-core-plugins/packages/eth-lite

Running the tests

npm test(或 npm run test-coverage 以生成代码覆盖率)。

测试覆盖率以 HTML 和 LCOV 格式写入 ./coverage

Release process

  1. Changes are proposed via pull requests and merged into master after they obtain approval.
  2. Releases are made from master, by a maintainer, collecting changes that were made since the previous release.
  3. A new independent version is chosen for plugins that were affected, according to semver.
  4. Changes are documented in CHANGELOG files, found in each package folder, committed and pushed to master.
  5. Publish to npm, with implicit git tags and corresponding release (see below).

Publishing to npm

这个 repo 使用 lerna。 因为源代码在包之间共享,所以 lerna 不会自动检测更改了哪些包。 需要执行以下命令:

  1. npx lerna version --force-publish=<explicitly_changed_package_names>

例如 npx lerna version --force-publish=@alethio/explorer-plugin-eth-common,@alethio/explorer-plugin-eth-lite

  1. npx lerna publish from-git

explorer-core-plugins

Core plugins for Alethio Explorer

Project structure

The project contains 3 core plugins that provide basic explorer functionality and which share the same codebase, dependencies and build process. Each plugin has a folder in packages/<pluginName>, from which a separate npm package is created:

  • eth-common - common pages and modules that should be available regardless of what data source is used
  • eth-extended - pages, modules and data sources specific to the "full" explorer. This plugin uses the Alethio explorer API endpoints and a Deepstream connection
  • eth-lite - a "lite" explorer plugin, using web3 as a data source. It only offers what can be directly fetched from an eth node, without the aggregations provided by the Alethio API.

Development

Install (Linux, MacOS)

npm install

Install (Windows)

npm --add-python-to-path='true' --debug install --global windows-build-tools npm install just as with Linux

Build

npm run watch or npm run build-dev.

Link to an explorer installation

You can acp link any plugin folder into your block explorer installation.

$ npm i -g @alethio/cms-plugin-tool $ cd <explorer-checkout-folder>

$ acp link ../explorer-core-plugins/packages/eth-common \
    ../explorer-core-plugins/packages/eth-extended \
    ../explorer-core-plugins/packages/eth-lite

Running the tests

npm test (or npm run test-coverage to generate code coverage as well).

Test coverage is written to ./coverage in HTML and LCOV formats.

Release process

  1. Changes are proposed via pull requests and merged into master after they obtain approval.
  2. Releases are made from master, by a maintainer, collecting changes that were made since the previous release.
  3. A new independent version is chosen for plugins that were affected, according to semver.
  4. Changes are documented in CHANGELOG files, found in each package folder, committed and pushed to master.
  5. Publish to npm, with implicit git tags and corresponding release (see below).

Publishing to npm

This repo uses lerna. Because the source code is shared between packages, lerna will not automatically detect which packages were changed. The following commands need to be executed:

  1. npx lerna version --force-publish=<explicitly_changed_package_names>

e.g. npx lerna version --force-publish=@alethio/explorer-plugin-eth-common,@alethio/explorer-plugin-eth-lite

  1. npx lerna publish from-git
    我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
    原文