Comparing version 1.3.1 to 1.4.0
# Changelog | ||
## [1.3.1](https://github.com/depcheck/depcheck/tree/1.3.1) (2020-11-09) | ||
[Full Changelog](https://github.com/depcheck/depcheck/compare/1.3.0...1.3.1) | ||
**Merged pull requests:** | ||
- Fix extracting dependencies from webpack [\#602](https://github.com/depcheck/depcheck/pull/602) ([rumpl](https://github.com/rumpl)) | ||
## [1.3.0](https://github.com/depcheck/depcheck/tree/1.3.0) (2020-11-09) | ||
@@ -351,3 +359,3 @@ | ||
[Full Changelog](https://github.com/depcheck/depcheck/compare/0.6.10...0.7.0) | ||
[Full Changelog](https://github.com/depcheck/depcheck/compare/0.6.11...0.7.0) | ||
@@ -394,2 +402,6 @@ **Fixed bugs:** | ||
## [0.6.11](https://github.com/depcheck/depcheck/tree/0.6.11) (2018-08-23) | ||
[Full Changelog](https://github.com/depcheck/depcheck/compare/0.6.10...0.6.11) | ||
## [0.6.10](https://github.com/depcheck/depcheck/tree/0.6.10) (2018-08-23) | ||
@@ -417,8 +429,4 @@ | ||
[Full Changelog](https://github.com/depcheck/depcheck/compare/0.6.11...0.6.10-beta.2) | ||
[Full Changelog](https://github.com/depcheck/depcheck/compare/0.6.10-beta.1...0.6.10-beta.2) | ||
## [0.6.11](https://github.com/depcheck/depcheck/tree/0.6.11) (2018-08-23) | ||
[Full Changelog](https://github.com/depcheck/depcheck/compare/0.6.10-beta.1...0.6.11) | ||
**Closed issues:** | ||
@@ -425,0 +433,0 @@ |
@@ -10,3 +10,3 @@ "use strict"; | ||
var _vueTemplateCompiler = require("vue-template-compiler"); | ||
var _compilerSfc = require("@vue/compiler-sfc"); | ||
@@ -17,9 +17,9 @@ var _file = require("../utils/file"); | ||
const content = await (0, _file.getContent)(filename); | ||
const parsed = (0, _vueTemplateCompiler.parseComponent)(content); | ||
const parsed = (0, _compilerSfc.parse)(content); | ||
if (!parsed.script) { | ||
if (!parsed.descriptor.script) { | ||
return []; | ||
} | ||
return (0, _parser.parse)(parsed.script.content, { | ||
return (0, _parser.parse)(parsed.descriptor.script.content, { | ||
sourceType: 'module', | ||
@@ -26,0 +26,0 @@ // Enable all known compatible @babel/parser plugins at the time of writing. |
@@ -21,11 +21,17 @@ "use strict"; | ||
function findStringPlugins(pluginElementsArray) { | ||
return pluginElementsArray.filter(e => e.type === 'StringLiteral').map(e => e.value); | ||
return pluginElementsArray.filter(e => e.type === 'StringLiteral' || e.type === 'TemplateLiteral').map(e => { | ||
if (e.type === 'TemplateLiteral') return e.quasis[0].value.cooked; | ||
return e.value; | ||
}); | ||
} | ||
function findResolvePlugins(pluginElementsArray) { | ||
return pluginElementsArray.filter(e => e.type === 'ObjectExpression').map(e => e.properties).reduce((acc, props) => acc.concat(props), []).filter(resolvePropCandidate => resolvePropCandidate.key.value === 'resolve' && resolvePropCandidate.value && resolvePropCandidate.value.type === 'StringLiteral').map(resolveProp => resolveProp.value.value); | ||
return pluginElementsArray.filter(e => e.type === 'ObjectExpression').map(e => e.properties).reduce((acc, props) => acc.concat(props), []).filter(resolvePropCandidate => (resolvePropCandidate.key.name === 'resolve' || resolvePropCandidate.key.value === 'resolve') && resolvePropCandidate.value && (resolvePropCandidate.value.type === 'StringLiteral' || resolvePropCandidate.value.type === 'TemplateLiteral')).map(resolveProp => { | ||
if (resolveProp.value.type === 'TemplateLiteral') return resolveProp.value.quasis[0].value.cooked; | ||
return resolveProp.value.value; | ||
}); | ||
} | ||
function findNestedPlugins(pluginElementsArray) { | ||
return pluginElementsArray.filter(e => e.type === 'ObjectExpression').map(e => e.properties).reduce((acc, props) => acc.concat(props), []).filter(optionsPropCandidate => optionsPropCandidate && optionsPropCandidate.key && optionsPropCandidate.key.value === 'options' && optionsPropCandidate.value && optionsPropCandidate.value.type === 'ObjectExpression') // eslint-disable-next-line no-use-before-define | ||
return pluginElementsArray.filter(e => e.type === 'ObjectExpression').map(e => e.properties).reduce((acc, props) => acc.concat(props), []).filter(optionsPropCandidate => optionsPropCandidate && optionsPropCandidate.key && (optionsPropCandidate.key.name === 'options' || optionsPropCandidate.key.value === 'options') && optionsPropCandidate.value && optionsPropCandidate.value.type === 'ObjectExpression') // eslint-disable-next-line no-use-before-define | ||
.map(optionsNode => findPluginsInObjectExpression(optionsNode.value)).reduce((deps, dep) => deps.concat(dep), []); | ||
@@ -32,0 +38,0 @@ } |
@@ -13,3 +13,2 @@ /** | ||
import 'node-sass'; | ||
import 'vue-template-compiler'; | ||
@@ -16,0 +15,0 @@ /** |
{ | ||
"name": "depcheck", | ||
"version": "1.3.1", | ||
"version": "1.4.0", | ||
"description": "Check dependencies in your node module", | ||
@@ -54,2 +54,3 @@ "main": "dist/index.js", | ||
"@babel/traverse": "^7.12.5", | ||
"@vue/compiler-sfc": "^3.0.5", | ||
"builtin-modules": "^3.1.0", | ||
@@ -74,3 +75,2 @@ "camelcase": "^6.2.0", | ||
"semver": "^7.3.2", | ||
"vue-template-compiler": "^2.6.12", | ||
"yargs": "^16.1.0" | ||
@@ -77,0 +77,0 @@ }, |
@@ -37,3 +37,3 @@ # depcheck | ||
- [SASS and SCSS](http://sass-lang.com/) (with `node-sass` dependency) | ||
- [Vue.js](https://vuejs.org/) (with `vue-template-compiler` dependency) | ||
- [Vue.js](https://vuejs.org/) (with `@vue/compiler-sfc` dependency) | ||
@@ -40,0 +40,0 @@ To get the syntax support by external dependency, please install the corresponding package explicitly. For example, for Typescript user, install depcheck with `typescript` package: |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
204172
2526
+ Added@vue/compiler-sfc@^3.0.5
+ Added@vue/compiler-core@3.5.12(transitive)
+ Added@vue/compiler-dom@3.5.12(transitive)
+ Added@vue/compiler-sfc@3.5.12(transitive)
+ Added@vue/compiler-ssr@3.5.12(transitive)
+ Added@vue/shared@3.5.12(transitive)
+ Addedentities@4.5.0(transitive)
+ Addedestree-walker@2.0.2(transitive)
+ Addedmagic-string@0.30.12(transitive)
+ Addednanoid@3.3.7(transitive)
+ Addedpostcss@8.4.47(transitive)
- Removedvue-template-compiler@^2.6.12
- Removedde-indent@1.0.2(transitive)
- Removedhe@1.2.0(transitive)
- Removedvue-template-compiler@2.7.16(transitive)