Skip to content

Build will not run properly if there is a hidden directory in the path #1107

@cyress

Description

@cyress

First of all, I would like to thank you for this great project! ✌️

If the path to the current working directory contains a hidden directory (e.g. .fractal-workspace), the build process will not find the fractal components and the static export will not correct generated.

Steps to reproduce the issue

  1. Create a new hidden directory, e.g. in your user home directory.
    mkdir -p .fractal-workspace/main && cd .fractal-workspace/main
  2. Initialise project
    npm init -y && npm install --save @frctl/fractal
  3. Create Fractal project skeleton
    ./node_modules/.bin/fractal new test-project
    Answer all questions with yes (hit Enter)
  4. Set builder destination path in config
    cd test-project/ && echo "fractal.web.set('builder.dest', path.join(__dirname, 'build'));" >> fractal.config.js
  5. Run Fractal build-process
    NODE_ENV=debug ./node_modules/.bin/fractal build

Current result

  • The example component of the skeleton project isn't generated in the /build folder and also not referenced in the exported html files (e.g. index.html).
  • Only 6 items to be exported are found, but there must be 9.
⚑ Finished parsing components directory
⚑ Finished parsing docs directory
✔ Build started...
⚑ Exported '/' ==> '/index.html'
⚑ Exported 1 of 6 items
⚑ Exported 2 of 6 items
⚑ Exported 3 of 6 items
⚑ Exported 5 of 6 items
⚑ Exported 6 of 6 items
⚑ Copied '/Users/ms/.fractal-workspace/main/test-project/node_modules/@frctl/mandelbrot/dist' ==> '/Users/ms/.fractal-workspace/main/test-project/build/themes/mandelbrot'
✔ Build finished with no errors.

Expected result

  • If the path to the current working directory does not contain a hidden directory, the build process will run as expected and the example component will be generated.
  • You can just rename the folder for testing: cd ../../../ && mv .fractal-workspace fractal-workspace && cd fractal-workspace/main/test-project
  • And run the build again: NODE_ENV=debug ./node_modules/.bin/fractal build
⚑ Finished parsing docs directory
⚑ Finished parsing components directory
✔ Build started...
⚑ Exported '/assets' ==> '/assets.html'
⚑ Exported 1 of 9 items
⚑ Exported 2 of 9 items
⚑ Exported 3 of 9 items
⚑ Exported 5 of 9 items
⚑ Copied '/Users/ms/fractal-workspace/main/test-project/public' ==> '/Users/ms/fractal-workspace/main/test-project/build'
⚑ Exported 6 of 9 items
⚑ Exported 7 of 9 items
⚑ Exported 9 of 9 items
⚑ Copied '/Users/ms/fractal-workspace/main/test-project/node_modules/@frctl/mandelbrot/dist' ==> '/Users/ms/fractal-workspace/main/test-project/build/themes/mandelbrot'
✔ Build finished with no errors.

Reproduces how often:
Always

Context

  • Fractal version: 1.5.11
  • Node version: v16.8.0
  • OS: macOS 12.0.1 and Debian 11

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions