diff --git a/frontend/.gitignore b/frontend/.gitignore index e2fbe38cb5..ae7d20f10a 100644 --- a/frontend/.gitignore +++ b/frontend/.gitignore @@ -1,8 +1,10 @@ node_modules extracted-messages -public *.log .env tsconfig.tsbuildinfo coverage +.turbo +public +dist !remark42 diff --git a/frontend/.lintstagedrc.js b/frontend/.lintstagedrc.js deleted file mode 100644 index 238adec601..0000000000 --- a/frontend/.lintstagedrc.js +++ /dev/null @@ -1,14 +0,0 @@ -module.exports = { - "./**/*.{ts,tsx,js,jsx}": [ - "cd apps/remark42 && pnpm lint-staged:lint:scripts", - "cd apps/remark42 && pnpm lint-staged:format", - ], - "./**/*.css": [ - "cd apps/remark42 && pnpm lint-staged:lint:styles", - "cd apps/remark42 && pnpm lint-staged:format", - ], - "./templates/**.html": [ - "cd apps/remark42 && pnpm lint-staged:lint:styles", - "cd apps/remark42 && pnpm lint-staged:format", - ], -}; diff --git a/frontend/apps/remark42/.lintstagedrc.cjs b/frontend/apps/remark42/.lintstagedrc.cjs new file mode 100644 index 0000000000..8ec0664bfe --- /dev/null +++ b/frontend/apps/remark42/.lintstagedrc.cjs @@ -0,0 +1,9 @@ +const eslint = 'eslint --fix'; +const stylelint = 'stylelint --fix'; +const prettier = 'prettier --write'; + +module.exports = { + './**/*.{ts,tsx,js,jsx,cjs,mjs}': [eslint, prettier], + './**/*.css': [stylelint, prettier], + './templates/**.html': [stylelint, prettier], +}; diff --git a/frontend/apps/remark42/package.json b/frontend/apps/remark42/package.json index d4ba455c8c..e6ede27610 100644 --- a/frontend/apps/remark42/package.json +++ b/frontend/apps/remark42/package.json @@ -3,25 +3,22 @@ "version": "0.16.0", "license": "MIT", "scripts": { + "dev": "cross-env REMARK_URL=http://127.0.0.1:8080 webpack serve --mode development", + "start": "cross-env REMARK_API_BASE_URL=https://demo.remark42.com webpack serve --mode development", "build": "webpack --mode production", "build:analyze": "webpack --mode production --analyze", - "start": "cross-env REMARK_API_BASE_URL=https://demo.remark42.com webpack serve --mode development", - "dev": "cross-env REMARK_URL=http://127.0.0.1:8080 webpack serve --mode development", "lint": "run-p lint:*", - "lint:scripts": "eslint --max-warnings=0 \"**/*.{ts?(x),js}\"", "lint:styles": "stylelint \"app/**/*.css\" \"templates/**\"", + "lint:scripts": "eslint --max-warnings=0 \"**/*.{ts?(x),?(c)js}\"", "test": "jest", "coverage": "jest --coverage", + "format": "prettier --write \"./**/*.{js,ts,tsx,css,html}\"", + "size-check": "cross-env NODE_ENV=production npm run build && size-limit", "type-check": "tsc -p tsconfig.json --noEmit", "translation-check": "run-s translation:extract translation:check", - "size": "cross-env NODE_ENV=production npm run build && size-limit", - "format": "prettier --write \"./**/*.{js,ts,tsx,css,html}\"", "translation:extract": "formatjs extract --out-file=./extracted-messages/messages.json \"**/*.{ts,tsx}\" --ignore=\"**/*.d.ts\"", "translation:generate": "node ./tasks/generateDictionary.js", - "translation:check": "node ./tasks/checkTranslation.js", - "lint-staged:format": "prettier --write", - "lint-staged:lint:styles": "stylelint --fix", - "lint-staged:lint:scripts": "eslint --fix" + "translation:check": "node ./tasks/checkTranslation.js" }, "engines": { "node": ">=16.15 <=17.*", diff --git a/frontend/pnpm-lock.yaml b/frontend/pnpm-lock.yaml index 5179e9a73c..af68d67711 100644 --- a/frontend/pnpm-lock.yaml +++ b/frontend/pnpm-lock.yaml @@ -2548,7 +2548,7 @@ packages: resolution: {integrity: sha512-9K4zoImiZc3HlIp6AVUDE4CWYx22a+lhSZMYNpbjW04+YF0KWj4pJXnEMjdnFTiQibFFmElcsasJXDbdI/EPhA==} dependencies: '@types/eslint': 8.4.5 - '@types/estree': 0.0.51 + '@types/estree': 1.0.0 dev: true /@types/eslint/8.4.5: @@ -4410,7 +4410,7 @@ packages: supports-color: optional: true dependencies: - ms: 2.1.2 + ms: 2.1.3 dev: true /debug/4.3.4: diff --git a/frontend/turbo.json b/frontend/turbo.json new file mode 100644 index 0000000000..9d4a06959b --- /dev/null +++ b/frontend/turbo.json @@ -0,0 +1,30 @@ +{ + "$schema": "https://turborepo.org/schema.json", + "baseBranch": "origin/master", + "pipeline": { + "dev": {}, + "start": {}, + "build": { + "outputs": ["public/**"] + }, + "lint": { + "inputs": ["**/*.tsx", "**/*.ts", "**/*.css"] + }, + "lint:styles": { + "inputs": ["**/*.css"] + }, + "lint:scripts": { + "inputs": ["**/*.tsx", "**/*.ts"] + }, + "test": { + "inputs": ["**/*.tsx", "**/*.ts"] + }, + "coverage": { + "inputs": ["**/*.tsx", "**/*.ts"] + }, + "type-check": { + "inputs": ["**/*.tsx", "**/*.ts"] + }, + "format": {} + } +}