diff --git a/dist/modules/app/AppController.js b/dist/modules/app/AppController.js index f43bce45..92a78772 100644 --- a/dist/modules/app/AppController.js +++ b/dist/modules/app/AppController.js @@ -9,6 +9,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge }); }; Object.defineProperty(exports, "__esModule", { value: true }); +exports.AppController = void 0; const fs_1 = require("fs"); const path_1 = require("path"); const util_1 = require("util"); @@ -229,10 +230,10 @@ class AppController { hasErrors = true; this.showException(err, options, cli); } - for (let file of files) { + for (let file of files || []) { cli.newLine(cli.symbolSuccess, 'Generated script', cli.colorHighlight(file)); } - for (let err of errors) { + for (let err of errors || []) { // cli.newLine( cli.symbolError, err.message ); this.showException(err, options, cli); } diff --git a/dist/modules/plugin/PluginController.js b/dist/modules/plugin/PluginController.js index 5b89449e..12c11f60 100644 --- a/dist/modules/plugin/PluginController.js +++ b/dist/modules/plugin/PluginController.js @@ -9,6 +9,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge }); }; Object.defineProperty(exports, "__esModule", { value: true }); +exports.PluginController = void 0; const PluginDrawer_1 = require("./PluginDrawer"); const PluginManager_1 = require("./PluginManager"); const PackageBasedPluginFinder_1 = require("./PackageBasedPluginFinder"); diff --git a/dist/modules/plugin/PluginManager.js b/dist/modules/plugin/PluginManager.js index 82509a0d..d6ce7026 100644 --- a/dist/modules/plugin/PluginManager.js +++ b/dist/modules/plugin/PluginManager.js @@ -9,12 +9,13 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge }); }; Object.defineProperty(exports, "__esModule", { value: true }); +exports.PluginManager = void 0; const childProcess = require("child_process"); -const inquirer = require("inquirer"); const fs = require("fs"); +const inquirer = require("inquirer"); const path_1 = require("path"); -const PluginData_1 = require("./PluginData"); const read_file_1 = require("../util/read-file"); +const PluginData_1 = require("./PluginData"); /** * Plug-in manager * @@ -103,7 +104,8 @@ class PluginManager { } // Install the plug-in as a DEVELOPMENT dependency using NPM const PACKAGE_MANAGER = 'NPM'; - const INSTALL_DEV_CMD = 'npm install --save-dev ' + name + ' --color=always'; + // App @1 to install only plugins compatible with Concordia 1.x + const INSTALL_DEV_CMD = 'npm install --save-dev ' + name + '@1 --no-fund --no-audit --loglevel error --color=always'; drawer.showMessageTryingToInstall(name, PACKAGE_MANAGER); const code = yield this.runCommand(INSTALL_DEV_CMD); drawer.showCommandCode(code, false); @@ -130,7 +132,7 @@ class PluginManager { } // Remove with a package manager drawer.showMessageTryingToUninstall(name, 'NPM'); - let code = yield this.runCommand('npm uninstall --save-dev ' + name + ' --color=always'); + let code = yield this.runCommand('npm uninstall --save-dev ' + name + ' --no-fund --no-audit --color=always'); drawer.showCommandCode(code); }); } diff --git a/modules/app/AppController.ts b/modules/app/AppController.ts index 0e901008..300917c2 100644 --- a/modules/app/AppController.ts +++ b/modules/app/AppController.ts @@ -262,11 +262,11 @@ export class AppController { this.showException( err, options, cli ); } - for ( let file of files ) { + for ( let file of files || [] ) { cli.newLine( cli.symbolSuccess, 'Generated script', cli.colorHighlight( file ) ); } - for ( let err of errors ) { + for ( let err of errors || [] ) { // cli.newLine( cli.symbolError, err.message ); this.showException( err, options, cli ); } @@ -355,4 +355,4 @@ export class AppController { return "\n DETAILS: " + err.stack.substring( err.stack.indexOf( "\n" ) ); } -} \ No newline at end of file +} diff --git a/modules/dbi/DatabaseInterface.ts b/modules/dbi/DatabaseInterface.ts index 3b7b2db7..a7c6659d 100644 --- a/modules/dbi/DatabaseInterface.ts +++ b/modules/dbi/DatabaseInterface.ts @@ -1,6 +1,6 @@ import { Database } from "../ast/Database"; import { Queryable } from "./Queryable"; -import { Table } from "modules/ast"; +import { Table } from "../ast/Table"; /** * Database interface @@ -56,4 +56,4 @@ export interface DatabaseInterface extends Queryable { /// @see more methods in Queryable -} \ No newline at end of file +} diff --git a/modules/plugin/PluginController.ts b/modules/plugin/PluginController.ts index 31fffb67..822ac02a 100644 --- a/modules/plugin/PluginController.ts +++ b/modules/plugin/PluginController.ts @@ -79,4 +79,4 @@ export class PluginController { return true; }; -} \ No newline at end of file +} diff --git a/modules/plugin/PluginManager.ts b/modules/plugin/PluginManager.ts index b08adc25..09eefbaa 100644 --- a/modules/plugin/PluginManager.ts +++ b/modules/plugin/PluginManager.ts @@ -1,13 +1,14 @@ import * as childProcess from 'child_process'; -import * as inquirer from 'inquirer'; +import { Plugin } from 'concordialang-plugin'; import * as fs from 'fs'; +import * as inquirer from 'inquirer'; import { join } from 'path'; -import { Plugin } from "concordialang-plugin"; -import { CLI } from 'modules/app/CLI'; -import { PluginData, PLUGIN_PREFIX } from "./PluginData"; -import { PluginDrawer } from "./PluginDrawer"; -import { PluginFinder } from "./PluginFinder"; + +import { CLI } from '../app/CLI'; import { readFileAsync } from '../util/read-file'; +import { PLUGIN_PREFIX, PluginData } from './PluginData'; +import { PluginDrawer } from './PluginDrawer'; +import { PluginFinder } from './PluginFinder'; /** * Plug-in manager @@ -122,8 +123,9 @@ export class PluginManager { // Install the plug-in as a DEVELOPMENT dependency using NPM - const PACKAGE_MANAGER = 'NPM'; - const INSTALL_DEV_CMD = 'npm install --save-dev ' + name + ' --color=always'; + const PACKAGE_MANAGER = 'NPM'; + // App @1 to install only plugins compatible with Concordia 1.x + const INSTALL_DEV_CMD = 'npm install --save-dev ' + name + '@1 --no-fund --no-audit --loglevel error --color=always'; drawer.showMessageTryingToInstall( name, PACKAGE_MANAGER ); const code: number = await this.runCommand( INSTALL_DEV_CMD ); @@ -156,7 +158,7 @@ export class PluginManager { // Remove with a package manager drawer.showMessageTryingToUninstall( name, 'NPM' ); - let code: number = await this.runCommand( 'npm uninstall --save-dev ' + name + ' --color=always' ); + let code: number = await this.runCommand( 'npm uninstall --save-dev ' + name + ' --no-fund --no-audit --color=always' ); drawer.showCommandCode( code ); } @@ -255,4 +257,4 @@ export class PluginManager { return new context[ className ]( ... args ); } -} \ No newline at end of file +}