Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions .changeset/structurer-migration.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
"@platforma-open/milaboratories.rarefaction.model": patch
"@platforma-open/milaboratories.rarefaction.ui": patch
"@platforma-open/milaboratories.rarefaction.workflow": patch
"@platforma-open/milaboratories.rarefaction.software": patch
---

Migrate onto the block-tools structurer (tool-managed layout: oxlint/oxfmt,
ts-builder, regenerated configs) and bump the SDK to latest (model/ui-vue
1.79.15, workflow-tengo 6.6.3, tengo-builder 4.0.9, block-tools 2.11.1). No block
behavior change — the model was already on BlockModelV3.
8 changes: 4 additions & 4 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,12 @@ jobs:
uses: milaboratory/github-ci/.github/workflows/node-simple-pnpm.yaml@v4
with:
app-name: 'Block: Rarefaction'
app-name-slug: 'block-repertoire-rarefaction'
app-name-slug: 'block-rarefaction'
node-version: '20.x'
build-script-name: 'build'
build-script-name: 'build:release'
pnpm-recursive-build: false

test: false
test: true
test-script-name: 'test'
pnpm-recursive-tests: false
team-id: 'ciplopen'
Expand All @@ -55,7 +55,7 @@ jobs:
"PL_CI_TEST_PASSWORD": ${{ toJSON(secrets.PL_CI_TEST_PASSWORD) }},

"AWS_CI_IAM_MONOREPO_SIMPLE_ROLE": ${{ toJSON(secrets.AWS_CI_IAM_MONOREPO_SIMPLE_ROLE) }},
"AWS_CI_TURBOREPO_S3_BUCKET": ${{ toJSON(secrets.AWS_CI_TURBOREPO_US_S3_BUCKET) }},
"AWS_CI_TURBOREPO_S3_BUCKET": ${{ toJSON(secrets.AWS_CI_TURBOREPO_S3_BUCKET) }},
"PL_REGISTRY_PLATFORMA_OPEN_UPLOAD_URL": ${{ toJSON(secrets.PL_REGISTRY_PLOPEN_UPLOAD_URL) }},
"QUAY_USERNAME": ${{ toJSON(secrets.QUAY_USERNAME) }},
"QUAY_ROBOT_TOKEN": ${{ toJSON(secrets.QUAY_ROBOT_TOKEN) }} }
Expand Down
6 changes: 2 additions & 4 deletions .github/workflows/mark-stable.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,18 @@ on:
workflow_dispatch: {}
jobs:
init:
if: github.repository != 'milaboratory/platforma-rarefaction'
runs-on: ubuntu-latest
steps:
- uses: milaboratory/github-ci/actions/context/init@v4
with:
version-canonize: false
branch-versioning: main
run:
if: github.repository != 'milaboratory/platforma-rarefaction'
needs:
- init
uses: milaboratory/github-ci/.github/workflows/block-mark-stable.yaml@v4
with:
app-name: 'Block: rarefaction - Mark Stable'
app-name: 'Block: Rarefaction - Mark Stable'
node-version: '20.x'
npmrc-config: |
{
Expand All @@ -32,5 +30,5 @@ jobs:
{ "NPMJS_TOKEN": ${{ toJSON(secrets.NPMJS_TOKEN) }},
"AWS_CI_IAM_MONOREPO_SIMPLE_ROLE": ${{ toJSON(secrets.AWS_CI_IAM_MONOREPO_SIMPLE_ROLE) }} }

SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
SLACK_CHANNEL: ${{ secrets.SLACK_BLOCKS_CI_CHANNEL }}
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,5 @@ software/*.tgz
.DS_Store
.vscode/sftp.json
test-dry-run.json
.idea/
.idea/
software/**/*.tgz
1 change: 1 addition & 0 deletions .structure
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"version":2}
19 changes: 1 addition & 18 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,20 +1,3 @@
{
"vitest.disableWorkspaceWarning": true,
"editor.defaultFormatter": "dbaeumer.vscode-eslint",
"[typescript]": {
"editor.defaultFormatter": "dbaeumer.vscode-eslint"
},
"[vue]": {
"editor.defaultFormatter": "dbaeumer.vscode-eslint"
},
"cSpell.words": [
"datasource",
"pframe",
"prerun"
],
"editor.codeActionsOnSave": {
"source.fixAll.eslint": "always"
},
"eslint.enable": true,
"eslint.format.enable": true
"typescript.tsdk": "node_modules/typescript/lib"
}
1 change: 0 additions & 1 deletion block/index.d.ts

