UNPKG

zapier-platform-cli

Version:

The CLI for apps in the Zapier Developer Platform.

21 lines (18 loc) 1.82 kB
'use strict'; var constants = require('../constants'); var utils = require('../utils'); var build = function build(context) { context.line('Building project.\n'); return utils.build().then(function () { context.line('\nBuild complete! Moved to ' + constants.BUILD_PATH + '! Try the `zapier upload` command now.'); }); }; build.argsSpec = []; build.argOptsSpec = { 'disable-dependency-detection': { flag: true, help: 'disables walking required files to slim the build' }, 'include-js-map': { flag: true, help: 'include .js.map files (usually source maps' } }; build.help = 'Builds a pushable zip from the current directory.'; build.example = 'zapier build'; build.docs = '\nBuilds a ready-to-upload zip file, but does not upload / push the zip file. Generally you\'d use `zapier push` which does this and `zapier upload` together.\n\nIt does the following steps:\n\n* Creates a temporary folder\n* Copies all code into the temporary folder\n* Adds an entry point `zapierwrapper.js`\n* Generates and validates app definition.\n* Detects dependencies via browserify (optional)\n* Zips up all needed `.js` files\n* Moves the zip to `' + constants.BUILD_PATH + '`\n\n> If you get live errors like `Error: Cannot find module \'some-path\'`, try disabling dependency detection.\n\n**Arguments**\n\n' + utils.argsFragment(build.argsSpec) + '\n' + utils.argOptsFragment(build.argOptsSpec) + '\n\n' + '```' + 'bash\n$ zapier build\n# Building project.\n#\n# Copying project to temp directory - done!\n# Installing project dependencies - done!\n# Applying entry point file - done!\n# Validating project - done!\n# Building app definition.json - done!\n# Zipping project and dependencies - done!\n# Cleaning up temp directory - done!\n#\n# Build complete!\n' + '```' + '\n'; module.exports = build;