Home

tailwind-ctp-intellisense @master - refs - log -
-
https://git.jolheiser.com/tailwind-ctp-intellisense.git
Tailwind intellisense + Catppuccin
tree log patch
update browserslist usage (#159) fixes "extends" in browserslist config
Brad Cornes <bradlc41@gmail.com>
4 years ago
4 changed files, 21 additions(+), 12 deletions(-)
M package-lock.json -> package-lock.json
diff --git a/package-lock.json b/package-lock.json
index 2a11d31504f5dc440e1a8621ce26fa672669025c..70dca2436b99dd2f530918448a54a94ef17b3bea 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -12132,7 +12132,7 @@       }
     },
     "packages/tailwindcss-intellisense": {
       "name": "vscode-tailwindcss",
-      "version": "0.5.2",
+      "version": "0.5.3",
       "license": "MIT",
       "dependencies": {
         "@types/debounce": "^1.2.0",
@@ -12147,6 +12147,7 @@         "debounce": "^1.2.0",
         "dlv": "^1.1.3",
         "dset": "^2.0.1",
         "esm": "^3.2.25",
+        "execa": "^3.4.0",
         "fast-glob": "^3.2.4",
         "glob-exec": "^0.1.1",
         "import-from": "^3.0.0",
@@ -20171,6 +20172,7 @@         "debounce": "^1.2.0",
         "dlv": "^1.1.3",
         "dset": "^2.0.1",
         "esm": "^3.2.25",
+        "execa": "^3.4.0",
         "fast-glob": "^3.2.4",
         "glob-exec": "^0.1.1",
         "import-from": "^3.0.0",
M packages/tailwindcss-intellisense/package-lock.json -> packages/tailwindcss-intellisense/package-lock.json
diff --git a/packages/tailwindcss-intellisense/package-lock.json b/packages/tailwindcss-intellisense/package-lock.json
index 1d238c0f62488cfa60a8a13e71cb47f6cc3ed6b2..5ed9145e91d53094b990ee02fd04933135a5cae0 100644
--- a/packages/tailwindcss-intellisense/package-lock.json
+++ b/packages/tailwindcss-intellisense/package-lock.json
@@ -21,6 +21,7 @@         "debounce": "^1.2.0",
         "dlv": "^1.1.3",
         "dset": "^2.0.1",
         "esm": "^3.2.25",
+        "execa": "^3.4.0",
         "fast-glob": "^3.2.4",
         "glob-exec": "^0.1.1",
         "import-from": "^3.0.0",
M packages/tailwindcss-intellisense/package.json -> packages/tailwindcss-intellisense/package.json
diff --git a/packages/tailwindcss-intellisense/package.json b/packages/tailwindcss-intellisense/package.json
index 0996ab0589f8373452f714718771a100f2587451..a6488acd4cd483807fdecfa668190762891f7617 100755
--- a/packages/tailwindcss-intellisense/package.json
+++ b/packages/tailwindcss-intellisense/package.json
@@ -191,6 +191,7 @@     "debounce": "^1.2.0",
     "dlv": "^1.1.3",
     "dset": "^2.0.1",
     "esm": "^3.2.25",
+    "execa": "^3.4.0",
     "fast-glob": "^3.2.4",
     "glob-exec": "^0.1.1",
     "import-from": "^3.0.0",
M packages/tailwindcss-intellisense/src/class-names/index.js -> packages/tailwindcss-intellisense/src/class-names/index.js
diff --git a/packages/tailwindcss-intellisense/src/class-names/index.js b/packages/tailwindcss-intellisense/src/class-names/index.js
index 922900da05a7abbbaf299745350a6fd26167088f..737b5bedf5f72851ca20936e5756e562e5049174 100644
--- a/packages/tailwindcss-intellisense/src/class-names/index.js
+++ b/packages/tailwindcss-intellisense/src/class-names/index.js
@@ -15,6 +15,7 @@ import * as fs from 'fs'
 import { getUtilityConfigMap } from './getUtilityConfigMap'
 import glob from 'fast-glob'
 import normalizePath from 'normalize-path'
+import execa from 'execa'
 
 function arraysEqual(arr1, arr2) {
   return (
@@ -33,7 +34,6 @@ ) {
   async function run() {
     let postcss
     let tailwindcss
-    let browserslistModule
     let version
     let featureFlags = { future: [], experimental: [] }
 
@@ -61,11 +61,6 @@     postcss = importFrom(tailwindBase, 'postcss')
     tailwindcss = importFrom(configDir, 'tailwindcss')
     version = importFrom(configDir, 'tailwindcss/package.json').version
     console.log(`Found tailwindcss v${version}: ${tailwindBase}`)
-
-    try {
-      // this is not required
-      browserslistModule = importFrom(tailwindBase, 'browserslist')
-    } catch (_) {}
 
     try {
       featureFlags = importFrom(tailwindBase, './lib/featureFlags.js').default
@@ -130,11 +125,21 @@       delete config.purge
     }
 
     const resolvedConfig = resolveConfig({ cwd: configDir, config })
-    const browserslist = browserslistModule
-      ? browserslistModule(undefined, {
-          path: configDir,
-        })
-      : []
+
+    let browserslist = []
+    try {
+      const { stdout, stderr } = await execa('browserslist', [], {
+        preferLocal: true,
+        localDir: configDir,
+        cwd: configDir,
+      })
+      if (stderr) {
+        throw Error(stderr)
+      }
+      browserslist = stdout.split('\n')
+    } catch (error) {
+      console.error('Failed to load browserslist:', error)
+    }
 
     return {
       version,