@activeprospect/integration-dev-dependencies 中文文档教程
Integration Dev Dependencies
集中管理和更新 LeadConduit 集成使用的常见 devDependencies
。
Usage
请注意,在此包中,它们被列为 dependencies
,但在您的集成模块中,这实际上应该作为条目包含在 devDependencies
中:
npm install --save-dev @activeprospect/integration-dev-dependencies
Conversion
将旧集成转换为使用这个包,你可以运行它的convert.js
脚本。 一旦将包添加到 devDependencies
(见上文),只需运行:
npx convert
这将纠正 ESLint 配置,如果需要修改一些源文件,并更新 package.json
修改依赖项,以及一些新脚本:fixlint
、lint
和 watch
(如果集成有 UI)。
Linting
安装此包会通过指向父包的符号链接安装 ESLint 配置文件 .eslintrc.js
。
这可以由您的 IDE 使用,或通过 npm 脚本运行:npm run lint
或 npm run fixlint
。
Live webpacking with watch
此包不使用 webpack-dev-middleware
,而是支持在开发期间通过 Webpack 的“监视”功能实时更新 webpacked rich UI (RUI) 文件。
在与本地 LeadConduit 服务器不同的终端会话中,运行 npm run watch
。 这会更新 RUI 使用的 webpacked 源,然后保持运行。 每当更新其中一个 RUI 文件时(尽管不是在服务器端运行的 /api
代码),这将自动重新运行 webpack。 这允许在开发时在浏览器中更快速、更轻松地进行更改和重新加载。
Integration Dev Dependencies
Centralizes management and updates of common devDependencies
used by LeadConduit integrations.
Usage
Note that in this package, they're listed as dependencies
, but in your integration module, this should in fact be included as an entry in devDependencies
:
npm install --save-dev @activeprospect/integration-dev-dependencies
Conversion
To convert old integrations to use this package, you can run its convert.js
script. Once the package is added to devDependencies
(see above), just run:
npx convert
This will correct ESLint configuration, modify a few source files if needed, and update package.json
with revised dependencies, as well as a few new scripts: fixlint
, lint
, and watch
(if the integration has a UI).
Linting
Installation of this package installs the ESLint configuration file .eslintrc.js
via symbolic link to the parent package.
This can be used by your IDE, or run via npm scripts: npm run lint
or npm run fixlint
.
Live webpacking with watch
Instead of using webpack-dev-middleware
, this package supports live updating of webpacked rich UI (RUI) files during development via Webpack's "watch" functionality.
In a separate terminal session from your local LeadConduit server, run npm run watch
. This updates the webpacked source used by the RUI, and then stays running. Whenever one of the RUI files is updated (though not /api
code, which runs server-side), this will rerun webpack automatically. This allows changes to be made and reloaded more quickly and easily in the browser while developing.