Skip to content

Update prepublishOnly script to align with latest block-tools - #120

Merged
kevindetry-milaboratories merged 1 commit into
mainfrom
push-wymqxvzuuvom
Jul 12, 2026
Merged

Update prepublishOnly script to align with latest block-tools#120
kevindetry-milaboratories merged 1 commit into
mainfrom
push-wymqxvzuuvom

Conversation

@kevindetry-milaboratories

@kevindetry-milaboratories kevindetry-milaboratories commented Jul 12, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR updates the prepublishOnly script in block/package.json to align with the latest block-tools API, adding the required --registry-serve-url argument to block-tools publish. A patch-level changeset is included.

  • prepublishOnly script (block/package.json): block-tools publish now receives a --registry-serve-url argument pointing to the public-facing block registry. The single quotes previously wrapping the -r S3 URL were also removed, creating a minor inconsistency with the still-quoted mark-stable script.
  • Changeset (.changeset/many-cows-hang.md): Registers a patch bump for @platforma-open/milaboratories.mixcr-shm-trees to version the script change.

Touched terms:

Term Definition Change
prepublishOnly npm lifecycle hook executed automatically before npm publish Updated to pass --registry-serve-url to block-tools publish and unquoted the -r S3 URL
block-tools publish CLI subcommand that packages and pushes a block to the S3 registry Now accepts --registry-serve-url to specify the public serve base URL
--registry-serve-url New block-tools publish flag pointing to the public HTTP registry endpoint Added, set to https://blocks.pl-open.science
changeset Versioning artifact consumed by Changesets tooling to produce a release New patch-level entry many-cows-hang.md added for this change

Confidence Score: 4/5

Safe to merge; the functional change adds --registry-serve-url which aligns the script with the latest block-tools interface.

The core change is straightforward and intentional. The only notable issue is that single quotes around the S3 URL were dropped in prepublishOnly while the identical URL in mark-stable remains quoted, leaving a shell wildcard character unguarded in an edge case. This is unlikely to cause real failures in practice.

block/package.json — the unquoted S3 URL is worth a second look for consistency with mark-stable

Important Files Changed

Filename Overview
block/package.json prepublishOnly script updated: adds --registry-serve-url to block-tools publish, and removes single quotes around the S3 -r URL (inconsistent with mark-stable)
.changeset/many-cows-hang.md New patch-level changeset for @platforma-open/milaboratories.mixcr-shm-trees documenting the prepublishOnly script update

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A([npm publish]) --> B[prepublishOnly hook fires]
    B --> C[block-tools pack]
    C --> D{Pack successful?}
    D -- No --> E([Abort])
    D -- Yes --> F["block-tools publish -r S3_URL --registry-serve-url https://blocks.pl-open.science"]
    F --> G([Block published to S3 + served at blocks.pl-open.science])
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([npm publish]) --> B[prepublishOnly hook fires]
    B --> C[block-tools pack]
    C --> D{Pack successful?}
    D -- No --> E([Abort])
    D -- Yes --> F["block-tools publish -r S3_URL --registry-serve-url https://blocks.pl-open.science"]
    F --> G([Block published to S3 + served at blocks.pl-open.science])
Loading

Fix All in Claude Code

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

---

### Issue 1 of 1
block/package.json:8
The `-r` URL in `prepublishOnly` is now unquoted, while the identical URL in `mark-stable` is still wrapped in single quotes. The `?` in `?region=eu-central-1` is a shell wildcard character; although most shells won't glob-expand it because `s3://` is not a filesystem path, removing quotes creates an inconsistency with the rest of the scripts and introduces an unnecessary fragility if the shell environment differs.

```suggestion
    "prepublishOnly": "block-tools pack && 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"
```

Reviews (1): Last reviewed commit: "Update prepublishOnly script to align wi..." | Re-trigger Greptile

Greptile also left 1 inline comment 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 updates the prepublishOnly script in block/package.json to include the --registry-serve-url option. The reviewer noted that removing the quotes around the S3 URL containing a ? character could lead to shell expansion errors (such as in zsh) and provided a suggestion to wrap the URL in single quotes.

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
"build": "shx 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'"
"prepublishOnly": "block-tools pack && 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"

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 S3 URL contains a ? character (?region=eu-central-1). Without quotes, some shells (like zsh) will treat ? as a glob wildcard and fail with a 'no matches found' error. It is safer to wrap the URL in single quotes, similar to how it is done in the mark-stable script.

Suggested change
"prepublishOnly": "block-tools pack && 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"
"prepublishOnly": "block-tools pack && 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"

Comment thread block/package.json
"build": "shx 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'"
"prepublishOnly": "block-tools pack && 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"

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 The -r URL in prepublishOnly is now unquoted, while the identical URL in mark-stable is still wrapped in single quotes. The ? in ?region=eu-central-1 is a shell wildcard character; although most shells won't glob-expand it because s3:// is not a filesystem path, removing quotes creates an inconsistency with the rest of the scripts and introduces an unnecessary fragility if the shell environment differs.

Suggested change
"prepublishOnly": "block-tools pack && 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"
"prepublishOnly": "block-tools pack && 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"
Prompt To Fix With AI
This is a comment left during a code review.
Path: block/package.json
Line: 8

Comment:
The `-r` URL in `prepublishOnly` is now unquoted, while the identical URL in `mark-stable` is still wrapped in single quotes. The `?` in `?region=eu-central-1` is a shell wildcard character; although most shells won't glob-expand it because `s3://` is not a filesystem path, removing quotes creates an inconsistency with the rest of the scripts and introduces an unnecessary fragility if the shell environment differs.

```suggestion
    "prepublishOnly": "block-tools pack && 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"
```

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

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

Fix in Claude Code

@kevindetry-milaboratories
kevindetry-milaboratories added this pull request to the merge queue Jul 12, 2026
Merged via the queue into main with commit 1d8a82c Jul 12, 2026
12 checks passed
@kevindetry-milaboratories
kevindetry-milaboratories deleted the push-wymqxvzuuvom branch July 12, 2026 12:29
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