@cbourgois/simonsays
Advanced tools
Comparing version 1.0.6 to 1.0.7
@@ -15,9 +15,16 @@ #!/usr/bin/env node | ||
if (output === 'summary') { | ||
const hasUndetectableCol = modules.map(module => module.hasUndetectable).length; | ||
const head = [ | ||
chalk.yellow('Module'), | ||
chalk.yellow('Used'), | ||
chalk.yellow('Missings'), | ||
chalk.yellow('Results'), | ||
]; | ||
if (hasUndetectableCol) { | ||
head.push(chalk.yellow('Contains undetectable')); | ||
} | ||
const table = new Table({ | ||
head: [ | ||
chalk.yellow('Module'), | ||
chalk.yellow('Used'), | ||
chalk.yellow('Missings'), | ||
chalk.yellow('Results'), | ||
], | ||
head, | ||
}); | ||
@@ -31,3 +38,4 @@ | ||
const numCompatibles = Object.keys(module.compatibles).length; | ||
return [ | ||
const row = [ | ||
`./${modulePath}`, | ||
@@ -40,2 +48,8 @@ numUsed, | ||
]; | ||
if (hasUndetectableCol) { | ||
row.push(module.hasUndetectable ? chalk.red('yes') : chalk.green('no')); | ||
} | ||
return row; | ||
}), | ||
@@ -59,2 +73,6 @@ ); | ||
const modulePath = path.relative(sourcePath, module.path); | ||
let content = `./${modulePath}`; | ||
if (module.hasUndetectable) { | ||
content = `${content} ${chalk.red('(contains undetectable translations)')}`; | ||
} | ||
return [ | ||
@@ -64,3 +82,3 @@ { | ||
hAlign: 'center', | ||
content: `./${modulePath}`, | ||
content, | ||
}, | ||
@@ -67,0 +85,0 @@ ]; |
@@ -0,1 +1,10 @@ | ||
## [1.0.7](https://github.com/cbourgois/simonsays/compare/1.0.6...1.0.7) (2019-03-20) | ||
### Bug Fixes | ||
* **check:** prevent undetectable translations ([#18](https://github.com/cbourgois/simonsays/issues/18)) ([216b5d3](https://github.com/cbourgois/simonsays/commit/216b5d3)), closes [#16](https://github.com/cbourgois/simonsays/issues/16) | ||
## [1.0.6](https://github.com/cbourgois/simonsays/compare/1.0.5...1.0.6) (2019-03-20) | ||
@@ -2,0 +11,0 @@ |
{ | ||
"name": "@cbourgois/simonsays", | ||
"version": "1.0.6", | ||
"version": "1.0.7", | ||
"description": "Find translations used in AngularJS project", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
@@ -183,4 +183,7 @@ const traverse = require('@babel/traverse').default; | ||
if (left === '*' && right === '*') { | ||
return '*'; | ||
} | ||
return left + right; | ||
} | ||
}; |
@@ -9,2 +9,3 @@ const Promise = require('bluebird'); | ||
const uniq = require('lodash/uniq'); | ||
const without = require('lodash/without'); | ||
const path = require('path'); | ||
@@ -40,13 +41,18 @@ | ||
const used = await SimonSays.findUsed(module); | ||
const hasUndetectable = includes(used, '*'); | ||
const usedTranslationKeys = without(used, '*'); | ||
const { missings, compatibles, declared } = await SimonSays.findDeclaredTranslations({ | ||
...module, | ||
used, | ||
used: usedTranslationKeys, | ||
}, locale); | ||
return { | ||
...module, | ||
used, | ||
used: usedTranslationKeys, | ||
declared, | ||
missings, | ||
compatibles, | ||
hasUndetectable, | ||
}; | ||
@@ -124,3 +130,2 @@ }, | ||
async (module) => { | ||
let moduleRenamed = module; | ||
@@ -127,0 +132,0 @@ |
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
169129
4575