Skip to content

Commit

Permalink
PDE-4682 chore(cli): fix text alignment in zapier validate (#743)
Browse files Browse the repository at this point in the history
* add @clif/core and upgrade @oclif/plugin-help

* another spot that uses stdtermwidth

* remove renderList options

* Fix text alignment in `zapier validate`

* change stdtermwidth in renderMarkdownHelp
  • Loading branch information
eliangcs authored Feb 2, 2024
1 parent 5e71387 commit 3878106
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 4 deletions.
10 changes: 9 additions & 1 deletion example-apps/custom-auth/authentication.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,15 @@ module.exports = {

// Define any input app's auth requires here. The user will be prompted to enter
// this info when they connect their account.
fields: [{ key: 'apiKey', label: 'API Key', required: true, helpText: 'Find the API Key in your [app settings page](https://yourapp.com/settings)' }],
fields: [
{
key: 'apiKey',
label: 'API Key',
required: true,
helpText:
'Find the API Key in your [app settings page](https://yourapp.com/settings)',
},
],

// The test method allows Zapier to verify that the credentials a user provides
// are valid. We'll execute this method whenever a user connects their account for
Expand Down
5 changes: 3 additions & 2 deletions packages/cli/src/oclif/ZapierBaseCommand.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
const { Command } = require('@oclif/command');
const { renderList } = require('@oclif/core/lib/cli-ux/list');
const { stdtermwidth } = require('@oclif/help/lib/screen');
const { renderList } = require('@oclif/help/lib/list');
const colors = require('colors/safe');

const { startSpinner, endSpinner, formatStyles } = require('../utils/display');
Expand Down Expand Up @@ -149,7 +150,7 @@ class ZapierBaseCommand extends Command {
* @param {string[][]} items
*/
logList(items) {
this.log(renderList(items));
this.log(renderList(items, { spacer: '\n', maxWidth: stdtermwidth }));
}

/**
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/src/oclif/hooks/renderMarkdownHelp.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
const chalk = require('chalk');
const { marked } = require('marked');
const TerminalRenderer = require('marked-terminal');
const { stdtermwidth } = require('@oclif/core/lib/screen');
const { stdtermwidth } = require('@oclif/help/lib/screen');

marked.setOptions({
renderer: new TerminalRenderer({
Expand Down

0 comments on commit 3878106

Please sign in to comment.