fix[faustwp-cli]: resolve blockset globs against the build directory - #2494
Open
eastagiletracker wants to merge 1 commit into
Open
fix[faustwp-cli]: resolve blockset globs against the build directory#2494eastagiletracker wants to merge 1 commit into
eastagiletracker wants to merge 1 commit into
Conversation
eastagiletracker
requested review from
a team,
colinmurphy and
josephfusco
as code owners
August 13, 2026 08:31
|
Currently, we do not support the creation of preview deployments based on changes coming from forked repositories. |
🦋 Changeset detectedLatest commit: 3565b0f The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR proposes a fix for
faust blocksetdiscovering no blocks when the project's own directory path gets parsed as glob syntax instead of as a literal path — the Windows case reported in #1804, and the same silent failure on macOS and Linux whenever a directory name contains a character such as[or](Fixes #1804). We include this PR work along with a full history of your repo at https://eastagiletracker.com/projects/302. You can sign in with your GitHub ID to claim ownership of the project.What goes wrong
fetchBlockFiles()interpolatesFAUST_BUILD_DIR— an OS path derived fromprocess.cwd()— straight into a glob pattern:Everything left of
/**/is then read as pattern syntax rather than as a directory name, and a real project path has two ways of containing syntax. On Windowspath.joinseparates with\, which glob reads as an escape character, so the whole directory prefix collapses into one literal segment that cannot exist on disk:On any platform, a directory named something like
my site[1]is read as a character class. Either wayfetchBlockFiles()resolves to[],blockset()writes{"blocks": []}tomanifest.json, and the command still exits 0 — which is exactly the empty.faust/blocks/manifest.jsondescribed in #1804.processBlockFiles()builds its PHP-cleanup pattern the same way, so on those same paths the.phpfiles copied into.faust/blocks/<block>are never stripped and end up insideblocks.zip.Reproducing it on current
canary(402bfd2)The two tests added here are the reproduction, and they fail against
canary'sblockset.ts:I also drove the built CLI end to end against a compiled block on disk, running from the project directory, with a plain directory name as the control:
The change
Both call sites now hand the directory to glob's
cwdoption and keep the pattern a constant, so the path is treated as data and never parsed:absolute: truekeeps the existing contract intact —processBlockFiles()still receives absolute paths, and thepath.dirname/path.basenamehandling downstream is untouched. This is deliberately not a.replace(/\\/g, '/')on the path: normalising separators would fix Windows and still leavemy site[1]broken, whilecwdcovers both. A changeset is included, per CONTRIBUTING.Verification
I ran the repo's own checks on a clean
canarycheckout first, then again with this change:npm test(build plus the@faustwp/core,@faustwp/cli,@faustwp/blocksand@faustwp/block-editor-utilssuites),npm run lint, andnpm run test:format. All three exit 0 in both runs, with no failures either side. The only difference between the two is the@faustwp/clisuite going from 10 files / 37 tests to 11 files / 39 tests — the two added here, which fail without theblockset.tschange and pass with it. Node 24.15.0, npm 11.12.1.How this was managed
This work was tracked on a live board built from this repository's own history — 1,524 of your issues and pull requests imported as stories, carrying your 49 labels, with milestones as epics. The story behind this PR is fetchBlockFiles returns empty Array while running faust blockset, and the board it lives on is at https://eastagiletracker.com/projects/302.
If you'd rather not receive contributions like this, reply
no-more-prson this pull request and we won't open any further ones on your repositories.Lawrence W. Sinclair
CEO / East Agile
linkedin.com/in/lwsinclair/
eastagile.com