Skip to content

Commit

Permalink
chore: sync alpha (#2643)
Browse files Browse the repository at this point in the history
  • Loading branch information
adamstankiewicz authored and PKulkoRaccoonGang committed Aug 1, 2024
2 parents 6ccf602 + e023988 commit 7b69dd0
Show file tree
Hide file tree
Showing 36 changed files with 6,460 additions and 4,013 deletions.
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,16 @@ Usage on with `@edx/brand`:

Note that including fonts will affect performance. In some applications may choose not to load the custom font to keep it highly performant.

## Paragon CLI

The Paragon CLI (Command Line Interface) is a tool that provides various utility commands to automate actions within the Open edX environment.

### Available Commands

- `paragon install-theme [theme]`: Installs the specific @edx/brand package.

Use `paragon help` to see more information.

## Getting Help

Please reach out to the Paragon Working Group (PWG):
Expand Down
55 changes: 51 additions & 4 deletions bin/paragon-scripts.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,52 @@
#!/usr/bin/env node
const chalk = require('chalk');
const themeCommand = require('../lib/install-theme');
const helpCommand = require('../lib/help');

const HELP_COMMAND = 'help';

// command: executor function
const COMMANDS = {
'install-theme': themeCommand,
/**
*'command-name': {
* executor: executorFunc,
*
* ********** Block for help command start **********
* description: 'Command description',
* parameters: [
* {
* name: 'paramName',
* description: 'paramDescription',
* defaultValue: 'paramDefaultValue',
* required: true/false,
* },
* ...
* ],
* options: [
* {
* name: '--optionName',
* description: 'optionDescription',
* },
* ...
* ],
* ********** Block for help command end **********
*},
*/
'install-theme': {
executor: themeCommand,
description: 'Installs the specific @edx/brand package.',
parameters: [
{
name: 'theme',
description: 'The @edx/brand package to install.',
defaultValue: '@edx/brand-openedx@latest',
required: false,
},
],
},
help: {
executor: helpCommand,
description: 'Displays help for available commands.',
},
};

(async () => {
Expand All @@ -13,12 +55,17 @@ const COMMANDS = {

if (!executor) {
// eslint-disable-next-line no-console
console.log(chalk.red.bold('Unknown command. Usage: paragon <command>'));
console.log(chalk.red.bold('Unknown command. Usage: paragon <command>.'));
return;
}

if (command === HELP_COMMAND) {
helpCommand(COMMANDS);
return;
}

try {
await executor();
await executor.executor();
} catch (error) {
// eslint-disable-next-line no-console
console.error(chalk.red.bold('An error occurred:', error.message));
Expand Down
Loading

0 comments on commit 7b69dd0

Please sign in to comment.