Files
deepseek-harness/scripts/check-workspace-constraints.spec.ts
T
Tianyi Cui 32c32932f9 chore(repo): wire profile apps and the renamed runtime through builds
Update workspace manifests, the lockfile, Host project references, Knip inputs, package constraints, vendoring rewrites, and Python runtime build/smoke scripts for sdk-app, acp-app, and @deepseek-ai/dsh-sdk-python-runtime. Add the ACP hook packages to the dsh dependency closure so installed profile materialization resolves the same plugins as source workspaces.

Keep Python distribution outputs deliberately unchanged: the wheel modules, executable names, and smoke targets retain their public identities even though their private npm carrier moved. Constraint fixtures pin the new package locations and catch missing application dependencies on every platform.
2026-08-23 10:59:01 +08:00

101 lines
3.9 KiB
TypeScript

/** Experimental-package publication and dependency constraints. */
import { readFileSync } from 'node:fs'
import { join } from 'node:path'
import { describe, expect, it } from 'vitest'
import {
checkExperimentalDependencyIsolation,
checkExperimentalManifest,
checkWorkspaceManifest,
type WorkspaceManifest,
} from './check-workspace-constraints.ts'
const experimental: WorkspaceManifest = {
dir: 'packages/experimental/prototype',
manifest: { name: '@deepseek-ai/dsh-experimental-prototype', private: true },
}
describe('experimental workspace constraints', () => {
it('requires the experimental package-name prefix', () => {
expect(checkExperimentalManifest({
...experimental,
manifest: { ...experimental.manifest, name: '@deepseek-ai/dsh-prototype' },
})).toEqual([
'@deepseek-ai/dsh-prototype: experimental package name must start with "@deepseek-ai/dsh-experimental-"',
])
})
it('requires private manifests without publication metadata', () => {
expect(checkExperimentalManifest(experimental)).toEqual([])
expect(checkExperimentalManifest({
...experimental,
manifest: { ...experimental.manifest, private: false, publishConfig: { access: 'public' } },
})).toEqual([
'@deepseek-ai/dsh-experimental-prototype: experimental package must set "private": true',
'@deepseek-ai/dsh-experimental-prototype: experimental package must omit publishConfig',
])
})
it.each(['dependencies', 'optionalDependencies', 'peerDependencies'] as const)(
'rejects release %s on an experimental package',
(section) => {
expect(checkExperimentalDependencyIsolation([experimental, {
dir: 'packages/core/consumer',
manifest: {
name: '@deepseek-ai/dsh-consumer',
[section]: { '@deepseek-ai/dsh-experimental-prototype': 'workspace:^' },
},
}])).toEqual([
`@deepseek-ai/dsh-consumer: ${section}.@deepseek-ai/dsh-experimental-prototype must not reference an experimental package`,
])
},
)
it('allows development and experimental consumers but rejects the Python release runtime', () => {
const manifests: WorkspaceManifest[] = [experimental, {
dir: 'packages/core/test-only',
manifest: {
name: '@deepseek-ai/dsh-test-only',
devDependencies: { '@deepseek-ai/dsh-experimental-prototype': 'workspace:^' },
},
}, {
dir: 'packages/experimental/consumer',
manifest: {
name: '@deepseek-ai/dsh-experimental-consumer',
dependencies: { '@deepseek-ai/dsh-experimental-prototype': 'workspace:^' },
},
}, {
dir: 'python/sdk-runtime',
manifest: {
name: '@deepseek-ai/dsh-python-runtime',
dependencies: { '@deepseek-ai/dsh-experimental-prototype': 'workspace:^' },
},
}]
expect(checkExperimentalDependencyIsolation(manifests)).toEqual([
'@deepseek-ai/dsh-python-runtime: dependencies.@deepseek-ai/dsh-experimental-prototype must not reference an experimental package',
])
})
})
describe('private Python runtime carrier', () => {
const manifest = JSON.parse(
readFileSync(new URL('../packages/sdk/python-runtime/package.json', import.meta.url), 'utf8'),
) as WorkspaceManifest['manifest']
it('participates in dsh package checks without becoming an npm release member', () => {
expect(checkWorkspaceManifest({ dir: 'packages/sdk/python-runtime', manifest })).toEqual([])
})
it('rejects publication metadata on the private carrier', () => {
const path = join('packages', 'sdk', 'python-runtime', 'package.json')
expect(checkWorkspaceManifest({
dir: 'packages/sdk/python-runtime',
manifest: { ...manifest, private: false, publishConfig: { access: 'public' } },
})).toEqual([
`${path}: @deepseek-ai/dsh-sdk-python-runtime: private carrier must set "private": true`,
`${path}: @deepseek-ai/dsh-sdk-python-runtime: private carrier must omit publishConfig`,
])
})
})