mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-11-12 13:13:45 +01:00
[monorepo] fix running make lint from root (#33559)
* [monorepo] remove spurious package-name field from buildscript.txt * [monorepo] align variables/paths across build script variants * [monorepo] align linting/test setup for jobs/libraries * [monorepo] fix "make lint/lint_fix" from root * [wiki-algolia] integrate with yarn workspace GitOrigin-RevId: a0954f2936d03cd4a69b3f2c8098d9ee2e361993
This commit is contained in:
@@ -0,0 +1,59 @@
|
||||
# Run the test commands in the scope of the monorepo.
|
||||
# Eslint and prettier (plus some configs) are on the root.
|
||||
RUN_LINTING = ../../bin/run -w /overleaf/libraries/metrics monorepo yarn run --silent
|
||||
RUN_LINTING_MONOREPO = ../../bin/run monorepo yarn run --silent
|
||||
|
||||
WITH_CACHE_FOLDER = \
|
||||
lint \
|
||||
lint_ci \
|
||||
lint_fix \
|
||||
format \
|
||||
format_ci \
|
||||
format_fix \
|
||||
typecheck \
|
||||
typecheck_ci \
|
||||
|
||||
$(WITH_CACHE_FOLDER): ../../node_modules/.cache/prettier/
|
||||
../../node_modules/.cache/prettier/:
|
||||
mkdir -p $@
|
||||
|
||||
$(WITH_CACHE_FOLDER): ../../node_modules/.cache/eslint/
|
||||
../../node_modules/.cache/eslint/:
|
||||
mkdir -p $@
|
||||
|
||||
format:
|
||||
$(RUN_LINTING_MONOREPO) format libraries/metrics
|
||||
|
||||
format_ci:
|
||||
$(RUN_LINTING_MONOREPO) format libraries/metrics
|
||||
|
||||
format_fix:
|
||||
$(RUN_LINTING_MONOREPO) format:fix libraries/metrics
|
||||
|
||||
lint:
|
||||
$(RUN_LINTING) lint
|
||||
|
||||
lint_ci:
|
||||
-$(RUN_LINTING) lint --format json --output-file reports/eslint.json
|
||||
sed -i 's_"filePath":"/overleaf_"filePath":"$(MONOREPO)_g' reports/eslint.json
|
||||
|
||||
lint_fix:
|
||||
$(RUN_LINTING) lint:fix
|
||||
|
||||
typecheck:
|
||||
$(RUN_LINTING) types:check
|
||||
|
||||
typecheck_ci:
|
||||
$(RUN_LINTING) types:check
|
||||
|
||||
test: test_unit
|
||||
test_unit:
|
||||
ifneq (,$(wildcard test/unit))
|
||||
$(RUN_LINTING) test:unit
|
||||
endif
|
||||
|
||||
test: test_acceptance
|
||||
test_acceptance:
|
||||
ifneq (,$(wildcard test/acceptance))
|
||||
$(RUN_LINTING) test:acceptance
|
||||
endif
|
||||
@@ -5,6 +5,5 @@ metrics
|
||||
--esmock-loader=False
|
||||
--is-library=True
|
||||
--node-version=24.14.1
|
||||
--package-name=@overleaf/metrics
|
||||
--pipeline-owner=32
|
||||
--public-repo=False
|
||||
|
||||
Reference in New Issue
Block a user