specify npm prefix and stylelint configs and adjust ignores

This commit is contained in:
Vivianne Langdon 2022-03-16 23:56:19 -07:00
parent 0617b9424b
commit dbd5a02617
6 changed files with 18 additions and 12 deletions

18
bw-dev
View file

@ -139,19 +139,21 @@ case "$CMD" in
docker-compose run --rm dev-tools black celerywyrm bookwyrm
;;
prettier)
docker-compose run --rm dev-tools npx prettier --write bookwyrm/static/js/*.js
docker-compose run --rm dev-tools npm exec --prefix=dev-tools/ -- prettier \
--write bookwyrm/static/js/*.js
;;
stylelint)
docker-compose run --rm dev-tools npx stylelint \
bookwyrm/static/css/bookwyrm.scss bookwyrm/static/css/bookwyrm/**/*.scss --fix \
--config dev-tools/.stylelintrc.js
docker-compose run --rm dev-tools npm exec --prefix=dev-tools/ -- stylelint \
--fix --config=dev-tools/.stylelintrc.js --ignore-path=dev-tools/.stylelintignore \
bookwyrm/static/css
;;
formatters)
docker-compose run --rm dev-tools black celerywyrm bookwyrm
docker-compose run --rm dev-tools npx prettier --write bookwyrm/static/js/*.js
docker-compose run --rm dev-tools npx stylelint \
bookwyrm/static/css/bookwyrm.scss bookwyrm/static/css/bookwyrm/**/*.scss --fix \
--config dev-tools/.stylelintrc.js
docker-compose run --rm dev-tools npm exec --prefix=dev-tools/ -- prettier \
--write bookwyrm/static/js/*.js
docker-compose run --rm dev-tools npm exec --prefix=dev-tools/ -- stylelint \
--fix --config=dev-tools/.stylelintrc.js --ignore-path=dev-tools/.stylelintignore \
bookwyrm/static/css
;;
compilescss)
runweb python manage.py compilescss

View file

@ -1 +1,2 @@
**/vendor/**
**/fonts/**

View file

@ -1,7 +1,7 @@
/* global module */
module.exports = {
"extends": "stylelint-config-standard",
"extends": "stylelint-config-standard-scss",
"plugins": [
"stylelint-order"

View file

@ -2,13 +2,14 @@ FROM python:3.9
ENV PYTHONUNBUFFERED 1
RUN mkdir /app
WORKDIR /app
WORKDIR /app/dev-tools
COPY package.json requirements.txt .stylelintrc.js .stylelintignore /app/
COPY package.json requirements.txt .stylelintrc.js .stylelintignore /app/dev-tools/
RUN pip install -r requirements.txt
RUN apt-get update && apt-get install -y curl
RUN curl -sL https://deb.nodesource.com/setup_17.x | bash -
RUN apt-get install -y nodejs && apt-get clean
RUN npm install .
WORKDIR /app

View file

@ -11,6 +11,7 @@
"stylelint-config-recommended": "^7.0.0",
"stylelint-config-standard": "^25.0.0",
"stylelint-order": "^5.0.0",
"stylelint-config-standard-scss": "^3.0.0",
"watch": "^0.13.0"
},
"dependencies": {

View file

@ -101,6 +101,7 @@ services:
build: dev-tools
env_file: .env
volumes:
- /app/dev-tools/
- .:/app
volumes:
pgdata: