vtex
Version:
The platform for e-commerce apps
47 lines (46 loc) • 2.35 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
const command_1 = require("@oclif/command");
const CustomCommand_1 = require("../api/oclif/CustomCommand");
const link_1 = require("../modules/apps/link");
const Colors_1 = require("../api/constants/Colors");
class Link extends CustomCommand_1.CustomCommand {
async run() {
const { flags, flags: { account, setup, clean, unsafe, workspace }, } = this.parse(Link);
const noWatch = flags['no-watch'];
await link_1.appLink({ account, workspace, setup, clean, unsafe, noWatch });
}
}
exports.default = Link;
Link.description = `Syncs the app in the current directory with the ${Colors_1.ColorifyConstants.ID('development workspace')} in use.`;
Link.examples = [`${Colors_1.ColorifyConstants.COMMAND_OR_VTEX_REF('vtex link')} -a youraccount -w yourworkspace`];
Link.flags = {
...CustomCommand_1.CustomCommand.globalFlags,
account: command_1.flags.string({
char: 'a',
description: `Starts a development session in the specified ${Colors_1.ColorifyConstants.ID('account')}. Must be paired with the ${Colors_1.ColorifyConstants.COMMAND_OR_VTEX_REF('--workspace')} flag.`,
required: false,
dependsOn: ['workspace'],
}),
clean: command_1.flags.boolean({ char: 'c', description: 'Cleans builder cache', default: false }),
setup: command_1.flags.boolean({
char: 's',
description: `Locally sets typings before linking [see ${Colors_1.ColorifyConstants.COMMAND_OR_VTEX_REF('vtex setup --help')}]`,
default: false,
}),
'no-watch': command_1.flags.boolean({
description: "Doesn't watch for file changes after the initial link.",
default: false,
}),
unsafe: command_1.flags.boolean({
char: 'u',
description: 'Allows linking the app despite Typescript errors.',
default: false,
}),
workspace: command_1.flags.string({
char: 'w',
description: `Starts a development session in the specified ${Colors_1.ColorifyConstants.ID('workspace')}. Can be paired with the ${Colors_1.ColorifyConstants.COMMAND_OR_VTEX_REF('--account')} flag to switch from the current ${Colors_1.ColorifyConstants.ID('account')} and ${Colors_1.ColorifyConstants.ID('workspace')}.`,
required: false,
}),
};
Link.args = [];