new(all): Node.js v22 and ts-node.
This commit is contained in:
parent
441dea2c22
commit
30994a3a28
7 changed files with 22 additions and 27 deletions
16
.vscode/launch.json
vendored
16
.vscode/launch.json
vendored
|
@ -5,25 +5,25 @@
|
|||
"type": "node",
|
||||
"request": "launch",
|
||||
"sourceMaps": true,
|
||||
"name": "Debug Program",
|
||||
"runtimeExecutable": "node",
|
||||
"name": "Debug Program with Nodemon",
|
||||
"runtimeExecutable": "npx",
|
||||
"runtimeArgs": ["nodemon", "--exec", "tsx"], // Use nodemon with tsx
|
||||
"program": "${workspaceRoot}/boot.mjs",
|
||||
"cwd": "${workspaceRoot}",
|
||||
"env": {
|
||||
"NODE_ENV": "development",
|
||||
"NODE_NO_WARNINGS":"1"
|
||||
"NODE_NO_WARNINGS": "1"
|
||||
},
|
||||
"args": [
|
||||
"--no-deprecation",
|
||||
"--loader ts-node/esm",
|
||||
"--require ${workspaceRoot}/suppress-node-warnings.cjs",
|
||||
"--require", "${workspaceRoot}/suppress-node-warnings.cjs"
|
||||
],
|
||||
"skipFiles": [
|
||||
"node_modules/**/*.js",
|
||||
"<node_internals>/**"
|
||||
],
|
||||
],
|
||||
"outFiles": [
|
||||
"${workspaceRoot}/dist/**/*.js"],
|
||||
"${workspaceRoot}/dist/**/*.js"
|
||||
],
|
||||
"stopOnEntry": false,
|
||||
"console": "integratedTerminal"
|
||||
}
|
||||
|
|
16
boot.mjs
16
boot.mjs
|
@ -6,8 +6,8 @@ import fs from 'fs/promises';
|
|||
import os from 'node:os';
|
||||
import path from 'path';
|
||||
import { exec } from 'child_process';
|
||||
import pjson from './package.json' assert { type: 'json' };
|
||||
import {GBUtil} from './dist/src/util.js'
|
||||
import pjson from './package.json';
|
||||
import {GBUtil} from './src/util.js'
|
||||
|
||||
// Displays version of Node JS being used at runtime and others attributes.
|
||||
|
||||
|
@ -22,19 +22,7 @@ try {
|
|||
});
|
||||
};
|
||||
var processDist = async () => {
|
||||
if (!await GBUtil.exists('dist')) {
|
||||
console.log(`\n`);
|
||||
console.log(`General Bots: Compiling...`);
|
||||
exec(path.join(__dirname, 'node_modules/.bin/tsc'), async (err, stdout, stderr) => {
|
||||
if (err) {
|
||||
console.error(err);
|
||||
return;
|
||||
}
|
||||
await run();
|
||||
});
|
||||
} else {
|
||||
await run();
|
||||
}
|
||||
};
|
||||
|
||||
// Installing modules if it has not been done yet.
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
{
|
||||
"name": "botserver",
|
||||
"version": "5.0.0",
|
||||
"type": "module",
|
||||
"description": "General Bot Community Edition open-core server.",
|
||||
"main": "./boot.mjs",
|
||||
"bugs": "https://github.com/pragmatismo-io/BotServer/issues",
|
||||
|
@ -15,7 +14,7 @@
|
|||
"Alan Perdomo <alanperdomo@hotmail.com>"
|
||||
],
|
||||
"engines": {
|
||||
"node": "=20.17.0"
|
||||
"node": "=22.9.0"
|
||||
},
|
||||
"license": "AGPL-3.0",
|
||||
"preferGlobal": true,
|
||||
|
@ -171,6 +170,7 @@
|
|||
"node-html-parser": "6.1.13",
|
||||
"node-nlp": "4.27.0",
|
||||
"node-tesseract-ocr": "2.2.1",
|
||||
"nodemon": "^3.1.7",
|
||||
"npm": "10.8.3",
|
||||
"open": "10.1.0",
|
||||
"open-docxtemplater-image-module": "1.0.3",
|
||||
|
@ -249,6 +249,7 @@
|
|||
"super-strong-password-generator-es": "2.0.2",
|
||||
"travis-deploy-once": "5.0.11",
|
||||
"tslint": "6.1.3",
|
||||
"tsx": "^4.19.1",
|
||||
"vitest": "2.0.5"
|
||||
},
|
||||
"eslintConfig": {
|
||||
|
|
5
packages/nodemon.json
Normal file
5
packages/nodemon.json
Normal file
|
@ -0,0 +1,5 @@
|
|||
{
|
||||
"watch": ["src", "packages"],
|
||||
"ext": "ts",
|
||||
"exec": "tsx"
|
||||
}
|
|
@ -380,7 +380,7 @@ function shutdown() {
|
|||
GBLogEx.info(0, 'General Bots API server closed.');
|
||||
process.exit(0);
|
||||
});
|
||||
|
||||
|
||||
});
|
||||
|
||||
}
|
||||
|
|
|
@ -31,7 +31,7 @@
|
|||
/**
|
||||
* @fileoverview General Bots local utility.
|
||||
*/
|
||||
|
||||
|
||||
'use strict';
|
||||
import * as YAML from 'yaml';
|
||||
import SwaggerClient from 'swagger-client';
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
{
|
||||
"compilerOptions": {
|
||||
"strict": false,
|
||||
"rootDir": "./",
|
||||
"strict": true,
|
||||
"allowJs": true,
|
||||
"downlevelIteration": true,
|
||||
"baseUrl": "./",
|
||||
|
|
Loading…
Add table
Reference in a new issue