zenflow / composite-service Goto Github PK
View Code? Open in Web Editor NEWCompose multiple services into one
License: MIT License
Compose multiple services into one
License: MIT License
Add boolean colorOutput
config defaulting to false
.
Choose:
This also includes replacing tsdx which is blocking upgrading TypeScript, ESLint, etc.:
babel-plugin-macros
+ ts-interface-builder/macro
For example, returning a Symbol would work to signal that the composite service should crash.
If there's an error in the onCrash
, it should be logged and the service should be restarted.
Each line of output for each composed service has a prefix with some styles applied: bright background colors & default text color.
This looks fine when the terminal background is black/dark background, but sometimes terminal background is white/light and the contrast is not nice.
As titled
Config validation errors:
Also, maybe validation errors for config.services.foo
should appear like nested validation errors in config. Or maybe validation errors for config.serviceDefaults
should not appear like nested validation errors in config
.
Also, not an enhancement to functionality, but for maintainability gristlabs/ts-interface-builder#24 needs to be documented & an official release made.
The following interface would be useful for safely determining port numbers for your services.
type PortNumber = number | string
// Throw an error if the given `port` number is already in use
declare function assertPortFree(port: PortNumber): void
// Returns an array of port numbers that are not in use.
declare function findPorts(numberOfPorts: number, options: { exclude: PortNumber | PortNumber[] }): number[]
// Example of using findPorts
const [apiPort, webPort] = findPorts(2, { exclude: PORT });
The function signatures above assume that we're only ever working with ports on localhost
.
Should we support working with ports on other hosts?
Docker Machine runs on a different host than localhost
on Windows, for example.
Describe similarities & differences between this library and others:
I'm thinking a composite service composing:
Project should be able to run in either production or development mode.
Feature this in the docs introduction.
Also make sure docs refer to "ordered startup" instead of "graceful startup"
https://docs.docker.com/config/containers/multi-service_container/
Then remove item in TODO.md
And maybe share this project on reddit or wherever
docusaurus-plugin-sitemap
package?// Configures a composite service that creates a cluster (using Node.js's `cluster` module) of the given `config.script`
declare function configureNodeCluster (config: NodeClusterConfig): ServiceConfig
// Example of using configureNodeCluster
startCompositeService({
services: {
cluster: configureNodeCluster({ script: 'path/to/script.js', scale: 4 }),
// more services....
},
})
This should integrate with the proxy routes in a flexible way. For example, we should be able to mount static files at /admin
and mount a proxy at /
(default catch-all route) and vice-versa
https://expressjs.com/en/resources/middleware/serve-static.html
https://github.com/lukeed/polka#readme
Polka is faster and smaller than Express.
It seems that @semantic-release/release-notes-generator
now outputs these headings as h1 (one #
) instead of h2 (two #
s).. Not sure why, since conventional-changelog-writer
documentation shows use of h2 (##
) here.
Interactive mode could be used to receive commands from keyboard input, such as:
If there will be some kind of interactive UI in the terminal, it would also be nice to have a "dashboard line" displayed below the log tail and above the command prompt, which indicates the status of each service (e.g. starting, stopping, crashed)
This ink
package looks pretty neato! Uses React, and this build system already compiles jsx.
ServiceConfig.ready
function before Crash Handling (which should be changed to Custom Crash Handling)nodemon
)and enhancements to README for https://github.com/zenflow/composite-service-http-gateway
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.