Skip to content

Commit

Permalink
initial
Browse files Browse the repository at this point in the history
  • Loading branch information
rjrodger committed Jun 6, 2024
1 parent 4394dd6 commit 862fa70
Show file tree
Hide file tree
Showing 14 changed files with 162 additions and 845 deletions.
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ seneca.use('BatchProcessor', {
msg: {
aim: 'bar',
color: 'blue',
planet: 'out~planet' // dot path ref (see npm package `inks`)
planet: 'out~planet' // dot path ref (see npm package `inks` .evaluate)
order: 'ctx~place.order~Number' // Gubu validation expression
}
},
Expand Down Expand Up @@ -86,7 +86,9 @@ seneca.act({aim:bar,color:green,planet:mars,order:1})

// Seneca setup script:

seneca.use('BatchProcessor', {
seneca
.use('BatchMonitor', {...})
.use('BatchProcessor', {
send: {
mode: 'async', // wait for transition, global setting
},
Expand Down
10 changes: 10 additions & 0 deletions dist/BatchProcessor.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
type BatchProcessorOptionsFull = {
debug: boolean;
};
export type BatchProcessorOptions = Partial<BatchProcessorOptionsFull>;
declare function BatchProcessor(this: any, options: BatchProcessorOptionsFull): {
exports: {
process: (seneca: any, ctx: any, out: any) => any;
};
};
export default BatchProcessor;
25 changes: 25 additions & 0 deletions dist/BatchProcessor.js

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

1 change: 1 addition & 0 deletions dist/BatchProcessor.js.map

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

4 changes: 4 additions & 0 deletions dist/BatchProcessorDoc.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
declare const docs: {
messages: {};
};
export default docs;
11 changes: 11 additions & 0 deletions dist/BatchProcessorDoc.js

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

1 change: 1 addition & 0 deletions dist/BatchProcessorDoc.js.map

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

24 changes: 14 additions & 10 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
{
"name": "@seneca/config",
"name": "@seneca/batch-processor",
"version": "0.4.0",
"main": "dist/Config.js",
"type": "commonjs",
"types": "dist/Config.d.ts",
"description": "Live configuration plugin for the Seneca framework.",
"homepage": "https://github.com/senecajs/SenecaConfig",
"description": "Seneca Batch Processor",
"homepage": "https://github.com/senecajs/SenecaBatchProcessor",
"keywords": [
"seneca",
"Config"
],
"author": "Richard Rodger - richardrodger.com",
"repository": {
"type": "git",
"url": "git://github.com/senecajs/SenecaConfig.git"
"url": "git://github.com/senecajs/SenecaBatchProcessor.git"
},
"scripts": {
"prettier": "prettier --write .",
Expand All @@ -24,7 +24,7 @@
"build": "tsc -d",
"doc": "seneca-doc",
"clean": "rm -rf node_modules yarn.lock package-lock.json",
"reset": "npm run clean && npm i && npm test",
"reset": "npm run clean && npm i -f && npm test",
"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;",
"repo-publish": "npm run clean && npm i && npm run repo-publish-quick",
"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 "
Expand All @@ -39,7 +39,8 @@
"node": ">=14"
},
"devDependencies": {
"@seneca/doc": "^7.2.0",
"@seneca/batch-monitor": "^0.0.6",
"@seneca/doc": "^8.0.0",
"@seneca/maintain": "^0.1.0",
"@types/jest": "^29.5.12",
"@types/node": "^20.14.2",
Expand All @@ -48,12 +49,15 @@
"jest": "^29.7.0",
"prettier": "3.3.1",
"seneca-msg-test": "^4.1.0",
"seneca": "4.0.0-rc2",
"typescript": "^5.4.5"
},
"peerDependencies": {
"@seneca/entity-util": ">=2",
"seneca": ">=3",
"seneca-entity": ">=25",
"seneca-promisify": ">=3"
"@seneca/entity-util": ">=3",
"seneca": ">=4",
"seneca-entity": ">=25"
},
"dependencies": {
"inks": "^2.0.0"
}
}
40 changes: 40 additions & 0 deletions src/BatchProcessor.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
/* Copyright © 2024 Seneca Project Contributors, MIT License. */


type BatchProcessorOptionsFull = {
debug: boolean
}

export type BatchProcessorOptions = Partial<BatchProcessorOptionsFull>


// FEATURE: subsets of keys by dot separators.

function BatchProcessor(this: any, options: BatchProcessorOptionsFull) {
const seneca: any = this

function process(seneca: any, ctx: any, out: any) {
return out
}

return {
exports: {
process
}
}
}


// Default options.
const defaults: BatchProcessorOptionsFull = {
debug: false,
}


Object.assign(BatchProcessor, { defaults })

export default BatchProcessor

if ('undefined' !== typeof module) {
module.exports = BatchProcessor
}
12 changes: 12 additions & 0 deletions src/BatchProcessorDoc.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
/* Copyright © 2024 Seneca Project Contributors, MIT License. */

const docs = {
messages: {
}
}

export default docs

if ('undefined' !== typeof module) {
module.exports = docs
}
Loading

0 comments on commit 862fa70

Please sign in to comment.