Skip to content

Commit 825be83

Browse files
Complete block-tools structurer migration
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.
1 parent 44a18a9 commit 825be83

24 files changed

Lines changed: 151 additions & 52 deletions

File tree

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
---
2+
'@platforma-open/milaboratories.immune-assay-data': patch
3+
---
4+
5+
Complete the block-tools structurer migration: move the block facade to the
6+
managed `block/src` layout and regenerate the package manifests and CI
7+
workflows. This adds the `--registry-serve-url` flag that the bumped block-tools
8+
now requires for `block-tools publish`, fixing the block-registry publish step
9+
that failed after the SDK bump.

.github/workflows/build.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,8 @@ jobs:
2727
node-version: '20.x'
2828
build-script-name: 'build'
2929
pnpm-recursive-build: false
30-
test: false
30+
31+
test: true
3132
test-script-name: 'test'
3233
pnpm-recursive-tests: false
3334
team-id: 'ciplopen'
@@ -54,14 +55,13 @@ jobs:
5455
"PL_CI_TEST_PASSWORD": ${{ toJSON(secrets.PL_CI_TEST_PASSWORD) }},
5556
5657
"AWS_CI_IAM_MONOREPO_SIMPLE_ROLE": ${{ toJSON(secrets.AWS_CI_IAM_MONOREPO_SIMPLE_ROLE) }},
57-
"AWS_CI_TURBOREPO_S3_BUCKET": ${{ toJSON(secrets.AWS_CI_TURBOREPO_US_S3_BUCKET) }},
58+
"AWS_CI_TURBOREPO_S3_BUCKET": ${{ toJSON(secrets.AWS_CI_TURBOREPO_S3_BUCKET) }},
5859
"PL_REGISTRY_PLATFORMA_OPEN_UPLOAD_URL": ${{ toJSON(secrets.PL_REGISTRY_PLOPEN_UPLOAD_URL) }},
59-
6060
"QUAY_USERNAME": ${{ toJSON(secrets.QUAY_USERNAME) }},
6161
"QUAY_ROBOT_TOKEN": ${{ toJSON(secrets.QUAY_ROBOT_TOKEN) }} }
6262
63-
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
6463
SLACK_CHANNEL: ${{ secrets.SLACK_BLOCKS_CI_CHANNEL }}
64+
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
6565

6666
GH_ZEN_APP_ID: ${{ secrets.GH_ZEN_APP_ID }}
6767
GH_ZEN_APP_PRIVATE_KEY: ${{ secrets.GH_ZEN_APP_PRIVATE_KEY }}

.github/workflows/mark-stable.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,5 +30,5 @@ jobs:
3030
{ "NPMJS_TOKEN": ${{ toJSON(secrets.NPMJS_TOKEN) }},
3131
"AWS_CI_IAM_MONOREPO_SIMPLE_ROLE": ${{ toJSON(secrets.AWS_CI_IAM_MONOREPO_SIMPLE_ROLE) }} }
3232
33-
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
3433
SLACK_CHANNEL: ${{ secrets.SLACK_BLOCKS_CI_CHANNEL }}
34+
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}

block/index.d.ts

Lines changed: 0 additions & 6 deletions
This file was deleted.

block/index.js

Lines changed: 0 additions & 8 deletions
This file was deleted.

block/package.json

