Skip to content

Commit

Permalink
Merge pull request #131 from zapier/port-convert
Browse files Browse the repository at this point in the history
refactor(cli) port convert command
  • Loading branch information
xavdid committed Dec 18, 2019
2 parents 72193b6 + a8a7515 commit dd33e90
Show file tree
Hide file tree
Showing 11 changed files with 172 additions and 278 deletions.
26 changes: 8 additions & 18 deletions docs/cli.html
Original file line number Diff line number Diff line change
Expand Up @@ -393,26 +393,16 @@ <h2 id="convert">convert</h2>
<div class="col-md-5 col-sm-12 col-height docs-primary">
<blockquote>
<p>Converts a Legacy Web Builder or Visual Builder app to a CLI app.</p>
</blockquote><p> <strong>Usage:</strong> <code>zapier convert appid path</code></p><p>Creates a new CLI app from an existing app.</p><p>If you&apos;re converting a <strong>Legacy Web Builder</strong> app: the new app contains code stubs only. It is supposed to get you started - it isn&apos;t going to create a complete app!</p><p>After running this, you&apos;ll have a new app in your directory, with stubs for your trigger and actions. If you re-run this command on an existing directory it will leave existing files alone and not clobber them.</p><p>Once you&apos;ve run the command, make sure to run <code>zapier push</code> to see it in the editor.</p><p>If you&apos;re converting a <strong>Visual Builder</strong> app, then it will be identical and ready to push and use immediately! You&apos;ll need to do a <code>zapier push</code> before the new version is visible in the editor, but otherwise you&apos;re good to go.</p><p><strong>Arguments</strong></p><ul>
<li><code>appid [value]</code> -- <strong>required</strong>, Get the appid from &quot;<a href="https://zapier.com/app/developer&quot;">https://zapier.com/app/developer&quot;</a>, clicking on an integration, and taking the number after &quot;/app&quot; in the url.</li>
<li><code>location [value]</code> -- <strong>required</strong>, Relative to your current path - IE: <code>.</code> for current directory</li>
<li><code>--version=1.0.0</code> -- <em>optional</em>, Convert a specific version. Required when converting a Visual Builder app</li>
</blockquote><p><strong>Usage</strong>: <code>zapier convert INTEGRATIONID PATH</code></p><p>If you&apos;re converting a <strong>Legacy Web Builder</strong> app: the new app contains code stubs only. It is supposed to get you started - it isn&apos;t going to create a complete app!</p><p>After running this, you&apos;ll have a new app in your directory, with stubs for your trigger and actions. If you re-run this command on an existing directory it will leave existing files alone and not clobber them.</p><p>If you&apos;re converting a <strong>Visual Builder</strong> app, then it will be identical and ready to push and use immediately!</p><p>You&apos;ll need to do a <code>zapier push</code> before the new version is visible in the editor, but otherwise you&apos;re good to go.</p><p><strong>Arguments</strong></p><ul>
<li>(required) <code>integrationId</code> | To get the integration id, go to &quot;<a href="https://zapier.com/app/developer&quot;">https://zapier.com/app/developer&quot;</a>, click on an integration, and copy the number directly after &quot;/app/&quot; in the url.</li>
<li>(required) <code>path</code> | Relative to your current path - IE: <code>.</code> for current directory</li>
</ul><p><strong>Flags</strong></p><ul>
<li><code>-v, --version</code> | Convert a specific version. Required when converting a Visual Builder app</li>
<li><code>-d, --debug</code> | Show extra debugging output</li>
</ul>
</div>
<div class="col-md-7 col-sm-12 col-height docs-code">
<pre><code class="lang-bash">$ zapier convert 1234 .
<span class="hljs-comment"># Let&apos;s convert your app!</span>
<span class="hljs-comment">#</span>
<span class="hljs-comment"># Downloading app from Zapier - done!</span>
<span class="hljs-comment"># Writing triggers/trigger.js - done!</span>
<span class="hljs-comment"># Writing package.json - done!</span>
<span class="hljs-comment"># Writing index.js - done!</span>
<span class="hljs-comment"># Copy ./index.js - done!</span>
<span class="hljs-comment"># Copy ./package.json - done!</span>
<span class="hljs-comment"># Copy ./triggers/trigger.js - done!</span>
<span class="hljs-comment">#</span>
<span class="hljs-comment"># Finished! You might need to `npm install` then try `zapier test`!</span>
</code></pre>
<div class="col-md-7 col-sm-12 col-height is-empty docs-code">

