🚨 Active Supply Chain Attack:node-ipc Package Compromised.Learn More
Socket
Book a DemoSign in
Socket

@seneca/doc

Package Overview
Dependencies
Maintainers
4
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@seneca/doc - npm Package Compare versions

Comparing version
5.0.1
to
6.0.0
+11
-5
lib/inject.js

@@ -13,3 +13,2 @@ /* Copyright (c) 2019 voxgig and other contributors, MIT License */

update_source: function(source, injections) {
// console.log('INJS: ', injections)
Object.values(injections).forEach(inj => {

@@ -21,6 +20,13 @@ inj.forEach(({ name, text }) => {

)
source = source.replace(
re,
'<!--START:' + name + '-->\n' + text + '\n<!--END:' + name + '-->'
)
let html =
'<!--START:' +
name +
'-->\n' +
text.replace(/\$/g, '$$$$') +
'\n<!--END:' +
name +
'-->'
source = source.replace(re, html)
})

@@ -27,0 +33,0 @@ })

@@ -28,3 +28,3 @@ /* Copyright (c) 2019 voxgig and other contributors, MIT License */

// local_options has double role here - fix this - separate into seneca options and doc options!
let seneca_options = { ...local_options }
let seneca_options = { legacy: false, ...local_options }
delete seneca_options.top

@@ -38,3 +38,6 @@

seneca.use('promisify').use(__dirname + '/../', { generating: true })
const plugin_options = seneca.options().legacy.options
? { generating: true }
: {}
seneca.use('promisify').use(__dirname + '/../', plugin_options)

@@ -41,0 +44,0 @@ if ('function' === typeof local_init) {

@@ -14,2 +14,3 @@ /* Copyright (c) 2019-2023 voxgig and other contributors, MIT License */

const joi_schema = plugin.def.options_schema
const options_shape = plugin.def.options_shape

@@ -23,3 +24,3 @@ if (

intern.walk_options('', b, joidesc)
intern.walk_joi_options('', b, joidesc)

@@ -35,2 +36,4 @@ b.push('\n\nSet plugin options when loading with:\n```js\n')

`)
} else if (options_shape) {
intern.walk_gubu_options('', b, options_shape)
} else {

@@ -40,3 +43,3 @@ b.push('*None.*')

return [
let out = [
{

@@ -47,2 +50,4 @@ name: 'options',

]
return out
},

@@ -168,3 +173,3 @@

const intern = (module.exports.intern = {
walk_options: function(prefix, b, joidesc) {
walk_joi_options: function(prefix, b, joidesc) {
if (joidesc.keys) {

@@ -184,2 +189,19 @@ Object.keys(joidesc.keys).forEach(optname => {

walk_gubu_options: function(prefix, b, shape) {
let spec = shape?.gubu ? shape.spec() : null
if (spec && 'object' === spec.t) {
Object.keys(spec.v).forEach(optname => {
intern.walk_gubu_options(
(prefix ? prefix + '.' : '') + optname,
b,
spec.v[optname]
)
})
} else {
const opt_md = '* `' + prefix + '` : '
b.push(opt_md + shape.t + intern.gubuflags(shape))
// TODO: meta description
}
},
action_params: function(rules) {

@@ -240,2 +262,10 @@ const self = this

gubuflags: function(shape) {
if (shape.r) {
return ' <i><small>required</small></i>'
}
return ''
},
// order alpha but top level names (sys,role) go first

@@ -242,0 +272,0 @@ nicepat: function(orig, top) {

{
"name": "@seneca/doc",
"version": "5.0.1",
"version": "6.0.0",
"description": "Documentation helper for Seneca plugins.",

@@ -49,7 +49,7 @@ "main": "doc.js",

"@hapi/joi": "^17.1.1",
"seneca": "^3.32.0",
"seneca-promisify": "^3.6.0"
"seneca": "^3.34.0",
"seneca-promisify": "^3.7.1"
},
"devDependencies": {
"jest": "^29.6.4",
"jest": "^29.7.0",
"seneca-joi": "^7.0.2",

@@ -56,0 +56,0 @@ "seneca-plugin-validator": "^0.6.1"

@@ -15,5 +15,9 @@ ![Seneca Doc](http://senecajs.org/files/assets/seneca-logo.png)

[![DeepScan grade](https://deepscan.io/api/teams/5016/projects/25451/branches/796879/badge/grade.svg)](https://deepscan.io/dashboard#view=project&tid=5016&pid=25451&bid=796879)
[![Maintainability](https://api.codeclimate.com/v1/badges/68675302d30a1e3e9447/maintainability)](https://codeclimate.com/github/voxgig/seneca-doc/maintainability)
[![Maintainability](https://api.codeclimate.com/v1/badges/83a38bd880993e70afc1/maintainability)](https://codeclimate.com/github/senecajs/seneca-doc/maintainability)
| ![Voxgig](https://www.voxgig.com/res/img/vgt01r.png) | This open source module is sponsored and supported by [Voxgig](https://www.voxgig.com). |
|---|---|
Documentation helper for [Seneca](senecajs.org) plugins.

@@ -121,3 +125,5 @@

*None.*
* `test` : boolean
* `errors` : object
* `init$` : boolean

@@ -124,0 +130,0 @@