Lines changed: 25 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,23 +2,37 @@
22
"name": "@platforma-open/milaboratories.immune-assay-data",
33
"version": "1.5.2",
44
"files": [
5-
"index.d.ts",
6-
"index.js"
5+
"dist",
6+
"block-pack"
77
],
8+
"type": "module",
9+
"main": "./dist/index.js",
10+
"module": "./dist/index.js",
11+
"types": "./dist/index.d.ts",
12+
"exports": {
13+
".": {
14+
"sources": "./src/index.ts",
15+
"types": "./dist/index.d.ts",
16+
"default": "./dist/index.js"
17+
}
18+
},
819
"scripts": {
9-
"build": "shx rm -rf ./block-pack && block-tools pack",
10-
"mark-stable": "block-tools mark-stable -r 's3://milab-euce1-prod-pkgs-s3-block-registry/pub/releases/?region=eu-central-1'",
11-
"prepublishOnly": "block-tools pack && block-tools publish -r 's3://milab-euce1-prod-pkgs-s3-block-registry/pub/releases/?region=eu-central-1'",
12-
"do-pack": "shx rm -f *.tgz && block-tools pack && pnpm pack && shx mv *.tgz package.tgz"
20+
"build": "ts-builder build --target block-facade && block-tools pack",
21+
"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",
22+
"do-pack": "pnpm pack && shx mv *.tgz package.tgz",
23+
"check": "ts-builder type-check --target block-facade"
1324
},
14-
"dependencies": {
25+
"dependencies": {},
26+
"devDependencies": {
27+
"@milaboratories/ts-builder": "catalog:",
28+
"@milaboratories/ts-configs": "catalog:",
1529
"@platforma-open/milaboratories.immune-assay-data.model": "workspace:*",
1630
"@platforma-open/milaboratories.immune-assay-data.ui": "workspace:*",
17-
"@platforma-open/milaboratories.immune-assay-data.workflow": "workspace:*"
18-
},
19-
"devDependencies": {
31+
"@platforma-open/milaboratories.immune-assay-data.workflow": "workspace:*",
2032
"@platforma-sdk/block-tools": "catalog:",
21-
"shx": "catalog:"
33+
"@platforma-sdk/model": "catalog:",
34+
"shx": "catalog:",
35+
"typescript": "catalog:"
2236
},
2337
"packageManager": "pnpm@9.12.0",
2438
"block": {

block/src/AGENTS.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
// This file is managed by `block-tools structure`. Do not edit by hand.
2+
// Narrow MCP / AI surface.
3+
4+
export type { BlockContract, BlockOutputs, BlockData } from "./index";
5+
export * from "./agents-extra";

block/src/agents-extra.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
// Author-owned. `block-tools structure` does not modify this file.
2+
// MCP / AI extension surface. Add types and functions the agent
3+
// surface should expose.
4+
//
5+
// In the future this file will host JS functions the MCP runtime
6+
// can execute. The `.d.ts` declarations stay visible to the agent;
7+
// the JS bodies execute in the MCP code-execution context (the
8+
// agent sees the types but not the implementation).

block/src/block-extra.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
// Author-owned. `block-tools structure` does not modify this file.
2+
// Add block-specific helper types or values the consumer surface
3+
// should expose. Anything you `export` here flows out via the
4+
// main entry (./index re-exports this file).
5+
//
6+
// Do NOT redefine: BlockContract, BlockOutputs, BlockData,
7+
// BlockPointer, platforma, or the block-named <PascalName>Block*
8+
// aliases — those names come from ./index and `export *` from this
9+
// file would shadow them.

block/src/index.ts

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
// This file is managed by `block-tools structure`. Do not edit by hand.
2+
// Author content lives in ./block-extra.ts.
3+
4+
import { platforma } from "@platforma-open/milaboratories.immune-assay-data.model";
5+
import {
6+
InferOutputsType,
7+
InferDataType,
8+
InferHrefType,
9+
} from "@platforma-sdk/model";
10+
11+
export { platforma };
12+
13+
export type BlockContract = {
14+
outputs: InferOutputsType<typeof platforma>;
15+
data: InferDataType<typeof platforma>;
16+
href: InferHrefType<typeof platforma>;
17+
};
18+
19+
export type BlockOutputs = BlockContract["outputs"];
20+
export type BlockData = BlockContract["data"];
21+
22+
// import.meta.url is a file: URL (always forward-slash, even on Windows:
23+
// file:///C:/…). We expose URLs, NOT paths — the facade stays dependency-free
24+
// and loadable in minimal engines (e.g. QuickJS), and each consumer converts
25+
// at its own edge with the right tool (fileURLToPath in Node), where Windows
26+
// drive letters / %-encoding / UNC are handled correctly. The bundled entry
27+
// sits one dir under the package root (dist/index.js, or src/index.ts in dev),
28+
// so the root is two URL segments up. The structurer owns this layout —
29+
// consumers read these URLs, they never reconstruct <root>/block-pack.
30+
//
31+
// TypeScript ships `ImportMeta.url` only in the `dom`/`webworker` libs; the
32+
// facade tsconfig is lib-minimal (no `dom`, no `@types/node`) by design. We
33+
// type the one ESM-standard member we use with a local cast rather than a
34+
// `declare global` — a global augmentation would leak into the published
35+
// `dist/index.d.ts` and clash with `@types/node`'s `ImportMeta` in full-Node
36+
// consumers (test packages, the Middle Layer).
37+
const selfUrl = (import.meta as ImportMeta & { url: string }).url;
38+
const dirUrl = selfUrl.slice(0, selfUrl.lastIndexOf("/"));
39+
const rootUrl = dirUrl.slice(0, dirUrl.lastIndexOf("/"));
40+
41+
export const BlockPointer = {
42+
type: "from-pack-v2" as const,
43+
packUrl: rootUrl + "/block-pack",
44+
rootUrl,
45+
} as const;
46+
47+
// Block-named aliases for readable cross-block imports in tests and
48+
// consumer code. Same types / same runtime value as the universal
49+
// names above; the aliases avoid `as`-renames at the import site.
50+
export type ImmuneAssayDataBlockContract = BlockContract;
51+
export type ImmuneAssayDataBlockOutputs = BlockOutputs;
52+
export type ImmuneAssayDataBlockData = BlockData;
53+
export const ImmuneAssayDataBlockPointer = BlockPointer;
54+
55+
export * from "./block-extra";

0 commit comments

Comments
 (0)