npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@gapi/daemon

v1.8.151

Published

![Build Status](http://gitlab.youvolio.com/gapi/gapi-starter/badges/master/build.svg)

Downloads

53

Readme

Daemon

Helps with productivity

Automatically apply schema introspection changes from graphql API to specific folders

The schema is introspected only when the API is successfully started

When API changes his schema the client should know about it

When You have multiple clients (mobile, desktop, web) you want to sync them according to your API Graphql Schema

To use daemon you need to activate it inside your @gapi/core => CoreModule configuration

const DEFAULT_CONFIG = {
    server: {},
    graphql: {},
    daemon: { activated: true }
};
import { BootstrapFramework } from '@rxdi/core';
import { AppModule } from './app/app.module';
import { CoreModule, Module } from '@gapi/core';

@Module({
    imports: [
        CoreModule.forRoot({
            server: {},
            pubsub: {},
            graphql: {},
            daemon: { activated: true }
        }),

    ]
})
export class FrameworkImports {}

BootstrapFramework(AppModule, [FrameworkImports]).subscribe()

Starting daemon

gapi daemon start

Stopping daemon

gapi daemon stop

Cleaning daemon cache folder ~/.gapi/daemon

gapi daemon clean

Link project

gapi daemon link your-link-name

Unlink project

gapi daemon unlink

Unlink all projects

gapi daemon unlink --all

Flow

  1. Start the API
  2. Execute gapi daemon link your-link-name
  3. Go to client project folder
  4. Execute gapi daemon link your-link-name
  5. Made change to the graphql schema on the API
  6. You will see that client introspection changed also without writing single line of code

If you wish to link more than one project just execute command inside other folder

gapi daemon link your-link-name

IMPORTANT

gapi-cli.conf.yml will be created if not present since daemon will trigger command using configuration from it.

gapi schema introspect --collect-documents --collect-types

Read more about schema introspect

config:
  schema:
    introspectionEndpoint: http://localhost:9000/graphql
    introspectionOutputFolder: ./src/server/api-introspection

Replace with the desired configuration

Custom plugins

Gapi daemon has capability to load external plugins via IPFS network or using regular @gapi module example module can be found HERE

A simple plugin looks like regular @rxdi/@gapi module basically every module inside this architecture can be used as a daemon plugin.

import { Module } from '@gapi/core';
import { MainService } from './services/main.service';
import { CustomControllerController } from './custom-controller/custom-controller.controller';

@Module({
    providers: [MainService],
    controllers: [CustomControllerController]
})
export class AppModule {}

You can add also plugins via IPFS https://ipfs.io/ipfs/QmY74wyqeeHYVtEkChvbQypxeZd43rk77hY8yfaU16fZQ4 this is @rxdi/deploy plugin module can be found here https://ipfs.io/ipfs/QmYtvfC5cXutnH6y7nK8eGnPcAkU75DpngR3vGDk9A9KQt

gapi plugin add QmY74wyqeeHYVtEkChvbQypxeZd43rk77hY8yfaU16fZQ4

Remove

gapi plugin remove QmY74wyqeeHYVtEkChvbQypxeZd43rk77hY8yfaU16fZQ4