@chuva.io/less-cli
Advanced tools
Comparing version 1.0.0-beta.19 to 1.0.0-beta.20
124
bin/index.js
#!/usr/bin/env node | ||
import path from 'path'; | ||
import fs from 'fs'; | ||
import { Command } from 'commander'; | ||
import { Command, Option } from 'commander'; | ||
import chalk from 'chalk'; | ||
@@ -9,4 +9,9 @@ | ||
import deploy_static from '../commands/deploy_static/index.js'; | ||
import add_template from '../commands/add-template/index.js'; | ||
import init_project_structure from '../commands/init/project_structure.js'; | ||
import create_route from '../commands/create/route/index.js'; | ||
import create_socket from '../commands/create/socket/index.js'; | ||
import create_topic from '../commands/create/topic/index.js'; | ||
import create_subscribers from '../commands/create/subscribers/index.js'; | ||
import create_cron from '../commands/create/cron/index.js'; | ||
import create_shared_module from '../commands/create/shared_module/index.js'; | ||
import create_cloud_function from '../commands/create/cloud_function/index.js'; | ||
import get_all from '../commands/projects/get_all.js'; | ||
@@ -134,32 +139,95 @@ import get_by_id from '../commands/projects/get_by_id.js'; | ||
const template = program | ||
.command('template') | ||
.description('Use templates to help you get your boilerplate code set up for common tasks.'); | ||
const create = program | ||
.command('create') | ||
.summary('Creates your Less files/resources and boilerplate code for you.') | ||
.description('Streamline your development by creating your Less files/resources and boilerplate code automatically.'); | ||
template | ||
.command('add') | ||
.description('Add a template to your project.') | ||
.option('-n, --name <name>', 'The template you want to add. Options are "mongodb-js-shared-client".') | ||
.action((str, options) => { | ||
if (!options.name) { | ||
console.log(chalk.redBright('Error:'), 'The template name is required.'); | ||
process.exit(1); | ||
} | ||
create | ||
.command('route') | ||
.summary('Creates your HTTP routes.') | ||
.description('Creates your HTTP routes.\n\nRequired options: For options marked as required, if you do not specify an option you will be asked to specify it in interactive mode instead.\n\nRead the REST API Documentation: https://less.chuva.io/rest-apis') | ||
.option('-n, --name <name>', 'Required: The name of the API to create the route for. (E.g. "store_api")') | ||
.option('-p, --path <path>', 'Required: The HTTP route path to create. (E.g. "/orders/{order_id}")') | ||
.addOption( | ||
new Option('-l, --language <language>', 'Required: The programming language to use for the code.') | ||
.choices(['js', 'py']) | ||
) | ||
.addOption( | ||
new Option('-v, --verb <verb>', 'Required: The HTTP verb to use for the route.') | ||
.choices(['get', 'post', 'put', 'patch', 'delete']) | ||
) | ||
.action(create_route); | ||
switch (options.name) { | ||
case 'mongodb-js-shared-client': | ||
add_template.create_mongodb_js_shared_client(); | ||
process.exit(0); | ||
default: | ||
console.log(chalk.redBright('Error:'), 'Invalid template provided.'); | ||
process.exit(1); | ||
} | ||
}); | ||
create | ||
.command('socket') | ||
.summary('Creates your Web Sockets and socket channels or adds channels to existing sockets.') | ||
.description('Creates your Web Sockets and socket channels or adds channels to existing sockets.\n\nRequired options: For options marked as required, if you do not specify an option you will be asked to specify it in interactive mode instead.\n\nRead the Web Socket Documentation: https://less.chuva.io/web-sockets') | ||
.option('-n, --name <name>', 'Required: The name of the Web Socket to create or to add channels to. (E.g. "--name realtime_chat")') | ||
.addOption( | ||
new Option('-l, --language <language>', 'Required: The programming language to use for the code.') | ||
.choices(['js', 'py']) | ||
) | ||
.option('-c, --channels <channels...>', 'A list of channels to create, allowing clients to send messages to the server. (E.g. "--channels public_chatroom private_chatroom")') | ||
.action(create_socket); | ||
program | ||
.command('init') | ||
.description('Create your initial Less project structure.') | ||
.action(init_project_structure); | ||
create | ||
.command('topic') | ||
.summary('Creates Topics and Subscribers.') | ||
.description('Creates Topics and Subscribers.\n\nRequired options: For options marked as required, if you do not specify an option you will be asked to specify it in interactive mode instead.\n\nRead the Topics / Subscribers (Pub / Sub) Documentation: https://less.chuva.io/topics_subscribers') | ||
.option('-n, --name <name>', 'Required: The name of the Topic to create or to add Subscribers to. (E.g. "--name user_created")') | ||
.addOption( | ||
new Option('-l, --language <language>', 'Required: The programming language to use for the code.') | ||
.choices(['js', 'py']) | ||
) | ||
.option('-s, --subscribers <subscribers...>', 'A list of Subscribers to create for a Topic. (E.g. "--subscribers send_welcome_email send_to_analytics")') | ||
.option('-ex, --external-topic <external-name>', 'The name of the external service to connect to. Use this option to create subscribers to external services. (E.g. "--external-name iot_sensor_stream_service")') | ||
.action(create_topic); | ||
create | ||
.command('subscribers') | ||
.summary('Creates Subscribers to Topics.') | ||
.description('Creates Subscribers to Topics.\n\nRead the Topics / Subscribers (Pub / Sub) Documentation: https://less.chuva.io/topics_subscribers') | ||
.option('-n, --names <subscribers...>', 'Required: A list of Subscribers to create. (E.g. "--subscribers send_welcome_email send_to_analytics")') | ||
.option('-t, --topic <topic>', 'Required: The name of the Topic to create or subscribe to. (E.g. "--name user_created")') | ||
.addOption( | ||
new Option('-l, --language <language>', 'Required: The programming language to use for each subscriber\'s code.') | ||
.choices(['js', 'py']) | ||
) | ||
.option('-ex, --external-topic <external-name>', 'The name of the external service to subscribe to. Use this option to create subscribers to external services. (E.g. "--external-name iot_sensor_stream_service")') | ||
.action(create_subscribers); | ||
create | ||
.command('cron') | ||
.summary('Creates your CRON Jobs.') | ||
.description('Creates your CRON Jobs.\n\nRead the CRON Jobs Documentation: https://less.chuva.io/cron-jobs') | ||
.option('-n, --name <name>', 'Required: Enter The name of the CRON Job to create. (E.g. "--name generate_report")') | ||
.addOption( | ||
new Option('-l, --language <language>', 'Required: The programming language to use for the code.') | ||
.choices(['js', 'py']) | ||
) | ||
.action(create_cron); | ||
create | ||
.command('shared-module') | ||
.summary('Creates your Shared Code Modules.') | ||
.description('Creates your Shared Code Modules.\n\nRead the Shared Modules Documentation: https://less.chuva.io/shared-modules') | ||
.option('-n, --name <name>', 'Required: The name of the Module to create. (E.g. "--name orm_models")') | ||
.addOption( | ||
new Option('-l, --language <language>', 'Required: The programming language to use for the code.') | ||
.choices(['js', 'py']) | ||
) | ||
.action(create_shared_module); | ||
create | ||
.command('cloud-function') | ||
.summary('Creates your Cloud Functions.') | ||
.description('Creates your Cloud Functions.\n\nRead the Cloud Functions Documentation: https://less.chuva.io/cloud-functions') | ||
.option('-n, --name <name>', 'Required: The name of the Cloud Function to create. (E.g. "--name add_numbers")') | ||
.addOption( | ||
new Option('-l, --language <language>', 'Required: The programming language to use for the code.') | ||
.choices(['js', 'py']) | ||
) | ||
.action(create_cloud_function); | ||
// Parsing the command-line arguments and executing the corresponding actions | ||
program.parse(); |
{ | ||
"name": "@chuva.io/less-cli", | ||
"version": "1.0.0-beta.19", | ||
"version": "1.0.0-beta.20", | ||
"description": "`less-cli` is a CLI tool that allows you to deploy your Less projects to AWS while providing several other tools to facilitate your interaction with Less.", | ||
@@ -8,3 +8,3 @@ "author": "Chuva, LLC", | ||
"url": "https://github.com/chuva-io/less-cli.git", | ||
"homepage": "https://bit.ly/less-framework", | ||
"homepage": "https://docs.less.chuva.io", | ||
"type": "module", | ||
@@ -33,6 +33,5 @@ "exports": "./bin/index.js", | ||
"javascript", | ||
"swift", | ||
"go", | ||
"c#", | ||
"ruby", | ||
"rust", | ||
"less", | ||
@@ -39,0 +38,0 @@ "less-cli" |
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
70192
29
1313
9