Skip to content

Commit 862fa70

Browse files
committed
initial
1 parent 4394dd6 commit 862fa70

14 files changed

+162
-845
lines changed

README.md

+4-2
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ seneca.use('BatchProcessor', {
4040
msg: {
4141
aim: 'bar',
4242
color: 'blue',
43-
planet: 'out~planet' // dot path ref (see npm package `inks`)
43+
planet: 'out~planet' // dot path ref (see npm package `inks` .evaluate)
4444
order: 'ctx~place.order~Number' // Gubu validation expression
4545
}
4646
},
@@ -86,7 +86,9 @@ seneca.act({aim:bar,color:green,planet:mars,order:1})
8686

8787
// Seneca setup script:
8888

89-
seneca.use('BatchProcessor', {
89+
seneca
90+
.use('BatchMonitor', {...})
91+
.use('BatchProcessor', {
9092
send: {
9193
mode: 'async', // wait for transition, global setting
9294
},

dist/BatchProcessor.d.ts

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
type BatchProcessorOptionsFull = {
2+
debug: boolean;
3+
};
4+
export type BatchProcessorOptions = Partial<BatchProcessorOptionsFull>;
5+
declare function BatchProcessor(this: any, options: BatchProcessorOptionsFull): {
6+
exports: {
7+
process: (seneca: any, ctx: any, out: any) => any;
8+
};
9+
};
10+
export default BatchProcessor;

dist/BatchProcessor.js

+25
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/BatchProcessor.js.map

+1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/BatchProcessorDoc.d.ts

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
declare const docs: {
2+
messages: {};
3+
};
4+
export default docs;

dist/BatchProcessorDoc.js

+11
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/BatchProcessorDoc.js.map

+1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+14-10
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
{
2-
"name": "@seneca/config",
2+
"name": "@seneca/batch-processor",
33
"version": "0.4.0",
44
"main": "dist/Config.js",
55
"type": "commonjs",
66
"types": "dist/Config.d.ts",
7-
"description": "Live configuration plugin for the Seneca framework.",
8-
"homepage": "https://github.com/senecajs/SenecaConfig",
7+
"description": "Seneca Batch Processor",
8+
"homepage": "https://github.com/senecajs/SenecaBatchProcessor",
99
"keywords": [
1010
"seneca",
1111
"Config"
1212
],
1313
"author": "Richard Rodger - richardrodger.com",
1414
"repository": {
1515
"type": "git",
16-
"url": "git://github.com/senecajs/SenecaConfig.git"
16+
"url": "git://github.com/senecajs/SenecaBatchProcessor.git"
1717
},
1818
"scripts": {
1919
"prettier": "prettier --write .",
@@ -24,7 +24,7 @@
2424
"build": "tsc -d",
2525
"doc": "seneca-doc",
2626
"clean": "rm -rf node_modules yarn.lock package-lock.json",
27-
"reset": "npm run clean && npm i && npm test",
27+
"reset": "npm run clean && npm i -f && npm test",
2828
"repo-tag": "REPO_VERSION=`node -e \"console.log(require('./package').version)\"` && echo TAG: v$REPO_VERSION && git commit -a -m v$REPO_VERSION && git push && git tag v$REPO_VERSION && git push --tags;",
2929
"repo-publish": "npm run clean && npm i && npm run repo-publish-quick",
3030
"repo-publish-quick": "npm run build && npm run test && npm run doc && npm run repo-tag && npm publish --access public --registry https://registry.npmjs.org "
@@ -39,7 +39,8 @@
3939
"node": ">=14"
4040
},
4141
"devDependencies": {
42-
"@seneca/doc": "^7.2.0",
42+
"@seneca/batch-monitor": "^0.0.6",
43+
"@seneca/doc": "^8.0.0",
4344
"@seneca/maintain": "^0.1.0",
4445
"@types/jest": "^29.5.12",
4546
"@types/node": "^20.14.2",
@@ -48,12 +49,15 @@
4849
"jest": "^29.7.0",
4950
"prettier": "3.3.1",
5051
"seneca-msg-test": "^4.1.0",
52+
"seneca": "4.0.0-rc2",
5153
"typescript": "^5.4.5"
5254
},
5355
"peerDependencies": {
54-
"@seneca/entity-util": ">=2",
55-
"seneca": ">=3",
56-
"seneca-entity": ">=25",
57-
"seneca-promisify": ">=3"
56+
"@seneca/entity-util": ">=3",
57+
"seneca": ">=4",
58+
"seneca-entity": ">=25"
59+
},
60+
"dependencies": {
61+
"inks": "^2.0.0"
5862
}
5963
}

src/BatchProcessor.ts

+40
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
/* Copyright © 2024 Seneca Project Contributors, MIT License. */
2+
3+
4+
type BatchProcessorOptionsFull = {
5+
debug: boolean
6+
}
7+
8+
export type BatchProcessorOptions = Partial<BatchProcessorOptionsFull>
9+
10+
11+
// FEATURE: subsets of keys by dot separators.
12+
13+
function BatchProcessor(this: any, options: BatchProcessorOptionsFull) {
14+
const seneca: any = this
15+
16+
function process(seneca: any, ctx: any, out: any) {
17+
return out
18+
}
19+
20+
return {
21+
exports: {
22+
process
23+
}
24+
}
25+
}
26+
27+
28+
// Default options.
29+
const defaults: BatchProcessorOptionsFull = {
30+
debug: false,
31+
}
32+
33+
34+
Object.assign(BatchProcessor, { defaults })
35+
36+
export default BatchProcessor
37+
38+
if ('undefined' !== typeof module) {
39+
module.exports = BatchProcessor
40+
}

src/BatchProcessorDoc.ts

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
/* Copyright © 2024 Seneca Project Contributors, MIT License. */
2+
3+
const docs = {
4+
messages: {
5+
}
6+
}
7+
8+
export default docs
9+
10+
if ('undefined' !== typeof module) {
11+
module.exports = docs
12+
}

0 commit comments

Comments
 (0)