|
@@ -8,6 +8,7 @@
|
|
|
import { existsSync, readdirSync, readFileSync } from 'node:fs'
|
|
import { existsSync, readdirSync, readFileSync } from 'node:fs'
|
|
|
import { join, relative, resolve } from 'node:path'
|
|
import { join, relative, resolve } from 'node:path'
|
|
|
import { pathToFileURL } from 'node:url'
|
|
import { pathToFileURL } from 'node:url'
|
|
|
|
|
+import { isPublicExperimentalPackageDirectory } from './experimental-package-policy.ts'
|
|
|
import { hasTypertRemoteNavigation, isForbiddenPublicationFile } from './publication-payload.ts'
|
|
import { hasTypertRemoteNavigation, isForbiddenPublicationFile } from './publication-payload.ts'
|
|
|
import { collectProjectReferenceFaceViolations } from './project-reference-faces.ts'
|
|
import { collectProjectReferenceFaceViolations } from './project-reference-faces.ts'
|
|
|
|
|
|
|
@@ -50,12 +51,12 @@ const repositoryUrl = 'git+https://github.com/deepseek-harness/deepseek-harness.
|
|
|
* their trusted publishing against the repository that runs the workflow.
|
|
* their trusted publishing against the repository that runs the workflow.
|
|
|
*/
|
|
*/
|
|
|
const publishedRepositoryUrl = 'git+https://github.com/deepseek-ai/deepseek-harness.git'
|
|
const publishedRepositoryUrl = 'git+https://github.com/deepseek-ai/deepseek-harness.git'
|
|
|
-/** Private packages that participate in workspace checks but not releases. */
|
|
|
|
|
|
|
+/** Packages that participate in the experimental policy. */
|
|
|
const experimentalPackageDirectory = /^packages\/experimental\/[^/]+$/
|
|
const experimentalPackageDirectory = /^packages\/experimental\/[^/]+$/
|
|
|
-/** npm namespace reserved for private experimental packages. */
|
|
|
|
|
|
|
+/** npm namespace reserved for experimental packages. */
|
|
|
const experimentalPackageNamePrefix = '@deepseek-ai/dsh-experimental-'
|
|
const experimentalPackageNamePrefix = '@deepseek-ai/dsh-experimental-'
|
|
|
-/** Directories whose packages this repository publishes: one release member each. */
|
|
|
|
|
-const releaseMemberDirectory = /^(?:packages\/(?!experimental\/)[^/]+\/[^/]+|apps\/(?!desktop(?:-host)?$)[^/]+|vendor\/[^/]+)$/
|
|
|
|
|
|
|
+/** Ordinary directories whose packages this repository publishes: one release member each. */
|
|
|
|
|
+const standardReleaseMemberDirectory = /^(?:packages\/(?!experimental\/)[^/]+\/[^/]+|apps\/(?!desktop(?:-host)?$)[^/]+|vendor\/[^/]+)$/
|
|
|
/** Installable application assembled by electron-builder rather than published to npm. */
|
|
/** Installable application assembled by electron-builder rather than published to npm. */
|
|
|
const desktopApplicationDirectory = 'apps/desktop'
|
|
const desktopApplicationDirectory = 'apps/desktop'
|
|
|
const localArtifactDirs = new Set(['node_modules'])
|
|
const localArtifactDirs = new Set(['node_modules'])
|
|
@@ -267,7 +268,7 @@ function usesEmittedTreeDefaults(manifest: PackageManifest): boolean {
|
|
|
exportDefault(manifest, subpath)?.startsWith('./lib/types/') === true)
|
|
exportDefault(manifest, subpath)?.startsWith('./lib/types/') === true)
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-/** Experimental manifest requirements enforced independently from release metadata. */
|
|
|
|
|
|
|
+/** Experimental manifest requirements, including explicit public exceptions. */
|
|
|
export function checkExperimentalManifest({ dir, manifest }: WorkspaceManifest): string[] {
|
|
export function checkExperimentalManifest({ dir, manifest }: WorkspaceManifest): string[] {
|
|
|
if (!experimentalPackageDirectory.test(dir)) return []
|
|
if (!experimentalPackageDirectory.test(dir)) return []
|
|
|
const label = manifest.name ?? dir
|
|
const label = manifest.name ?? dir
|
|
@@ -275,11 +276,22 @@ export function checkExperimentalManifest({ dir, manifest }: WorkspaceManifest):
|
|
|
if (manifest.name?.startsWith(experimentalPackageNamePrefix) !== true) {
|
|
if (manifest.name?.startsWith(experimentalPackageNamePrefix) !== true) {
|
|
|
errors.push(`${label}: experimental package name must start with ${JSON.stringify(experimentalPackageNamePrefix)}`)
|
|
errors.push(`${label}: experimental package name must start with ${JSON.stringify(experimentalPackageNamePrefix)}`)
|
|
|
}
|
|
}
|
|
|
- if (manifest.private !== true) errors.push(`${label}: experimental package must set "private": true`)
|
|
|
|
|
- if (manifest.publishConfig !== undefined) errors.push(`${label}: experimental package must omit publishConfig`)
|
|
|
|
|
|
|
+ if (isPublicExperimentalPackageDirectory(dir)) {
|
|
|
|
|
+ if (manifest.private === true) errors.push(`${label}: public experimental package must not set "private": true`)
|
|
|
|
|
+ if (manifest.publishConfig?.access !== 'public') {
|
|
|
|
|
+ errors.push(`${label}: public experimental package must set publishConfig.access to "public"`)
|
|
|
|
|
+ }
|
|
|
|
|
+ } else {
|
|
|
|
|
+ if (manifest.private !== true) errors.push(`${label}: experimental package must set "private": true`)
|
|
|
|
|
+ if (manifest.publishConfig !== undefined) errors.push(`${label}: experimental package must omit publishConfig`)
|
|
|
|
|
+ }
|
|
|
return errors
|
|
return errors
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+function isReleaseMemberDirectory(dir: string): boolean {
|
|
|
|
|
+ return standardReleaseMemberDirectory.test(dir) || isPublicExperimentalPackageDirectory(dir)
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
/**
|
|
/**
|
|
|
* Require a dsh-family manifest to carry the workspace version.
|
|
* Require a dsh-family manifest to carry the workspace version.
|
|
|
*
|
|
*
|
|
@@ -330,7 +342,7 @@ export function checkWorkspaceManifest({ dir, manifest }: WorkspaceManifest): st
|
|
|
|| manifest.repository.directory !== expectedDirectory) {
|
|
|| manifest.repository.directory !== expectedDirectory) {
|
|
|
errors.push(`${label}: published Landlock package repository must use ${repositoryUrl} with directory ${expectedDirectory} for trusted publishing`)
|
|
errors.push(`${label}: published Landlock package repository must use ${repositoryUrl} with directory ${expectedDirectory} for trusted publishing`)
|
|
|
}
|
|
}
|
|
|
- } else if (releaseMemberDirectory.test(dir)) {
|
|
|
|
|
|
|
+ } else if (isReleaseMemberDirectory(dir)) {
|
|
|
// Release members state that they are publishable: npm refuses a private
|
|
// Release members state that they are publishable: npm refuses a private
|
|
|
// package, and the repository field is how a consumer finds the source of
|
|
// package, and the repository field is how a consumer finds the source of
|
|
|
// the package it installed.
|
|
// the package it installed.
|
|
@@ -482,7 +494,7 @@ export function checkExperimentalDependencyIsolation(manifests: readonly Workspa
|
|
|
.filter(name => name !== undefined))
|
|
.filter(name => name !== undefined))
|
|
|
const errors: string[] = []
|
|
const errors: string[] = []
|
|
|
for (const { dir, manifest } of manifests) {
|
|
for (const { dir, manifest } of manifests) {
|
|
|
- if (!releaseMemberDirectory.test(dir) && dir !== 'python/sdk-runtime') continue
|
|
|
|
|
|
|
+ if (!standardReleaseMemberDirectory.test(dir) && dir !== 'python/sdk-runtime') continue
|
|
|
for (const section of runtimeDependencySections) {
|
|
for (const section of runtimeDependencySections) {
|
|
|
for (const name of Object.keys(manifest[section] ?? {})) {
|
|
for (const name of Object.keys(manifest[section] ?? {})) {
|
|
|
if (!experimentalNames.has(name)) continue
|
|
if (!experimentalNames.has(name)) continue
|