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

@oliveai/ldk

v4.0.0

Published

The Loop Development Kit for Olive Helps.

Downloads

3,067

Readme

Loop Development Kit

This is the central repository.

New Loop: Getting Started

Installing the LDK

Install the LDK from npm:

npm i @oliveai/ldk

Producing Loop Compilations

We recommend using Webpack 5 to compile your Loop code for you. Our Webpack configuration includes support for Typescript, and generates the Loop metadata required for installation.

Using Our Configuration As-Is

Install Webpack 5 and its CLI, and add this build script to your package.json:

webpack --entry ./index.js --config ./node_modules/@oliveai/ldk/dist/webpack/config.js

This will use the LDK webpack configuration and compile the file to the ./dist/loop.js directory.

Extending the Configuration

If you want to extend the Webpack configuration, create a webpack.config.js file and use webpack-merge to extend it:

const path = require('path');
const merge = require('webpack-merge');
const ldkConfig = require('@oliveai/ldk/dist/webpack/config');

const merged = merge.merge(ldkConfig.default, {
  entry: [path.resolve(__dirname, './index.js')],
});

module.exports = merged;

Development Builds

We also provide a development Webpack configuration, which offer faster builds in exchange for increased build size:

webpack --entry ./index.js --config ./node_modules/@oliveai/ldk/dist/webpack/config.development.js
const path = require('path');
const merge = require('webpack-merge');
const ldkConfig = require('@oliveai/ldk/dist/webpack/config.development');

const merged = merge.merge(ldkConfig.default, {
  entry: [path.resolve(__dirname, './index.js')],
});

module.exports = merged;

VSCode Extension

If you prefer to use VSCode, you can install our VSCode extension to generate boilerplate code for Olive Helps Loops.

React Whispers

We've added support for writing and updating Whispers with React to the LDK. Visit the documentation for details on how to use it.

Loading a Local Loop Into Olive Helps

Once you have generated the Loop using the above steps into your ./dist/loop.js directory, you can now load it into Olive Helps to test.

  • Open up Olive Helps and authenticate
  • Click "Loop Library"

loop library

  • Click "Local Loops"

loop library

  • Click "Install Local Loop"

loop library

  • Fill out the required Loop data, and browse to your ./dist directory via the "Local Directory" dialog

loop library

You will see a toast within Olive Helps if your Loop was started.

Loop Permissions

In order to ensure your Loop is executing in a secure manner, you must declare which network URL domains, file system path globs, and aptitudes your Loop will use.

Permissions are declared inside of the Loop package.json root within a ldk/permissions json object.

The included LDK Webpack configuration allows Loop authors to configure alternate permissions for different development environments. See the Permissions Configuration guide on the Olive Helps Developer Hub for more information.

"ldk": {
  "permissions": {
    "clipboard": {},
    "filesystem": {
      "pathGlobs": [
        {
          "value": "/some/path/something.txt"
        }
      ]
    },
    "network": {
      "urlDomains": [
        {
          "value": "*.google.com"
        }
      ]
    },
    "window": {}
  }
},

Network Permission:

Any domain URL reference. Supports domain wildcards.

"ldk": {
  "permissions": {
    "network": {
      "urlDomains": [
        {
          "value": string
        }
      ]
    }
  }
}

Examples | Value | |-----------| | "*.google.com" | | "github.com/" | | "en.wikipedia.org" |

Filesystem Permission:

Any filesystem path. Supports path wildcards. All filesystem permissions include access to the Loop's working folder by default.

"ldk": {
  "permissions": {
    "filesystem": {
      "pathGlobs": [
        {
          "value": string
        }
      ]
    }
  }
}

Examples | Value | |-----------| | "/some/path/something.txt" | | "/Users/ldkuser/Desktop/*" |

If your Loop only needs access to the Loop's working folder, provide an empty object:

"ldk": {
  "permissions": {
    "filesystem": {}
  }
}

User Permission:

Any optional claims which your Loop needs to use. At this time, there is only one supported optional claim: email.

"ldk": {
  "permissions": {
    "user": {
      "optionalClaims": [
        {
          "value": string
        }
      ]
    }
  }
}

Examples | Value | |-----------| | "email" |

If your Loop only needs access to the default set of JWT claims, provide an empty object:

"ldk": {
  "user": {}
}

Aptitude Permission:

An Aptitude Name.

"ldk": {
  "clipboard": {},
  "process": {}
}

| Valid Options | | | | ------------- | --------- | ---------- | | "clipboard" | "cursor" | "keyboard" | | "process" | "ui" | "system" | | "vault" | "whisper" | "window" |

Loop Examples

Examples are provided in the examples/ directory. These examples include more information about creating and building Loops.

Guidelines and Warnings

  • The Goja runtime is not the same thing as the Node runtime, and built-in Node modules (like fs, path) are not available.
  • You can install npm packages and use them in your code, however Webpack will not throw a compilation error if a package you import requires a Node built-in module. Instead it will generate an error at runtime.
  • Olive Helps expects that the compilation folder is empty besides the loop.js file.
  • Multiple file chunks are not supported.