Skip to content

Migrate block onto the structurer - #10

Merged
mzueva merged 4 commits into
mainfrom
mzueva/structure-migration
Jun 22, 2026
Merged

mzueva merged 4 commits into
mainfrom
mzueva/structure-migration

Conversation

@mzueva

@mzueva mzueva commented Jun 19, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR migrates the block onto the block-tools structurer pattern (adding .structure, centralizing tsconfig/oxfmt/oxlint configs via @milaboratories/ts-builder presets, and generating block/index.js+index.d.ts) while simultaneously bumping the whole SDK toolchain: block-tools 2.10.12→2.11.0, workflow-tengo 6.5.0→6.6.3, model/ui-vue/test 1.79.0→1.79.14, tengo-builder 4.0.7→4.0.8, ts-builder 1.5.0→1.5.2.

Touched terms:

  • .structure / structurer — New sentinel file {\"version\":1} that marks the block as layout-managed by block-tools structure refresh. Future upgrade-sdk runs will use this file to keep tooling config in sync automatically.
  • blockSpec — New exported constant in block/index.js (type: \"dev-v2\", folder: __dirname) that replaces the old workflow-level Templates export as the canonical handle a host app uses to locate the block's compiled artifacts.
  • catalog — pnpm workspace shared version registry in pnpm-workspace.yaml. vitest (~4.0.18) was added here; all SDK packages bumped to their latest patch.
  • block-tools (@platforma-sdk/block-tools) — Upgraded to 2.11.0; gains the structure refresh subcommand used by the new update-sdk / upgrade-sdk root scripts.
  • workflow-tengo (@platforma-sdk/workflow-tengo) — Upgraded from 6.5.0 to 6.6.3; drives the Tengo workflow compiler.
  • ts-builder (@milaboratories/ts-builder) — Upgraded to 1.5.2; now owns the shared oxfmt/oxlint JSON presets that all package-level .oxfmtrc.json / .oxlintrc.json files extend.
  • model dual CJS/ESMmodel/package.json gains \"module\": \"dist/index.js\" and changes \"main\" to dist/index.cjs, completing the standard dual-output layout introduced by the new ts-builder target.

Confidence Score: 4/5

Safe to merge with one item to verify: the workflow test script calls vitest but vitest is no longer declared as a direct dependency of that package.

The bulk of the change is mechanical tool-managed scaffolding and SDK version bumps consistent throughout all packages. The one real concern is workflow/package.json where vitest was removed from peerDependencies and vitest.config.mts was deleted, but the test script was kept. Whether this fails in CI depends on whether pnpm hoists the vitest binary from @platforma-sdk/test. The test package correctly added vitest explicitly; the workflow package did not follow the same pattern.

workflow/package.json — verify the test script is still runnable after vitest was removed from peerDependencies and vitest.config.mts was deleted.

Important Files Changed

Filename Overview
workflow/package.json Deleted vitest.config.mts, emptied peerDependencies, removed vitest, but kept the test:vitest script — likely to break in CI unless @platforma-sdk/test re-exports the vitest binary.
.github/workflows/build.yaml Removed hello-world template guards, enabled tests, dropped GitHub Packages registry, changed app-name casing (3D to 3d). The mark-stable workflow received the same app-name change plus lost internal hyphens.
block/package.json Added mark-stable script, moved shx to devDependencies, added block/index.js and index.d.ts, reordered fields to align with structurer layout.
model/package.json Adds module field and changes main to dist/index.cjs for dual CJS/ESM publishing, consistent with ts-builder 1.5.2 output format.
pnpm-workspace.yaml Added vitest ~4.0.18 to the catalog; SDK packages bumped to their latest patch versions.
package.json Dropped --env-mode=loose from the test command, updated update-sdk script to use structurer, added do-pack and upgrade-sdk scripts, loosened oxlint version pin.
.structure New sentinel file marking the block as managed by block-tools structurer.
test/package.json Correctly moves vitest from a free-range specifier to catalog:, and adds ts-builder/ts-configs as devDependencies.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[block-tools structure refresh] -->|generates| B[.structure sentinel]
    A -->|generates| C[block/index.js + index.d.ts]
    A -->|generates| D[per-pkg tsconfig.json]
    A -->|generates| E[per-pkg oxfmtrc / oxlintrc]

    subgraph block_package [block package]
        C -->|exports| F["blockSpec: type=dev-v2, folder=__dirname"]
    end

    subgraph workflow_package [workflow package]
        G["test script: vitest"] -->|vitest removed from deps| H{vitest accessible?}
        H -->|"via @platforma-sdk/test hoist"| I[tests pass]
        H -->|pnpm strict isolation| J[CI failure]
    end

    subgraph sdk_bump [SDK Bumps]
        L[block-tools 2.10.12 to 2.11.0]
        M[workflow-tengo 6.5.0 to 6.6.3]
        N[model + ui-vue + test 1.79.0 to 1.79.14]
        O[ts-builder 1.5.0 to 1.5.2]
    end
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-tools structure refresh] -->|generates| B[.structure sentinel]
    A -->|generates| C[block/index.js + index.d.ts]
    A -->|generates| D[per-pkg tsconfig.json]
    A -->|generates| E[per-pkg oxfmtrc / oxlintrc]

    subgraph block_package [block package]
        C -->|exports| F["blockSpec: type=dev-v2, folder=__dirname"]
    end

    subgraph workflow_package [workflow package]
        G["test script: vitest"] -->|vitest removed from deps| H{vitest accessible?}
        H -->|"via @platforma-sdk/test hoist"| I[tests pass]
        H -->|pnpm strict isolation| J[CI failure]
    end

    subgraph sdk_bump [SDK Bumps]
        L[block-tools 2.10.12 to 2.11.0]
        M[workflow-tengo 6.5.0 to 6.6.3]
        N[model + ui-vue + test 1.79.0 to 1.79.14]
        O[ts-builder 1.5.0 to 1.5.2]
    end
Loading

Fix All in Claude Code

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

---

### Issue 1 of 3
workflow/package.json:8
**`vitest` removed but test script retained**

`vitest` was previously declared as a `peerDependency` (`"vitest": "*"`) and `vitest.config.mts` was deleted, but the `"test": "vitest"` script was not updated. With no `vitest` in `dependencies`, `devDependencies`, or `peerDependencies`, the CI `test` step for this package will fail unless `@platforma-sdk/test` exposes a usable `vitest` binary as a hoisted transitive dependency — which pnpm's strict isolation does not guarantee.

The sibling `test` package avoids this by explicitly adding `vitest: "catalog:"` to `devDependencies` and using `vitest run --passWithNoTests`. Either add `vitest: "catalog:"` to this package's `devDependencies`, or remove the stale `test` script.

### Issue 2 of 3
.github/workflows/build.yaml:40
**App name case change may break tracking integrations**

`'Block: 3D Structure-Based Liabilities'` was changed to `'Block: 3d Structure-Based Liabilities'` (lowercase `d`). The same inconsistency appears in `mark-stable.yaml`, where the name also loses its hyphens: `'Block: 3d Structure Based Liabilities - Mark Stable'`. If this `app-name` is used to key dashboards, Slack notifications, or release tracking in the CI system, both workflows should use the same casing, and any existing references to the original name will no longer match.

### Issue 3 of 3
package.json:10
**`--env-mode=loose` removal may silently hide env vars from tests**

Removing `--env-mode=loose` from the `test` script means Turbo now runs in its default (strict) mode where only env vars listed in `passThroughEnv` are forwarded. The `turbo.json` `test` task currently declares `["PL_ADDRESS", "PL_TEST_PASSWORD", "PL_TEST_USER", "PL_TEST_PROXY", "DEBUG"]`. Any test that consumes an env var not in this list will silently receive `undefined` rather than a CI failure, which can produce misleading test results.

Reviews (1): Last reviewed commit: "Migrate block onto the structurer" | Re-trigger Greptile

Greptile also left 3 inline comments on this PR.

Context used:

  • Context used - Terms is a types in codebase. Provide the list of ... (source)

@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 performs a significant migration of the project structure to use a new 'structurer' tool, upgrades the SDK toolchain, and updates dependencies across the workspace. It also cleans up configuration files and reorganizes package scripts. I have identified two issues: the root package.json is missing a fmt script required by the new upgrade-sdk command, and the workflow package is missing vitest in its devDependencies despite using it in its test script.

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 package.json
Comment on lines +17 to +19
"update-sdk": "block-tools structure refresh --update-deps-only",
"do-pack": "turbo run do-pack",
"upgrade-sdk": "block-tools structure refresh --update-deps-only && pnpm i && block-tools structure refresh && pnpm i && pnpm fmt"

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

The upgrade-sdk script runs pnpm fmt at the end, but there is no fmt script defined in the root package.json. This will cause the command to fail with a Missing script: fmt error. Consider adding a root fmt script that delegates to turbo run fmt so that all workspace packages are formatted correctly.

    "update-sdk": "block-tools structure refresh --update-deps-only",
    "do-pack": "turbo run do-pack",
    "fmt": "turbo run fmt",
    "upgrade-sdk": "block-tools structure refresh --update-deps-only && pnpm i && block-tools structure refresh && pnpm i && pnpm fmt"

Comment thread workflow/package.json
Comment on lines 17 to +18
"@platforma-sdk/tengo-builder": "catalog:",
"@platforma-sdk/test": "catalog:"
"@platforma-sdk/test": "catalog:",

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

The test script in this package runs vitest, but vitest has been removed from peerDependencies and is not declared in devDependencies or dependencies. This will cause pnpm test to fail in this workspace. Please add vitest to devDependencies using the catalog.

Suggested change
"@platforma-sdk/tengo-builder": "catalog:",
"@platforma-sdk/test": "catalog:"
"@platforma-sdk/test": "catalog:",
"@platforma-sdk/test": "catalog:",
"shx": "catalog:",
"vitest": "catalog:"

Comment thread workflow/package.json Outdated
"scripts": {
"build": "shx rm -rf dist && pl-tengo check && pl-tengo build",
"build": "shx rm -rf dist && pl-tengo build",
"test": "vitest",

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 vitest removed but test script retained

vitest was previously declared as a peerDependency ("vitest": "*") and vitest.config.mts was deleted, but the "test": "vitest" script was not updated. With no vitest in dependencies, devDependencies, or peerDependencies, the CI test step for this package will fail unless @platforma-sdk/test exposes a usable vitest binary as a hoisted transitive dependency — which pnpm's strict isolation does not guarantee.

The sibling test package avoids this by explicitly adding vitest: "catalog:" to devDependencies and using vitest run --passWithNoTests. Either add vitest: "catalog:" to this package's devDependencies, or remove the stale test script.

Prompt To Fix With AI
This is a comment left during a code review.
Path: workflow/package.json
Line: 8

Comment:
**`vitest` removed but test script retained**

`vitest` was previously declared as a `peerDependency` (`"vitest": "*"`) and `vitest.config.mts` was deleted, but the `"test": "vitest"` script was not updated. With no `vitest` in `dependencies`, `devDependencies`, or `peerDependencies`, the CI `test` step for this package will fail unless `@platforma-sdk/test` exposes a usable `vitest` binary as a hoisted transitive dependency — which pnpm's strict isolation does not guarantee.

The sibling `test` package avoids this by explicitly adding `vitest: "catalog:"` to `devDependencies` and using `vitest run --passWithNoTests`. Either add `vitest: "catalog:"` to this package's `devDependencies`, or remove the stale `test` script.

How can I resolve this? If you propose a fix, please make it concise.

Fix in Claude Code

create-tag: true
create-tag: 'true'

npmrc-config: |

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 App name case change may break tracking integrations

'Block: 3D Structure-Based Liabilities' was changed to 'Block: 3d Structure-Based Liabilities' (lowercase d). The same inconsistency appears in mark-stable.yaml, where the name also loses its hyphens: 'Block: 3d Structure Based Liabilities - Mark Stable'. If this app-name is used to key dashboards, Slack notifications, or release tracking in the CI system, both workflows should use the same casing, and any existing references to the original name will no longer match.

Prompt To Fix With AI
This is a comment left during a code review.
Path: .github/workflows/build.yaml
Line: 40

Comment:
**App name case change may break tracking integrations**

`'Block: 3D Structure-Based Liabilities'` was changed to `'Block: 3d Structure-Based Liabilities'` (lowercase `d`). The same inconsistency appears in `mark-stable.yaml`, where the name also loses its hyphens: `'Block: 3d Structure Based Liabilities - Mark Stable'`. If this `app-name` is used to key dashboards, Slack notifications, or release tracking in the CI system, both workflows should use the same casing, and any existing references to the original name will no longer match.

How can I resolve this? If you propose a fix, please make it concise.

Fix in Claude Code

Comment thread package.json
@@ -8,13 +8,15 @@
"check": "turbo run check",
"build": "turbo run build",
"build:dev": "env PL_PKG_DEV=local turbo run build",

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 --env-mode=loose removal may silently hide env vars from tests

Removing --env-mode=loose from the test script means Turbo now runs in its default (strict) mode where only env vars listed in passThroughEnv are forwarded. The turbo.json test task currently declares ["PL_ADDRESS", "PL_TEST_PASSWORD", "PL_TEST_USER", "PL_TEST_PROXY", "DEBUG"]. Any test that consumes an env var not in this list will silently receive undefined rather than a CI failure, which can produce misleading test results.

Prompt To Fix With AI
This is a comment left during a code review.
Path: package.json
Line: 10

Comment:
**`--env-mode=loose` removal may silently hide env vars from tests**

Removing `--env-mode=loose` from the `test` script means Turbo now runs in its default (strict) mode where only env vars listed in `passThroughEnv` are forwarded. The `turbo.json` `test` task currently declares `["PL_ADDRESS", "PL_TEST_PASSWORD", "PL_TEST_USER", "PL_TEST_PROXY", "DEBUG"]`. Any test that consumes an env var not in this list will silently receive `undefined` rather than a CI failure, which can produce misleading test results.

How can I resolve this? If you propose a fix, please make it concise.

Fix in Claude Code

@mzueva
mzueva merged commit a7e0c04 into main Jun 22, 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.

1 participant