fix(all): Fixes #399 tabs missing from JS output.
This commit is contained in:
parent
2dc6e327e8
commit
c23f025d6a
2 changed files with 157 additions and 151 deletions
|
@ -121,6 +121,7 @@
|
|||
"ibm-watson": "7.1.2",
|
||||
"join-images-updated": "1.1.4",
|
||||
"js-md5": "0.8.3",
|
||||
"just-indent": "0.0.1",
|
||||
"keyv": "4.5.2",
|
||||
"koa": "2.13.4",
|
||||
"koa-body": "6.0.1",
|
||||
|
|
|
@ -32,8 +32,9 @@
|
|||
|
||||
'use strict';
|
||||
|
||||
import { GBMinInstance, GBService, IGBCoreService, GBDialogStep, GBLog, GBError } from 'botlib';
|
||||
import { GBMinInstance, GBService, IGBCoreService, GBLog } from 'botlib';
|
||||
import * as Fs from 'fs';
|
||||
import * as ji from 'just-indent'
|
||||
import { GBServer } from '../../../src/app.js';
|
||||
import { GBDeployer } from '../../core.gbapp/services/GBDeployer.js';
|
||||
import { CollectionUtil } from 'pragmatismo-io-framework';
|
||||
|
@ -52,10 +53,9 @@ import { KeywordsExpressions } from './KeywordsExpressions.js';
|
|||
import { GBLogEx } from '../../core.gbapp/services/GBLogEx.js';
|
||||
import { GuaribasUser } from '../../security.gbapp/models/index.js';
|
||||
import { SystemKeywords } from './SystemKeywords.js';
|
||||
import lineReplace from 'line-replace';
|
||||
import { Sequelize, DataTypes, QueryTypes } from '@sequelize/core';
|
||||
import { table } from 'console';
|
||||
import { SequelizeOptions } from 'sequelize-typescript';
|
||||
import { Sequelize, QueryTypes } from '@sequelize/core';
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @fileoverview Decision was to priorize security(isolation) and debugging,
|
||||
|
@ -632,10 +632,8 @@ export class GBVMService extends GBService {
|
|||
};
|
||||
|
||||
try{
|
||||
|
||||
await ensureTokens(true);
|
||||
|
||||
${code} // ISSUE: #339, tabify this.
|
||||
${ code }
|
||||
}
|
||||
catch(e){
|
||||
console.log(e);
|
||||
|
@ -646,11 +644,12 @@ export class GBVMService extends GBService {
|
|||
|
||||
await wa.closeHandles({pid: pid});
|
||||
await sys.closeHandles({pid: pid});
|
||||
|
||||
}
|
||||
|
||||
})();
|
||||
`;
|
||||
|
||||
code = ji.default(code, ' ');
|
||||
|
||||
Fs.writeFileSync(jsfile, code);
|
||||
GBLogEx.info(min, `[GBVMService] Finished loading of ${filename}, JavaScript from Word: \n ${code}`);
|
||||
|
||||
|
@ -800,6 +799,8 @@ export class GBVMService extends GBService {
|
|||
let fields = {};
|
||||
let tables = [];
|
||||
|
||||
const outputLines = [];
|
||||
let emmitIndex = 1;
|
||||
for (let i = 1; i <= lines.length; i++) {
|
||||
|
||||
let line = lines[i - 1];
|
||||
|
@ -866,8 +867,12 @@ export class GBVMService extends GBService {
|
|||
|
||||
let add = emmit ? line.split(/\r\n|\r|\n/).length : 0;
|
||||
current = current + (add ? add : 0);
|
||||
map[i] = current;
|
||||
lines[i - 1] = emmit ? line : '';
|
||||
|
||||
if (emmit){
|
||||
emmitIndex ++;
|
||||
map[emmitIndex] = current;
|
||||
outputLines[emmitIndex - 1] = line;
|
||||
}
|
||||
}
|
||||
|
||||
if (tables) {
|
||||
|
@ -877,7 +882,7 @@ export class GBVMService extends GBService {
|
|||
|
||||
}
|
||||
|
||||
code = `${lines.join('\n')}\n`;
|
||||
code = `${outputLines.join('\n')}\n`;
|
||||
|
||||
let metadata = GBVMService.getMetadata(mainName, properties, description);
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue