detective-vue2 2.0.3 → 2.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/index.js +18 -9
  2. package/package.json +6 -5
package/index.js CHANGED
@@ -6,11 +6,9 @@ const detectiveEs6 = require('detective-es6');
6
6
  const detectiveScss = require('detective-scss');
7
7
  const detectiveStylus = require('detective-stylus');
8
8
  const detectiveSass = require('detective-sass');
9
+ const detectiveLess = require('@dependents/detective-less');
9
10
 
10
- /**
11
- * Extracts the dependencies of the supplied Vue module
12
- */
13
- module.exports = function(content, options) {
11
+ function detectiveVue(content, options) {
14
12
  if (content === undefined) throw new Error('content not given');
15
13
  if (typeof content !== 'string') throw new Error('content is not a string');
16
14
 
@@ -34,27 +32,38 @@ module.exports = function(content, options) {
34
32
  for (const style of styles) {
35
33
  switch (style.attrs.lang) {
36
34
  case 'scss': {
37
- dependencies.push(...detectiveScss(style.content));
35
+ dependencies.push(...detectiveScss(style.content, options));
38
36
 
39
37
  break;
40
38
  }
41
39
 
42
40
  case 'stylus': {
43
- dependencies.push(...detectiveStylus(style.content));
41
+ dependencies.push(...detectiveStylus(style.content, options));
44
42
 
45
43
  break;
46
44
  }
47
45
 
48
46
  case 'sass': {
49
- dependencies.push(...detectiveSass(style.content));
47
+ dependencies.push(...detectiveSass(style.content, options));
48
+
49
+ break;
50
+ }
51
+
52
+ case 'less': {
53
+ dependencies.push(...detectiveLess(style.content, options));
50
54
 
51
55
  break;
52
56
  }
53
57
 
54
58
  default:
55
- // css has no deps
59
+ // css has no deps
56
60
  }
57
61
  }
58
62
 
59
63
  return dependencies;
60
- };
64
+ }
65
+
66
+ /**
67
+ * Extracts the dependencies of the supplied Vue module
68
+ */
69
+ module.exports = detectiveVue;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "detective-vue2",
3
- "version": "2.0.3",
3
+ "version": "2.1.0",
4
4
  "author": "Havunen <sampo.kivisto@live.fi>",
5
5
  "description": "Get the dependencies of a Vue module",
6
6
  "main": "index.js",
@@ -39,7 +39,8 @@
39
39
  "typescript": "^5.4.4"
40
40
  },
41
41
  "dependencies": {
42
- "@vue/compiler-sfc": "^3.4.27",
42
+ "@dependents/detective-less": "^5.0.0",
43
+ "@vue/compiler-sfc": "^3.5.12",
43
44
  "detective-es6": "^5.0.0",
44
45
  "detective-sass": "^6.0.0",
45
46
  "detective-scss": "^5.0.0",
@@ -47,9 +48,9 @@
47
48
  "detective-typescript": "^13.0.0"
48
49
  },
49
50
  "devDependencies": {
50
- "c8": "^9.1.0",
51
- "mocha": "^10.4.0",
52
- "xo": "^0.58.0"
51
+ "c8": "^10.1.2",
52
+ "mocha": "^10.7.3",
53
+ "xo": "^0.59.3"
53
54
  },
54
55
  "xo": {
55
56
  "space": true,