@global-torque/invest-core 0.2.4 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,10 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.3.0 candidate
4
+
5
+ - Require Node `^24.21.0`; Node 22 is no longer supported.
6
+ - Upgrade Markdown to 15 and retain typed table-plugin compatibility with Markdown 14 hosts.
7
+
3
8
  ## 0.2.4 candidate
4
9
 
5
10
  - Reissued the framework cohort for the dropdown SFC correction; core
package/package.json CHANGED
@@ -1,11 +1,11 @@
1
1
  {
2
2
  "name": "@global-torque/invest-core",
3
3
  "private": false,
4
- "version": "0.2.4",
4
+ "version": "0.3.0",
5
5
  "description": "Pure investment policy, calculations, formatters, and schema helpers.",
6
6
  "license": "MIT",
7
7
  "engines": {
8
- "node": ">=22.12.0"
8
+ "node": "^24.21.0"
9
9
  },
10
10
  "sideEffects": false,
11
11
  "type": "module",
@@ -67,17 +67,16 @@
67
67
  },
68
68
  "dependencies": {
69
69
  "@types/lodash": "^4.17.24",
70
- "@types/markdown-it": "^14.1.2",
70
+ "@global-torque/domain-types": "0.3.0",
71
71
  "ajv": "^8.20.0",
72
72
  "ajv-errors": "^3.0.0",
73
73
  "ajv-formats": "^3.0.1",
74
74
  "lodash": "^4.18.1",
75
- "markdown-it": "^14.3.0",
76
- "@global-torque/domain-types": "0.2.4"
75
+ "markdown-it": "^15.0.2"
77
76
  },
78
77
  "devDependencies": {
79
78
  "typescript": "^6.0.2",
80
- "vitest": "4.1.11"
79
+ "vitest": "5.0.1"
81
80
  },
82
81
  "files": [
83
82
  "src",
@@ -1,11 +1,20 @@
1
- import type MarkdownIt from 'markdown-it';
1
+ // The plugin forwards renderer arguments unchanged. Infer their types from the
2
+ // host so Markdown 14 and 15 can each retain their own token/options contracts.
3
+ interface TokenRenderer<Tokens, Options> {
4
+ renderToken(tokens: Tokens, idx: number, options: Options): string;
5
+ }
6
+ type TableRule<Tokens, Options, Env, Renderer> = (
7
+ tokens: Tokens, idx: number, options: Options, env: Env, self: Renderer,
8
+ ) => string;
2
9
 
3
10
  /**
4
11
  * Plugin to wrap tables in a div with overflow scrolling
5
12
  * This allows tables to be horizontally scrollable on smaller screens
6
13
  * Matches the VTable component's wrapper structure
7
14
  */
8
- export const tableWrap = (md: MarkdownIt): void => {
15
+ export const tableWrap = <Tokens, Options, Env, Renderer extends TokenRenderer<Tokens, Options>>(
16
+ md: { renderer: { rules: Record<string, TableRule<Tokens, Options, Env, Renderer> | undefined> } },
17
+ ): void => {
9
18
  // Store the original table renderers if they exist
10
19
  const defaultTableOpen = md.renderer.rules.table_open || ((tokens, idx, options, env, self) => {
11
20
  return self.renderToken(tokens, idx, options);
@@ -26,4 +35,3 @@ export const tableWrap = (md: MarkdownIt): void => {
26
35
  };
27
36
 
28
37
  export default tableWrap;
29
-