dsh 0.2.0-rc.2: in-container update (experimental channel), path-agnostic compose, upstream patches adapted to 0.1.x/0.2.x

This commit is contained in:
hermes committed 2026-10-01 19:21:19 +00:00
commit e6dcef9bf5
302 files changed
+75178

No files matched your search

@@ -0,0 +1,35 @@
import assert from 'node:assert/strict'
import { mkdtemp, mkdir, readFile, writeFile } from 'node:fs/promises'
import { tmpdir } from 'node:os'
import { join } from 'node:path'
import test from 'node:test'
import { applyPatch, verifyPatch, NATIVE_CORNERS_RELATIVE_TARGET } from '../../environment/resources/patches/native-corners.mjs'
const BEFORE = 'var corner_shape_css_default = "@supports (corner-shape:superellipse(1.5)){:root{--dsw-corner-shape:superellipse(1.5)}*,:before,:after{corner-shape:var(--dsw-corner-shape)}}";'
async function fixture(source = BEFORE) {
const root = await mkdtemp(join(tmpdir(), 'dsh-native-corners-'))
const target = join(root, NATIVE_CORNERS_RELATIVE_TARGET)
await mkdir(join(root, 'node_modules/@deepseek-ai/dsh-client-ui-theme/lib'), { recursive: true })
await writeFile(target, source + '\n')
return { root, target }
}
test('removes the image-injected global superellipse rule exactly once', async () => {
const { root, target } = await fixture()
applyPatch(root)
verifyPatch(root)
assert.equal(await readFile(target, 'utf8'), 'var corner_shape_css_default = "";\n')
assert.throws(() => applyPatch(root), /found 0/)
})
test('fails closed when the upstream theme anchor changes', async () => {
const { root } = await fixture('var corner_shape_css_default = "changed";')
assert.throws(() => applyPatch(root), /found 0/)
})
test('allows upstream packages without the optional theme module', async () => {
const root = await mkdtemp(join(tmpdir(), 'dsh-native-corners-absent-'))
assert.doesNotThrow(() => applyPatch(root))
assert.doesNotThrow(() => verifyPatch(root))
})