Skip to content

Repository files navigation

glance

One client for GitHub and GitLab, behind a single set of types.

Merge requests and pull requests are the same idea wearing different API shapes. glance hides that difference: you write against one provider interface and it works on either forge, over REST, GraphQL, and real-time subscriptions, so a dashboard can update when a pipeline finishes instead of polling for it.

Part of mattstack.

Packages

PackageDescription
@mattstack/glanceThe provider-agnostic client: types, REST/GraphQL, subscriptions, dashboard helpers. Runs on Node or Bun.
@mattstack/glance-reactReact components and hooks for rendering merge request state: cards, rows, reviewer status, pipeline badges.

Install

bun add @mattstack/glance
bun add @mattstack/glance-react # optional React layer

Usage

import{createProvider}from'@mattstack/glance';constforge=createProvider({kind: 'gitlab',host: 'gitlab.com', token });constdashboard=awaitforge.fetchMRDashboard({project: 'group/repo'});

The same code against GitHub is one field different:

constforge=createProvider({kind: 'github',host: 'github.com', token });

Who uses it

rt, gitq, and mr-board all read and write merge requests through this layer, which is why the same review state shows up in a CLI, a board, and an editor extension without three integrations drifting apart.

Development

bun install
bun run build
bun run check-types

License

MIT

About

One client for GitHub and GitLab, behind a single set of types. REST, GraphQL, and real-time subscriptions.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages