Skip to content

Commit

Permalink
v3.34.1
Browse files Browse the repository at this point in the history
  • Loading branch information
rjrodger committed Jan 19, 2024
1 parent 18d0811 commit a96c79f
Show file tree
Hide file tree
Showing 8 changed files with 45 additions and 13 deletions.
5 changes: 5 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
## 3.34.1 2024-01-18

* Remove lodash.template as a sub-dependency.


## 3.34.0 2024-01-18

* Internal plugin description now includes Gubu shape for plugin options.
Expand Down
7 changes: 6 additions & 1 deletion lib/plugin.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion lib/plugin.js.map

Large diffs are not rendered by default.

9 changes: 8 additions & 1 deletion lib/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -589,7 +589,9 @@ function make_tasks(): any {
resolved_options = fullopts
}
else {
if (!so.legacy.options && !Joi.isSchema(defaults_values, { legacy: true })) {
let useJoi = so.legacy.options || Joi.isSchema(defaults_values, { legacy: true })

if (!useJoi) {
// TODO: use Gubu.isShape
let isShape = defaults_values.gubu && defaults_values.gubu.gubu$

Expand Down Expand Up @@ -949,6 +951,11 @@ function make_intern() {
return spec
}

// Joi prototype missing, so just accept any options
else if (null != spec.$_root) {
return Joi.object({})
}

let joiobj = Joi.object()

if (opts.allow_unknown) {
Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "seneca",
"description": "A Microservices Framework for Node.js",
"version": "3.34.0",
"version": "3.34.1",
"license": "MIT",
"homepage": "http://senecajs.org",
"keywords": [
Expand Down Expand Up @@ -101,8 +101,8 @@
"patrun": "^7.2.5",
"qs": "^6.11.2",
"rolling-stats": "^0.2.1",
"seneca-transport": "^8.0.0",
"use-plugin": "9"
"seneca-transport": "^8.2.0",
"use-plugin": "^10.2.0"
},
"devDependencies": {
"@hapi/code": "8",
Expand Down
8 changes: 4 additions & 4 deletions test/options.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@ var it = lab.it
var Seneca = require('..')

describe('options', function () {
it('strict.find', async () => {
it('options-strict.find', async () => {
await Seneca({ strict: { find: false } })
.test()
.act('foo:1')
.ready()
})

it('internal.routers', async () => {
it('options-internal.routers', async () => {
await Seneca({
internal: {
actrouter: new Patrun({ gex: true }),
Expand All @@ -36,13 +36,13 @@ describe('options', function () {
.ready()
})

it('default_plugins', async () => {
it('options-default_plugins', async () => {
await Seneca({ legacy: false, default_plugins: { foo: true } })
.test()
.ready()
})

it('validate', async () => {
it('options-validate', async () => {
expect(() => Seneca({ prior: { direct: 'BAD' } })).throws(/type/)
expect(
Seneca({ valid: { active: false }, prior: { direct: 'BAD' } }),
Expand Down
19 changes: 16 additions & 3 deletions test/order.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ var it = lab.it
var Seneca = require('..')

describe('order', function () {
it('happy', async () => {
it('order-happy', async () => {
var s0 = Seneca({ legacy: false }).test()

s0.order.plugin.add({
Expand All @@ -22,6 +22,9 @@ describe('order', function () {
op: 'merge',
out: {
plugin: {
defaults: {
c: Number,
},
options: {
c: 3,
},
Expand Down Expand Up @@ -107,6 +110,9 @@ describe('order', function () {
op: 'merge',
out: {
plugin: {
defaults: {
f: Number,
},
options: {
f: 5,
},
Expand All @@ -122,6 +128,7 @@ describe('order', function () {

s0.use(p1)

/*
var Joi = s0.util.Joi
// console.log('TASKLIST',s0.order.plugin.tasks().map(t=>t.name).join('\n'))
Expand All @@ -133,6 +140,7 @@ describe('order', function () {
}).default()
// console.log(Joi.isSchema(joidef,{legacy:true}))
*/

s0.use({
name: 'p2',
Expand All @@ -144,12 +152,17 @@ describe('order', function () {
}
},

defaults: joidef,
// defaults: joidef,
defaults: {
e: 'v0',
c: Number,
f: Number,
},
})

s0.ready(function () {
//console.log('AAA', s0.export('p2/opts'))
expect(s0.export('p2/opts')).equals({
expect(s0.export('p2/opts')).contains({
c: 3,
e: 'v0',
d: NaN,
Expand Down
2 changes: 2 additions & 0 deletions test/plugin.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -1154,6 +1154,7 @@ describe('plugin', function () {
})
})

/*
it('plugin-defaults-top-level-joi', function (fin) {
var s0 = Seneca().test(fin)
var Joi = s0.util.Joi
Expand Down Expand Up @@ -1202,6 +1203,7 @@ describe('plugin', function () {
fin()
})
})
*/

it('plugin-order-task-args', function (fin) {
var s0 = Seneca({ legacy: false }).test(fin)
Expand Down

0 comments on commit a96c79f

Please sign in to comment.