</div>
</div>
</div><div class="row">
Expand Down
34 changes: 9 additions & 25 deletions docs/cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,41 +55,25 @@ This command is typically followed by `zapier upload`.

## convert

> Converts a Legacy Web Builder or Visual Builder app to a CLI app.
> Converts a Legacy Web Builder or Visual Builder app to a CLI app.
**Usage:** `zapier convert appid path`


Creates a new CLI app from an existing app.
**Usage**: `zapier convert INTEGRATIONID PATH`

If you're converting a **Legacy Web Builder** app: the new app contains code stubs only. It is supposed to get you started - it isn't going to create a complete app!

After running this, you'll have a new app in your directory, with stubs for your trigger and actions. If you re-run this command on an existing directory it will leave existing files alone and not clobber them.

Once you've run the command, make sure to run `zapier push` to see it in the editor.
If you're converting a **Visual Builder** app, then it will be identical and ready to push and use immediately!

If you're converting a **Visual Builder** app, then it will be identical and ready to push and use immediately! You'll need to do a `zapier push` before the new version is visible in the editor, but otherwise you're good to go.
You'll need to do a `zapier push` before the new version is visible in the editor, but otherwise you're good to go.

**Arguments**
* (required) `integrationId` | To get the integration id, go to "https://zapier.com/app/developer", click on an integration, and copy the number directly after "/app/" in the url.
* (required) `path` | Relative to your current path - IE: `.` for current directory

* `appid [value]` -- **required**, Get the appid from "https://zapier.com/app/developer", clicking on an integration, and taking the number after "/app" in the url.
* `location [value]` -- **required**, Relative to your current path - IE: `.` for current directory
* `--version=1.0.0` -- _optional_, Convert a specific version. Required when converting a Visual Builder app

```bash
$ zapier convert 1234 .
# Let's convert your app!
#
# Downloading app from Zapier - done!
# Writing triggers/trigger.js - done!
# Writing package.json - done!
# Writing index.js - done!
# Copy ./index.js - done!
# Copy ./package.json - done!
# Copy ./triggers/trigger.js - done!
#
# Finished! You might need to `npm install` then try `zapier test`!
```
**Flags**
* `-v, --version` | Convert a specific version. Required when converting a Visual Builder app
* `-d, --debug` | Show extra debugging output


## delete:integration
Expand Down
26 changes: 8 additions & 18 deletions packages/cli/docs/cli.html
Original file line number Diff line number Diff line change
Expand Up @@ -393,26 +393,16 @@ <h2 id="convert">convert</h2>
<div class="col-md-5 col-sm-12 col-height docs-primary">
<blockquote>
<p>Converts a Legacy Web Builder or Visual Builder app to a CLI app.</p>
</blockquote><p> <strong>Usage:</strong> <code>zapier convert appid path</code></p><p>Creates a new CLI app from an existing app.</p><p>If you&apos;re converting a <strong>Legacy Web Builder</strong> app: the new app contains code stubs only. It is supposed to get you started - it isn&apos;t going to create a complete app!</p><p>After running this, you&apos;ll have a new app in your directory, with stubs for your trigger and actions. If you re-run this command on an existing directory it will leave existing files alone and not clobber them.</p><p>Once you&apos;ve run the command, make sure to run <code>zapier push</code> to see it in the editor.</p><p>If you&apos;re converting a <strong>Visual Builder</strong> app, then it will be identical and ready to push and use immediately! You&apos;ll need to do a <code>zapier push</code> before the new version is visible in the editor, but otherwise you&apos;re good to go.</p><p><strong>Arguments</strong></p><ul>
<li><code>appid [value]</code> -- <strong>required</strong>, Get the appid from &quot;<a href="https://zapier.com/app/developer&quot;">https://zapier.com/app/developer&quot;</a>, clicking on an integration, and taking the number after &quot;/app&quot; in the url.</li>
<li><code>location [value]</code> -- <strong>required</strong>, Relative to your current path - IE: <code>.</code> for current directory</li>
<li><code>--version=1.0.0</code> -- <em>optional</em>, Convert a specific version. Required when converting a Visual Builder app</li>
</blockquote><p><strong>Usage</strong>: <code>zapier convert INTEGRATIONID PATH</code></p><p>If you&apos;re converting a <strong>Legacy Web Builder</strong> app: the new app contains code stubs only. It is supposed to get you started - it isn&apos;t going to create a complete app!</p><p>After running this, you&apos;ll have a new app in your directory, with stubs for your trigger and actions. If you re-run this command on an existing directory it will leave existing files alone and not clobber them.</p><p>If you&apos;re converting a <strong>Visual Builder</strong> app, then it will be identical and ready to push and use immediately!</p><p>You&apos;ll need to do a <code>zapier push</code> before the new version is visible in the editor, but otherwise you&apos;re good to go.</p><p><strong>Arguments</strong></p><ul>
<li>(required) <code>integrationId</code> | To get the integration id, go to &quot;<a href="https://zapier.com/app/developer&quot;">https://zapier.com/app/developer&quot;</a>, click on an integration, and copy the number directly after &quot;/app/&quot; in the url.</li>
<li>(required) <code>path</code> | Relative to your current path - IE: <code>.</code> for current directory</li>
</ul><p><strong>Flags</strong></p><ul>
<li><code>-v, --version</code> | Convert a specific version. Required when converting a Visual Builder app</li>
<li><code>-d, --debug</code> | Show extra debugging output</li>
</ul>
</div>
<div class="col-md-7 col-sm-12 col-height docs-code">
<pre><code class="lang-bash">$ zapier convert 1234 .
<span class="hljs-comment"># Let&apos;s convert your app!</span>
<span class="hljs-comment">#</span>
<span class="hljs-comment"># Downloading app from Zapier - done!</span>
<span class="hljs-comment"># Writing triggers/trigger.js - done!</span>
<span class="hljs-comment"># Writing package.json - done!</span>
<span class="hljs-comment"># Writing index.js - done!</span>
<span class="hljs-comment"># Copy ./index.js - done!</span>
<span class="hljs-comment"># Copy ./package.json - done!</span>
<span class="hljs-comment"># Copy ./triggers/trigger.js - done!</span>
<span class="hljs-comment">#</span>
<span class="hljs-comment"># Finished! You might need to `npm install` then try `zapier test`!</span>
</code></pre>
<div class="col-md-7 col-sm-12 col-height is-empty docs-code">

