Skip to content
This repository has been archived by the owner on Jun 15, 2023. It is now read-only.

Directory structure handled incorrectly in new project. #1890

Open
seanmorris opened this issue Dec 5, 2022 · 4 comments
Open

Directory structure handled incorrectly in new project. #1890

seanmorris opened this issue Dec 5, 2022 · 4 comments

Comments

@seanmorris
Copy link

seanmorris commented Dec 5, 2022

Description

The assets directory is not being handled correctly in a new project.

Expected behavior

The index.html file should be built to the public/ directory.

Actual behavior

The index.html file is built to the public/assets/ directory.

Environment

  1. Brunch Version: 4.0.1
  2. Node.js Version: 19.2.0
  3. NPM Version: 8.19.3
  4. Operating system: Debian GNU/Linux 11 Kernel 5.10.0-19-amd64

package.json contents

{
  "name": "brunch-app",
  "description": "Brunch.io application",
  "private": true,
  "author": "Brunch",
  "version": "0.0.1",
  "repository": "",
  "scripts": {
    "start": "brunch watch --server",
    "build": "brunch build --production"
  },
  "dependencies": {},
  "devDependencies": {
    "auto-reload-brunch": "^2",
    "brunch": "^4",
    "clean-css-brunch": "^3",
    "terser-brunch": "^4"
  }
}

brunch config contents

none

@seanmorris seanmorris changed the title Directory structure incorrect in new project. Directory structure handled incorrectly in new project. Dec 16, 2022
@seanmorris
Copy link
Author

Working Lockfile: https://pastebin.com/UuipAhAK
Broken Lockfile: https://pastebin.com/z1iYS1ck

@seanmorris
Copy link
Author

seanmorris commented Dec 25, 2022

It seems to be a bug with the new way strings are handled in anymatch 3.1.3. On line 50 of index.js, false is now provided as the second parameter to normalizePath().

https://github.com/micromatch/anymatch/blob/master/index.js#L50

Adding the following values to the root level package.json corrects the issue:

Note that npm install must be run explicitly if node_modules does not exists yet.

{
  "overrides": {
    "brunch": {"anymatch": "3.1.2"},
    ".": {"anymatch": "3.1.2"}
  }
}

@seanmorris
Copy link
Author

seanmorris commented Dec 25, 2022

I've found the issue, submitted a patch, and alerted the maintainers of the dependency to watch their semver.
#1891
micromatch/anymatch#51

@psagers
Copy link

psagers commented Feb 15, 2023

It's worth noting here that a workaround was committed in a20d6a2 and released in 4.0.2 (Jan 10).

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

No branches or pull requests

2 participants