detective-vue2 1.0.0 → 1.0.2

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 +3 -13
  2. package/package.json +9 -12
package/index.js CHANGED
@@ -7,8 +7,6 @@ const detectiveScss = require('detective-scss')
7
7
  const detectiveStylus = require('detective-stylus')
8
8
  const detectiveSass = require('detective-sass')
9
9
 
10
- const isVue3 = typeof compiler.parseComponent === 'undefined';
11
-
12
10
  /**
13
11
  * Extracts the dependencies of the supplied Vue module
14
12
  */
@@ -16,17 +14,9 @@ module.exports = function vueDetective(fileContent, opts) {
16
14
  if (typeof fileContent === 'undefined') throw new Error('content not given');
17
15
  if (typeof fileContent !== 'string') throw new Error('content is not a string');
18
16
 
19
- let script, styles;
20
-
21
- if (isVue3) {
22
- const result = compiler.parse(fileContent, {sourceMap: false})
23
- styles = result.descriptor.styles;
24
- script = result.descriptor.script;
25
- } else {
26
- const result = compiler.parse({source: fileContent, sourceMap: false})
27
- styles = result.styles;
28
- script = result.script;
29
- }
17
+ const result = compiler.parse(fileContent, {sourceMap: false})
18
+ const styles = result.descriptor.styles;
19
+ const script = result.descriptor.script;
30
20
 
31
21
  const dependencies = [];
32
22
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "detective-vue2",
3
- "version": "1.0.0",
3
+ "version": "1.0.2",
4
4
  "author": "Havunen <sampo.kivisto@live.fi>",
5
5
  "description": "Get the dependencies of a Vue module",
6
6
  "main": "index.js",
@@ -30,19 +30,16 @@
30
30
  },
31
31
  "license": "MIT",
32
32
  "homepage": "https://github.com/dependents/detective-typescript",
33
- "peerDependencies": {
34
- "@vue/compiler-sfc": ">= 2 < 4"
35
- },
36
33
  "dependencies": {
37
- "detective-es6": "^3.0.0",
38
- "detective-sass": "^4.0.1",
39
- "detective-scss": "^3.0.0",
40
- "detective-stylus": "^2.0.1",
41
- "detective-typescript": "^9.0.0"
34
+ "@vue/compiler-sfc": ">=3",
35
+ "detective-es6": ">=5",
36
+ "detective-sass": ">=6",
37
+ "detective-scss": ">=5",
38
+ "detective-stylus": ">=5",
39
+ "detective-typescript": ">=12"
42
40
  },
43
41
  "devDependencies": {
44
- "eslint": "^8.34.0",
45
- "mocha": "^10.2.0",
46
- "@vue/compiler-sfc": "^2.7.14"
42
+ "eslint": "^8.57.0",
43
+ "mocha": "^10.4.0"
47
44
  }
48
45
  }