This file was deleted.

1 change: 0 additions & 1 deletion block/index.js

This file was deleted.

49 changes: 32 additions & 17 deletions block/package.json
Original file line number Diff line number Diff line change
@@ -1,21 +1,40 @@
{
"name": "@platforma-open/milaboratories.rarefaction",
"version": "2.1.0",
"scripts": {
"build": "rm -rf ./block-pack && block-tools pack",
"mark-stable": "block-tools mark-stable -r 's3://milab-euce1-prod-pkgs-s3-block-registry/pub/releases/?region=eu-central-1'",
"prepublishOnly": "block-tools pack && block-tools publish -r 's3://milab-euce1-prod-pkgs-s3-block-registry/pub/releases/?region=eu-central-1'",
"do-pack": "rm -f *.tgz && block-tools pack && pnpm pack && mv *.tgz package.tgz"
},
"files": [
"index.d.ts",
"index.js"
"dist",
"block-pack"
],
"dependencies": {
"@platforma-open/milaboratories.rarefaction.workflow": "workspace:*",
"type": "module",
"main": "./dist/index.js",
"module": "./dist/index.js",
"types": "./dist/index.d.ts",
"exports": {
".": {
"sources": "./src/index.ts",
"types": "./dist/index.d.ts",
"default": "./dist/index.js"
}
},
"scripts": {
"build": "ts-builder build --target block-facade && block-tools pack",
"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",
"do-pack": "shx rm -f package.tgz && pnpm pack && shx mv *.tgz package.tgz",
"check": "ts-builder type-check --target block-facade"
},
"dependencies": {},
"devDependencies": {
"@milaboratories/ts-builder": "catalog:",
"@milaboratories/ts-configs": "catalog:",
"@platforma-open/milaboratories.rarefaction.model": "workspace:*",
"@platforma-open/milaboratories.rarefaction.ui": "workspace:*"
"@platforma-open/milaboratories.rarefaction.ui": "workspace:*",
"@platforma-open/milaboratories.rarefaction.workflow": "workspace:*",
"@platforma-sdk/block-tools": "catalog:",
"@platforma-sdk/model": "catalog:",
"shx": "catalog:",
"typescript": "catalog:"
},
"packageManager": "pnpm@9.12.0",
"block": {
"components": {
"workflow": "@platforma-open/milaboratories.rarefaction.workflow/dist/tengo/tpl/main.plj.gz",
Expand Down Expand Up @@ -43,9 +62,5 @@
"logo": "file:../logos/organization-logo.png"
}
}
},
"devDependencies": {
"@platforma-sdk/block-tools": "catalog:"
},
"packageManager": "pnpm@9.12.0"
}
}
}
5 changes: 5 additions & 0 deletions block/src/AGENTS.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
// This file is managed by `block-tools structure`. Do not edit by hand.
// Narrow MCP / AI surface.

export type { BlockContract, BlockOutputs, BlockData } from "./index";
export * from "./agents-extra";
8 changes: 8 additions & 0 deletions block/src/agents-extra.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
// Author-owned. `block-tools structure` does not modify this file.
// MCP / AI extension surface. Add types and functions the agent
// surface should expose.
//
// In the future this file will host JS functions the MCP runtime
// can execute. The `.d.ts` declarations stay visible to the agent;
// the JS bodies execute in the MCP code-execution context (the
// agent sees the types but not the implementation).
9 changes: 9 additions & 0 deletions block/src/block-extra.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
// Author-owned. `block-tools structure` does not modify this file.
// Add block-specific helper types or values the consumer surface
// should expose. Anything you `export` here flows out via the
// main entry (./index re-exports this file).
//
// Do NOT redefine: BlockContract, BlockOutputs, BlockData,
// BlockPointer, platforma, or the block-named <PascalName>Block*
// aliases — those names come from ./index and `export *` from this
// file would shadow them.
55 changes: 55 additions & 0 deletions block/src/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
// This file is managed by `block-tools structure`. Do not edit by hand.
// Author content lives in ./block-extra.ts.

import { platforma } from "@platforma-open/milaboratories.rarefaction.model";
import {
InferOutputsType,
InferDataType,
InferHrefType,
} from "@platforma-sdk/model";

export { platforma };

export type BlockContract = {
outputs: InferOutputsType<typeof platforma>;
data: InferDataType<typeof platforma>;
href: InferHrefType<typeof platforma>;
};

