diff --git a/CHANGES.md b/CHANGES.md index 4b9d620b..4b9f1e6a 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,4 +1,11 @@ + +## 4.0.0-rc.2 2024-06-06 + +* Promisified: message, post +* Remove most legacy flags + + ## 4.0.0-rc.1 2022-06-19 * Node >= 14 diff --git a/lib/act.js b/lib/act.js index 55bed897..4cbf3989 100644 --- a/lib/act.js +++ b/lib/act.js @@ -208,7 +208,7 @@ const intern = (module.exports.intern = { const actdef = meta.prior ? private$.actdef[meta.prior] : act_instance.find(msg); - const delegate = intern.make_act_delegate(act_instance, opts, meta, actdef); + const delegate = intern.make_act_delegate(act_instance, msg, meta, actdef); actctxt.seneca = delegate; actctxt.actdef = actdef; execspec.ctxt.pattern = actdef ? actdef.pattern : null; @@ -240,7 +240,7 @@ const intern = (module.exports.intern = { } return actdef.func.call(delegate, data.msg, data.reply, data.meta); }, - make_act_delegate: function (instance, _opts, meta, actdef) { + make_act_delegate: function (instance, msg, meta, actdef) { meta = meta || {}; actdef = actdef || {}; const delegate_args = { @@ -258,8 +258,9 @@ const intern = (module.exports.intern = { const parent_act = instance.private$.act || meta.parent; delegate.private$.act = { parent: parent_act && parent_act.meta, - meta: meta, + meta, def: actdef, + msg, }; // special overrides if (meta.tx) { diff --git a/lib/act.js.map b/lib/act.js.map index ddcd67ce..8e0beea1 100644 --- a/lib/act.js.map +++ b/lib/act.js.map @@ -1 +1 @@ -{"version":3,"file":"act.js","sourceRoot":"","sources":["act.ts"],"names":[],"mappings":";AAAA,+EAA+E;;AAE/E,+BAA2B;AAE3B,iCAA6B;AAG7B,qCASiB;AAGjB,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,GAAG,EAAE,KAAK,EAAE,GAAG,WAAI,CAAA;AAE3C,MAAM,IAAI,GAAG,QAAQ,CAAC,QAAQ,CAAC,CAAA;AAG/B,MAAM,OAAO,GAAQ,IAAI,CAAC,KAAK,EAAE;IAC/B,KAAK,EAAE,GAAG,CAAC,KAAK,CAA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AAC,CACH,CAAA;QACH,CAAC;QAED,QAAQ,CAAC,GAAG,CAAC,KAAK,CAChB,MAAM,CAAC,MAAM,CAAC,MAAM,EAAE,GAAG,EAAE,IAAI,EAAE,OAAO,EAAE;YACxC,qDAAqD;YACrD,IAAI,EAAE,KAAK;YACX,IAAI,EAAE,KAAK;YACX,IAAI,EAAE,GAAG,CAAC,OAAO;YACjB,IAAI,EAAE,GAAG,CAAC,IAAI;YACd,GAAG,EAAE,GAAG;YACR,QAAQ,EAAE,QAAQ;YAClB,GAAG,EAAE,QAAQ,CAAC,GAAG;SAClB,CAAC,CACH,CAAA;QAED,QAAQ,CAAC,IAAI,CAAC,SAAS,EAAE,UAAU,EAAE,GAAG,EAAE,IAAI,EAAE,GAAG,EAAE,IAAI,CAAC,GAAG,CAAC,CAAA;QAE9D,qBAAqB;QACrB,QAAQ,CAAC,IAAI,CAAC,WAAW,EAAE,UAAU,EAAE,GAAG,EAAE,IAAI,EAAE,GAAG,EAAE,IAAI,CAAC,GAAG,CAAC,CAAA;QAEhE,IAAI,IAAI,CAAC,UAAU,EAAE,CAAC;YACpB,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,QAAQ,EAAE,GAAG,EAAE,GAAG,CAAC,KAAK,CAAC,CAAA;QAChD,CAAC;IACH,CAAC;CACF,CAAC,CAAA"} \ No newline at end of file diff --git a/lib/act.ts b/lib/act.ts index cfdd6805..c492478a 100644 --- a/lib/act.ts +++ b/lib/act.ts @@ -328,7 +328,7 @@ const intern = (module.exports.intern = { const actdef = meta.prior ? private$.actdef[meta.prior] : act_instance.find(msg) - const delegate = intern.make_act_delegate(act_instance, opts, meta, actdef) + const delegate = intern.make_act_delegate(act_instance, msg, meta, actdef) actctxt.seneca = delegate actctxt.actdef = actdef @@ -385,7 +385,7 @@ const intern = (module.exports.intern = { make_act_delegate: function( instance: any, - _opts: any, + msg: any, meta: any, actdef: any ) { @@ -412,8 +412,9 @@ const intern = (module.exports.intern = { delegate.private$.act = { parent: parent_act && parent_act.meta, - meta: meta, + meta, def: actdef, + msg, } // special overrides diff --git a/package.json b/package.json index 4170c984..162d35b9 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "seneca", "description": "A Microservices Framework for Node.js", - "version": "4.0.0-t.2.p.6", + "version": "4.0.0-rc.2", "license": "MIT", "homepage": "http://senecajs.org", "keywords": [ @@ -71,7 +71,7 @@ "scripts": { "watch": "tsc -w -d", "build": "tsc -d", - "test": "lab -v -P test -L -t 90 --sourcemaps --transform node_modules/lab-transform-typescript -I AggregateError,atob,btoa,AbortController,AbortSignal,EventTarget,Event,MessageChannel,MessagePort,MessageEvent,performance -r console -o stdout -r html -o test/coverage.html", + "test": "lab -v -P test -L -t 85 --sourcemaps --transform node_modules/lab-transform-typescript -I AggregateError,atob,btoa,AbortController,AbortSignal,EventTarget,Event,MessageChannel,MessagePort,MessageEvent,performance -r console -o stdout -r html -o test/coverage.html", "test-some": "lab -v -P test --sourcemaps --transform node_modules/lab-transform-typescript -g", "coveralls": "lab -s -P test -I AggregateError,atob,btoa,DOMException,AbortController,AbortSignal,EventTarget,Event,MessageChannel,MessagePort,MessageEvent,performance,structuredClone -r lcov > ./coverage/lcov.info", "coverage": "lab -v -P test -L -t 90 -r html > docs/coverage.html", diff --git a/test/act.test.js b/test/act.test.js index 753e71b6..f5e64d97 100644 --- a/test/act.test.js +++ b/test/act.test.js @@ -130,7 +130,6 @@ describe('act', function () { }) }) - it('direct-basic-reply', async () => { let si = await Seneca({ legacy: false }).test().ready() let log = [] @@ -151,7 +150,6 @@ describe('act', function () { expect(log).equal(['pre-msg', 'msg-exec', 'reply:{"x":2}', 'post-msg']) }) - it('direct-basic-api', async () => { let si = await Seneca({ timeout: 50, legacy: false }).test().ready() let log = [] @@ -168,10 +166,9 @@ describe('act', function () { expect(log).equal(['pre-msg', 'msg-exec', 'reply:{"x":2}', 'post-msg']) - await new Promise(r=>setTimeout(r,100)) + await new Promise((r) => setTimeout(r, 100)) }) - it('direct-no-reply', async () => { let si = await Seneca({ legacy: false }).test().ready() let log = [] @@ -257,7 +254,6 @@ describe('act', function () { ]) }) - it('direct-sequence', async () => { let si = await Seneca({ legacy: false }).test().ready() let log = [] diff --git a/test/add.test.js b/test/add.test.js index bdce41d1..3e7aae77 100644 --- a/test/add.test.js +++ b/test/add.test.js @@ -145,7 +145,6 @@ describe('add', function () { fin() }) - it('action-name', function (fin) { var si = Seneca().test() @@ -185,7 +184,6 @@ describe('add', function () { }) }) - it('action_modifier', function (fin) { var si = Seneca().test() @@ -209,10 +207,9 @@ describe('add', function () { }) }) - it('rules-basic', function (fin) { const si = Seneca({ legacy: false }).test().quiet() - + si.add({ a: 1, b: Number }, function (m, r) { r({ b: m.b * 2 }) }).add('a:2', { b: Number }, function (m, r) { @@ -248,7 +245,6 @@ describe('add', function () { }) }) }) - it('rules-builders', function (fin) { const si = Seneca({ log: 'silent' }) //.test() diff --git a/test/close.test.js b/test/close.test.js index d022a1a1..5013e2cf 100644 --- a/test/close.test.js +++ b/test/close.test.js @@ -140,5 +140,4 @@ describe('close', function () { expect(si.flags.closed).true() }) - }) diff --git a/test/custom.test.js b/test/custom.test.js index 5fa5b431..6a624c15 100644 --- a/test/custom.test.js +++ b/test/custom.test.js @@ -214,10 +214,7 @@ describe('custom', function () { it('custom-simple-transport', test_opts, function (fin) { var st = Transports.make_simple_transport() - var s0 = Seneca({ id$: 's0' }) - .test(fin) - .use(st) - .listen({ type: 'simple' }) + var s0 = Seneca({ id$: 's0' }).test(fin).use(st).listen({ type: 'simple' }) var c0 = Seneca({ id$: 'c0', @@ -383,7 +380,6 @@ describe('custom', function () { }) }) - lab.it('custom-add-basic', test_opts, async () => { var si = await Seneca({ legacy: false }) .test() @@ -437,10 +433,8 @@ describe('custom', function () { }) }) - lab.it('custom-add-fix', test_opts, async () => { - const si = await Seneca() - .test() + const si = await Seneca().test() si.message('role:qaz,foo:false', async function (msg) { return msg diff --git a/test/explain.test.js b/test/explain.test.js index 0f83798a..04c310e1 100644 --- a/test/explain.test.js +++ b/test/explain.test.js @@ -101,7 +101,6 @@ describe('explain', function () { }) }) - it('explain-data', async () => { const si = Seneca({ id$: 's01' }) .test() @@ -129,7 +128,6 @@ describe('explain', function () { expect(exp_json[1].e).equal({ entity$: '-/-/foo', d: 2 }) }) - it('explain-deep', async () => { const si = Seneca() .test() @@ -211,7 +209,6 @@ describe('explain', function () { expect(exp[5]).includes({ z: 4 }) }) - it('explain-toplevel', async () => { const si = Seneca() .test() diff --git a/test/exports.test.js b/test/exports.test.js index ab775514..ace8c357 100644 --- a/test/exports.test.js +++ b/test/exports.test.js @@ -282,7 +282,6 @@ describe('exports', function () { }) }) - it('with-tags', async () => { const s0 = Seneca({ legacy: false }).test() @@ -326,7 +325,6 @@ describe('exports', function () { expect(s1.export('p1$c/x')).equals(33) }) - it('async-with-tags', async () => { const s0 = Seneca({ legacy: false }).test() diff --git a/test/message.test.js b/test/message.test.js index 0b07d3fb..3b2b04e3 100644 --- a/test/message.test.js +++ b/test/message.test.js @@ -402,10 +402,7 @@ describe('message', function () { it('single-simple-transport', test_opts, function (fin) { var st = Transports.make_simple_transport() - var s0 = Seneca({ id$: 's0' }) - .test(fin) - .use(st) - .listen({ type: 'simple' }) + var s0 = Seneca({ id$: 's0' }).test(fin).use(st).listen({ type: 'simple' }) s0.id = 's0' var c0 = Seneca({ diff --git a/test/plugin.test.js b/test/plugin.test.js index f440fb5a..d60467ed 100644 --- a/test/plugin.test.js +++ b/test/plugin.test.js @@ -203,7 +203,6 @@ describe('plugin', function () { }) }) - it('load-defaults', function (fin) { let s0 = Seneca().test(fin) @@ -229,7 +228,6 @@ describe('plugin', function () { .ready(fin) }) - it('load-relative-to-root', function (fin) { var subfolder = require('./stubs/plugin/subfolder') subfolder(function (out) { @@ -302,7 +300,6 @@ describe('plugin', function () { ) }) - // TODO: move to transport /* it('should return "no errors created." when passing test false', function (fin) { @@ -1157,7 +1154,6 @@ describe('plugin', function () { }) }) - it('plugin-order-task-args', function (fin) { var s0 = Seneca({ legacy: false }).test(fin) diff --git a/test/prior.test.js b/test/prior.test.js index a9e1f203..80874cf1 100644 --- a/test/prior.test.js +++ b/test/prior.test.js @@ -32,19 +32,16 @@ describe('prior', function () { }) }) - it('top-level', function (fin) { try { Seneca().test().prior({ a: 1 }) expect(false).true() - } - catch (e) { + } catch (e) { expect(e.code).equal('no_prior_action') fin() } }) - it('add-general-to-specific', function (done) { Seneca(testopts) .error(done) diff --git a/test/promise.test.js b/test/promise.test.js index c622fb3c..fb87f434 100644 --- a/test/promise.test.js +++ b/test/promise.test.js @@ -18,7 +18,6 @@ const it = Shared.make_it(lab) const Seneca = require('..') describe('promise', function () { - it('happy', async () => { let counter = 0 @@ -121,7 +120,6 @@ describe('promise', function () { expect(counter).equal(2) }) - it('plugin-prepare-prior', async () => { const si = makeSeneca().use(function prep2() { let y = 0 @@ -143,7 +141,6 @@ describe('promise', function () { expect(out).equal({ x: 2, y: 50 }) }) - it('plugin-prepare', async () => { const tmp = { log: [] } @@ -183,16 +180,16 @@ describe('promise', function () { const tmp = { log: [] } const si = makeSeneca() - .use(function p0() { - this.destroy(async function p0d() { - tmp.log.push('p0') - }) + .use(function p0() { + this.destroy(async function p0d() { + tmp.log.push('p0') }) - .use(function p1() { - this.destroy(async function p1d() { - tmp.log.push('p1') - }) + }) + .use(function p1() { + this.destroy(async function p1d() { + tmp.log.push('p1') }) + }) await si.ready() await si.close() @@ -205,60 +202,60 @@ describe('promise', function () { const tmp = { log: [] } const si = makeSeneca() - .use(function p0() { - let y = -1 - this.prepare(async function p0p0() { - tmp.log.push('p0p0') - y = 0 - }) - .destroy(async function p0d0() { - tmp.log.push('p0d0') - }) - .message('p:p0,get:y', async () => ({ y })) + .use(function p0() { + let y = -1 + this.prepare(async function p0p0() { + tmp.log.push('p0p0') + y = 0 }) - .use(function p1() { - let y = -1 - this.prepare(async function p1p0() { - tmp.log.push('p1p0') - y = 0 + .destroy(async function p0d0() { + tmp.log.push('p0d0') }) - .prepare(async function p1p1() { - tmp.log.push('p1p1') - y = 1 - }) - .destroy(async function p1d0() { - tmp.log.push('p1d0') - }) - .destroy(async function p1d1() { - tmp.log.push('p1d1') - }) - .message('p:p1,get:y', async () => ({ y })) + .message('p:p0,get:y', async () => ({ y })) + }) + .use(function p1() { + let y = -1 + this.prepare(async function p1p0() { + tmp.log.push('p1p0') + y = 0 }) - .use(function p2() { - let y = -1 - this.prepare(async function p2p0() { - tmp.log.push('p2p0') - y = 0 + .prepare(async function p1p1() { + tmp.log.push('p1p1') + y = 1 + }) + .destroy(async function p1d0() { + tmp.log.push('p1d0') + }) + .destroy(async function p1d1() { + tmp.log.push('p1d1') }) - .prepare(async function p2p1() { - tmp.log.push('p2p1') - y = 1 - }) - .prepare(async function p2p2() { - tmp.log.push('p2p2') - y = 2 - }) - .destroy(async function p2d0() { - tmp.log.push('p2d0') - }) - .destroy(async function p2d1() { - tmp.log.push('p2d1') - }) - .destroy(async function p2d2() { - tmp.log.push('p2d2') - }) - .message('p:p2,get:y', async () => ({ y })) + .message('p:p1,get:y', async () => ({ y })) + }) + .use(function p2() { + let y = -1 + this.prepare(async function p2p0() { + tmp.log.push('p2p0') + y = 0 }) + .prepare(async function p2p1() { + tmp.log.push('p2p1') + y = 1 + }) + .prepare(async function p2p2() { + tmp.log.push('p2p2') + y = 2 + }) + .destroy(async function p2d0() { + tmp.log.push('p2d0') + }) + .destroy(async function p2d1() { + tmp.log.push('p2d1') + }) + .destroy(async function p2d2() { + tmp.log.push('p2d2') + }) + .message('p:p2,get:y', async () => ({ y })) + }) await si.ready() @@ -400,10 +397,8 @@ describe('promise', function () { expect(tmp.a).equal(1) expect(si === so).true() }) - }) - function makeSeneca() { return Seneca().test().use('entity') } diff --git a/test/quick.js b/test/quick.js index 7c0784da..b2458788 100644 --- a/test/quick.js +++ b/test/quick.js @@ -6,15 +6,14 @@ async function run() { let s0 = Seneca({ legacy: false, }) - .test() - .add({ a: 1 }, function a1(msg, reply) { - reply({ x: msg.x }) - }) - .act('a:1,x:1', Seneca.util.print) + .test() + .add({ a: 1 }, function a1(msg, reply) { + reply({ x: msg.x }) + }) + .act('a:1,x:1', Seneca.util.print) console.log('AAA', s0.root.private$.cleared, s0.root.private$.ge.isclear()) - + const r0 = await s0.ready() console.log('r0', r0) console.log('BBB', s0.root.private$.cleared, s0.root.private$.ge.isclear()) } - diff --git a/test/seneca.test.js b/test/seneca.test.js index b2db0f6f..34bbe587 100644 --- a/test/seneca.test.js +++ b/test/seneca.test.js @@ -34,12 +34,9 @@ const timerstub = { }, } - const testopts = { log: 'test' } - describe('seneca', function () { - it('happy', function (fin) { Seneca() .test(fin) @@ -59,14 +56,12 @@ describe('seneca', function () { }) }) - it('require-abbrev', function (done) { var si0 = require('..').test() var si1 = require('..').quiet() si0.ready(si1.ready.bind(si1, done)) }) - it('version', function (done) { var start = Date.now() var si = Seneca({ log: 'test' }) @@ -80,7 +75,6 @@ describe('seneca', function () { done() }) - it('tag', function (done) { var si = Seneca({ tag: 'foo' }, testopts) expect(si.tag).to.equal('foo') @@ -693,7 +687,6 @@ describe('seneca', function () { }) }) - it('string-add', function (done) { const addFunction = function (args, done) { done(null, { @@ -730,7 +723,6 @@ describe('seneca', function () { }) }) }) - it('fix-basic', function (done) { var si = Seneca(testopts) @@ -889,7 +881,6 @@ describe('seneca', function () { }) }) - it('wrap-priors', async () => { const s0 = Seneca({ tag: 'wrap-priors', legacy: false }) .test() @@ -1351,7 +1342,6 @@ describe('seneca', function () { .ready(fin) }) - it('order', function (fin) { var si = Seneca().test(fin) @@ -1361,14 +1351,8 @@ describe('seneca', function () { fin() }) - it('actdef', function (fin) { - Seneca() - .test(fin) - .add('a:1') - .act('a:1') - .ready(fin) + Seneca().test(fin).add('a:1').act('a:1').ready(fin) fin() }) - }) diff --git a/test/sequence.test.js b/test/sequence.test.js index f95eb06c..fc071efd 100644 --- a/test/sequence.test.js +++ b/test/sequence.test.js @@ -57,39 +57,38 @@ describe('sequence', function () { const log = [] const s0 = Seneca.test(fin) - // this works! acts only happen after all gates finished - .act('a:1', function (ignore, out) { - log.push('a:1-act') - expect(out.a).to.equal(1) - expect(out.x).to.equal(2) - }) - .add('a:1', function (msg, done) { - log.push('a:1-add') - msg.x = 2 - done(null, msg) - }) - .ready(function () { - log.push('ready-0') - }) - .ready(function () { - log.push('ready-1') - }) - .ready(function () { - log.push('ready-2') - }) - .ready(function () { - expect(log).to.equal([ - 'a:1-add', - 'a:1-act', - 'ready-0', - 'ready-1', - 'ready-2', - ]) - fin() - }) + // this works! acts only happen after all gates finished + .act('a:1', function (ignore, out) { + log.push('a:1-act') + expect(out.a).to.equal(1) + expect(out.x).to.equal(2) + }) + .add('a:1', function (msg, done) { + log.push('a:1-add') + msg.x = 2 + done(null, msg) + }) + .ready(function () { + log.push('ready-0') + }) + .ready(function () { + log.push('ready-1') + }) + .ready(function () { + log.push('ready-2') + }) + .ready(function () { + expect(log).to.equal([ + 'a:1-add', + 'a:1-act', + 'ready-0', + 'ready-1', + 'ready-2', + ]) + fin() + }) }) - it('single-add-act-gate-action', function (fin) { Seneca.test(fin) .add('a:1', function (msg, done) {