Update prepublishOnly script to align with latest block-tools - #120
Conversation
There was a problem hiding this comment.
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.
| "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" |
There was a problem hiding this comment.
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.
| "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" |
| "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" |
There was a problem hiding this 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.
| "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!
Greptile Summary
This PR updates the
prepublishOnlyscript inblock/package.jsonto align with the latestblock-toolsAPI, adding the required--registry-serve-urlargument toblock-tools publish. A patch-level changeset is included.prepublishOnlyscript (block/package.json):block-tools publishnow receives a--registry-serve-urlargument pointing to the public-facing block registry. The single quotes previously wrapping the-rS3 URL were also removed, creating a minor inconsistency with the still-quotedmark-stablescript..changeset/many-cows-hang.md): Registers apatchbump for@platforma-open/milaboratories.mixcr-shm-treesto version the script change.Touched terms:
prepublishOnlynpm publish--registry-serve-urltoblock-tools publishand unquoted the-rS3 URLblock-tools publish--registry-serve-urlto specify the public serve base URL--registry-serve-urlblock-tools publishflag pointing to the public HTTP registry endpointhttps://blocks.pl-open.sciencemany-cows-hang.mdadded for this changeConfidence 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
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])%%{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])Prompt To Fix All With AI
Reviews (1): Last reviewed commit: "Update prepublishOnly script to align wi..." | Re-trigger Greptile
Context used: