ToolJet/cli/src/commands/plugin/create.ts

168 lines
5.1 KiB
TypeScript
Raw Normal View History

import { Command, Flags, CliUx } from '@oclif/core';
import * as inquirer from 'inquirer';
const execa = require('execa');
const path = require('path');
const fs = require('fs');
const { runner } = require('hygen');
2022-03-18 04:45:29 +00:00
const Logger = require('hygen/dist/logger').default;
export default class Create extends Command {
static flags = {
type: Flags.string({ options: ['database', 'api', 'cloud-storage'] }),
build: Flags.boolean({ char: 'b' }),
[Feature] Make plugins installable (#3069) * feat: add user avatar * update: @nest/platform-express from 8.0.0 to 8.4.4 * add avatar_id in login response * add user avatar upload in frontend * align cross divider with layout icons' * generate nest model - extensions * Add extensions module * Add extension to datasouce * add not implemented check * create extension * refactor * cleanup * fix tests * reduce the avatar size on homepage * poc: run js code from string * resolve conflicts * fix conflicts * add globals * add new route * add icon, manifest file upload * complete user flow * add flow for data queries * add dynamic manifest instead of local datasource types * add version attr * remove unused code * add version * rename extension(s) -> plugins(s) * add test connection method * feat: add marketplace listing page * Add install plugin cmd + missing attrs {name, repo, desc} to plugin * add missing icon * - Add npm workspaces for marketplace monorepo - Added cassandra datasource plugin - Created upload to s3 script - Created plugins.json entry file * install plugin from s3 bucket * cleanup * update pkg locks * fix icon render * cleanup * marketplace changes * ui changes * operations file load fix + revert vm2 * update module from string to 3.2.1 * load plugins.json from local file instead of remote * install plugin from local file if not production environment * add sqlite * feat: add plivo api plugin * exp: add heroku 22 stack * update assets include path * Revert "exp: add heroku 22 stack" This reverts commit a8926b36e116fb76cd3b6d0aa41778779c9273c8. * add integrations link * Add casl ability for plugin * load host from env else fallback to default * update imports * remove sqlite * typo * add marketplace flag to cli command * move ts and ncc to devDep * add hygen templates for marketplace * cli tree-node path fix * template indent fix * TOOLJET_URL -> MARKETPLACE_TOOLJET_URL * add tests * refactor: move to plugins.helper for get-service helper utility * fix; typo * update package-lock.json * review changes * remove a href * remove bg color + redirect issue due to href * add test url * fix crash on search * remove extra slash * feat: allow plugin to be installed from github repository * remove unwanted args from cli command * add repo attr while save * feat: add feature toggle for marketplace feature * fix: make default config as false * chore: remove hyperlink * fix: failing build * chore: update s3 url to point to prod * fix failing test * fix test * fix: test case * update module from string pkg * update env * fix test * fix test * add readme file * Update README.md Co-authored-by: Akshay Sasidharan <akshaysasidharan93@gmail.com>
2022-10-27 11:29:43 +00:00
marketplace: Flags.boolean({ char: 'm' }),
};
static description = 'Create a new tooljet plugin';
static examples = [`$ tooljet plugin create <name> --type=<database | api | cloud-storage> [--build]`];
static args = [{ name: 'plugin_name', description: 'Name of the plugin', required: true }];
async run(): Promise<void> {
const { args, flags } = await this.parse(Create);
if (Number(args.plugin_name)) {
this.log('\x1b[41m%s\x1b[0m', 'Error : Plugin name can not be a number');
process.exit(1);
}
[Feature] Make plugins installable (#3069) * feat: add user avatar * update: @nest/platform-express from 8.0.0 to 8.4.4 * add avatar_id in login response * add user avatar upload in frontend * align cross divider with layout icons' * generate nest model - extensions * Add extensions module * Add extension to datasouce * add not implemented check * create extension * refactor * cleanup * fix tests * reduce the avatar size on homepage * poc: run js code from string * resolve conflicts * fix conflicts * add globals * add new route * add icon, manifest file upload * complete user flow * add flow for data queries * add dynamic manifest instead of local datasource types * add version attr * remove unused code * add version * rename extension(s) -> plugins(s) * add test connection method * feat: add marketplace listing page * Add install plugin cmd + missing attrs {name, repo, desc} to plugin * add missing icon * - Add npm workspaces for marketplace monorepo - Added cassandra datasource plugin - Created upload to s3 script - Created plugins.json entry file * install plugin from s3 bucket * cleanup * update pkg locks * fix icon render * cleanup * marketplace changes * ui changes * operations file load fix + revert vm2 * update module from string to 3.2.1 * load plugins.json from local file instead of remote * install plugin from local file if not production environment * add sqlite * feat: add plivo api plugin * exp: add heroku 22 stack * update assets include path * Revert "exp: add heroku 22 stack" This reverts commit a8926b36e116fb76cd3b6d0aa41778779c9273c8. * add integrations link * Add casl ability for plugin * load host from env else fallback to default * update imports * remove sqlite * typo * add marketplace flag to cli command * move ts and ncc to devDep * add hygen templates for marketplace * cli tree-node path fix * template indent fix * TOOLJET_URL -> MARKETPLACE_TOOLJET_URL * add tests * refactor: move to plugins.helper for get-service helper utility * fix; typo * update package-lock.json * review changes * remove a href * remove bg color + redirect issue due to href * add test url * fix crash on search * remove extra slash * feat: allow plugin to be installed from github repository * remove unwanted args from cli command * add repo attr while save * feat: add feature toggle for marketplace feature * fix: make default config as false * chore: remove hyperlink * fix: failing build * chore: update s3 url to point to prod * fix failing test * fix test * fix: test case * update module from string pkg * update env * fix test * fix test * add readme file * Update README.md Co-authored-by: Akshay Sasidharan <akshaysasidharan93@gmail.com>
2022-10-27 11:29:43 +00:00
let { type, marketplace } = flags;
const name = await CliUx.ux.prompt('Enter plugin display name');
if (Number(name)) {
this.log('\x1b[41m%s\x1b[0m', 'Error : Plugin Display name can not be a number');
process.exit(1);
}
if (!type) {
const responses: any = await inquirer.prompt([
{
name: 'type',
message: 'select a type',
type: 'list',
choices: [{ name: 'database' }, { name: 'api' }, { name: 'cloud-storage' }],
},
]);
type = responses.type;
}
[Feature] Make plugins installable (#3069) * feat: add user avatar * update: @nest/platform-express from 8.0.0 to 8.4.4 * add avatar_id in login response * add user avatar upload in frontend * align cross divider with layout icons' * generate nest model - extensions * Add extensions module * Add extension to datasouce * add not implemented check * create extension * refactor * cleanup * fix tests * reduce the avatar size on homepage * poc: run js code from string * resolve conflicts * fix conflicts * add globals * add new route * add icon, manifest file upload * complete user flow * add flow for data queries * add dynamic manifest instead of local datasource types * add version attr * remove unused code * add version * rename extension(s) -> plugins(s) * add test connection method * feat: add marketplace listing page * Add install plugin cmd + missing attrs {name, repo, desc} to plugin * add missing icon * - Add npm workspaces for marketplace monorepo - Added cassandra datasource plugin - Created upload to s3 script - Created plugins.json entry file * install plugin from s3 bucket * cleanup * update pkg locks * fix icon render * cleanup * marketplace changes * ui changes * operations file load fix + revert vm2 * update module from string to 3.2.1 * load plugins.json from local file instead of remote * install plugin from local file if not production environment * add sqlite * feat: add plivo api plugin * exp: add heroku 22 stack * update assets include path * Revert "exp: add heroku 22 stack" This reverts commit a8926b36e116fb76cd3b6d0aa41778779c9273c8. * add integrations link * Add casl ability for plugin * load host from env else fallback to default * update imports * remove sqlite * typo * add marketplace flag to cli command * move ts and ncc to devDep * add hygen templates for marketplace * cli tree-node path fix * template indent fix * TOOLJET_URL -> MARKETPLACE_TOOLJET_URL * add tests * refactor: move to plugins.helper for get-service helper utility * fix; typo * update package-lock.json * review changes * remove a href * remove bg color + redirect issue due to href * add test url * fix crash on search * remove extra slash * feat: allow plugin to be installed from github repository * remove unwanted args from cli command * add repo attr while save * feat: add feature toggle for marketplace feature * fix: make default config as false * chore: remove hyperlink * fix: failing build * chore: update s3 url to point to prod * fix failing test * fix test * fix: test case * update module from string pkg * update env * fix test * fix test * add readme file * Update README.md Co-authored-by: Akshay Sasidharan <akshaysasidharan93@gmail.com>
2022-10-27 11:29:43 +00:00
if (!marketplace) {
const responses: any = await inquirer.prompt([
{
name: 'marketplace',
message: 'is it a marketplace integration?',
type: 'confirm',
default: false,
},
]);
marketplace = responses.marketplace;
}
const pluginsPath = marketplace ? 'marketplace' : 'plugins';
const docsPath = 'docs';
[Feature] Make plugins installable (#3069) * feat: add user avatar * update: @nest/platform-express from 8.0.0 to 8.4.4 * add avatar_id in login response * add user avatar upload in frontend * align cross divider with layout icons' * generate nest model - extensions * Add extensions module * Add extension to datasouce * add not implemented check * create extension * refactor * cleanup * fix tests * reduce the avatar size on homepage * poc: run js code from string * resolve conflicts * fix conflicts * add globals * add new route * add icon, manifest file upload * complete user flow * add flow for data queries * add dynamic manifest instead of local datasource types * add version attr * remove unused code * add version * rename extension(s) -> plugins(s) * add test connection method * feat: add marketplace listing page * Add install plugin cmd + missing attrs {name, repo, desc} to plugin * add missing icon * - Add npm workspaces for marketplace monorepo - Added cassandra datasource plugin - Created upload to s3 script - Created plugins.json entry file * install plugin from s3 bucket * cleanup * update pkg locks * fix icon render * cleanup * marketplace changes * ui changes * operations file load fix + revert vm2 * update module from string to 3.2.1 * load plugins.json from local file instead of remote * install plugin from local file if not production environment * add sqlite * feat: add plivo api plugin * exp: add heroku 22 stack * update assets include path * Revert "exp: add heroku 22 stack" This reverts commit a8926b36e116fb76cd3b6d0aa41778779c9273c8. * add integrations link * Add casl ability for plugin * load host from env else fallback to default * update imports * remove sqlite * typo * add marketplace flag to cli command * move ts and ncc to devDep * add hygen templates for marketplace * cli tree-node path fix * template indent fix * TOOLJET_URL -> MARKETPLACE_TOOLJET_URL * add tests * refactor: move to plugins.helper for get-service helper utility * fix; typo * update package-lock.json * review changes * remove a href * remove bg color + redirect issue due to href * add test url * fix crash on search * remove extra slash * feat: allow plugin to be installed from github repository * remove unwanted args from cli command * add repo attr while save * feat: add feature toggle for marketplace feature * fix: make default config as false * chore: remove hyperlink * fix: failing build * chore: update s3 url to point to prod * fix failing test * fix test * fix: test case * update module from string pkg * update env * fix test * fix test * add readme file * Update README.md Co-authored-by: Akshay Sasidharan <akshaysasidharan93@gmail.com>
2022-10-27 11:29:43 +00:00
const defaultTemplates = path.join(pluginsPath, '_templates');
if (!(fs.existsSync(pluginsPath) && fs.existsSync(docsPath) && fs.existsSync(defaultTemplates))) {
this.log(
'\x1b[41m%s\x1b[0m',
2022-12-27 14:40:33 +00:00
`Error : ${pluginsPath}, docs or ${pluginsPath}/_templates directory missing, make sure that you are running this command in Tooljet directory`
);
process.exit(1);
}
[Feature] Make plugins installable (#3069) * feat: add user avatar * update: @nest/platform-express from 8.0.0 to 8.4.4 * add avatar_id in login response * add user avatar upload in frontend * align cross divider with layout icons' * generate nest model - extensions * Add extensions module * Add extension to datasouce * add not implemented check * create extension * refactor * cleanup * fix tests * reduce the avatar size on homepage * poc: run js code from string * resolve conflicts * fix conflicts * add globals * add new route * add icon, manifest file upload * complete user flow * add flow for data queries * add dynamic manifest instead of local datasource types * add version attr * remove unused code * add version * rename extension(s) -> plugins(s) * add test connection method * feat: add marketplace listing page * Add install plugin cmd + missing attrs {name, repo, desc} to plugin * add missing icon * - Add npm workspaces for marketplace monorepo - Added cassandra datasource plugin - Created upload to s3 script - Created plugins.json entry file * install plugin from s3 bucket * cleanup * update pkg locks * fix icon render * cleanup * marketplace changes * ui changes * operations file load fix + revert vm2 * update module from string to 3.2.1 * load plugins.json from local file instead of remote * install plugin from local file if not production environment * add sqlite * feat: add plivo api plugin * exp: add heroku 22 stack * update assets include path * Revert "exp: add heroku 22 stack" This reverts commit a8926b36e116fb76cd3b6d0aa41778779c9273c8. * add integrations link * Add casl ability for plugin * load host from env else fallback to default * update imports * remove sqlite * typo * add marketplace flag to cli command * move ts and ncc to devDep * add hygen templates for marketplace * cli tree-node path fix * template indent fix * TOOLJET_URL -> MARKETPLACE_TOOLJET_URL * add tests * refactor: move to plugins.helper for get-service helper utility * fix; typo * update package-lock.json * review changes * remove a href * remove bg color + redirect issue due to href * add test url * fix crash on search * remove extra slash * feat: allow plugin to be installed from github repository * remove unwanted args from cli command * add repo attr while save * feat: add feature toggle for marketplace feature * fix: make default config as false * chore: remove hyperlink * fix: failing build * chore: update s3 url to point to prod * fix failing test * fix test * fix: test case * update module from string pkg * update env * fix test * fix test * add readme file * Update README.md Co-authored-by: Akshay Sasidharan <akshaysasidharan93@gmail.com>
2022-10-27 11:29:43 +00:00
let repoUrl;
if (marketplace) {
const buffer = fs.readFileSync(path.join('server', 'src', 'assets', 'marketplace', 'plugins.json'), 'utf8');
const pluginsJson = JSON.parse(buffer);
pluginsJson.map((plugin: any) => {
if (plugin.id === args.plugin_name.toLowerCase()) {
this.log('\x1b[41m%s\x1b[0m', 'Error : Plugin id already exists');
process.exit(1);
}
});
repoUrl = await CliUx.ux.prompt('Please enter the repository URL if hosted on GitHub', {
required: false,
});
}
const hygenArgs = [
'plugin',
'new',
'--name',
`${args.plugin_name}`,
'--type',
`${type}`,
'--display_name',
`${name}`,
'--plugins_path',
`${pluginsPath}`,
'--docs_path',
`${docsPath}`,
];
CliUx.ux.action.start('creating plugin');
[Feature] Make plugins installable (#3069) * feat: add user avatar * update: @nest/platform-express from 8.0.0 to 8.4.4 * add avatar_id in login response * add user avatar upload in frontend * align cross divider with layout icons' * generate nest model - extensions * Add extensions module * Add extension to datasouce * add not implemented check * create extension * refactor * cleanup * fix tests * reduce the avatar size on homepage * poc: run js code from string * resolve conflicts * fix conflicts * add globals * add new route * add icon, manifest file upload * complete user flow * add flow for data queries * add dynamic manifest instead of local datasource types * add version attr * remove unused code * add version * rename extension(s) -> plugins(s) * add test connection method * feat: add marketplace listing page * Add install plugin cmd + missing attrs {name, repo, desc} to plugin * add missing icon * - Add npm workspaces for marketplace monorepo - Added cassandra datasource plugin - Created upload to s3 script - Created plugins.json entry file * install plugin from s3 bucket * cleanup * update pkg locks * fix icon render * cleanup * marketplace changes * ui changes * operations file load fix + revert vm2 * update module from string to 3.2.1 * load plugins.json from local file instead of remote * install plugin from local file if not production environment * add sqlite * feat: add plivo api plugin * exp: add heroku 22 stack * update assets include path * Revert "exp: add heroku 22 stack" This reverts commit a8926b36e116fb76cd3b6d0aa41778779c9273c8. * add integrations link * Add casl ability for plugin * load host from env else fallback to default * update imports * remove sqlite * typo * add marketplace flag to cli command * move ts and ncc to devDep * add hygen templates for marketplace * cli tree-node path fix * template indent fix * TOOLJET_URL -> MARKETPLACE_TOOLJET_URL * add tests * refactor: move to plugins.helper for get-service helper utility * fix; typo * update package-lock.json * review changes * remove a href * remove bg color + redirect issue due to href * add test url * fix crash on search * remove extra slash * feat: allow plugin to be installed from github repository * remove unwanted args from cli command * add repo attr while save * feat: add feature toggle for marketplace feature * fix: make default config as false * chore: remove hyperlink * fix: failing build * chore: update s3 url to point to prod * fix failing test * fix test * fix: test case * update module from string pkg * update env * fix test * fix test * add readme file * Update README.md Co-authored-by: Akshay Sasidharan <akshaysasidharan93@gmail.com>
2022-10-27 11:29:43 +00:00
await runner(hygenArgs, {
templates: defaultTemplates,
cwd: process.cwd(),
logger: new Logger(console.log.bind(console)),
createPrompter: () => require('enquirer'),
exec: (action: any, body: string | any[]) => {
const opts = body && body.length > 0 ? { input: body } : {};
return require('execa').shell(action, opts);
},
debug: !!process.env.DEBUG,
});
[Feature] Make plugins installable (#3069) * feat: add user avatar * update: @nest/platform-express from 8.0.0 to 8.4.4 * add avatar_id in login response * add user avatar upload in frontend * align cross divider with layout icons' * generate nest model - extensions * Add extensions module * Add extension to datasouce * add not implemented check * create extension * refactor * cleanup * fix tests * reduce the avatar size on homepage * poc: run js code from string * resolve conflicts * fix conflicts * add globals * add new route * add icon, manifest file upload * complete user flow * add flow for data queries * add dynamic manifest instead of local datasource types * add version attr * remove unused code * add version * rename extension(s) -> plugins(s) * add test connection method * feat: add marketplace listing page * Add install plugin cmd + missing attrs {name, repo, desc} to plugin * add missing icon * - Add npm workspaces for marketplace monorepo - Added cassandra datasource plugin - Created upload to s3 script - Created plugins.json entry file * install plugin from s3 bucket * cleanup * update pkg locks * fix icon render * cleanup * marketplace changes * ui changes * operations file load fix + revert vm2 * update module from string to 3.2.1 * load plugins.json from local file instead of remote * install plugin from local file if not production environment * add sqlite * feat: add plivo api plugin * exp: add heroku 22 stack * update assets include path * Revert "exp: add heroku 22 stack" This reverts commit a8926b36e116fb76cd3b6d0aa41778779c9273c8. * add integrations link * Add casl ability for plugin * load host from env else fallback to default * update imports * remove sqlite * typo * add marketplace flag to cli command * move ts and ncc to devDep * add hygen templates for marketplace * cli tree-node path fix * template indent fix * TOOLJET_URL -> MARKETPLACE_TOOLJET_URL * add tests * refactor: move to plugins.helper for get-service helper utility * fix; typo * update package-lock.json * review changes * remove a href * remove bg color + redirect issue due to href * add test url * fix crash on search * remove extra slash * feat: allow plugin to be installed from github repository * remove unwanted args from cli command * add repo attr while save * feat: add feature toggle for marketplace feature * fix: make default config as false * chore: remove hyperlink * fix: failing build * chore: update s3 url to point to prod * fix failing test * fix test * fix: test case * update module from string pkg * update env * fix test * fix test * add readme file * Update README.md Co-authored-by: Akshay Sasidharan <akshaysasidharan93@gmail.com>
2022-10-27 11:29:43 +00:00
if (marketplace) {
await execa('npm', ['i'], { cwd: pluginsPath });
const buffer = fs.readFileSync(path.join('server', 'src', 'assets', 'marketplace', 'plugins.json'), 'utf8');
const pluginsJson = JSON.parse(buffer);
const plugin = {
name: args.plugin_name,
repo: repoUrl || '',
description: `${type} plugin from ${args.plugin_name}`,
version: '1.0.0',
id: `${args.plugin_name.toLowerCase()}`,
author: 'Tooljet',
timestamp: new Date().toUTCString(),
};
pluginsJson.push(plugin);
const jsonString = JSON.stringify(pluginsJson, null, 2);
fs.writeFileSync(path.join('server', 'src', 'assets', 'marketplace', 'plugins.json'), jsonString);
} else {
await execa('npx', ['lerna', 'link', 'convert'], { cwd: pluginsPath });
}
CliUx.ux.action.stop();
[Feature] Make plugins installable (#3069) * feat: add user avatar * update: @nest/platform-express from 8.0.0 to 8.4.4 * add avatar_id in login response * add user avatar upload in frontend * align cross divider with layout icons' * generate nest model - extensions * Add extensions module * Add extension to datasouce * add not implemented check * create extension * refactor * cleanup * fix tests * reduce the avatar size on homepage * poc: run js code from string * resolve conflicts * fix conflicts * add globals * add new route * add icon, manifest file upload * complete user flow * add flow for data queries * add dynamic manifest instead of local datasource types * add version attr * remove unused code * add version * rename extension(s) -> plugins(s) * add test connection method * feat: add marketplace listing page * Add install plugin cmd + missing attrs {name, repo, desc} to plugin * add missing icon * - Add npm workspaces for marketplace monorepo - Added cassandra datasource plugin - Created upload to s3 script - Created plugins.json entry file * install plugin from s3 bucket * cleanup * update pkg locks * fix icon render * cleanup * marketplace changes * ui changes * operations file load fix + revert vm2 * update module from string to 3.2.1 * load plugins.json from local file instead of remote * install plugin from local file if not production environment * add sqlite * feat: add plivo api plugin * exp: add heroku 22 stack * update assets include path * Revert "exp: add heroku 22 stack" This reverts commit a8926b36e116fb76cd3b6d0aa41778779c9273c8. * add integrations link * Add casl ability for plugin * load host from env else fallback to default * update imports * remove sqlite * typo * add marketplace flag to cli command * move ts and ncc to devDep * add hygen templates for marketplace * cli tree-node path fix * template indent fix * TOOLJET_URL -> MARKETPLACE_TOOLJET_URL * add tests * refactor: move to plugins.helper for get-service helper utility * fix; typo * update package-lock.json * review changes * remove a href * remove bg color + redirect issue due to href * add test url * fix crash on search * remove extra slash * feat: allow plugin to be installed from github repository * remove unwanted args from cli command * add repo attr while save * feat: add feature toggle for marketplace feature * fix: make default config as false * chore: remove hyperlink * fix: failing build * chore: update s3 url to point to prod * fix failing test * fix test * fix: test case * update module from string pkg * update env * fix test * fix test * add readme file * Update README.md Co-authored-by: Akshay Sasidharan <akshaysasidharan93@gmail.com>
2022-10-27 11:29:43 +00:00
this.log('\x1b[42m', '\x1b[30m', `Plugin: ${args.plugin_name} created successfully`, '\x1b[0m');
if (flags.build) {
CliUx.ux.action.start('building plugins');
[Feature] Make plugins installable (#3069) * feat: add user avatar * update: @nest/platform-express from 8.0.0 to 8.4.4 * add avatar_id in login response * add user avatar upload in frontend * align cross divider with layout icons' * generate nest model - extensions * Add extensions module * Add extension to datasouce * add not implemented check * create extension * refactor * cleanup * fix tests * reduce the avatar size on homepage * poc: run js code from string * resolve conflicts * fix conflicts * add globals * add new route * add icon, manifest file upload * complete user flow * add flow for data queries * add dynamic manifest instead of local datasource types * add version attr * remove unused code * add version * rename extension(s) -> plugins(s) * add test connection method * feat: add marketplace listing page * Add install plugin cmd + missing attrs {name, repo, desc} to plugin * add missing icon * - Add npm workspaces for marketplace monorepo - Added cassandra datasource plugin - Created upload to s3 script - Created plugins.json entry file * install plugin from s3 bucket * cleanup * update pkg locks * fix icon render * cleanup * marketplace changes * ui changes * operations file load fix + revert vm2 * update module from string to 3.2.1 * load plugins.json from local file instead of remote * install plugin from local file if not production environment * add sqlite * feat: add plivo api plugin * exp: add heroku 22 stack * update assets include path * Revert "exp: add heroku 22 stack" This reverts commit a8926b36e116fb76cd3b6d0aa41778779c9273c8. * add integrations link * Add casl ability for plugin * load host from env else fallback to default * update imports * remove sqlite * typo * add marketplace flag to cli command * move ts and ncc to devDep * add hygen templates for marketplace * cli tree-node path fix * template indent fix * TOOLJET_URL -> MARKETPLACE_TOOLJET_URL * add tests * refactor: move to plugins.helper for get-service helper utility * fix; typo * update package-lock.json * review changes * remove a href * remove bg color + redirect issue due to href * add test url * fix crash on search * remove extra slash * feat: allow plugin to be installed from github repository * remove unwanted args from cli command * add repo attr while save * feat: add feature toggle for marketplace feature * fix: make default config as false * chore: remove hyperlink * fix: failing build * chore: update s3 url to point to prod * fix failing test * fix test * fix: test case * update module from string pkg * update env * fix test * fix test * add readme file * Update README.md Co-authored-by: Akshay Sasidharan <akshaysasidharan93@gmail.com>
2022-10-27 11:29:43 +00:00
if (marketplace) {
await execa('npm', ['run', 'build', '--workspaces'], { cwd: pluginsPath });
} else {
await execa.command('npm run build:plugins', { cwd: process.cwd() });
}
CliUx.ux.action.stop();
}
const tree = CliUx.ux.tree();
[Feature] Make plugins installable (#3069) * feat: add user avatar * update: @nest/platform-express from 8.0.0 to 8.4.4 * add avatar_id in login response * add user avatar upload in frontend * align cross divider with layout icons' * generate nest model - extensions * Add extensions module * Add extension to datasouce * add not implemented check * create extension * refactor * cleanup * fix tests * reduce the avatar size on homepage * poc: run js code from string * resolve conflicts * fix conflicts * add globals * add new route * add icon, manifest file upload * complete user flow * add flow for data queries * add dynamic manifest instead of local datasource types * add version attr * remove unused code * add version * rename extension(s) -> plugins(s) * add test connection method * feat: add marketplace listing page * Add install plugin cmd + missing attrs {name, repo, desc} to plugin * add missing icon * - Add npm workspaces for marketplace monorepo - Added cassandra datasource plugin - Created upload to s3 script - Created plugins.json entry file * install plugin from s3 bucket * cleanup * update pkg locks * fix icon render * cleanup * marketplace changes * ui changes * operations file load fix + revert vm2 * update module from string to 3.2.1 * load plugins.json from local file instead of remote * install plugin from local file if not production environment * add sqlite * feat: add plivo api plugin * exp: add heroku 22 stack * update assets include path * Revert "exp: add heroku 22 stack" This reverts commit a8926b36e116fb76cd3b6d0aa41778779c9273c8. * add integrations link * Add casl ability for plugin * load host from env else fallback to default * update imports * remove sqlite * typo * add marketplace flag to cli command * move ts and ncc to devDep * add hygen templates for marketplace * cli tree-node path fix * template indent fix * TOOLJET_URL -> MARKETPLACE_TOOLJET_URL * add tests * refactor: move to plugins.helper for get-service helper utility * fix; typo * update package-lock.json * review changes * remove a href * remove bg color + redirect issue due to href * add test url * fix crash on search * remove extra slash * feat: allow plugin to be installed from github repository * remove unwanted args from cli command * add repo attr while save * feat: add feature toggle for marketplace feature * fix: make default config as false * chore: remove hyperlink * fix: failing build * chore: update s3 url to point to prod * fix failing test * fix test * fix: test case * update module from string pkg * update env * fix test * fix test * add readme file * Update README.md Co-authored-by: Akshay Sasidharan <akshaysasidharan93@gmail.com>
2022-10-27 11:29:43 +00:00
tree.insert(pluginsPath);
const subtree = CliUx.ux.tree();
subtree.insert(`${args.plugin_name}`);
[Feature] Make plugins installable (#3069) * feat: add user avatar * update: @nest/platform-express from 8.0.0 to 8.4.4 * add avatar_id in login response * add user avatar upload in frontend * align cross divider with layout icons' * generate nest model - extensions * Add extensions module * Add extension to datasouce * add not implemented check * create extension * refactor * cleanup * fix tests * reduce the avatar size on homepage * poc: run js code from string * resolve conflicts * fix conflicts * add globals * add new route * add icon, manifest file upload * complete user flow * add flow for data queries * add dynamic manifest instead of local datasource types * add version attr * remove unused code * add version * rename extension(s) -> plugins(s) * add test connection method * feat: add marketplace listing page * Add install plugin cmd + missing attrs {name, repo, desc} to plugin * add missing icon * - Add npm workspaces for marketplace monorepo - Added cassandra datasource plugin - Created upload to s3 script - Created plugins.json entry file * install plugin from s3 bucket * cleanup * update pkg locks * fix icon render * cleanup * marketplace changes * ui changes * operations file load fix + revert vm2 * update module from string to 3.2.1 * load plugins.json from local file instead of remote * install plugin from local file if not production environment * add sqlite * feat: add plivo api plugin * exp: add heroku 22 stack * update assets include path * Revert "exp: add heroku 22 stack" This reverts commit a8926b36e116fb76cd3b6d0aa41778779c9273c8. * add integrations link * Add casl ability for plugin * load host from env else fallback to default * update imports * remove sqlite * typo * add marketplace flag to cli command * move ts and ncc to devDep * add hygen templates for marketplace * cli tree-node path fix * template indent fix * TOOLJET_URL -> MARKETPLACE_TOOLJET_URL * add tests * refactor: move to plugins.helper for get-service helper utility * fix; typo * update package-lock.json * review changes * remove a href * remove bg color + redirect issue due to href * add test url * fix crash on search * remove extra slash * feat: allow plugin to be installed from github repository * remove unwanted args from cli command * add repo attr while save * feat: add feature toggle for marketplace feature * fix: make default config as false * chore: remove hyperlink * fix: failing build * chore: update s3 url to point to prod * fix failing test * fix test * fix: test case * update module from string pkg * update env * fix test * fix test * add readme file * Update README.md Co-authored-by: Akshay Sasidharan <akshaysasidharan93@gmail.com>
2022-10-27 11:29:43 +00:00
tree.nodes[pluginsPath].insert(marketplace ? 'plugins' : 'packages', subtree);
tree.display();
}
}