bookwyrm icon indicating copy to clipboard operation
bookwyrm copied to clipboard

fix for npm dev commands (stylelint and prettier)

Open viviicat opened this issue 2 years ago • 2 comments

Fixing a number of overlapping issues that prevented stylelint from working on a fresh install (at least for me). I was getting a "permission denied" error. I believe if your install has node_modules and/or package.json outside the container, you may be able to run the commands ok. But maybe try with a fresh install dir--I believe it's reproducible.

The dev-tools image was being created okay, but then when the /app directory was mapped, the npm files/folders were being overlaid and discarded. With my change, npm now installs to the dev-tools/ directory, and that folder is mapped to the container's directory.

I then altered the commands in ./bw-dev to run with a prefix of dev-tools/.

Then I modified the stylelint config as it had a number of issues:

  • Use scss config to mute the warning.
  • Lint all files, but exclude fonts.
  • Then discovered a linter error due to the import at the bottom of the themes -- I believe it makes sense to exclude it?

And finally, cleaned up the existing linting issues.

viviicat avatar Mar 17 '22 08:03 viviicat

Looks like the workflows may need to be changed for this to work, though.

viviicat avatar Mar 17 '22 08:03 viviicat

Thank you for updating the dev-tools image, I'll try and take a look next week. Getting these checks working right is such a hassle 😵

mouse-reeve avatar Mar 18 '22 17:03 mouse-reeve

I'd already merged in main and re-ran the stylelint, so I opened a PR in @viviicat's repo to save y'all the trouble: https://github.com/viviicat/bookwyrm/pull/1 - I think if @viviicat merges that PR, it should just show up as updated here.

(@mouse-reeve if you're familiar with adding origins and such locally, you can pull and merge that way too, maybe? I'm not really sure how the "maintainer pushing to someone else's PR" permissions work)

cincodenada avatar Nov 14 '22 11:11 cincodenada

Is there something I can do to get this PR ready? I feel bad for neglecting it for so long but i'm not sure what needs to happen at this point 😅

mouse-reeve avatar Dec 19 '22 23:12 mouse-reeve

Hmm, not sure either! I'll have to take a look at this. Probably tonight.

viviicat avatar Dec 19 '22 23:12 viviicat

Any progress on this or workaround until this PR is merged? stylelint unfortunately does not work for me without changing the docker files

alopix avatar Jan 31 '23 18:01 alopix

Is there any chance we could revisit this one and bring it to an end?

jaschaurbach avatar Oct 17 '23 18:10 jaschaurbach