@treeseed/sdk 0.12.34 → 0.12.35

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -222,6 +222,9 @@ function beamPackageAdapter(root, dir) {
222
222
  const versionSource = resolve(dir, versionSourceRel);
223
223
  const image = typeof manifest?.image === "string" && manifest.image.trim() ? manifest.image.trim() : id === "treedx" ? "treeseed/treedx" : null;
224
224
  const dockerArtifacts = manifestDockerArtifacts(manifest?.artifacts);
225
+ const dockerImages = stringRecord(manifest?.dockerImages);
226
+ const dockerImageReleaseWorkflow = stringValue(dockerImages.releaseWorkflow);
227
+ const dockerImageArchitectures = stringArray(dockerImages.architectures);
225
228
  const repository = stringValue(manifest?.repository) ?? (id === "treedx" ? "treeseed-ai/treedx" : null);
226
229
  const hostedVerifyWorkflow = stringValue(manifest?.hostedVerifyWorkflow) ?? stringValue(stringRecord(manifest?.releaseGate).workflow) ?? (existsSync(resolve(dir, ".github/workflows/release-gate.yml")) ? "release-gate.yml" : null);
227
230
  const projectArchitecture = normalizeTreeseedPackageProjectArchitecture(manifest?.projectArchitecture, id);
@@ -255,7 +258,7 @@ function beamPackageAdapter(root, dir) {
255
258
  context: artifact.context ?? ".",
256
259
  target: artifact.target,
257
260
  role: artifact.role ?? id,
258
- architectures: artifact.architectures.length > 0 ? artifact.architectures : stringArray(stringRecord(manifest?.dockerImages).architectures)
261
+ architectures: artifact.architectures.length > 0 ? artifact.architectures : dockerImageArchitectures
259
262
  })) : image ? [{
260
263
  provider: "docker",
261
264
  name: image,
@@ -264,7 +267,7 @@ function beamPackageAdapter(root, dir) {
264
267
  context: ".",
265
268
  target: null,
266
269
  role: id,
267
- architectures: stringArray(stringRecord(manifest?.dockerImages).architectures)
270
+ architectures: dockerImageArchitectures
268
271
  }] : [],
269
272
  releaseChecks: dockerArtifacts.length > 0 ? dockerArtifacts.map((artifact) => ({ kind: "docker-manifest", name: `${artifact.name} Docker image manifest`, detail: `${artifact.name}:${version ?? "<version>"}` })) : image ? [{ kind: "docker-manifest", name: "Docker image manifest", detail: `${image}:${version ?? "<version>"}` }] : [],
270
273
  metadata: {
@@ -272,7 +275,9 @@ function beamPackageAdapter(root, dir) {
272
275
  hasDockerfile: existsSync(resolve(dir, "Dockerfile")),
273
276
  repository,
274
277
  deploymentSource: stringRecord(manifest?.deploymentSource),
275
- imageHosting: stringRecord(stringRecord(manifest?.dockerImages).hosting),
278
+ dockerImageReleaseWorkflow: dockerImageReleaseWorkflow ? `.github/workflows/${dockerImageReleaseWorkflow}` : null,
279
+ dockerImageArchitectures,
280
+ imageHosting: stringRecord(dockerImages.hosting),
276
281
  versionSource: versionSourceRel,
277
282
  ...hostedVerifyWorkflow ? {
278
283
  hostedVerifyWorkflow: hostedVerifyWorkflow.startsWith(".github/workflows/") ? hostedVerifyWorkflow : `.github/workflows/${hostedVerifyWorkflow}`
@@ -818,6 +823,9 @@ function shellQuoteWorkflowArg(value) {
818
823
  return `'${value.replace(/'/gu, `'\\''`)}'`;
819
824
  }
820
825
  function workflowTemplatesForAdapter(adapter) {
826
+ if (adapter.metadata.workflowTemplateVersion === "custom") {
827
+ return [];
828
+ }
821
829
  const hasDocker = adapter.artifacts.some((artifact) => artifact.provider === "docker");
822
830
  const hasNpm = adapter.artifacts.some((artifact) => artifact.provider === "npm");
823
831
  return [
@@ -2006,9 +2006,9 @@ function failWorkflowRun(root, runId, error, recovery) {
2006
2006
  releaseWorkflowLock(root, runId);
2007
2007
  }
2008
2008
  function validatePackageReleaseWorkflows(root, packageNames) {
2009
- const missing = checkedOutWorkspacePackageRepos(root).filter((pkg) => packageNames.includes(pkg.name)).filter((pkg) => !existsSync(resolve(pkg.dir, ".github/workflows/publish.yml"))).map((pkg) => pkg.name);
2009
+ const missing = checkedOutWorkspacePackageRepos(root).filter((pkg) => packageNames.includes(pkg.name)).map((pkg) => ({ pkg, workflow: releaseWorkflowForPackage(root, pkg.name) })).filter((entry) => !existsSync(resolve(entry.pkg.dir, ".github/workflows", entry.workflow))).map((entry) => `${entry.pkg.name} (${entry.workflow})`);
2010
2010
  if (missing.length > 0) {
2011
- workflowError("release", "workflow_contract_missing", `Treeseed release requires .github/workflows/publish.yml in: ${missing.join(", ")}.`, {
2011
+ workflowError("release", "workflow_contract_missing", `Treeseed release requires package release workflows in: ${missing.join(", ")}.`, {
2012
2012
  details: {
2013
2013
  missing
2014
2014
  }
@@ -2016,9 +2016,9 @@ function validatePackageReleaseWorkflows(root, packageNames) {
2016
2016
  }
2017
2017
  }
2018
2018
  function releaseWorkflowForPackage(root, packageName) {
2019
- void root;
2020
- void packageName;
2021
- return "publish.yml";
2019
+ const adapter = discoverTreeseedPackageAdapters(root).find((entry) => entry.id === packageName || entry.name === packageName);
2020
+ const configured = typeof adapter?.metadata?.dockerImageReleaseWorkflow === "string" ? adapter.metadata.dockerImageReleaseWorkflow : null;
2021
+ return configured && configured.trim() ? configured.trim().replace(/^\.github\/workflows\//u, "") : "publish.yml";
2022
2022
  }
2023
2023
  function productionDeployWorkflowForPackage(root, packageName) {
2024
2024
  const adapter = discoverTreeseedPackageAdapters(root).find((entry) => entry.id === packageName || entry.name === packageName);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@treeseed/sdk",
3
- "version": "0.12.34",
3
+ "version": "0.12.35",
4
4
  "description": "Shared Treeseed SDK for content-backed and D1-backed object models.",
5
5
  "license": "AGPL-3.0-only",
6
6
  "repository": {