documentary
Advanced tools
Comparing version 1.35.3 to 1.35.4
@@ -55,7 +55,11 @@ const { h } = require('preact'); | ||
/** | ||
* Prints the type definition table. | ||
* @param {Object} opts | ||
* @param {Documentary} opts.documentary | ||
* @param {boolean} [opts.print-imports=false] Add lines with imports | ||
* @param {boolean} opts.slimFunctions Don't add method tables with <kbd> for arguments. | ||
*/ | ||
function Typedef({ documentary, children, name, narrow, | ||
flatten, details, level, noArgTypesInToc = false, slimFunctions = false, | ||
'print-imports': noFlatten = false, flatten = !noFlatten, details, level, | ||
noArgTypesInToc = false, slimFunctions = false, | ||
}) { | ||
@@ -62,0 +66,0 @@ details = details ? details.split(',') : [] |
@@ -32,2 +32,3 @@ const { h } = require('preact'); | ||
let table = method.description || '' | ||
const nameProcess = makeIconsName(allTypes, documentary) | ||
const lis = method.args.map(({ optional, name, type, description }) => { | ||
@@ -41,3 +42,3 @@ optional = optional || name.startsWith('...') | ||
...linkingOpts, | ||
nameProcess: makeIconsName(allTypes, documentary), | ||
nameProcess, | ||
}) | ||
@@ -44,0 +45,0 @@ useCode = typeWithLink != type |
const { Replaceable, replace } = require('../../stdlib'); | ||
const { collect } = require('../../stdlib'); | ||
const { relative, sep, join, resolve } = require('path'); | ||
const { relative, sep, join, resolve, dirname } = require('path'); | ||
const { typedefMdRe } = require('./rules/typedef-md'); | ||
@@ -224,3 +224,14 @@ const { read } = require('./'); | ||
loc = loc.trim() || 'typedefs.json' | ||
const data = require(resolve(loc)) | ||
let data | ||
try { | ||
// if a package is referenced | ||
const p = `${loc}/package.json` | ||
const { typedefs: td } = require(p) | ||
const pl = require.resolve(p) | ||
if (td) loc = join(dirname(pl), td) | ||
else throw new Error(`typedefs field not found in ${loc}/package.json`) | ||
} catch (err) { | ||
loc = resolve(loc) | ||
} | ||
data = require(loc) | ||
Object.entries(data).forEach(([k, d]) => { | ||
@@ -227,0 +238,0 @@ const n = `${namespace}.` |
@@ -0,1 +1,9 @@ | ||
## 21 December 2019 | ||
### [1.35.4](https://github.com/artdecocode/documentary/compare/v1.35.3...v1.35.4) | ||
- [feature] Read `<include-typedefs>` from package.json's typedefs field. | ||
- [feature] Flatten imports in types by default. | ||
- [fix] Update _Typal_ to fix linking order bug. | ||
## 20 December 2019 | ||
@@ -2,0 +10,0 @@ |
{ | ||
"name": "documentary", | ||
"version": "1.35.3", | ||
"version": "1.35.4", | ||
"description": "Documentation Compiler To Generate The Table Of Contents, Embed Examples With Their Output, Make Markdown Tables, Maintain Typedefs For JavaScript And README, Watch Changes To Push, Use Macros And Prettify API Titles.", | ||
@@ -89,2 +89,3 @@ "main": "build", | ||
"@idio/debug": "^1.2.3", | ||
"@typedefs/goa": "^0.1.4", | ||
"@wrote/clone": "^1.2.1", | ||
@@ -123,4 +124,4 @@ "@wrote/ensure-path": "^1.1.0", | ||
"preact": "8.5.3", | ||
"typal": "^1.24.17" | ||
"typal": "^1.24.19" | ||
} | ||
} |
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
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
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
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
467539
5178
36
36
Updatedtypal@^1.24.19