Giter VIP home page Giter VIP logo

composite-service's People

Contributors

dependabot[bot] avatar semantic-release-bot avatar zenflow avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

lgtm-migrator

composite-service's Issues

Upgrade dependencies

This also includes replacing tsdx which is blocking upgrading TypeScript, ESLint, etc.:

  • bundling: microbundle or tsup
  • linting: eslint & eslint-config-zenflow
  • testing: unit testing needs to test TS source which also relies on Babel + babel-plugin-macros + ts-interface-builder/macro

Fix color contrast in terminal output

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.

Config validation error improvements

Config validation errors:

  1. should show the invalid value
  2. should show link to documentation for the relevant interface field
  3. should include full description of type instead of "1 more" (issue for https://github.com/gristlabs/ts-interface-checker)
  4. should not show stack trace (?)

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.

Add "Port Utilities"

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.

Demo project on codesandbox

I'm thinking a composite service composing:

  1. some node web app like a file manager or TODO tracker from awesome-selfhosted
  2. an express.js backend that makes some calls to it
  3. a static frontend with Parcel

Project should be able to run in either production or development mode.

Feature this in the docs introduction.

Show website some love

  1. nicer theme & styles/colors
  2. github stars somwhere on website to encourage starring
  3. include README badges & links, & possibly whole README (organizational change)
  4. frontpage demo animation (show contents of a composite service script & results of running it)
  5. site search https://docsearch.algolia.com/
  6. sitemap - docusaurus-plugin-sitemap package?
  7. social media meta tags - https://metatags.io
  8. make landing page pleasant and or informative. For inspiration:

Companion package: composite-service-node-cluster

// 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....
  },
})

Interactive mode when `process.stdin.isTTY`

Interactive mode could be used to receive commands from keyboard input, such as:

  1. Select service to direct keyboard input into
  2. Restart a certain service on-the-fly
  3. Stop a certain service's dependents, restart the certain service, start the certain service's dependents again

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.

README enhancements

  • general editing
  • less verbose Features section
  • simplify/reduce Basic Usage section
  • explain ServiceConfig.ready function before Crash Handling (which should be changed to Custom Crash Handling)
  • Shutting down: detail "optional behaviors"
  • Shutting Down: "hint" -> Caveats (need for windowsCtrlCShutdown /w e.g. nodemon)

and enhancements to README for https://github.com/zenflow/composite-service-http-gateway

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.