Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build: stop pre-compiling lint-md #55266

Merged
merged 2 commits into from
Nov 1, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -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
@@ -28,7 +28,6 @@ on:
- histogram
- icu
# - libuv
- lint-md-dependencies
- llhttp
- minimatch
- nbytes
@@ -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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -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
25 changes: 8 additions & 17 deletions Makefile
Original file line number Diff line number Diff line change
@@ -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
@@ -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 $@
@@ -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))


@@ -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)
1 change: 0 additions & 1 deletion eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -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
1 change: 0 additions & 1 deletion tools/lint-md/.gitignore

This file was deleted.

23,908 changes: 16 additions & 23,892 deletions tools/lint-md/lint-md.mjs

Large diffs are not rendered by default.

53 changes: 0 additions & 53 deletions tools/lint-md/lint-md.src.mjs

This file was deleted.

778 changes: 180 additions & 598 deletions tools/lint-md/package-lock.json

Large diffs are not rendered by default.

9 changes: 0 additions & 9 deletions tools/lint-md/package.json
Original file line number Diff line number Diff line change
@@ -2,21 +2,12 @@
"name": "lint-md",
"description": "markdown linting",
"version": "1.0.0",
"scripts": {
"build": "rollup -f es -p '@rollup/plugin-node-resolve={exportConditions: [\"node\"]}' -p @rollup/plugin-commonjs -p rollup-plugin-cleanup lint-md.src.mjs --file lint-md.mjs"
},
"dependencies": {
"remark-parse": "^11.0.0",
"remark-preset-lint-node": "^5.1.2",
"remark-stringify": "^11.0.0",
"to-vfile": "^8.0.0",
"unified": "^11.0.5",
"vfile-reporter": "^8.1.1"
},
"devDependencies": {
"@rollup/plugin-commonjs": "^28.0.1",
"@rollup/plugin-node-resolve": "^15.3.0",
"rollup": "^4.24.0",
"rollup-plugin-cleanup": "^3.2.1"
}
}
21 changes: 11 additions & 10 deletions vcbuild.bat
Original file line number Diff line number Diff line change
@@ -122,7 +122,6 @@ if /i "%1"=="lint-js-build" set lint_js_build=1&goto arg-ok
if /i "%1"=="lint-js-fix" set lint_js_fix=1&goto arg-ok
if /i "%1"=="jslint" set lint_js=1&echo Please use lint-js instead of jslint&goto arg-ok
if /i "%1"=="lint-md" set lint_md=1&goto arg-ok
if /i "%1"=="lint-md-build" set lint_md_build=1&goto arg-ok
if /i "%1"=="lint" set lint_cpp=1&set lint_js=1&set lint_md=1&goto arg-ok
if /i "%1"=="lint-ci" set lint_cpp=1&set lint_js_ci=1&goto arg-ok
if /i "%1"=="format-md" set format_md=1&goto arg-ok
@@ -750,24 +749,21 @@ echo running lint-js
goto lint-js-fix

:lint-js-fix
if not defined lint_js_fix goto lint-md-build
if not defined lint_js_fix goto lint-md
if not exist tools\eslint\node_modules\eslint goto no-lint
echo running lint-js-fix
%node_exe% tools\eslint\node_modules\eslint\bin\eslint.js --cache --max-warnings=0 --report-unused-disable-directives --rule "@stylistic/js/linebreak-style: 0" eslint.config.mjs benchmark doc lib test tools --fix
goto lint-md-build

:no-lint
echo Linting is not available through the source tarball.
echo Use the git repo instead: $ git clone https://github.com/nodejs/node.git
goto lint-md-build

:lint-md-build
if not defined lint_md_build goto lint-md
echo "Deprecated no-op target 'lint_md_build'"
goto lint-md
if not defined lint_md if not defined format_md goto lint-md
cd tools\lint-md
%npm_exe% ci
cd ..\..

:lint-md
if not defined lint_md goto format-md
if not exist tools\lint-md\node_modules goto no-lint
echo Running Markdown linter on docs...
SETLOCAL ENABLEDELAYEDEXPANSION
set lint_md_files=
@@ -782,6 +778,7 @@ goto format-md

:format-md
if not defined format_md goto exit
if not exist tools\lint-md\node_modules goto no-lint
echo Running Markdown formatter on docs...
SETLOCAL ENABLEDELAYEDEXPANSION
set lint_md_files=
@@ -792,6 +789,10 @@ for /D %%D IN (doc\*) do (
)
%node_exe% tools\lint-md\lint-md.mjs --format %lint_md_files%
ENDLOCAL

:no-lint
echo Linting is not available through the source tarball.
echo Use the git repo instead: $ git clone https://github.com/nodejs/node.git
goto exit

:create-msvs-files-failed