feat!: move to the alpha track — DSH 0.1.2-alpha.x only (v0.18.0-alpha.0)
DSH itself is still on its 0.1.2-alpha line (npm `alpha` dist-tag), so the
plugin mirrors it: v0.18.0-alpha.0 publishes under the npm `alpha`
dist-tag and supports DSH 0.1.2-alpha.x only. Stable-DSH (0.1.0-rc.8 ~
0.1.1-rc.2) users stay on v0.17.1 (npm `latest`). Verified end-to-end
against a real 0.1.2-alpha.2 host: full vitest suite, typecheck,
build/pack, consumer type surface, and the headless mount smoke 14/14
(the prerelease version also passes `dsh plugin add file:`).
- peer floor raised `^0.1.0-rc.8` -> `^0.1.2-alpha.2` (the mount install
no longer warns: the old floor could not semver-match a prerelease
host); dsh.plugin.json engines.dsh `>=0.1.2-alpha.2`.
- Dropped the pre-alpha compatibility layer:
- e2e host RPC collapsed from the dot/slash dual dialect to slash-only
(rpcAttempt; the 404-probe negotiation and its cache are gone), and
parseLaunchUrl now requires the ?token= launch URL;
- MarkdownText labels collapsed to the nested single shape (the cast
became unnecessary against the alpha.2 declarations);
- the defunct `@deepseek-ai/dsh-client-runtime` row is gone from the
chunk externals allowlist (chunk-loader / tsdown / two specs) and
from dsh.client.inject.
- market-manifest guard now allows an exact prerelease version (alpha
cuts are not the market's verified `latest` target); release.yml picks
the npm dist-tag from the version (prerelease -> `alpha`, else
`latest`) so an alpha can never hijack `latest`.
- Docs retargeted: AGENTS.md §2/§3, README/README_EN badges + v0.18.0
-alpha.0 section + install note (`dsh-better-sidebar@alpha`), guide.
This commit is contained in:
@@ -62,18 +62,11 @@ type ChunkFactory = (require: (spec: string) => unknown) => ChunkExports
|
||||
* CLIENT_EXTERNALS in tsdown.config.ts — the chunk builds keep these
|
||||
* external and the loader resolves them here). A superset is safe: the
|
||||
* require only answers what the chunk actually asks for. The shell's static
|
||||
* module table seeds React, Cordis, and the UI libraries (primitives/slots);
|
||||
* `dsh-client-runtime/client` normalizes onto the runtime package row
|
||||
* (stripClientSuffix). dsh-client-web-react / dsh-client-schema-form were
|
||||
* dropped in DSH 0.1.0-rc.8 (no rc.8 publish, nothing requires them) — the
|
||||
* chunks never asked for them, so they no longer belong here.
|
||||
*
|
||||
* DSH 0.1.2-alpha.1 removed the `dsh-client-runtime` package outright (the
|
||||
* seed table gained bare-name `@deepseek-ai/dsh-client-store` instead); the
|
||||
* runtime/client row below stays for 0.1.1-rc.x hosts — no chunk requires
|
||||
* it, and {@link buildExternalsRequire} keeps an unresolvable spec
|
||||
* undefined until a chunk actually asks (only then is it a loud error), so
|
||||
* the entry is inert on 0.1.2-alpha.1+.
|
||||
* module table seeds React, Cordis, and the UI libraries (primitives/slots).
|
||||
* `@deepseek-ai/dsh-client-runtime` was removed upstream in DSH 0.1.2-alpha
|
||||
* (its seed row became bare-name `@deepseek-ai/dsh-client-store`) and no
|
||||
* chunk ever required it, so its row is gone; so are dsh-client-web-react /
|
||||
* dsh-client-schema-form, dropped back in DSH 0.1.0-rc.8.
|
||||
*/
|
||||
export const CHUNK_EXTERNALS: readonly string[] = [
|
||||
'react',
|
||||
@@ -83,7 +76,6 @@ export const CHUNK_EXTERNALS: readonly string[] = [
|
||||
'cordis',
|
||||
'@deepseek-ai/dsh-client-ui-slots',
|
||||
'@deepseek-ai/dsh-client-ui-primitives',
|
||||
'@deepseek-ai/dsh-client-runtime/client',
|
||||
]
|
||||
|
||||
/** Chunk script endpoint served by the plugin host half (src/bundle-route.ts). */
|
||||
|
||||
@@ -1,52 +1,31 @@
|
||||
/**
|
||||
* Copy-button / chrome labels for DSH's shared `MarkdownText`, shaped for
|
||||
* BOTH prop generations the plugin supports:
|
||||
*
|
||||
* - 0.1.1-rc.x: optional flat prop `codeLabels` — the renderer reads
|
||||
* `labels.copyLabel` / `labels.copiedLabel` directly.
|
||||
* - 0.1.2-alpha.1+: renamed to a REQUIRED `labels` prop with a nested shape
|
||||
* (`labels.code.copyLabel` + a screen-reader-only `labels.footnotes`
|
||||
* heading). Passing only the old prop crashes the fence render with
|
||||
* "Cannot read properties of undefined (reading 'code')" — the exact
|
||||
* regression the mount lane caught on a real 0.1.2-alpha.1 host.
|
||||
*
|
||||
* The union object satisfies both readers, and {@link markdownTextProps}
|
||||
* passes it under BOTH prop names — each host ignores the one it does not
|
||||
* know. `footnotes` is left empty (the heading is sr-only; give it a real
|
||||
* string only if a locale key ever earns its place in all 19 dictionaries).
|
||||
* Copy-button / chrome labels for DSH's shared `MarkdownText` (DSH
|
||||
* 0.1.2-alpha contract): the renderer takes a REQUIRED nested `labels` prop
|
||||
* — `labels.code.copyLabel` / `labels.code.copiedLabel` for the fence copy
|
||||
* buttons plus a screen-reader-only `labels.footnotes` heading — and the
|
||||
* MarkdownText/CodeBlock are cordis-free, falling back to HARDCODED Chinese
|
||||
* when the labels are omitted, so every render site threads the plugin
|
||||
* dictionary's localized pair through here (re-evaluated per render).
|
||||
* `footnotes` is left empty (the heading is sr-only; give it a real string
|
||||
* only if a locale key ever earns its place in all 19 dictionaries).
|
||||
*/
|
||||
import type { ComponentProps } from 'react'
|
||||
import { MarkdownText } from '@deepseek-ai/dsh-client-ui-primitives'
|
||||
|
||||
/** The flat copy-button pair the plugin threads through its own props
|
||||
* (e.g. MermaidMarkdownProps.codeLabels — the chunk contract stays put). */
|
||||
/** The flat copy-button pair the plugin threads through its own props (e.g.
|
||||
* MermaidMarkdownProps.codeLabels — the chunk contract stays put). */
|
||||
export interface MarkdownCopyLabels {
|
||||
copyLabel: string
|
||||
copiedLabel: string
|
||||
}
|
||||
|
||||
/** The dual-generation chrome labels object (see module doc). */
|
||||
export interface MarkdownChromeLabels extends MarkdownCopyLabels {
|
||||
/** 0.1.2-alpha.1+ nested reads. */
|
||||
code: MarkdownCopyLabels
|
||||
/** 0.1.2-alpha.1+ sr-only footnotes heading. */
|
||||
footnotes: string
|
||||
}
|
||||
|
||||
/** Build the dual-shape chrome labels from a flat copy-button pair. */
|
||||
export function markdownChromeLabels(labels: MarkdownCopyLabels): MarkdownChromeLabels {
|
||||
/** MarkdownText props carrying the nested chrome labels. */
|
||||
export function markdownTextProps(text: string, labels: MarkdownCopyLabels): ComponentProps<typeof MarkdownText> {
|
||||
return {
|
||||
copyLabel: labels.copyLabel,
|
||||
copiedLabel: labels.copiedLabel,
|
||||
code: { copyLabel: labels.copyLabel, copiedLabel: labels.copiedLabel },
|
||||
footnotes: '',
|
||||
text,
|
||||
labels: {
|
||||
code: { copyLabel: labels.copyLabel, copiedLabel: labels.copiedLabel },
|
||||
footnotes: '',
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
/** MarkdownText props carrying the labels under BOTH prop names. The cast is
|
||||
* load-bearing: the plugin builds against the 0.1.1-rc.x declaration, where
|
||||
* `labels` does not exist yet (and vice versa on a 0.1.2-alpha.1+ host). */
|
||||
export function markdownTextProps(text: string, labels: MarkdownCopyLabels): ComponentProps<typeof MarkdownText> {
|
||||
const chrome = markdownChromeLabels(labels)
|
||||
return { text, codeLabels: chrome, labels: chrome } as unknown as ComponentProps<typeof MarkdownText>
|
||||
}
|
||||
|
||||
@@ -472,7 +472,7 @@ export function matchUrlTarget(tabs: readonly TabDescriptor[], url: URL): TabDes
|
||||
* The plugin version this service instance reports. Keep in lockstep with
|
||||
* `package.json`'s version — `tests/service.spec.ts` asserts the pair.
|
||||
*/
|
||||
export const SIDEBAR_SERVICE_VERSION = '0.17.2'
|
||||
export const SIDEBAR_SERVICE_VERSION = '0.18.0-alpha.0'
|
||||
|
||||
/**
|
||||
* Monotonic capability list consumers use to gate new API usage (features
|
||||
|
||||
Reference in New Issue
Block a user