Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug: Fix blockset cli failing when path contains spaces #1669

Merged
merged 1 commit into from
Dec 5, 2023

Conversation

theodesp
Copy link
Member

@theodesp theodesp commented Dec 5, 2023

Tasks

  • I have signed a Contributor License Agreement (CLA) with WP Engine.
  • If a code change, I have written testing instructions that the whole team & outside contributors can understand.
  • I have written and included a comprehensive changeset to properly document the changes I've made.

Description

Fixes a bug when blockset cli command fails to complete when a path to the output-folder contains spaces:

Reproduction

The following error happens when you use faust blockset command when running the project root that contains a space in the path:

❯ npm run blockset

> @faustwp/[email protected] blockset
> faust blockset

warn - Could not find FAUST_SECRET_KEY environment variable.
warn - Some functionality may be limited.
info - Faust: Compiling Blocks into /Users/theo.despoudis/Local Sites/my-app/.faust/build
...
ERROR in build
Module not found: Error: Can't resolve './Sites/my-app/.faust/build' in '/Users/theo.despoudis/Local Sites/my-app'
resolve './Sites/my-app/.faust/build' in '/Users/theo.despoudis/Local Sites/my-app'
  using description file: /Users/theo.despoudis/Local Sites/my-app/package.json (relative path: .)
    Field 'browser' doesn't contain a valid alias configuration
    using description file: /Users/theo.despoudis/Local Sites/my-app/package.json (relative path: ./Sites/my-app/.faust/build)
      no extension
        Field 'browser' doesn't contain a valid alias configuration
        /Users/theo.despoudis/Local Sites/my-app/Sites/my-app/.faust/build doesn't exist
      .jsx
        Field 'browser' doesn't contain a valid alias configuration
        /Users/theo.despoudis/Local Sites/my-app/Sites/my-app/.faust/build.jsx doesn't exist
      .ts
        Field 'browser' doesn't contain a valid alias configuration
        /Users/theo.despoudis/Local Sites/my-app/Sites/my-app/.faust/build.ts doesn't exist
      .tsx
        Field 'browser' doesn't contain a valid alias configuration
        /Users/theo.despoudis/Local Sites/my-app/Sites/my-app/.faust/build.tsx doesn't exist
      .js
        Field 'browser' doesn't contain a valid alias configuration
        /Users/theo.despoudis/Local Sites/my-app/Sites/my-app/.faust/build.js doesn't exist
      .json
        Field 'browser' doesn't contain a valid alias configuration
        /Users/theo.despoudis/Local Sites/my-app/Sites/my-app/.faust/build.json doesn't exist
      .wasm
        Field 'browser' doesn't contain a valid alias configuration
        /Users/theo.despoudis/Local Sites/my-app/Sites/my-app/.faust/build.wasm doesn't exist
      as directory
        /Users/theo.despoudis/Local Sites/my-app/Sites/my-app/.faust/build doesn't exist

exec command is tokenizing the --output-path causing the issue:

npm verb argv "exec" "wp-scripts" "start" "--package" "@wordpress/scripts" "--loglevel" "verbose" "--" "--no-watch" "--webpack-src-dir=wp-blocks" "--output-path=/Users/theo.despoudis/Local" "Sites/my-app/.faust/build"

Related Issue(s):

Testing

Screenshots

Documentation Changes

Dependant PRs

@theodesp theodesp requested a review from a team as a code owner December 5, 2023 10:43
Copy link

changeset-bot bot commented Dec 5, 2023

🦋 Changeset detected

Latest commit: 5a4d2b8

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@faustwp/cli Patch

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

Copy link
Contributor

github-actions bot commented Dec 5, 2023

📦 Next.js Bundle Analysis for @faustwp/getting-started-example

This analysis was generated by the Next.js Bundle Analysis action. 🤖

This PR introduced no changes to the JavaScript bundle! 🙌

@theodesp theodesp merged commit c75ab2b into canary Dec 5, 2023
18 checks passed
@theodesp theodesp deleted the nojira-bug-blockset-cli-path-contains-spaces branch December 5, 2023 14:05
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.

2 participants