diff --git a/packages/tooling/openmrs/package.json b/packages/tooling/openmrs/package.json index 2a0d05064..6707c7f18 100644 --- a/packages/tooling/openmrs/package.json +++ b/packages/tooling/openmrs/package.json @@ -37,6 +37,7 @@ "autoprefixer": "^10.4.2", "axios": "^0.21.1", "browserslist-config-openmrs": "^1.0.1", + "chalk": "^4.1.2", "copy-webpack-plugin": "^11.0.0", "cssnano": "^5.0.16", "ejs": "^3.1.8", diff --git a/packages/tooling/openmrs/src/utils/importmap.ts b/packages/tooling/openmrs/src/utils/importmap.ts index 9be019194..ca44014b4 100644 --- a/packages/tooling/openmrs/src/utils/importmap.ts +++ b/packages/tooling/openmrs/src/utils/importmap.ts @@ -1,13 +1,12 @@ -import { URL } from "url"; -import { basename, resolve } from "path"; -import { existsSync, readFileSync } from "fs"; +import axios from "axios"; +import glob from "glob"; +import { URL } from "node:url"; +import { basename, resolve } from "node:path"; +import { existsSync, readFileSync } from "node:fs"; import { exec } from "child_process"; import { logFail, logInfo, logWarn } from "./logger"; import { startWebpack } from "./webpack"; import { getMainBundle, getAppRoutes } from "./dependencies"; -import axios from "axios"; - -import glob = require("glob"); async function readImportmap(path: string, backend?: string, spaPath?: string) { if (path.startsWith("http://") || path.startsWith("https://")) { diff --git a/packages/tooling/openmrs/src/utils/logger.ts b/packages/tooling/openmrs/src/utils/logger.ts index 7aaad2857..b00c7bb47 100644 --- a/packages/tooling/openmrs/src/utils/logger.ts +++ b/packages/tooling/openmrs/src/utils/logger.ts @@ -1,13 +1,14 @@ /* eslint-disable no-console */ +import chalk from "chalk"; export function logInfo(message: string) { - console.log(`[openmrs] ${message}`); + console.log(`${chalk.green.bold("[openmrs]")} ${message}`); } export function logWarn(message: string) { - console.warn(`[openmrs] ${message}`); + console.warn(`${chalk.yellow.bold("[openmrs]")} ${chalk.yellow(message)}`); } export function logFail(message: string) { - console.error(`[openmrs] ${message}`); + console.error(`${chalk.red.bold("[openmrs]")} ${chalk.red(message)}`); } diff --git a/packages/tooling/openmrs/tsconfig.json b/packages/tooling/openmrs/tsconfig.json index 1d817bbac..f67997665 100644 --- a/packages/tooling/openmrs/tsconfig.json +++ b/packages/tooling/openmrs/tsconfig.json @@ -2,15 +2,14 @@ "compilerOptions": { "esModuleInterop": true, "module": "CommonJS", - "target": "es2015", + "target": "ES2020", "allowSyntheticDefaultImports": true, "skipLibCheck": true, - "jsx": "react", "strictNullChecks": true, "moduleResolution": "node", "resolveJsonModule": true, "outDir": "dist", - "lib": ["es5", "es2015", "es2015.promise", "es2016.array.include", "es2018"] + "lib": ["es5", "es2020"] }, "include": ["src/**/*"] } diff --git a/yarn.lock b/yarn.lock index 9425be1ee..f9719c411 100644 --- a/yarn.lock +++ b/yarn.lock @@ -12675,6 +12675,7 @@ __metadata: autoprefixer: "npm:^10.4.2" axios: "npm:^0.21.1" browserslist-config-openmrs: "npm:^1.0.1" + chalk: "npm:^4.1.2" copy-webpack-plugin: "npm:^11.0.0" cssnano: "npm:^5.0.16" ejs: "npm:^3.1.8"