You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have been doing some discovery on why this happens and discovered that the issue lies in this function:
\node_modules@faustwp\cli\dist\blockset.js:53
/**
* Fetches paths to all block.json files while ignoring node_modules.
*
* @returns {Promise<string[]>} - An array of paths to block.json files.
*/
export async function fetchBlockFiles() {
return glob(`${FAUST_BUILD_DIR}/**/block.json`, {
ignore: IGNORE_NODE_MODULES,
});
}
FAUST_BUILD_DIR contained the path to Faust Build folder in the Windows format ( \project-name.faust\ ) and based on what I researched, a glob pattern should be in POSIX format. (//). Since glob could not process this path correctly, fetchBlockFiles() would always return empty array.
I have fixed it in my local environment by formatting FAUST_BUILD_DIR with .replace(/\\/g, '/') and faust blockset has started to perform the script and detect blocks correctly
Steps to reproduce
Clone the faustwp-getting-started example project
"blockset": "faust blockset" in the package.json
npm run blockset
The blocks generated by @faustwp/blocks would not appear in WP, .faust/blocks folder only contains manifest.json with blocks: [], .zip archive only contains manifest.json
Additional context
No response
@faustwp/core Version
2.1.2
@faustwp/cli Version
2.0.0
FaustWP Plugin Version
1.2.1
WordPress Version
6.4.3
Additional environment details
@faustwp/blocks: 2.0.0
Windows 11 Home Version 22H2
Please confirm that you have searched existing issues in the repo.
Yes
The text was updated successfully, but these errors were encountered:
Description
Hello!
I have been running faust blockset command and every time my .faust folder would only contain these files:
block.zip only contains manifest.json with this kind of data:
I have been doing some discovery on why this happens and discovered that the issue lies in this function:
\node_modules@faustwp\cli\dist\blockset.js:53
FAUST_BUILD_DIR contained the path to Faust Build folder in the Windows format ( \project-name.faust\ ) and based on what I researched, a glob pattern should be in POSIX format. (//). Since glob could not process this path correctly, fetchBlockFiles() would always return empty array.
I have fixed it in my local environment by formatting FAUST_BUILD_DIR with
.replace(/\\/g, '/')
andfaust blockset
has started to perform the script and detect blocks correctlySteps to reproduce
faustwp-getting-started
example projectAdditional context
No response
@faustwp/core Version
2.1.2
@faustwp/cli Version
2.0.0
FaustWP Plugin Version
1.2.1
WordPress Version
6.4.3
Additional environment details
@faustwp/blocks: 2.0.0
Windows 11 Home Version 22H2
Please confirm that you have searched existing issues in the repo.
The text was updated successfully, but these errors were encountered: