Open Source Wealth Management Software. Angular + NestJS + Prisma + Nx + TypeScript 🤍
TypeScript angularetffinancefintechghostfoliohacktoberfestinvestingnestjsosspersonal-financeportfolioprismasoftwarestocktrackertradingtypescriptwealth-managementweb
Task/migrate tablemark to v4 (#5809)
David Requeno1f6b061ab006
diff --git a/CHANGELOG.md b/CHANGELOG.mdindex 0418331eaa..09d836e9a3 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -16,6 +16,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0- Localized the number formatting in the static portfolio analysis rule: _Liquidity_ (Buying Power)- Moved the _Prisma Configuration File_ from `prisma.config.ts` to `.config/prisma.ts`- Upgraded `prisma` from version `6.17.1` to `6.18.0`+- Upgraded `tablemark` from version `3.1.0` to `4.1.0`### Fixeddiff --git a/apps/api/src/app/endpoints/ai/ai.service.ts b/apps/api/src/app/endpoints/ai/ai.service.tsindex d1e1b413f0..4cc4fde655 100644--- a/apps/api/src/app/endpoints/ai/ai.service.ts+++ b/apps/api/src/app/endpoints/ai/ai.service.ts@@ -10,7 +10,7 @@ import type { AiPromptMode } from '@ghostfolio/common/types';import { Injectable } from '@nestjs/common';import { createOpenRouter } from '@openrouter/ai-sdk-provider';import { generateText } from 'ai';-import tablemark, { ColumnDescriptor } from 'tablemark';+import type { ColumnDescriptor } from 'tablemark';@Injectable()export class AiService {@@ -92,6 +92,13 @@ export class AiService {});+ // Dynamic import to load ESM module from CommonJS context+ // eslint-disable-next-line @typescript-eslint/no-implied-eval+ const dynamicImport = new Function('s', 'return import(s)') as (+ s: string+ ) => Promise<typeof import('tablemark')>;+ const { tablemark } = await dynamicImport('tablemark');+const holdingsTableString = tablemark(holdingsTableRows, {columns: holdingsTableColumns});diff --git a/package-lock.json b/package-lock.jsonindex 7889faa15f..d460624338 100644--- a/package-lock.json+++ b/package-lock.json@@ -92,7 +92,7 @@"rxjs": "7.8.1","stripe": "18.5.0","svgmap": "2.12.2",- "tablemark": "3.1.0",+ "tablemark": "4.1.0","twitter-api-v2": "1.23.0","uuid": "11.1.0","yahoo-finance2": "3.10.0",@@ -17595,6 +17595,12 @@"node": ">=8"}},+ "node_modules/change-case": {+ "version": "5.4.4",+ "resolved": "https://registry.npmjs.org/change-case/-/change-case-5.4.4.tgz",+ "integrity": "sha512-HRQyTk2/YPEkt9TnUPbOpr64Uw3KOicFWPVBb+xiHvd6eBx/qPr9xqfBFDT8P2vWsvvz4jbEkfDe71W3VyNu2w==",+ "license": "MIT"+ },"node_modules/char-regex": {"version": "1.0.2","resolved": "https://registry.npmjs.org/char-regex/-/char-regex-1.0.2.tgz",@@ -23695,15 +23701,6 @@"node": ">= 0.4"}},- "node_modules/get-stdin": {- "version": "5.0.1",- "resolved": "https://registry.npmjs.org/get-stdin/-/get-stdin-5.0.1.tgz",- "integrity": "sha512-jZV7n6jGE3Gt7fgSTJoz91Ak5MuTLwMwkoYdjxuJ/AmjIsE1UC03y/IWkZCQGEvVNS9qoRNwy5BCqxImv0FVeA==",- "license": "MIT",- "engines": {- "node": ">=0.12.0"- }- },"node_modules/get-stream": {"version": "5.2.0","resolved": "https://registry.npmjs.org/get-stream/-/get-stream-5.2.0.tgz",@@ -32021,6 +32018,7 @@"version": "2.0.2","resolved": "https://registry.npmjs.org/lower-case/-/lower-case-2.0.2.tgz","integrity": "sha512-7fm3l3NAF9WfN6W3JOmf5drwpVqX78JtoGJ3A6W0a6ZnldM41w2fV5D490psKFTpMds8TJse/eHLFFsNHHjHgg==",+ "dev": true,"license": "MIT","dependencies": {"tslib": "^2.0.3"@@ -32924,6 +32922,7 @@"version": "3.0.4","resolved": "https://registry.npmjs.org/no-case/-/no-case-3.0.4.tgz","integrity": "sha512-fgAN3jGAh+RoxUGZHTSOLJIqUc2wmoBwGR4tbpNAKmmovFoWq0OdRkb0VkldReO2a2iBT/OEulG9XSUc10r3zg==",+ "dev": true,"license": "MIT","dependencies": {"lower-case": "^2.0.2",@@ -37691,17 +37690,6 @@"integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==","license": "MIT"},- "node_modules/sentence-case": {- "version": "3.0.4",- "resolved": "https://registry.npmjs.org/sentence-case/-/sentence-case-3.0.4.tgz",- "integrity": "sha512-8LS0JInaQMCRoQ7YUytAo/xUu5W2XnQxV2HI/6uM6U7CITS1RqPElr30V6uIqyMKM9lJGRVFy5/4CuzcixNYSg==",- "license": "MIT",- "dependencies": {- "no-case": "^3.0.4",- "tslib": "^2.0.3",- "upper-case-first": "^2.0.2"- }- },"node_modules/serialize-javascript": {"version": "6.0.2","resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-6.0.2.tgz",@@ -38351,19 +38339,6 @@"wbuf": "^1.7.3"}},- "node_modules/split-text-to-chunks": {- "version": "1.0.0",- "resolved": "https://registry.npmjs.org/split-text-to-chunks/-/split-text-to-chunks-1.0.0.tgz",- "integrity": "sha512-HLtEwXK/T4l7QZSJ/kOSsZC0o5e2Xg3GzKKFxm0ZexJXw0Bo4CaEl39l7MCSRHk9EOOL5jT8JIDjmhTtcoe6lQ==",- "license": "MIT",- "dependencies": {- "get-stdin": "^5.0.1",- "minimist": "^1.2.0"- },- "bin": {- "wordwrap": "cli.js"- }- },"node_modules/sprintf-js": {"version": "1.1.3","resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.1.3.tgz",@@ -39133,16 +39108,114 @@}},"node_modules/tablemark": {- "version": "3.1.0",- "resolved": "https://registry.npmjs.org/tablemark/-/tablemark-3.1.0.tgz",- "integrity": "sha512-IwO6f0SEzp1Z+zqz/7ANUmeEac4gaNlknWyj/S9aSg11wZmWYnLeyI/xXvEOU88BYUIf8y30y0wxB58xIKrVlQ==",+ "version": "4.1.0",+ "resolved": "https://registry.npmjs.org/tablemark/-/tablemark-4.1.0.tgz",+ "integrity": "sha512-B3LDjbDo+ac+D5RwkBOPZZ6ua8716KdT+6NO3DKOCHJq0ezE6vV2r92rjrC1ci2H+ocuysl5ytf1T0QqV65yoA==","license": "MIT","dependencies": {- "sentence-case": "^3.0.4",- "split-text-to-chunks": "^1.0.0"+ "ansi-regex": "^6.2.2",+ "change-case": "^5.4.4",+ "string-width": "^8.1.0",+ "wordwrapjs": "^5.1.0",+ "wrap-ansi": "^9.0.2"},"engines": {- "node": ">=14.16"+ "node": ">=20"+ }+ },+ "node_modules/tablemark/node_modules/ansi-regex": {+ "version": "6.2.2",+ "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.2.2.tgz",+ "integrity": "sha512-Bq3SmSpyFHaWjPk8If9yc6svM8c56dB5BAtW4Qbw5jHTwwXXcTLoRMkpDJp6VL0XzlWaCHTXrkFURMYmD0sLqg==",+ "license": "MIT",+ "engines": {+ "node": ">=12"+ },+ "funding": {+ "url": "https://github.com/chalk/ansi-regex?sponsor=1"+ }+ },+ "node_modules/tablemark/node_modules/ansi-styles": {+ "version": "6.2.3",+ "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-6.2.3.tgz",+ "integrity": "sha512-4Dj6M28JB+oAH8kFkTLUo+a2jwOFkuqb3yucU0CANcRRUbxS0cP0nZYCGjcc3BNXwRIsUVmDGgzawme7zvJHvg==",+ "license": "MIT",+ "engines": {+ "node": ">=12"+ },+ "funding": {+ "url": "https://github.com/chalk/ansi-styles?sponsor=1"+ }+ },+ "node_modules/tablemark/node_modules/emoji-regex": {+ "version": "10.6.0",+ "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-10.6.0.tgz",+ "integrity": "sha512-toUI84YS5YmxW219erniWD0CIVOo46xGKColeNQRgOzDorgBi1v4D71/OFzgD9GO2UGKIv1C3Sp8DAn0+j5w7A==",+ "license": "MIT"+ },+ "node_modules/tablemark/node_modules/string-width": {+ "version": "8.1.0",+ "resolved": "https://registry.npmjs.org/string-width/-/string-width-8.1.0.tgz",+ "integrity": "sha512-Kxl3KJGb/gxkaUMOjRsQ8IrXiGW75O4E3RPjFIINOVH8AMl2SQ/yWdTzWwF3FevIX9LcMAjJW+GRwAlAbTSXdg==",+ "license": "MIT",+ "dependencies": {+ "get-east-asian-width": "^1.3.0",+ "strip-ansi": "^7.1.0"+ },+ "engines": {+ "node": ">=20"+ },+ "funding": {+ "url": "https://github.com/sponsors/sindresorhus"+ }+ },+ "node_modules/tablemark/node_modules/strip-ansi": {+ "version": "7.1.2",+ "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.2.tgz",+ "integrity": "sha512-gmBGslpoQJtgnMAvOVqGZpEz9dyoKTCzy2nfz/n8aIFhN/jCE/rCmcxabB6jOOHV+0WNnylOxaxBQPSvcWklhA==",+ "license": "MIT",+ "dependencies": {+ "ansi-regex": "^6.0.1"+ },+ "engines": {+ "node": ">=12"+ },+ "funding": {+ "url": "https://github.com/chalk/strip-ansi?sponsor=1"+ }+ },+ "node_modules/tablemark/node_modules/wrap-ansi": {+ "version": "9.0.2",+ "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-9.0.2.tgz",+ "integrity": "sha512-42AtmgqjV+X1VpdOfyTGOYRi0/zsoLqtXQckTmqTeybT+BDIbM/Guxo7x3pE2vtpr1ok6xRqM9OpBe+Jyoqyww==",+ "license": "MIT",+ "dependencies": {+ "ansi-styles": "^6.2.1",+ "string-width": "^7.0.0",+ "strip-ansi": "^7.1.0"+ },+ "engines": {+ "node": ">=18"+ },+ "funding": {+ "url": "https://github.com/chalk/wrap-ansi?sponsor=1"+ }+ },+ "node_modules/tablemark/node_modules/wrap-ansi/node_modules/string-width": {+ "version": "7.2.0",+ "resolved": "https://registry.npmjs.org/string-width/-/string-width-7.2.0.tgz",+ "integrity": "sha512-tsaTIkKW9b4N+AEj+SVA+WhJzV7/zMhcSu78mLKWSk7cXMOSHsBKFWUs0fWwq8QyK3MgJBQRX6Gbi4kYbdvGkQ==",+ "license": "MIT",+ "dependencies": {+ "emoji-regex": "^10.3.0",+ "get-east-asian-width": "^1.0.0",+ "strip-ansi": "^7.1.0"+ },+ "engines": {+ "node": ">=18"+ },+ "funding": {+ "url": "https://github.com/sponsors/sindresorhus"}},"node_modules/tapable": {@@ -40624,15 +40697,6 @@"browserslist": ">= 4.21.0"}},- "node_modules/upper-case-first": {- "version": "2.0.2",- "resolved": "https://registry.npmjs.org/upper-case-first/-/upper-case-first-2.0.2.tgz",- "integrity": "sha512-514ppYHBaKwfJRK/pNC6c/OxfGa0obSnAl106u97Ed0I625Nin96KAjttZF6ZL3e1XLtphxnqrOi9iWgm+u+bg==",- "license": "MIT",- "dependencies": {- "tslib": "^2.0.3"- }- },"node_modules/uri-js": {"version": "4.4.1","resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz",@@ -42036,6 +42100,15 @@"node": ">=0.10.0"}},+ "node_modules/wordwrapjs": {+ "version": "5.1.1",+ "resolved": "https://registry.npmjs.org/wordwrapjs/-/wordwrapjs-5.1.1.tgz",+ "integrity": "sha512-0yweIbkINJodk27gX9LBGMzyQdBDan3s/dEAiwBOj+Mf0PPyWL6/rikalkv8EeD0E8jm4o5RXEOrFTP3NXbhJg==",+ "license": "MIT",+ "engines": {+ "node": ">=12.17"+ }+ },"node_modules/wrap-ansi": {"version": "6.2.0","resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-6.2.0.tgz",diff --git a/package.json b/package.jsonindex 7cedd68bf3..dd31075cc0 100644--- a/package.json+++ b/package.json@@ -138,7 +138,7 @@"rxjs": "7.8.1","stripe": "18.5.0","svgmap": "2.12.2",- "tablemark": "3.1.0",+ "tablemark": "4.1.0","twitter-api-v2": "1.23.0","uuid": "11.1.0","yahoo-finance2": "3.10.0",