@adobe/io-cna-scripts 中文文档教程

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

版本 下载/周 构建状态 许可”></a> <a href=绿卫徽章 Codecov Coverage

CNA Scripts

实现 Adob​​e I/O CNA 脚本的模块

Include as a library in your nodejs project

npm i --save @adobe/io-cna-scripts
const cnaScripts = require('@adobe/io-cna-scripts')({
  listeners: {
    onStart: taskName => console.error(`${taskName} ...`),
    onEnd: (taskName, res) => { console.error(`${taskName} done!`); if (res) console.log(res) },
    onWarning: warning => console.error(warning),
    onProgress: item => console.error(`  > ${item}`)
  }
})

cnaScripts.buildUI()
  .then(cnaScripts.buildActions)
  .then(cnaScripts.deployActions)
  .then(cnaScripts.deployUI)
  .catch(e => { console.error(e); process.exit(1) })

Install globally to run directly

注意这个接口是实验性的,将来可能会消失< /em>

npm i -g @adobe/io-cna-scripts

命令:

cna-scripts build.actions
cna-scripts build.ui
cna-scripts deploy.actions
cna-scripts deploy.ui
cna-scripts undeploy.actions
cna-scripts undeploy.ui

Using cna-scripts for local dev

需要 docker!

  • run dev server, this will spin up a local OpenWhisk stack and run a small express server for the frontend
   cna-scripts dev
  • only run frontend server, the frontend will point to remotely deployed actions
   REMOTE_ACTIONS=true cna-scripts dev

Debugging with VS Code

需要尚未公开的 wskdebug!

  • 可以在本地开发和远程操作开发模式下调试操作

  • 只需启动开发服务器cna-scripts dev,这将生成所有需要的 vscode 调试配置

  • 然后从你想要的配置启动 vs 代码调试器,即选择 WebAndActions 同时调试所有操作和 UI 或选择单独 调试器。

  • 当您停止开发服务器时,所有 vs 代码配置都会被清理并 恢复。

Contributing

欢迎投稿! 阅读贡献指南了解更多信息。

Licensing

这个项目是根据 Apache V2 许可证获得许可的。 有关详细信息,请参阅许可证

Version Downloads/week Build Status License Greenkeeper badge Codecov Coverage

CNA Scripts

The module implementing the Adobe I/O CNA scripts

Include as a library in your nodejs project

npm i --save @adobe/io-cna-scripts
const cnaScripts = require('@adobe/io-cna-scripts')({
  listeners: {
    onStart: taskName => console.error(`${taskName} ...`),
    onEnd: (taskName, res) => { console.error(`${taskName} done!`); if (res) console.log(res) },
    onWarning: warning => console.error(warning),
    onProgress: item => console.error(`  > ${item}`)
  }
})

cnaScripts.buildUI()
  .then(cnaScripts.buildActions)
  .then(cnaScripts.deployActions)
  .then(cnaScripts.deployUI)
  .catch(e => { console.error(e); process.exit(1) })

Install globally to run directly

note this interface is experimental and may disappear in the future

npm i -g @adobe/io-cna-scripts

Commands:

cna-scripts build.actions
cna-scripts build.ui
cna-scripts deploy.actions
cna-scripts deploy.ui
cna-scripts undeploy.actions
cna-scripts undeploy.ui

Using cna-scripts for local dev

Requires docker!

  • run dev server, this will spin up a local OpenWhisk stack and run a small express server for the frontend
   cna-scripts dev
  • only run frontend server, the frontend will point to remotely deployed actions
   REMOTE_ACTIONS=true cna-scripts dev

Debugging with VS Code

Requires wskdebug which is not yet publicly available!

  • Actions can be debugged in both with local dev and remote actions dev modes

  • Simply start the dev server cna-scripts dev, this will generate all needed vscode debug configurations

  • Then start the vs code debugger from the configuration you want, i.e. choose WebAndActions to debug all actions and UI simultaneously or choose separate debuggers.

  • When you stop the dev server all vs code configurations are cleaned up and restored.

Contributing

Contributions are welcomed! Read the Contributing Guide for more information.

Licensing

This project is licensed under the Apache V2 License. See LICENSE for more information.

更多

友情链接

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