Skip to content

Complete block-tools structurer migration#54

Merged
kevindetry-milaboratories merged 1 commit into
mainfrom
push-omolxwokpxol
Jun 29, 2026
Merged

Complete block-tools structurer migration#54
kevindetry-milaboratories merged 1 commit into
mainfrom
push-omolxwokpxol

Conversation

@kevindetry-milaboratories

@kevindetry-milaboratories kevindetry-milaboratories commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

The deps-only SDK update bumped block-tools to 2.11.5 but left the managed package manifests stale. block-tools 2.11.5 makes --registry-serve-url mandatory for block-tools publish, so the block-facade publish step failed in CI.

Run the full structure refresh to regenerate the managed layout: move the facade to block/src, mark bundled component and software packages private, regenerate CI workflows, and add the required --registry-serve-url flag to prepublishOnly.

Greptile Summary

This PR completes the block-tools structurer migration by replacing the hand-written CJS facade (block/index.js / block/index.d.ts) with a generated ESM TypeScript facade under block/src/, and regenerates the CI workflows and package manifests. The immediate motivation is that block-tools 2.11.5 made --registry-serve-url mandatory for block-tools publish, which was missing and broke the CI publish step.

  • Facade migration: Old blockSpec / dev-v2 / __dirname CJS contract replaced by BlockPointer / from-pack-v2 / import.meta.url-based URL resolution; new AGENTS.ts exposes a narrow MCP/AI surface; all three are managed by block-tools structure going forward.
  • Package hygiene: All component sub-packages (model, ui, workflow, software/*) marked private: true; their workspace references in block/package.json moved to devDependencies since they are bundled by ts-builder.
  • CI fixes: Secret name corrected (AWS_CI_TURBOREPO_US_S3_BUCKET \u2192 AWS_CI_TURBOREPO_S3_BUCKET), tests re-enabled, and Slack parameters reordered.

Confidence Score: 4/5

The structural migration is correct and well-reasoned; the two items worth a second look are the unquoted S3 URL and the missing changeset entry for the public block package.

The S3 URL in prepublishOnly lost the single-quote wrapping present in the old script, leaving ?region=eu-central-1 technically shell-unsafe. The changeset lists only private packages, so the public block package whose entire exported API changed from blockSpec to BlockPointer won't get an npm version bump from this PR.

.changeset/complete-structurer-migration.md and block/package.json prepublishOnly script.

Important Files Changed

Filename Overview
block/package.json Migrated from CJS (index.js/index.d.ts) to ESM facade (dist/); added --registry-serve-url to prepublishOnly; workspace deps moved to devDependencies; S3 URL is now unquoted (minor shell-glob risk).
block/src/index.ts New managed ESM facade; replaces old blockSpec/dev-v2 with BlockPointer/from-pack-v2 using import.meta.url for URL-based block-pack resolution; well-commented to explain the ImportMeta typing workaround.
.changeset/complete-structurer-migration.md Changeset bumps ui/model/workflow (all now private, so not npm-published) but omits the public block package whose API changed entirely.
.github/workflows/build.yaml Re-enabled tests (test: false to true), fixed turborepo S3 secret name (removed US suffix), reordered SLACK env params; overall correct regeneration.
block/src/AGENTS.ts New managed file defining a narrow MCP/AI surface by re-exporting BlockContract, BlockOutputs, BlockData and the agents-extra extension point.
block/tsconfig.json New tsconfig extending @milaboratories/ts-configs/block/facade with src/**/* coverage; standard managed layout.
model/package.json Added private: true; component packages are not meant for standalone npm publication.
ui/package.json Added private: true; consistent with the other component sub-packages.
workflow/package.json Added private: true; consistent with the other component sub-packages.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A["block/src/index.ts\nManaged ESM facade"] -->|imports platforma| B["model package\nprivate: true"]
    A -->|InferOutputsType etc| C["@platforma-sdk/model\ncatalog:"]
    A -->|export star| D["block-extra.ts\nauthor-owned"]
    A --> E["dist/index.js\nbundled by ts-builder"]
    E --> F["block-pack/\nblock-tools pack"]

    subgraph CI ["CI publish"]
        G["build.yaml\ntest: true"]
        G --> H["ts-builder build\n--target block-facade"]
        H --> I["block-tools pack"]
        I --> J["block-tools publish\n-r s3://...\n--registry-serve-url\nhttps://blocks.pl-open.science"]
    end

    F --> J
    E --> K["npm package\nv1.5.2\nnot in changeset"]

    subgraph AGENTS ["MCP surface"]
        L["AGENTS.ts\nBlockContract, BlockOutputs\nBlockData + agents-extra"]
    end
    A --> L
Loading
%%{init: {'theme': 'base', 'themeVariables': {"darkMode": true, "background": "#0d1117", "primaryColor": "#21262d", "primaryTextColor": "#e6edf3", "primaryBorderColor": "#8b949e", "lineColor": "#8b949e", "textColor": "#e6edf3", "edgeLabelBackground": "#161b22", "actorBkg": "#21262d", "actorBorder": "#8b949e", "actorTextColor": "#e6edf3", "actorLineColor": "#8b949e", "signalColor": "#8b949e", "signalTextColor": "#e6edf3", "noteBkgColor": "#373320", "noteBorderColor": "#d4a72c", "noteTextColor": "#f0e6c0", "labelBoxBkgColor": "#21262d", "labelBoxBorderColor": "#8b949e", "labelTextColor": "#e6edf3", "loopTextColor": "#e6edf3", "activationBkgColor": "#30363d", "activationBorderColor": "#8b949e"}}}%%
flowchart TD
    A["block/src/index.ts\nManaged ESM facade"] -->|imports platforma| B["model package\nprivate: true"]
    A -->|InferOutputsType etc| C["@platforma-sdk/model\ncatalog:"]
    A -->|export star| D["block-extra.ts\nauthor-owned"]
    A --> E["dist/index.js\nbundled by ts-builder"]
    E --> F["block-pack/\nblock-tools pack"]

    subgraph CI ["CI publish"]
        G["build.yaml\ntest: true"]
        G --> H["ts-builder build\n--target block-facade"]
        H --> I["block-tools pack"]
        I --> J["block-tools publish\n-r s3://...\n--registry-serve-url\nhttps://blocks.pl-open.science"]
    end

    F --> J
    E --> K["npm package\nv1.5.2\nnot in changeset"]

    subgraph AGENTS ["MCP surface"]
        L["AGENTS.ts\nBlockContract, BlockOutputs\nBlockData + agents-extra"]
    end
    A --> L
Loading

Fix All in Claude Code

Prompt To Fix All With AI
Fix the following 2 code review issues. Work through them one at a time, proposing concise fixes.

---

### Issue 1 of 2
block/package.json:21
The S3 URL passed to `-r` is no longer quoted. The `?region=eu-central-1` segment contains `?`, which is a shell glob wildcard (matches any single character). In the default bash/sh `nullglob`-off configuration the literal is passed through when no filename matches, so the publish currently works, but it's fragile — a file named e.g. `region=eu-central-1` in the working directory during publish would corrupt the argument. The old `prepublishOnly` single-quoted the URL; the new one should too.

```suggestion
    "prepublishOnly": "block-tools publish -r 's3://milab-euce1-prod-pkgs-s3-block-registry/pub/releases/?region=eu-central-1' --registry-serve-url https://blocks.pl-open.science",
```

### Issue 2 of 2
.changeset/complete-structurer-migration.md:1-5
**Changeset covers private packages but omits the public block package**

The changeset bumps `ui`, `model`, and `workflow`, all of which are now marked `private: true` (changesets skips private packages on publish). The main public package `@platforma-open/milaboratories.immune-assay-data` is not listed, even though its entire exported API changed — the old CJS `blockSpec` / `dev-v2` surface was removed and replaced with ESM `BlockPointer` / `from-pack-v2`. Without a changeset entry for the public package its npm version stays at 1.5.2, so consumers who watch the registry won't see a version signal for the breaking rename.

Reviews (1): Last reviewed commit: "Complete block-tools structurer migratio..." | Re-trigger Greptile

Greptile also left 2 inline comments on this PR.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request completes the block-tools structurer migration by moving the block facade to the managed block/src layout, adding the necessary TypeScript configurations, and updating package manifests to mark internal packages as private. One critical issue was identified in block/package.json where dependencies re-exported by the facade (such as @platforma-open/milaboratories.immune-assay-data.model and @platforma-sdk/model) are incorrectly listed under devDependencies instead of dependencies, which will cause compilation errors for downstream consumers.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread block/package.json
Comment thread block/package.json
Comment thread .changeset/complete-structurer-migration.md
The deps-only SDK update bumped block-tools to 2.11.5 but left the managed package manifests stale. block-tools 2.11.5 makes --registry-serve-url mandatory for `block-tools publish`, so the block-facade publish step failed in CI.

Run the full structure refresh to regenerate the managed layout: move the facade to block/src, mark bundled component and software packages private, regenerate CI workflows, and add the required --registry-serve-url flag to prepublishOnly.
@kevindetry-milaboratories
kevindetry-milaboratories merged commit 825be83 into main Jun 29, 2026
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants