diff --git a/htmlhint-server/package-lock.json b/htmlhint-server/package-lock.json index 8d4bbd4..8e898ed 100644 --- a/htmlhint-server/package-lock.json +++ b/htmlhint-server/package-lock.json @@ -14,7 +14,7 @@ }, "devDependencies": { "@types/node": "20.17.57", - "typescript": "^5.8.3" + "typescript": "^5.2.2" }, "engines": { "node": "*" diff --git a/htmlhint-server/package.json b/htmlhint-server/package.json index eefc483..298e087 100644 --- a/htmlhint-server/package.json +++ b/htmlhint-server/package.json @@ -14,7 +14,7 @@ }, "devDependencies": { "@types/node": "20.17.57", - "typescript": "^5.8.3" + "typescript": "^5.2.2" }, "engines": { "node": "*" diff --git a/htmlhint-server/src/server.ts b/htmlhint-server/src/server.ts index 4d2d68f..6ed2131 100644 --- a/htmlhint-server/src/server.ts +++ b/htmlhint-server/src/server.ts @@ -1,7 +1,7 @@ "use strict"; -/// -/// +/// +/// import * as path from "path"; import * as server from "vscode-languageserver"; diff --git a/htmlhint/extension.ts b/htmlhint/extension.ts index d6a0c72..6af1e21 100644 --- a/htmlhint/extension.ts +++ b/htmlhint/extension.ts @@ -43,11 +43,7 @@ export function activate(context: ExtensionContext) { }; // Create the language client and start it - let client = new LanguageClient( - "HTML-hint", - serverOptions, - clientOptions - ); + let client = new LanguageClient("HTML-hint", serverOptions, clientOptions); // Start the client and add it to the subscriptions let disposable = client.start(); diff --git a/htmlhint/package-lock.json b/htmlhint/package-lock.json index 7bc3fb6..ee2ae63 100644 --- a/htmlhint/package-lock.json +++ b/htmlhint/package-lock.json @@ -7,14 +7,21 @@ "": { "name": "vscode-htmlhint", "version": "1.3.0", + "bundleDependencies": [ + "vscode-languageclient", + "htmlhint", + "strip-json-comments" + ], "license": "SEE LICENSE IN LICENSE.md", "dependencies": { + "htmlhint": "^1.3.0", + "strip-json-comments": "3.1.1", "vscode-languageclient": "3.5.1" }, "devDependencies": { "@types/node": "^20.0.0", "@types/vscode": "^1.89.0", - "typescript": "^5.4.0", + "typescript": "^5.2.2", "vscode-test": "^1.6.1" }, "engines": { @@ -59,11 +66,34 @@ "node": ">= 6.0.0" } }, + "node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "inBundle": true, + "license": "MIT", + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/async": { + "version": "3.2.6", + "resolved": "https://registry.npmjs.org/async/-/async-3.2.6.tgz", + "integrity": "sha512-htCUDlxyyCLMgaM3xXg0C0LW2xqfuQ6p05pCEIsXuyQ+a1koYKTuBMzRNwmybfLgvJDMd0r1LTn4+E0Ti6C2AA==", + "inBundle": true, + "license": "MIT" + }, "node_modules/balanced-match": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", - "dev": true + "inBundle": true }, "node_modules/big-integer": { "version": "1.6.52", @@ -138,6 +168,53 @@ "node": "*" } }, + "node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "inBundle": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "inBundle": true, + "license": "MIT", + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "inBundle": true, + "license": "MIT" + }, + "node_modules/commander": { + "version": "11.1.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-11.1.0.tgz", + "integrity": "sha512-yPVavfyCcRhmorC7rWlkHn15b4wDVgVmBA7kV4QVBsF7kv/9TKJAbAXVTxvTnwP8HHKjRCJDClKbciiYS7p0DQ==", + "inBundle": true, + "license": "MIT", + "engines": { + "node": ">=16" + } + }, "node_modules/concat-map": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", @@ -182,7 +259,7 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==", - "dev": true + "inBundle": true }, "node_modules/fstream": { "version": "1.0.12", @@ -242,6 +319,87 @@ "dev": true, "license": "ISC" }, + "node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "inBundle": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/htmlhint": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/htmlhint/-/htmlhint-1.3.0.tgz", + "integrity": "sha512-rapRu+/KFnok9ehmaE6uQcHT3+ypxkzod6vCjqa7121z7c4dJKCqDk6/Yu4pv1b25xEJY4gkS13lu9MxnVhwMg==", + "inBundle": true, + "license": "MIT", + "dependencies": { + "async": "3.2.6", + "chalk": "4.1.2", + "commander": "11.1.0", + "glob": "^8.1.0", + "is-glob": "^4.0.3", + "node-fetch": "^2.7.0", + "strip-json-comments": "3.1.1", + "xml": "1.0.1" + }, + "bin": { + "htmlhint": "bin/htmlhint" + }, + "engines": { + "node": ">=20" + }, + "funding": { + "type": "Open Collective", + "url": "https://opencollective.com/htmlhint" + } + }, + "node_modules/htmlhint/node_modules/brace-expansion": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", + "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", + "inBundle": true, + "license": "MIT", + "dependencies": { + "balanced-match": "^1.0.0" + } + }, + "node_modules/htmlhint/node_modules/glob": { + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/glob/-/glob-8.1.0.tgz", + "integrity": "sha512-r8hpEjiQEYlF2QU0df3dS+nxxSIreXQS1qRhMJM0Q5NDdR386C7jb7Hwwod8Fgiuex+k0GFjgft18yvxm5XoCQ==", + "deprecated": "Glob versions prior to v9 are no longer supported", + "inBundle": true, + "license": "ISC", + "dependencies": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^5.0.1", + "once": "^1.3.0" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/htmlhint/node_modules/minimatch": { + "version": "5.1.6", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.6.tgz", + "integrity": "sha512-lKwV/1brpG6mBUFHtb7NUmtABCb2WZZmm2wNiOA5hAb8VdCS4B3dtMWyvcoViccwAW/COERjXLt0zP1zXUN26g==", + "inBundle": true, + "license": "ISC", + "dependencies": { + "brace-expansion": "^2.0.1" + }, + "engines": { + "node": ">=10" + } + }, "node_modules/http-proxy-agent": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-4.0.1.tgz", @@ -273,7 +431,7 @@ "version": "1.0.6", "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", "integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==", - "dev": true, + "inBundle": true, "dependencies": { "once": "^1.3.0", "wrappy": "1" @@ -283,7 +441,30 @@ "version": "2.0.4", "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", - "dev": true + "inBundle": true + }, + "node_modules/is-extglob": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", + "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", + "inBundle": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-glob": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", + "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", + "inBundle": true, + "license": "MIT", + "dependencies": { + "is-extglob": "^2.1.1" + }, + "engines": { + "node": ">=0.10.0" + } }, "node_modules/isarray": { "version": "1.0.0", @@ -340,11 +521,32 @@ "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", "dev": true }, + "node_modules/node-fetch": { + "version": "2.7.0", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.7.0.tgz", + "integrity": "sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A==", + "inBundle": true, + "license": "MIT", + "dependencies": { + "whatwg-url": "^5.0.0" + }, + "engines": { + "node": "4.x || >=6.0.0" + }, + "peerDependencies": { + "encoding": "^0.1.0" + }, + "peerDependenciesMeta": { + "encoding": { + "optional": true + } + } + }, "node_modules/once": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", - "dev": true, + "inBundle": true, "dependencies": { "wrappy": "1" } @@ -422,6 +624,39 @@ "safe-buffer": "~5.1.0" } }, + "node_modules/strip-json-comments": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", + "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==", + "inBundle": true, + "license": "MIT", + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "inBundle": true, + "license": "MIT", + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/tr46": { + "version": "0.0.3", + "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz", + "integrity": "sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==", + "inBundle": true, + "license": "MIT" + }, "node_modules/traverse": { "version": "0.3.9", "resolved": "https://registry.npmjs.org/traverse/-/traverse-0.3.9.tgz", @@ -483,6 +718,7 @@ "version": "3.5.0", "resolved": "https://registry.npmjs.org/vscode-jsonrpc/-/vscode-jsonrpc-3.5.0.tgz", "integrity": "sha512-LeE9LS1IOIRDZy5Xugrbk2tKeMa64vkRODrXPZbwyn2l/Q0e/jyYq8ze/Lo96sjOFiRe3HHbTVN39Ta8KN2RpA==", + "inBundle": true, "engines": { "node": ">=4.0.0 || >=6.0.0" } @@ -491,6 +727,7 @@ "version": "3.5.1", "resolved": "https://registry.npmjs.org/vscode-languageclient/-/vscode-languageclient-3.5.1.tgz", "integrity": "sha512-GTQ+hSq/o4c/y6GYmyP9XNrVoIu0NFZ67KltSkqN+tO0eUNDIlrVNX+3DJzzyLhSsrctuGzuYWm3t87mNAcBmQ==", + "inBundle": true, "dependencies": { "vscode-languageserver-protocol": "3.5.1" }, @@ -502,6 +739,7 @@ "version": "3.5.1", "resolved": "https://registry.npmjs.org/vscode-languageserver-protocol/-/vscode-languageserver-protocol-3.5.1.tgz", "integrity": "sha512-1fPDIwsAv1difCV+8daOrJEGunClNJWqnUHq/ncWrjhitKWXgGmRCjlwZ3gDUTt54yRcvXz1PXJDaRNvNH6pYA==", + "inBundle": true, "dependencies": { "vscode-jsonrpc": "3.5.0", "vscode-languageserver-types": "3.5.0" @@ -510,7 +748,8 @@ "node_modules/vscode-languageserver-types": { "version": "3.5.0", "resolved": "https://registry.npmjs.org/vscode-languageserver-types/-/vscode-languageserver-types-3.5.0.tgz", - "integrity": "sha512-D4rUfu/oKYdc9Tmec0nEfedj+uXO2tZHR+eoHs9rE9G/QpRyZaHuug8ZUNGTGdO+ALLGgenL6bRpY8y3J9acHg==" + "integrity": "sha512-D4rUfu/oKYdc9Tmec0nEfedj+uXO2tZHR+eoHs9rE9G/QpRyZaHuug8ZUNGTGdO+ALLGgenL6bRpY8y3J9acHg==", + "inBundle": true }, "node_modules/vscode-test": { "version": "1.6.1", @@ -529,11 +768,36 @@ "node": ">=8.9.3" } }, + "node_modules/webidl-conversions": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz", + "integrity": "sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==", + "inBundle": true, + "license": "BSD-2-Clause" + }, + "node_modules/whatwg-url": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz", + "integrity": "sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==", + "inBundle": true, + "license": "MIT", + "dependencies": { + "tr46": "~0.0.3", + "webidl-conversions": "^3.0.0" + } + }, "node_modules/wrappy": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==", - "dev": true + "inBundle": true + }, + "node_modules/xml": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/xml/-/xml-1.0.1.tgz", + "integrity": "sha512-huCv9IH9Tcf95zuYCsQraZtWnJvBtLVE0QHMOs8bWyZAFZNDcYjsPq1nEx8jKA9y+Beo9v+7OBPRisQTjinQMw==", + "inBundle": true, + "license": "MIT" } } } diff --git a/htmlhint/package.json b/htmlhint/package.json index cf556d6..aa37510 100644 --- a/htmlhint/package.json +++ b/htmlhint/package.json @@ -67,19 +67,27 @@ ] }, "scripts": { - "vscode:prepublish": "npm run compile", + "vscode:prepublish": "npm run compile && npm run bundle-dependencies", "compile": "tsc -p ./", - "watch": "tsc -watch -p ./" + "watch": "tsc -watch -p ./", + "bundle-dependencies": "npm install --no-package-lock --no-save htmlhint@^1.3.0 strip-json-comments@3.1.1 vscode-languageserver@3.5.1" }, "devDependencies": { - "typescript": "^5.4.0", + "typescript": "^5.2.2", "@types/node": "^20.0.0", "@types/vscode": "^1.89.0", "vscode-test": "^1.6.1" }, "dependencies": { - "vscode-languageclient": "3.5.1" + "vscode-languageclient": "3.5.1", + "htmlhint": "^1.3.0", + "strip-json-comments": "3.1.1" }, + "bundleDependencies": [ + "vscode-languageclient", + "htmlhint", + "strip-json-comments" + ], "volta": { "node": "18.20.7" } diff --git a/package-lock.json b/package-lock.json index 7b9d9f4..524a08e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -7,6 +7,7 @@ "": { "name": "vscode-htmlhint", "version": "1.0.0", + "hasInstallScript": true, "license": "MIT", "dependencies": { "vscode-languageclient": "^3.5.1" @@ -24,7 +25,7 @@ "mocha": "^11.5.0", "prettier": "3.5.3", "ts-node": "^10.9.2", - "typescript": "^5.8.3", + "typescript": "^5.2.2", "vscode-test": "^1.6.1" }, "engines": { diff --git a/package.json b/package.json index 58c8f29..33a4485 100644 --- a/package.json +++ b/package.json @@ -18,7 +18,10 @@ "lint": "eslint -c .eslintrc.js --ext .ts .", "prettier": "prettier --write \"**/*.{js,md,ts,yml}\"", "spellcheck": "npx cspell \"**/*.{html,js,json,md,ts,yml}\"", - "test": "npm run prettier && npm run lint && cd htmlhint && npm i && cd ../htmlhint-server && npm i && npm run compile" + "postinstall": "cd htmlhint && npm i && cd ../htmlhint-server && npm i", + "compile": "cd htmlhint-server && npm run compile && cd ../htmlhint && npm run compile", + "test": "npm run prettier && npm run lint && npm run compile", + "package": "cd htmlhint && npm run vscode:prepublish && vsce package" }, "dependencies": { "vscode-languageclient": "^3.5.1" @@ -36,7 +39,7 @@ "mocha": "^11.5.0", "prettier": "3.5.3", "ts-node": "^10.9.2", - "typescript": "^5.8.3", + "typescript": "^5.2.2", "vscode-test": "^1.6.1" }, "engines": { diff --git a/test/testConfigFile/.htmlhintrc b/test/testConfigFile/.htmlhintrc index c0727c1..6e56db2 100644 --- a/test/testConfigFile/.htmlhintrc +++ b/test/testConfigFile/.htmlhintrc @@ -4,6 +4,8 @@ "attr-value-double-quotes": true, "doctype-first": true, "html-lang-require": true, + "h1-require": true, + "main-require": true, "tag-pair": true, "spec-char-escape": true, "id-unique": true, diff --git a/test/testConfigFile/test.html b/test/testConfigFile/test.html index e6472f0..9ebaa3e 100644 --- a/test/testConfigFile/test.html +++ b/test/testConfigFile/test.html @@ -1,5 +1,10 @@ - - + + + + + + diff --git a/verify.sh b/verify.sh index e14270a..dfda241 100755 --- a/verify.sh +++ b/verify.sh @@ -2,12 +2,18 @@ # Simple script to verify the extension builds and loads correctly +echo "Installing dependencies..." +cd "$(dirname "$0")" && npm install +cd "$(dirname "$0")/htmlhint" && npm install +cd "$(dirname "$0")/htmlhint-server" && npm install + echo "Building extension..." -cd "$(dirname "$0")/htmlhint" && npm run compile +cd "$(dirname "$0")/htmlhint-server" && npm run compile echo "Building server..." -cd "$(dirname "$0")/htmlhint-server" && npm run compile +cd "$(dirname "$0")/htmlhint" && npm run compile echo "Build complete." echo "Extension is ready to be loaded in VS Code." echo "You can test it by opening VS Code and using the 'Developer: Install Extension from Location' command." +echo "To package the extension, run 'npm run package' from the root directory."