</div>
</div>
</div><div class="row">
Expand Down
34 changes: 9 additions & 25 deletions packages/cli/docs/cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,41 +55,25 @@ This command is typically followed by `zapier upload`.

## convert

> Converts a Legacy Web Builder or Visual Builder app to a CLI app.
> Converts a Legacy Web Builder or Visual Builder app to a CLI app.
**Usage:** `zapier convert appid path`


Creates a new CLI app from an existing app.
**Usage**: `zapier convert INTEGRATIONID PATH`

If you're converting a **Legacy Web Builder** app: the new app contains code stubs only. It is supposed to get you started - it isn't going to create a complete app!

After running this, you'll have a new app in your directory, with stubs for your trigger and actions. If you re-run this command on an existing directory it will leave existing files alone and not clobber them.

Once you've run the command, make sure to run `zapier push` to see it in the editor.
If you're converting a **Visual Builder** app, then it will be identical and ready to push and use immediately!

If you're converting a **Visual Builder** app, then it will be identical and ready to push and use immediately! You'll need to do a `zapier push` before the new version is visible in the editor, but otherwise you're good to go.
You'll need to do a `zapier push` before the new version is visible in the editor, but otherwise you're good to go.

**Arguments**
* (required) `integrationId` | To get the integration id, go to "https://zapier.com/app/developer", click on an integration, and copy the number directly after "/app/" in the url.
* (required) `path` | Relative to your current path - IE: `.` for current directory

* `appid [value]` -- **required**, Get the appid from "https://zapier.com/app/developer", clicking on an integration, and taking the number after "/app" in the url.
* `location [value]` -- **required**, Relative to your current path - IE: `.` for current directory
* `--version=1.0.0` -- _optional_, Convert a specific version. Required when converting a Visual Builder app

```bash
$ zapier convert 1234 .
# Let's convert your app!
#
# Downloading app from Zapier - done!
# Writing triggers/trigger.js - done!
# Writing package.json - done!
# Writing index.js - done!
# Copy ./index.js - done!
# Copy ./package.json - done!
# Copy ./triggers/trigger.js - done!
#
# Finished! You might need to `npm install` then try `zapier test`!
```
**Flags**
* `-v, --version` | Convert a specific version. Required when converting a Visual Builder app
* `-d, --debug` | Show extra debugging output


## delete:integration
Expand Down
154 changes: 0 additions & 154 deletions packages/cli/src/commands/convert.js

This file was deleted.

1 change: 0 additions & 1 deletion packages/cli/src/commands/index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
module.exports = {
convert: require('./convert'),
help: require('./help')
};
Loading

0 comments on commit dd33e90

Please sign in to comment.