Skip to content

Commit a7af3cd

Browse files
committed
feat: Add new veeva screenshots command
feat: Add screenshooting for all key messages, slides, and overlays describe in clm.yml files. feat: PDF generation of screenshots
1 parent fc1f5ff commit a7af3cd

3 files changed

Lines changed: 259 additions & 140 deletions

File tree

bin/veeva.js

Lines changed: 48 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -1,67 +1,65 @@
11
#!/usr/bin/env node
22

33
'use strict';
4-
var chalk = require('chalk'),
5-
gulp = require('gulp'),
6-
pkg = require('../package.json'),
7-
utils = require('../lib/utils'),
8-
veeva = require('../index');
4+
const chalk = require('chalk'),
5+
gulp = require('gulp'),
6+
pkg = require('../package.json'),
7+
utils = require('../lib/utils'),
8+
veeva = require('../index');
99

10-
var nodeVersion = utils.getVersion(process.version.replace('v', '').split('.')),
11-
requiredNodeVersion = utils.getVersion(pkg.engines.node.replace('>=', '').split('.'));
10+
const nodeVersion = utils.getVersion(process.version.replace('v', '').split('.')),
11+
requiredNodeVersion = utils.getVersion(pkg.engines.node.replace('>=', '').split('.'));
1212

1313

1414
// check node version compatibility
1515
if (nodeVersion.major < requiredNodeVersion.major) {
16-
console.log();
17-
console.error(utils.log.chalk.red.bold('✗ '), utils.log.chalk.red.bold('NODE ' + process.version + ' was detected. Veeva requires node version ' + pkg.engines.node));
18-
console.log();
19-
process.exit(1);
16+
console.log();
17+
console.error(utils.log.chalk.red.bold('✗ '), utils.log.chalk.red.bold('NODE ' + process.version + ' was detected. Veeva requires node version ' + pkg.engines.node));
18+
console.log();
19+
process.exit(1);
2020
}
2121

22-
var args = [].slice.call(process.argv, 2);
22+
const args = [].slice.call(process.argv, 2);
2323

24-
function checkForCommand(command) {
24+
function checkForCommand (command) {
2525

26-
var commands = [
27-
'build',
28-
'stage',
29-
'deploy',
30-
'vault-stage'
31-
];
26+
const commands = [
27+
'build',
28+
'deploy',
29+
'screenshots',
30+
'stage',
31+
'vault-stage'
32+
];
3233

33-
return commands.indexOf(command) > -1;
34+
return commands.includes(command);
3435
}
3536

3637

37-
return veeva.cli(args).then((options) => {
38-
39-
return new Promise(function (resolve, reject) {
40-
41-
// import gulp tasks
42-
require('../lib/gulp')(gulp, options);
43-
44-
var gulpCommand = checkForCommand(args[0]) ? args[0] : 'default';
45-
46-
console.log();
47-
console.log(chalk.yellow.bold(' ⤷ Running veeva workflow: '), chalk.underline.yellow(gulpCommand));
48-
console.log();
49-
50-
/**
51-
* @notes:
52-
* * gulp.start will be depreciated in Gulp v4
53-
* * replace with gulp.series
54-
*/
55-
gulp.start(gulpCommand, function(err) {
56-
if (err) {
57-
reject(err);
58-
} else {
59-
resolve();
60-
}
61-
});
38+
return veeva.cli(args)
39+
.then((options) => new Promise(function (resolve, reject) {
40+
41+
// import gulp tasks
42+
require('../lib/gulp')(gulp, options);
43+
44+
const gulpCommand = checkForCommand(args[0]) ? args[0] : 'default';
45+
46+
console.log();
47+
console.log(chalk.yellow.bold(' ⤷ Running veeva workflow: '), chalk.underline.yellow(gulpCommand));
48+
console.log();
49+
50+
/**
51+
* @notes:
52+
* * gulp.start will be depreciated in Gulp v4
53+
* * replace with gulp.series
54+
*/
55+
gulp.start(gulpCommand, function (err) {
56+
if (err) {
57+
reject(err);
58+
} else {
59+
resolve();
60+
}
61+
});
62+
}))
63+
.catch((err) => {
64+
console.error(('\n\n', chalk.red.bold('✗ '), err));
6265
});
63-
64-
}).catch((err) => {
65-
console.error(('\n\n', chalk.red.bold('✗ '), err));
66-
});
67-

0 commit comments

Comments
 (0)