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 docker-compose run --rm dev-tools black celerywyrm bookwyrm
;; ;;
prettier) 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) stylelint)
docker-compose run --rm dev-tools npx stylelint \ docker-compose run --rm dev-tools npm exec --prefix=dev-tools/ -- stylelint \
bookwyrm/static/css/bookwyrm.scss bookwyrm/static/css/bookwyrm/**/*.scss --fix \ --fix --config=dev-tools/.stylelintrc.js --ignore-path=dev-tools/.stylelintignore \
--config dev-tools/.stylelintrc.js bookwyrm/static/css
;; ;;
formatters) formatters)
docker-compose run --rm dev-tools black celerywyrm bookwyrm 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 npm exec --prefix=dev-tools/ -- prettier \
docker-compose run --rm dev-tools npx stylelint \ --write bookwyrm/static/js/*.js
bookwyrm/static/css/bookwyrm.scss bookwyrm/static/css/bookwyrm/**/*.scss --fix \ docker-compose run --rm dev-tools npm exec --prefix=dev-tools/ -- stylelint \
--config dev-tools/.stylelintrc.js --fix --config=dev-tools/.stylelintrc.js --ignore-path=dev-tools/.stylelintignore \
bookwyrm/static/css
;; ;;
compilescss) compilescss)
runweb python manage.py compilescss runweb python manage.py compilescss

View file

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

View file

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

View file

@ -2,13 +2,14 @@ FROM python:3.9
ENV PYTHONUNBUFFERED 1 ENV PYTHONUNBUFFERED 1
RUN mkdir /app WORKDIR /app/dev-tools
WORKDIR /app
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 pip install -r requirements.txt
RUN apt-get update && apt-get install -y curl RUN apt-get update && apt-get install -y curl
RUN curl -sL https://deb.nodesource.com/setup_17.x | bash - RUN curl -sL https://deb.nodesource.com/setup_17.x | bash -
RUN apt-get install -y nodejs && apt-get clean RUN apt-get install -y nodejs && apt-get clean
RUN npm install . RUN npm install .
WORKDIR /app

View file

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

View file

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