开发者社区> 镜像站> NPM> @adobe/io-cna-scripts
@adobe/io-cna-scripts

A module holding scripts to build, deploy and run an Adobe I/O CNA

Please update dependencies to @adobe/aio-app-scripts
Last updated a year ago by moritzraho .
Apache-2.0 · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install @adobe/io-cna-scripts 
SYNC missed versions from official npm registry.

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.

Current Tags

  • 0.0.6-pre                                ...           experiment (a year ago)
  • 0.4.0-dev                                ...           latest (a year ago)

10 Versions

  • 0.4.0-dev [deprecated]           ...           a year ago
  • 0.3.2                                ...           a year ago
  • 0.3.1                                ...           a year ago
  • 0.2.0-dev                                ...           a year ago
  • 0.1.0                                ...           a year ago
  • 0.0.6-pre                                ...           a year ago
  • 0.0.5                                ...           a year ago
  • 0.0.4                                ...           a year ago
  • 0.0.3                                ...           a year ago
  • 0.0.2                                ...           a year ago