Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v6

- uses: ./.github/actions/setup-bun

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/duplicate-issues.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
issues: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
uses: actions/checkout@v6
with:
fetch-depth: 1

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/format.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
contents: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
uses: actions/checkout@v6
with:
token: ${{ secrets.GITHUB_TOKEN }}

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/guidelines-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
pull-requests: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
uses: actions/checkout@v6
with:
fetch-depth: 1

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/opencode.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
issues: read
steps:
- name: Checkout repository
uses: actions/checkout@v4
uses: actions/checkout@v6

- name: Run opencode
uses: lacymorrow/opencode/github@latest
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/publish-github-action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v6
with:
fetch-depth: 0

Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/publish-lash.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:

steps:
- name: Checkout code
uses: actions/checkout@v4
uses: actions/checkout@v6

- name: Setup Bun
uses: oven-sh/setup-bun@v2
Expand All @@ -29,7 +29,7 @@ jobs:
go-version: '1.21'

- name: Setup Node.js
uses: actions/setup-node@v4
uses: actions/setup-node@v6
with:
node-version: '20'
registry-url: 'https://registry.npmjs.org'
Expand Down Expand Up @@ -57,7 +57,7 @@ jobs:

- name: Upload artifacts
if: github.event_name == 'release'
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v6
with:
name: lash-binaries
path: packages/opencode/dist/lash-cli-*.zip
Expand All @@ -69,7 +69,7 @@ jobs:

steps:
- name: Download artifacts
uses: actions/download-artifact@v4
uses: actions/download-artifact@v6
with:
name: lash-binaries

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/publish-vscode.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v6
with:
fetch-depth: 0

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v6
with:
fetch-depth: 0

Expand Down
16 changes: 8 additions & 8 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ jobs:
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v4
uses: actions/checkout@v6
with:
fetch-depth: 0

Expand Down Expand Up @@ -67,7 +67,7 @@ jobs:
fi

- name: Upload artifacts
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v6
with:
name: binary-${{ matrix.target }}
path: |
Expand All @@ -80,12 +80,12 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
uses: actions/checkout@v6
with:
fetch-depth: 0

- name: Download artifacts
uses: actions/download-artifact@v4
uses: actions/download-artifact@v6
with:
path: artifacts
pattern: binary-*
Expand Down Expand Up @@ -173,7 +173,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
uses: actions/checkout@v6
with:
fetch-depth: 0

Expand All @@ -183,7 +183,7 @@ jobs:
bun-version: 1.2.19

- name: Setup Node.js
uses: actions/setup-node@v4
uses: actions/setup-node@v6
with:
node-version: '20'
registry-url: 'https://registry.npmjs.org'
Expand Down Expand Up @@ -215,7 +215,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
uses: actions/checkout@v6
with:
fetch-depth: 0

Expand All @@ -230,7 +230,7 @@ jobs:
go build -o lash-tui

- name: Upload TUI artifact
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v6
with:
name: go-tui
path: packages/tui/lash-tui
2 changes: 1 addition & 1 deletion .github/workflows/snapshot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v6
with:
fetch-depth: 0

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/stats.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:

steps:
- name: Checkout
uses: actions/checkout@v4
uses: actions/checkout@v6

- name: Setup Bun
uses: ./.github/actions/setup-bun
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
uses: actions/checkout@v6
with:
token: ${{ secrets.GITHUB_TOKEN }}

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/typecheck.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
uses: actions/checkout@v6

- name: Setup Bun
uses: ./.github/actions/setup-bun
Expand Down
6 changes: 3 additions & 3 deletions packages/console/core/src/drizzle/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ export * from "drizzle-orm"
import { Client } from "@planetscale/database"

import { MySqlTransaction, type MySqlTransactionConfig } from "drizzle-orm/mysql-core"
import type { ExtractTablesWithRelations } from "drizzle-orm"
import type { EmptyRelations } from "drizzle-orm"
import type { PlanetScalePreparedQueryHKT, PlanetscaleQueryResultHKT } from "drizzle-orm/planetscale-serverless"
import { Context } from "../context"
import { memo } from "../util/memo"
Expand All @@ -14,7 +14,7 @@ export namespace Database {
PlanetscaleQueryResultHKT,
PlanetScalePreparedQueryHKT,
Record<string, never>,
ExtractTablesWithRelations<Record<string, never>>
EmptyRelations
>

const client = memo(() => {
Expand All @@ -23,7 +23,7 @@ export namespace Database {
username: Resource.Database.username,
password: Resource.Database.password,
})
const db = drizzle(result, {})
const db = drizzle({ client: result })
return db
})

Expand Down
4 changes: 2 additions & 2 deletions packages/desktop/src/context/marked.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { createContext, useContext, type ParentProps } from "solid-js"
import { useShiki } from "@/context"
import { marked } from "marked"
import { marked, type MarkedExtension } from "marked"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

Using marked.use() modifies the global marked instance. Since init is called inside MarkedProvider (which can be remounted or instantiated multiple times), this will repeatedly append the markedShiki extension to the global instance. This leads to duplicate extension execution, performance degradation, and potential memory leaks (as each extension closure retains a reference to the highlighter instance).

To fix this, import the Marked class and instantiate an isolated parser instance using new Marked(...) instead of calling marked.use(...) on the global instance.

Here is how you can update the init function:

function init(highlighter: ReturnType<typeof useShiki>) {
  return new Marked(
    markedShiki({
      async highlight(code, lang) {
        if (!(lang in bundledLanguages)) {
          lang = "text"
        }
        if (!highlighter.getLoadedLanguages().includes(lang)) {
          await highlighter.loadLanguage(lang as BundledLanguage)
        }
        return highlighter.codeToHtml(code, {
          lang: lang || "text",
          theme: "opencode",
          tabindex: false,
        })
      },
    }) as MarkedExtension,
  )
}
Suggested change
import { marked, type MarkedExtension } from "marked"
import { Marked, type MarkedExtension } from "marked"

import markedShiki from "marked-shiki"
import { bundledLanguages, type BundledLanguage } from "shiki"

Expand All @@ -20,7 +20,7 @@ function init(highlighter: ReturnType<typeof useShiki>) {
tabindex: false,
})
},
}),
}) as MarkedExtension,
)
}

Expand Down
Loading