From b4c35ae9c6a209d8646b1867b27c2ba2b15d521d Mon Sep 17 00:00:00 2001 From: Georgiy Tarasov Date: Tue, 21 Jan 2025 10:27:01 +0100 Subject: [PATCH] chore: update scripts for the products folder --- package.json | 12 ++++++++---- tailwind.config.js | 7 ++++++- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index b5c53a5fecddc..dc10796d7cdf1 100644 --- a/package.json +++ b/package.json @@ -19,7 +19,7 @@ "scripts": { "copy-scripts": "mkdir -p frontend/dist/ && ./bin/copy-posthog-js", "test": "pnpm test:unit && pnpm test:visual", - "test:unit": "jest --testPathPattern=frontend/", + "test:unit": "jest --testPathPattern='(frontend/|products/)'", "jest": "jest", "test:visual:update": "rm -rf frontend/__snapshots__/__failures__/ && docker compose -f docker-compose.playwright.yml run --rm -it --build playwright pnpm test:visual:update:docker --url http://host.docker.internal:6006", "test:visual:update:docker": "NODE_OPTIONS=--max-old-space-size=6144 test-storybook -u --browsers chromium webkit --no-index-json", @@ -45,15 +45,15 @@ "prettier": "prettier --write \"./**/*.{js,mjs,ts,tsx,json,yaml,yml,css,scss}\"", "prettier:check": "prettier --check \"frontend/**/*.{js,mjs,ts,tsx,json,yaml,yml,css,scss}\"", "typescript:check": "tsc --noEmit && echo \"No errors reported by tsc.\"", - "lint:js": "eslint --cache frontend/src cypress", - "lint:css": "stylelint \"frontend/**/*.{css,scss}\"", + "lint:js": "eslint --cache frontend/src cypress products", + "lint:css": "stylelint \"(frontend|products)/**/*.{css,scss}\"", "format:backend": "ruff .", "format:frontend": "pnpm lint:js --fix && pnpm lint:css --fix && pnpm prettier", "format": "pnpm format:backend && pnpm format:frontend", "typegen:write": "kea-typegen write --delete --show-ts-errors", "typegen:check": "kea-typegen check", "typegen:watch": "kea-typegen watch --delete --show-ts-errors", - "typegen:clean": "find frontend/src -type f -name '*Type.ts' -delete", + "typegen:clean": "find frontend/src products -type f -name '*Type.ts' -delete", "storybook": "DEBUG=0 storybook dev -p 6006", "build-storybook": "DEBUG=0 storybook build", "dev:migrate:postgres": "export DEBUG=1 && source env/bin/activate && python manage.py migrate", @@ -357,6 +357,10 @@ "eslint --cache -c .eslintrc.js --fix", "prettier --write" ], + "products/**/frontend/**/*.{js,jsx,mjs,ts,tsx}": [ + "eslint --cache -c .eslintrc.js --fix", + "prettier --write" + ], "frontend/*.mjs": [ "eslint -c .eslintrc.js --fix", "prettier --write" diff --git a/tailwind.config.js b/tailwind.config.js index bb0f79c7b0f34..62deaff0988bb 100644 --- a/tailwind.config.js +++ b/tailwind.config.js @@ -1,6 +1,11 @@ /** @type {import('tailwindcss').Config} */ const config = { - content: ['./frontend/src/**/*.{ts,tsx}', './ee/frontend/**/*.{ts,tsx}', './frontend/src/index.html'], + content: [ + './frontend/src/**/*.{ts,tsx}', + './ee/frontend/**/*.{ts,tsx}', + './frontend/src/index.html', + './products/**/frontend/**/*.{ts,tsx}', + ], important: true, // Basically this: https://sebastiandedeyne.com/why-we-use-important-with-tailwind darkMode: ['selector', '[theme="dark"]'], theme: {