From e7de5c1c9fc60bdb47fbc21e277e2991c0265224 Mon Sep 17 00:00:00 2001 From: Remco Haszing Date: Tue, 30 Jul 2024 16:51:34 +0200 Subject: [PATCH] Update to @tailwindcss/language-service --- build.js | 20 +-- package-lock.json | 350 ++++++++++++++++++++++++-------------- package.json | 16 +- src/tailwindcss.worker.ts | 21 +-- src/types.ts | 2 +- types.d.ts | 2 +- 6 files changed, 248 insertions(+), 163 deletions(-) diff --git a/build.js b/build.js index 61b16605..a2416f0e 100644 --- a/build.js +++ b/build.js @@ -50,12 +50,6 @@ await build({ resolve(path.replace('lib', 'src'), options) ) - // The tailwindcss-language-service main export exports CJS by default, but we get better - // tree shaking if we import the ESM variant. - onResolve({ filter: /^tailwindcss-language-service$/ }, ({ path, ...options }) => - resolve('tailwindcss-language-service/dist/tailwindcss-language-service.esm.js', options) - ) - // This file pulls in a number of dependencies, but we don’t really need it anyway. onResolve({ filter: /^\.+\/(util\/)?log$/, namespace: 'file' }, ({ path, ...options }) => { if (options.importer.includes(`${sep}tailwindcss${sep}`)) { @@ -69,12 +63,6 @@ await build({ }) }) - // The culori main export exports CJS by default, but we get better tree shaking if we - // import the ESM variant. - onResolve({ filter: /^culori$/ }, ({ path, ...options }) => - resolve('culori/build/culori.js', options) - ) - // CJS doesn’t require extensions, but ESM does. Since our package uses ESM, but dependant // bundled packages don’t, we need to add it ourselves. onResolve( @@ -82,6 +70,14 @@ await build({ ({ path, ...options }) => resolve(`${path}.js`, options) ) + onResolve({ filter: /^postcss-value-parser$/ }, ({ path, ...options }) => + resolve('tailwindcss/src/value-parser', options) + ) + + onResolve({ filter: /^vscode-languageserver$/ }, ({ path, ...options }) => + resolve('vscode-languageserver-types', options) + ) + // Rewrite the tailwind stubs from CJS to ESM, so our bundle doesn’t need to include any CJS // related logic. onLoad( diff --git a/package-lock.json b/package-lock.json index 70c38b2a..dbcaf292 100644 --- a/package-lock.json +++ b/package-lock.json @@ -13,10 +13,13 @@ ], "dependencies": { "@alloc/quick-lru": "^5.0.0", + "@csstools/css-parser-algorithms": "^2.0.0", + "@csstools/css-tokenizer": "^2.0.0", + "@csstools/media-query-list-parser": "^2.0.0", "@ctrl/tinycolor": "^3.0.0", - "becke-ch--regex--s0-0-v1--base--pl--lib": "^1.0.0", "color-name": "^2.0.0", "css.escape": "^1.0.0", + "culori": "^4.0.0", "didyoumean": "^1.0.0", "dlv": "^1.0.0", "line-column": "^1.0.0", @@ -34,17 +37,17 @@ "stringify-object": "^5.0.0", "tailwindcss": "^3.0.0", "tmp-cache": "^1.0.0", - "vscode-languageserver-textdocument": "^1.0.0" + "vscode-languageserver-textdocument": "^1.0.0", + "vscode-languageserver-types": "^3.0.0" }, "devDependencies": { - "@types/culori": "^2.0.0", + "@tailwindcss/language-service": "0.0.32", "esbuild": "^0.19.0", "eslint": "^8.0.0", "eslint-config-remcohaszing": "^10.0.0", "prettier": "^3.0.0", "remark-cli": "^11.0.0", "remark-preset-remcohaszing": "^2.0.0", - "tailwindcss-language-service": "0.0.28", "typescript": "^5.0.0", "vscode-languageserver-protocol": "^3.0.0" }, @@ -288,6 +291,52 @@ "node": ">=4" } }, + "node_modules/@csstools/css-parser-algorithms": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/@csstools/css-parser-algorithms/-/css-parser-algorithms-2.1.1.tgz", + "integrity": "sha512-viRnRh02AgO4mwIQb2xQNJju0i+Fh9roNgmbR5xEuG7J3TGgxjnE95HnBLgsFJOJOksvcfxOUCgODcft6Y07cA==", + "license": "MIT", + "engines": { + "node": "^14 || ^16 || >=18" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/csstools" + }, + "peerDependencies": { + "@csstools/css-tokenizer": "^2.1.1" + } + }, + "node_modules/@csstools/css-tokenizer": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/@csstools/css-tokenizer/-/css-tokenizer-2.1.1.tgz", + "integrity": "sha512-GbrTj2Z8MCTUv+52GE0RbFGM527xuXZ0Xa5g0Z+YN573uveS4G0qi6WNOMyz3yrFM/jaILTTwJ0+umx81EzqfA==", + "license": "MIT", + "engines": { + "node": "^14 || ^16 || >=18" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/csstools" + } + }, + "node_modules/@csstools/media-query-list-parser": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/@csstools/media-query-list-parser/-/media-query-list-parser-2.0.4.tgz", + "integrity": "sha512-GyYot6jHgcSDZZ+tLSnrzkR7aJhF2ZW6d+CXH66mjy5WpAQhZD4HDke2OQ36SivGRWlZJpAz7TzbW6OKlEpxAA==", + "license": "MIT", + "engines": { + "node": "^14 || ^16 || >=18" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/csstools" + }, + "peerDependencies": { + "@csstools/css-parser-algorithms": "^2.1.1", + "@csstools/css-tokenizer": "^2.1.1" + } + }, "node_modules/@ctrl/tinycolor": { "version": "3.6.1", "resolved": "https://registry.npmjs.org/@ctrl/tinycolor/-/tinycolor-3.6.1.tgz", @@ -1044,6 +1093,125 @@ "resolved": "https://registry.npmjs.org/@sinclair/typebox/-/typebox-0.27.8.tgz", "integrity": "sha512-+Fj43pSMwJs4KRrH/938Uf+uAELIgVBmQzg/q1YG10djyfA3TnrU8N8XzqCh/okZdszqBQTZf96idMfE5lnwTA==" }, + "node_modules/@tailwindcss/language-service": { + "version": "0.0.32", + "resolved": "https://registry.npmjs.org/@tailwindcss/language-service/-/language-service-0.0.32.tgz", + "integrity": "sha512-aB71jcbOZQthTcB4oIZ3wcfmPFZV4U/dJNg1TyafnHCIVoIkUy6Sfw4yObVGGAOg5AKdxkBpHBMJqNPKo2h10g==", + "dev": true, + "dependencies": { + "@csstools/css-parser-algorithms": "2.1.1", + "@csstools/css-tokenizer": "2.1.1", + "@csstools/media-query-list-parser": "2.0.4", + "@types/culori": "^2.1.0", + "@types/moo": "0.5.3", + "@types/semver": "7.3.10", + "color-name": "1.1.4", + "css.escape": "1.5.1", + "culori": "^4.0.1", + "detect-indent": "6.0.0", + "dlv": "1.1.3", + "dset": "3.1.2", + "line-column": "1.0.2", + "moo": "0.5.1", + "postcss": "8.4.31", + "postcss-selector-parser": "6.0.2", + "postcss-value-parser": "4.2.0", + "semver": "7.5.2", + "sift-string": "0.0.2", + "stringify-object": "3.3.0", + "tmp-cache": "1.1.0", + "vscode-emmet-helper-bundled": "0.0.1", + "vscode-languageserver": "8.1.0", + "vscode-languageserver-textdocument": "1.0.11" + } + }, + "node_modules/@tailwindcss/language-service/node_modules/@types/semver": { + "version": "7.3.10", + "resolved": "https://registry.npmjs.org/@types/semver/-/semver-7.3.10.tgz", + "integrity": "sha512-zsv3fsC7S84NN6nPK06u79oWgrPVd0NvOyqgghV1haPaFcVxIrP4DLomRwGAXk0ui4HZA7mOcSFL98sMVW9viw==", + "dev": true, + "license": "MIT" + }, + "node_modules/@tailwindcss/language-service/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==", + "dev": true, + "license": "MIT" + }, + "node_modules/@tailwindcss/language-service/node_modules/is-obj": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-obj/-/is-obj-1.0.1.tgz", + "integrity": "sha512-l4RyHgRqGN4Y3+9JHVrNqO+tN0rV5My76uW5/nuO4K1b6vw5G8d/cmFjP9tRfEsdhZNt0IFdZuK/c2Vr4Nb+Qg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/@tailwindcss/language-service/node_modules/is-regexp": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-regexp/-/is-regexp-1.0.0.tgz", + "integrity": "sha512-7zjFAPO4/gwyQAAgRRmqeEeyIICSdmCqa3tsVHMdBzaXXRiqopZL4Cyghg/XulGWrtABTpbnYYzzIRffLkP4oA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/@tailwindcss/language-service/node_modules/moo": { + "version": "0.5.1", + "resolved": "https://registry.npmjs.org/moo/-/moo-0.5.1.tgz", + "integrity": "sha512-I1mnb5xn4fO80BH9BLcF0yLypy2UKl+Cb01Fu0hJRkJjlCRtxZMWkTdAtDd5ZqCOxtCkhmRwyI57vWT+1iZ67w==", + "dev": true, + "license": "BSD-3-Clause" + }, + "node_modules/@tailwindcss/language-service/node_modules/postcss-selector-parser": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/postcss-selector-parser/-/postcss-selector-parser-6.0.2.tgz", + "integrity": "sha512-36P2QR59jDTOAiIkqEprfJDsoNrvwFei3eCqKd1Y0tUsBimsq39BLp7RD+JWny3WgB1zGhJX8XVePwm9k4wdBg==", + "dev": true, + "license": "MIT", + "dependencies": { + "cssesc": "^3.0.0", + "indexes-of": "^1.0.1", + "uniq": "^1.0.1" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/@tailwindcss/language-service/node_modules/semver": { + "version": "7.5.2", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.2.tgz", + "integrity": "sha512-SoftuTROv/cRjCze/scjGyiDtcUyxw1rgYQSZY7XTmtR5hX+dm76iDbTH8TkLPHCQmlbQVSSbNZCPM2hb0knnQ==", + "dev": true, + "license": "ISC", + "dependencies": { + "lru-cache": "^6.0.0" + }, + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/@tailwindcss/language-service/node_modules/stringify-object": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/stringify-object/-/stringify-object-3.3.0.tgz", + "integrity": "sha512-rHqiFh1elqCQ9WPLIC8I0Q/g/wj5J1eMkyoiD6eoQApWHP0FtlK7rqnhmabL5VUY9JQCcqwwvlOaSuutekgyrw==", + "dev": true, + "license": "BSD-2-Clause", + "dependencies": { + "get-own-enumerable-property-symbols": "^3.0.0", + "is-obj": "^1.0.1", + "is-regexp": "^1.0.0" + }, + "engines": { + "node": ">=4" + } + }, "node_modules/@tailwindcss/line-clamp": { "version": "0.4.4", "resolved": "https://registry.npmjs.org/@tailwindcss/line-clamp/-/line-clamp-0.4.4.tgz", @@ -1130,10 +1298,11 @@ } }, "node_modules/@types/culori": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/@types/culori/-/culori-2.0.4.tgz", - "integrity": "sha512-GeLW8+KBRkwqIgeGrU8EnNbBE2D7waYbQHkx2xnI5exlzSGTMpjWtDaHzLWK1PTYmyJN9u6dPvMYumFevDe+VA==", - "dev": true + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/@types/culori/-/culori-2.1.1.tgz", + "integrity": "sha512-NzLYD0vNHLxTdPp8+RlvGbR2NfOZkwxcYGFwxNtm+WH2NuUNV8785zv1h0sulFQ5aFQ9n/jNDUuJeo3Bh7+oFA==", + "dev": true, + "license": "MIT" }, "node_modules/@types/debug": { "version": "4.1.12", @@ -2142,11 +2311,6 @@ "resolved": "https://registry.npmjs.org/batch/-/batch-0.6.1.tgz", "integrity": "sha512-x+VAiMRL6UPkx+kudNvxTl6hB2XNNCG2r+7wixVfIYwu/2HKRXimwQyaumLjMveWvT2Hkd/cAJw+QBMfJ/EKVw==" }, - "node_modules/becke-ch--regex--s0-0-v1--base--pl--lib": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/becke-ch--regex--s0-0-v1--base--pl--lib/-/becke-ch--regex--s0-0-v1--base--pl--lib-1.4.0.tgz", - "integrity": "sha512-FnWonOyaw7Vivg5nIkrUll9HSS5TjFbyuURAiDssuL6VxrBe3ERzudRxOcWRhZYlP89UArMDikz7SapRPQpmZQ==" - }, "node_modules/big-integer": { "version": "1.6.51", "resolved": "https://registry.npmjs.org/big-integer/-/big-integer-1.6.51.tgz", @@ -3004,10 +3168,13 @@ "integrity": "sha512-aylIc7Z9y4yzHYAJNuESG3hfhC+0Ibp/MAMiaOZgNv4pmEdFyfZhhhny4MNiAfWdBQ1RQ2mfDWmM1x8SvGyp8g==" }, "node_modules/culori": { - "version": "0.20.1", - "resolved": "https://registry.npmjs.org/culori/-/culori-0.20.1.tgz", - "integrity": "sha512-jNZDmufWx4vCHW2fTb62sarHEeIF3WWrUYIv4ZpoQnN2vQU6IRPz1Ra9QnsHUKzdb5lppSuLsdB72rMmBMAd+A==", - "dev": true + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/culori/-/culori-4.0.1.tgz", + "integrity": "sha512-LSnjA6HuIUOlkfKVbzi2OlToZE8OjFi667JWN9qNymXVXzGDmvuP60SSgC+e92sd7B7158f7Fy3Mb6rXS5EDPw==", + "license": "MIT", + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + } }, "node_modules/debug": { "version": "4.3.4", @@ -5178,6 +5345,13 @@ "node": ">=8" } }, + "node_modules/indexes-of": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/indexes-of/-/indexes-of-1.0.1.tgz", + "integrity": "sha512-bup+4tap3Hympa+JBJUG7XuOsdNQ6fxt0MHyXMKuLBKn0OqsTfvUxkUrroEX1+B2VsSHvCjiIcZVxRtYa4nllA==", + "dev": true, + "license": "MIT" + }, "node_modules/inflight": { "version": "1.0.6", "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", @@ -10849,105 +11023,6 @@ "node": ">=14.0.0" } }, - "node_modules/tailwindcss-language-service": { - "version": "0.0.28", - "resolved": "https://registry.npmjs.org/tailwindcss-language-service/-/tailwindcss-language-service-0.0.28.tgz", - "integrity": "sha512-qbyZxX+6pR8a6m7w9Z8KSW3Wzz5oD/IVmmD1tnywP2K8SfDwrMHcs+/067m1w38iRp6+XyNRTxBMA+nPeKQCmA==", - "dev": true, - "dependencies": { - "@types/moo": "0.5.3", - "@types/semver": "7.3.10", - "becke-ch--regex--s0-0-v1--base--pl--lib": "1.4.0", - "color-name": "1.1.4", - "css.escape": "1.5.1", - "culori": "0.20.1", - "detect-indent": "6.0.0", - "dlv": "1.1.3", - "dset": "3.1.2", - "line-column": "1.0.2", - "moo": "0.5.1", - "postcss": "8.3.9", - "postcss-selector-parser": "6.0.2", - "semver": "7.3.7", - "sift-string": "0.0.2", - "stringify-object": "3.3.0", - "tmp-cache": "1.1.0", - "vscode-emmet-helper-bundled": "0.0.1", - "vscode-languageserver": "8.0.2", - "vscode-languageserver-textdocument": "1.0.7" - } - }, - "node_modules/tailwindcss-language-service/node_modules/@types/semver": { - "version": "7.3.10", - "resolved": "https://registry.npmjs.org/@types/semver/-/semver-7.3.10.tgz", - "integrity": "sha512-zsv3fsC7S84NN6nPK06u79oWgrPVd0NvOyqgghV1haPaFcVxIrP4DLomRwGAXk0ui4HZA7mOcSFL98sMVW9viw==", - "dev": true - }, - "node_modules/tailwindcss-language-service/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==", - "dev": true - }, - "node_modules/tailwindcss-language-service/node_modules/is-obj": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/is-obj/-/is-obj-1.0.1.tgz", - "integrity": "sha512-l4RyHgRqGN4Y3+9JHVrNqO+tN0rV5My76uW5/nuO4K1b6vw5G8d/cmFjP9tRfEsdhZNt0IFdZuK/c2Vr4Nb+Qg==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/tailwindcss-language-service/node_modules/is-regexp": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-regexp/-/is-regexp-1.0.0.tgz", - "integrity": "sha512-7zjFAPO4/gwyQAAgRRmqeEeyIICSdmCqa3tsVHMdBzaXXRiqopZL4Cyghg/XulGWrtABTpbnYYzzIRffLkP4oA==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/tailwindcss-language-service/node_modules/moo": { - "version": "0.5.1", - "resolved": "https://registry.npmjs.org/moo/-/moo-0.5.1.tgz", - "integrity": "sha512-I1mnb5xn4fO80BH9BLcF0yLypy2UKl+Cb01Fu0hJRkJjlCRtxZMWkTdAtDd5ZqCOxtCkhmRwyI57vWT+1iZ67w==", - "dev": true - }, - "node_modules/tailwindcss-language-service/node_modules/semver": { - "version": "7.3.7", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.7.tgz", - "integrity": "sha512-QlYTucUYOews+WeEujDoEGziz4K6c47V/Bd+LjSSYcA94p+DmINdf7ncaUinThfvZyu13lN9OY1XDxt8C0Tw0g==", - "dev": true, - "dependencies": { - "lru-cache": "^6.0.0" - }, - "bin": { - "semver": "bin/semver.js" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/tailwindcss-language-service/node_modules/stringify-object": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/stringify-object/-/stringify-object-3.3.0.tgz", - "integrity": "sha512-rHqiFh1elqCQ9WPLIC8I0Q/g/wj5J1eMkyoiD6eoQApWHP0FtlK7rqnhmabL5VUY9JQCcqwwvlOaSuutekgyrw==", - "dev": true, - "dependencies": { - "get-own-enumerable-property-symbols": "^3.0.0", - "is-obj": "^1.0.1", - "is-regexp": "^1.0.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/tailwindcss-language-service/node_modules/vscode-languageserver-textdocument": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/vscode-languageserver-textdocument/-/vscode-languageserver-textdocument-1.0.7.tgz", - "integrity": "sha512-bFJH7UQxlXT8kKeyiyu41r22jCZXG8kuuVVA33OEJn1diWOZK5n8zBSPZFHVBOu8kXZ6h0LIRhf5UnCo61J4Hg==", - "dev": true - }, "node_modules/tapable": { "version": "2.2.1", "resolved": "https://registry.npmjs.org/tapable/-/tapable-2.2.1.tgz", @@ -11579,6 +11654,13 @@ "prettier": "^3.0.0" } }, + "node_modules/uniq": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/uniq/-/uniq-1.0.1.tgz", + "integrity": "sha512-Gw+zz50YNKPDKXs+9d+aKAjVwpjNwqzvNpLigIruT4HA9lMZNdMqs9x07kKHB/L9WRzqp4+DlTU5s4wG2esdoA==", + "dev": true, + "license": "MIT" + }, "node_modules/unist-util-generated": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/unist-util-generated/-/unist-util-generated-2.0.1.tgz", @@ -12394,12 +12476,13 @@ } }, "node_modules/vscode-languageserver": { - "version": "8.0.2", - "resolved": "https://registry.npmjs.org/vscode-languageserver/-/vscode-languageserver-8.0.2.tgz", - "integrity": "sha512-bpEt2ggPxKzsAOZlXmCJ50bV7VrxwCS5BI4+egUmure/oI/t4OlFzi/YNtVvY24A2UDOZAgwFGgnZPwqSJubkA==", + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/vscode-languageserver/-/vscode-languageserver-8.1.0.tgz", + "integrity": "sha512-eUt8f1z2N2IEUDBsKaNapkz7jl5QpskN2Y0G01T/ItMxBxw1fJwvtySGB9QMecatne8jFIWJGWI61dWjyTLQsw==", "dev": true, + "license": "MIT", "dependencies": { - "vscode-languageserver-protocol": "3.17.2" + "vscode-languageserver-protocol": "3.17.3" }, "bin": { "installServerIntoExtension": "bin/installServerIntoExtension" @@ -12425,29 +12508,32 @@ "integrity": "sha512-Ld1VelNuX9pdF39h2Hgaeb5hEZM2Z3jUrrMgWQAu82jMtZp7p3vJT3BzToKtZI7NgQssZje5o0zryOrhQvzQAg==" }, "node_modules/vscode-languageserver/node_modules/vscode-jsonrpc": { - "version": "8.0.2", - "resolved": "https://registry.npmjs.org/vscode-jsonrpc/-/vscode-jsonrpc-8.0.2.tgz", - "integrity": "sha512-RY7HwI/ydoC1Wwg4gJ3y6LpU9FJRZAUnTYMXthqhFXXu77ErDd/xkREpGuk4MyYkk4a+XDWAMqe0S3KkelYQEQ==", + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/vscode-jsonrpc/-/vscode-jsonrpc-8.1.0.tgz", + "integrity": "sha512-6TDy/abTQk+zDGYazgbIPc+4JoXdwC8NHU9Pbn4UJP1fehUyZmM4RHp5IthX7A6L5KS30PRui+j+tbbMMMafdw==", "dev": true, + "license": "MIT", "engines": { "node": ">=14.0.0" } }, "node_modules/vscode-languageserver/node_modules/vscode-languageserver-protocol": { - "version": "3.17.2", - "resolved": "https://registry.npmjs.org/vscode-languageserver-protocol/-/vscode-languageserver-protocol-3.17.2.tgz", - "integrity": "sha512-8kYisQ3z/SQ2kyjlNeQxbkkTNmVFoQCqkmGrzLH6A9ecPlgTbp3wDTnUNqaUxYr4vlAcloxx8zwy7G5WdguYNg==", + "version": "3.17.3", + "resolved": "https://registry.npmjs.org/vscode-languageserver-protocol/-/vscode-languageserver-protocol-3.17.3.tgz", + "integrity": "sha512-924/h0AqsMtA5yK22GgMtCYiMdCOtWTSGgUOkgEDX+wk2b0x4sAfLiO4NxBxqbiVtz7K7/1/RgVrVI0NClZwqA==", "dev": true, + "license": "MIT", "dependencies": { - "vscode-jsonrpc": "8.0.2", - "vscode-languageserver-types": "3.17.2" + "vscode-jsonrpc": "8.1.0", + "vscode-languageserver-types": "3.17.3" } }, "node_modules/vscode-languageserver/node_modules/vscode-languageserver-types": { - "version": "3.17.2", - "resolved": "https://registry.npmjs.org/vscode-languageserver-types/-/vscode-languageserver-types-3.17.2.tgz", - "integrity": "sha512-zHhCWatviizPIq9B7Vh9uvrH6x3sK8itC84HkamnBWoDFJtzBf7SWlpLCZUit72b3os45h6RWQNC9xHRDF8dRA==", - "dev": true + "version": "3.17.3", + "resolved": "https://registry.npmjs.org/vscode-languageserver-types/-/vscode-languageserver-types-3.17.3.tgz", + "integrity": "sha512-SYU4z1dL0PyIMd4Vj8YOqFvHu7Hz/enbWtpfnVbJHU4Nd1YNYx8u0ennumc6h48GQNeOLxmwySmnADouT/AuZA==", + "dev": true, + "license": "MIT" }, "node_modules/walk-up-path": { "version": "3.0.1", diff --git a/package.json b/package.json index 80205abf..743b58d5 100644 --- a/package.json +++ b/package.json @@ -38,9 +38,12 @@ "dependencies": { "@alloc/quick-lru": "^5.0.0", "@ctrl/tinycolor": "^3.0.0", - "becke-ch--regex--s0-0-v1--base--pl--lib": "^1.0.0", + "@csstools/css-parser-algorithms": "^2.0.0", + "@csstools/css-tokenizer": "^2.0.0", + "@csstools/media-query-list-parser": "^2.0.0", "color-name": "^2.0.0", "css.escape": "^1.0.0", + "culori": "^4.0.0", "didyoumean": "^1.0.0", "dlv": "^1.0.0", "line-column": "^1.0.0", @@ -58,27 +61,26 @@ "stringify-object": "^5.0.0", "tailwindcss": "^3.0.0", "tmp-cache": "^1.0.0", - "vscode-languageserver-textdocument": "^1.0.0" + "vscode-languageserver-textdocument": "^1.0.0", + "vscode-languageserver-types": "^3.0.0" }, "peerDependencies": { "monaco-editor": ">=0.36" }, "devDependencies": { - "@types/culori": "^2.0.0", + "@tailwindcss/language-service": "0.0.32", "esbuild": "^0.19.0", "eslint": "^8.0.0", "eslint-config-remcohaszing": "^10.0.0", "prettier": "^3.0.0", "remark-cli": "^11.0.0", "remark-preset-remcohaszing": "^2.0.0", - "tailwindcss-language-service": "0.0.28", "typescript": "^5.0.0", "vscode-languageserver-protocol": "^3.0.0" }, "overrides": { - "tailwindcss-language-service": { - "postcss": "^8.0.0", - "postcss-selector-parser": "^6.0.0" + "@tailwindcss/language-service": { + "postcss": "^8.0.0" } } } diff --git a/src/tailwindcss.worker.ts b/src/tailwindcss.worker.ts index 0ba30f5a..1dac7129 100644 --- a/src/tailwindcss.worker.ts +++ b/src/tailwindcss.worker.ts @@ -1,3 +1,13 @@ +import { + type AugmentedDiagnostic, + doComplete, + doHover, + doValidate, + type EditorState, + getColor, + getDocumentColors, + resolveCompletionItem +} from '@tailwindcss/language-service' import { type MonacoTailwindcssOptions, type TailwindConfig } from 'monaco-tailwindcss' import { type TailwindWorkerOptions } from 'monaco-tailwindcss/tailwindcss.worker' import { initialize as initializeWorker } from 'monaco-worker-manager/worker' @@ -9,16 +19,6 @@ import { generateRules } from 'tailwindcss/src/lib/generateRules.js' import { type ChangedContent, createContext } from 'tailwindcss/src/lib/setupContextUtils.js' import processTailwindFeatures from 'tailwindcss/src/processTailwindFeatures.js' import resolveConfig from 'tailwindcss/src/public/resolve-config.js' -import { - type AugmentedDiagnostic, - doComplete, - doHover, - doValidate, - type EditorState, - getColor, - getDocumentColors, - resolveCompletionItem -} from 'tailwindcss-language-service' import { type ColorInformation, type CompletionContext, @@ -59,6 +59,7 @@ async function stateFromConfig( const state: JitState = { version: '3.0.0', + blocklist: [], config, enabled: true, modules: { diff --git a/src/types.ts b/src/types.ts index c6d68a38..9e46bf41 100644 --- a/src/types.ts +++ b/src/types.ts @@ -1,5 +1,5 @@ +import { type State } from '@tailwindcss/language-service' import { type Config } from 'tailwindcss' -import { type State } from 'tailwindcss-language-service' export interface JitState extends State { config: Config diff --git a/types.d.ts b/types.d.ts index 0a4401cd..cef2ad7b 100644 --- a/types.d.ts +++ b/types.d.ts @@ -12,8 +12,8 @@ declare module 'tailwindcss/src/lib/generateRules.js' { } declare module 'tailwindcss/src/lib/setupContextUtils.js' { + import { type Variant } from '@tailwindcss/language-service' import { type Config } from 'tailwindcss' - import { type Variant } from 'tailwindcss-language-service' interface ChangedContent { content: string