export type BlockOutputs = BlockContract["outputs"];
export type BlockData = BlockContract["data"];

// import.meta.url is a file: URL (always forward-slash, even on Windows:
// file:///C:/…). We expose URLs, NOT paths — the facade stays dependency-free
// and loadable in minimal engines (e.g. QuickJS), and each consumer converts
// at its own edge with the right tool (fileURLToPath in Node), where Windows
// drive letters / %-encoding / UNC are handled correctly. The bundled entry
// sits one dir under the package root (dist/index.js, or src/index.ts in dev),
// so the root is two URL segments up. The structurer owns this layout —
// consumers read these URLs, they never reconstruct <root>/block-pack.
//
// TypeScript ships `ImportMeta.url` only in the `dom`/`webworker` libs; the
// facade tsconfig is lib-minimal (no `dom`, no `@types/node`) by design. We
// type the one ESM-standard member we use with a local cast rather than a
// `declare global` — a global augmentation would leak into the published
// `dist/index.d.ts` and clash with `@types/node`'s `ImportMeta` in full-Node
// consumers (test packages, the Middle Layer).
const selfUrl = (import.meta as ImportMeta & { url: string }).url;
const dirUrl = selfUrl.slice(0, selfUrl.lastIndexOf("/"));
const rootUrl = dirUrl.slice(0, dirUrl.lastIndexOf("/"));

export const BlockPointer = {
type: "from-pack-v2" as const,
packUrl: rootUrl + "/block-pack",
rootUrl,
} as const;

// Block-named aliases for readable cross-block imports in tests and
// consumer code. Same types / same runtime value as the universal
// names above; the aliases avoid `as`-renames at the import site.
export type RarefactionBlockContract = BlockContract;
export type RarefactionBlockOutputs = BlockOutputs;
export type RarefactionBlockData = BlockData;
export const RarefactionBlockPointer = BlockPointer;

export * from "./block-extra";
4 changes: 4 additions & 0 deletions block/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"extends": "@milaboratories/ts-configs/block/facade",
"include": ["src/**/*"]
}
4 changes: 4 additions & 0 deletions model/.oxfmtrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"extends": ["node_modules/@milaboratories/ts-builder/configs/oxfmt.json"],
"ignorePatterns": ["dist", "coverage", "CHANGELOG.md"]
}
3 changes: 3 additions & 0 deletions model/.oxlintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"extends": ["node_modules/@milaboratories/ts-builder/dist/configs/oxlint-block-model.json"]
}
4 changes: 0 additions & 4 deletions model/eslint.config.mjs

This file was deleted.

31 changes: 17 additions & 14 deletions model/package.json
Original file line number Diff line number Diff line change
@@ -1,37 +1,40 @@
{
"name": "@platforma-open/milaboratories.rarefaction.model",
"version": "2.1.0",
"private": true,
"description": "Block model",
"type": "module",
"main": "./dist/index.js",
"types": "./dist/index.d.ts",
"main": "dist/index.cjs",
"module": "dist/index.js",
"types": "dist/index.d.ts",
"exports": {
".": {
"types": "./dist/index.d.ts",
"import": "./dist/index.js",
"default": "./dist/index.js",
"sources": "./src/index.ts"
"sources": "./src/index.ts",
"import": "./dist/index.js"
},
"./dist/model.json": "./dist/model.json"
"./dist/*": "./dist/*"
},
"scripts": {
"build": "ts-builder build --target block-model && block-tools build-model",
"watch": "ts-builder build --target block-model --watch",
"type-check": "ts-builder type-check --target block-model",
"lint": "eslint ."
"fmt": "ts-builder format",
"check": "ts-builder check --target block-model"
},
"dependencies": {
"@platforma-sdk/model": "catalog:",
"@milaboratories/graph-maker": "catalog:",
"@milaboratories/helpers": "catalog:"
"@milaboratories/helpers": "catalog:",
"@platforma-sdk/model": "catalog:"
},
"devDependencies": {
"@milaboratories/ts-builder": "catalog:",
"@milaboratories/ts-configs": "catalog:",
"@platforma-sdk/block-tools": "catalog:",
"@platforma-sdk/eslint-config": "catalog:",
"eslint": "catalog:",
"typescript": "catalog:",
"vitest": "catalog:"
"eslint": "catalog:"
},
"peerDependencies": {
"@types/node": "*",
"typescript": "*"
}
}
}
Loading
Loading