From a718834830e0b53d6e194275f847dd4841243802 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sun, 1 Feb 2026 11:57:20 +0000 Subject: [PATCH 1/9] Initial plan From ef7d5736502d3654f6a8c44ce05c09dceb9c0b13 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sun, 1 Feb 2026 12:06:14 +0000 Subject: [PATCH 2/9] feat: add GPTVis syntax parser and integration Co-authored-by: hustcc <7856674+hustcc@users.noreply.github.com> --- .github/workflows/ci.yml | 14 + package.json | 3 + playground/index.html | 10 + playground/syntax-demo.html | 280 ++++++++++ playground/syntax-demo.ts | 101 ++++ src/ai/__tests__/integration.test.ts | 71 +++ src/ai/__tests__/parser.test.ts | 746 +++++++++++++++++++++++++++ src/ai/index.ts | 2 + src/ai/parser.ts | 298 +++++++++++ src/gpt-vis/index.ts | 41 +- src/index.ts | 2 + vitest.config.ts | 9 + 12 files changed, 1573 insertions(+), 4 deletions(-) create mode 100644 playground/syntax-demo.html create mode 100644 playground/syntax-demo.ts create mode 100644 src/ai/__tests__/integration.test.ts create mode 100644 src/ai/__tests__/parser.test.ts create mode 100644 src/ai/index.ts create mode 100644 src/ai/parser.ts create mode 100644 vitest.config.ts diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 75bfc9f2..0deca803 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -43,6 +43,20 @@ jobs: - name: Lint run: pnpm lint:ts + unit-test: + runs-on: ubuntu-latest + strategy: + matrix: + node-version: [18.x] + steps: + - uses: actions/checkout@v4 + - name: Install dependencies + uses: ./.github/actions/prepare-install + with: + node-version: ${{ matrix.node-version }} + - name: Run unit tests + run: pnpm test + ssr-test: runs-on: ubuntu-latest if: github.base_ref != 'ai' diff --git a/package.json b/package.json index 6426728b..f2042c1a 100644 --- a/package.json +++ b/package.json @@ -42,6 +42,8 @@ "format": "prettier './**/*.{ts,tsx,js,jsx,json,md,css,less}' --write", "lint:ts": "eslint src/**", "lint:ts-fix": "pnpm lint:ts --fix", + "test": "vitest run", + "test:watch": "vitest", "test:size": "pnpm build && limit-size", "changeset": "changeset add", "publish-version": "changeset version", @@ -82,6 +84,7 @@ "ts-node": "^10.9.2", "typescript": "^5.9.3", "typescript-eslint": "^8.46.1", + "vitest": "^4.0.18", "webpack-bundle-analyzer": "^4.10.2" }, "engines": { diff --git a/playground/index.html b/playground/index.html index 79c0a86d..ec0ef092 100644 --- a/playground/index.html +++ b/playground/index.html @@ -155,6 +155,16 @@

Wrapper Feature Demo

New Feature + + +
📝
+

Vis Syntax Demo

+

+ Explore the new markdown-like syntax for chart configurations. + Reduced token usage for LLM outputs with better error tolerance. +

+ New Feature +