Skip to content

Commit

Permalink
build: stop pre-compiling lint-md
Browse files Browse the repository at this point in the history
PR-URL: #55266
Reviewed-By: Claudio Wunder <cwunder@gnome.org>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
  • Loading branch information
RedYetiDev authored and ruyadorno committed Nov 27, 2024
1 parent 4cca54b commit 827e206
Show file tree
Hide file tree
Showing 11 changed files with 229 additions and 24,600 deletions.
13 changes: 13 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,16 @@ updates:
applies-to: version-updates
patterns:
- '*'

- package-ecosystem: npm
directory: /tools/lint-md
schedule:
interval: monthly
commit-message:
prefix: tools
open-pull-requests-limit: 10
groups:
lint-md:
applies-to: version-updates
patterns:
- '*'
19 changes: 0 additions & 19 deletions .github/workflows/tools.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ on:
- histogram
- icu
# - libuv
- lint-md-dependencies
- llhttp
- minimatch
- nbytes
Expand Down Expand Up @@ -187,24 +186,6 @@ jobs:
# cat temp-output
# tail -n1 temp-output | grep "NEW_VERSION=" >> "$GITHUB_ENV" || true
# rm temp-output
- id: lint-md-dependencies
subsystem: tools
label: tools
run: |
cd tools/lint-md
npm ci
NEW_VERSION=$(npm outdated --parseable | cut -d: -f4 | xargs)
if [ "$NEW_VERSION" != "" ]; then
echo "NEW_VERSION=$NEW_VERSION" >> $GITHUB_ENV
rm -rf package-lock.json node_modules
# Include $NEW_VERSION to explicitly update the package.json
# entry for the dependency and also so that semver-major updates
# are not skipped.
npm install --ignore-scripts $NEW_VERSION
npm install --ignore-scripts
cd ../..
make lint-md-rollup
fi
- id: llhttp
subsystem: deps
label: dependencies
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ tools/*/*.i.tmp
/tools/doc/node_modules
/tools/clang-format/node_modules
/tools/eslint/node_modules
/tools/lint-md/node_modules

# === Rules for test artifacts ===
/*.tap
Expand Down
25 changes: 8 additions & 17 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -1335,21 +1335,6 @@ bench-addons-clean:
$(RM) -r benchmark/napi/*/build
$(RM) benchmark/napi/.buildstamp

.PHONY: lint-md-rollup
lint-md-rollup:
$(RM) tools/.*mdlintstamp
cd tools/lint-md && npm ci && npm run build

.PHONY: lint-md-clean
.NOTPARALLEL: lint-md-clean
lint-md-clean:
$(RM) -r tools/lint-md/node_modules
$(RM) tools/.*mdlintstamp

.PHONY: lint-md-build
lint-md-build:
$(warning Deprecated no-op target 'lint-md-build')

ifeq ("$(wildcard tools/.mdlintstamp)","")
LINT_MD_NEWER =
else
Expand All @@ -1361,8 +1346,13 @@ LINT_MD_FILES = $(shell $(FIND) $(LINT_MD_TARGETS) -type f \
! -path '*node_modules*' ! -path 'test/fixtures/*' -name '*.md' \
$(LINT_MD_NEWER))
run-lint-md = tools/lint-md/lint-md.mjs $(LINT_MD_FILES)

# Check for a specific file, as (empty) directories are persisted in git.
tools/lint-md/node_modules/remark-parse/package.json:
-cd tools/lint-md && $(call available-node,$(run-npm-ci))

# Lint all changed markdown files maintained by us
tools/.mdlintstamp: $(LINT_MD_FILES)
tools/.mdlintstamp: tools/lint-md/node_modules/remark-parse/package.json $(LINT_MD_FILES)
$(info Running Markdown linter...)
@$(call available-node,$(run-lint-md))
@touch $@
Expand All @@ -1372,7 +1362,7 @@ lint-md: lint-js-doc | tools/.mdlintstamp ## Lint the markdown documents maintai

run-format-md = tools/lint-md/lint-md.mjs --format $(LINT_MD_FILES)
.PHONY: format-md
format-md: ## Format the markdown documents maintained by us in the codebase.
format-md: tools/lint-md/node_modules/remark-parse/package.json ## Format the markdown documents maintained by us in the codebase.
@$(call available-node,$(run-format-md))


Expand Down Expand Up @@ -1601,6 +1591,7 @@ lint-clean: ## Remove linting artifacts.
$(RM) tools/.*lintstamp
$(RM) .eslintcache
$(RM) -r tools/eslint/node_modules
$(RM) -r tools/lint-md/node_modules
$(RM) tools/pip/site_packages

HAS_DOCKER ?= $(shell command -v docker > /dev/null 2>&1; [ $$? -eq 0 ] && echo 1 || echo 0)
Expand Down
1 change: 0 additions & 1 deletion eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ export default [
'test/message/esm_display_syntax_error.mjs',
'tools/github_reporter/**',
'tools/icu/**',
'tools/lint-md/lint-md.mjs',
],
},
// #endregion
Expand Down
1 change: 0 additions & 1 deletion tools/lint-md/.gitignore

This file was deleted.

Loading

0 comments on commit 827e206

Please sign in to comment.