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

@bitrise/steplib-search

v2.3.0

Published

List and search steps for your Bitrise workflow

Downloads

476

Readme

Bitrise Steplib Search service

Description

A small NPM library that helps you search and fetch Bitrise Workflow steps.

How to use this library

You'll need an Algolia App ID and an API key with search and browse persmission.

In modern stuff

import StepLib from '@bitrise/steplib-search';

const stepLib = new StepLib(
  'ALGOLIA_APP_ID',
  'ALGOLIA_API_KEY',
  // You can optionally pass a config object for the indices
  // These are the defaults
  { stepIndex: 'steplib_steps', inputsIndex: 'steplib_inputs' }
);

Wihtout any options, we get the all steps (and all versions) with minimal information

const latestSteps: Step[] = await stepLib.list();
// latestSteps
[
  ...
  { "cvs": "[email protected]" },
  { "cvs": "[email protected]" },
  { "cvs": "[email protected]" },
  { "cvs": "[email protected]" },
  { "cvs": "[email protected]" },
  { "cvs": "[email protected]" },
  { "cvs": "[email protected]" },
  ...
]

Search for a specific step, with all versions and inputs included

const allFlutterSteps: Step[] = await stepLib.list({
  query: 'flutter',
  latestOnly: false,
  includeInputs: true
});
// allFlutterSteps
[
  ...
  {
    "cvs": "[email protected]",
    "inputs": [
      { "cvs": "[email protected]", "order": 0 },
      { "cvs": "[email protected]", "order": 1 },
      { "cvs": "[email protected]", "order": 2 }
      ...
    ]
  },
  {
    "cvs": "[email protected]",
    "inputs": [
      { "cvs": "[email protected]", "order": 0 },
      { "cvs": "[email protected]", "order": 1 },
      { "cvs": "[email protected]", "order": 2 }
    ]
  },
  {
    "cvs": "[email protected]",
    "inputs": [
      { "cvs": "[email protected]", "order": 0 },
      { "cvs": "[email protected]", "order": 1 }
    ]
  },
  {
    "cvs": "[email protected]",
    "inputs": [
      { "cvs": "[email protected]", "order": 0 }
    ]
  },
  {
    "cvs": "[email protected]",
    "inputs": [
      { "cvs": "[email protected]", "order": 0 }
    ]
  }
  ...
]

List steps by id, you can include a version to get an exact version, or omit it to get the latest

const workflowSteps: Step[] = await stepLib.list({
  stepIds: ['script', '[email protected]', '[email protected]'],
  algoliaOptions: {
    attributesToRetrieve: ['id', 'version', 'cvs', 'is_latest']
  }
});
// workflowSteps
[
  {
    "cvs": "[email protected]",
    "id": "script",
    "version": "1.1.6",
    "is_latest": true
  },
  {
    "cvs": "[email protected]",
    "id": "android-build",
    "version": "0.10.0",
    "is_latest": true
  },
  {
    "cvs": "[email protected]",
    "id": "github-release",
    "version": "0.9.3",
    "is_latest": false
  }
]

You can use projectTypes to speecify which platfrom you are looking for

const iosAndAndroidLatestSteps: Step[] = await stepLib.list({
  latestOnly: true,
  projectTypes: ['ios', 'android'],
  algoliaOptions: {
    attributesToRetrieve: ['cvs', 'step.project_type_tags']
  }
});
// iosAndAndroidLatestSteps
[
  ...
  {
    "cvs": "[email protected]",
    "step": {
      "project_type_tags": [
        "android"
      ]
    }
  },
  {
    "cvs": "[email protected]",
    "step": {
      "project_type_tags": [
        "ios",
        "xamarin",
        "react-native"
      ]
    }
  },
  {
    "cvs": "[email protected]",
    "step": {
      "project_type_tags": [
        "ios",
        "xamarin"
      ]
    }
  },
  {
    "cvs": "[email protected]",
    "step": {
      "project_type_tags": [
        "android",
        "react-native",
        "flutter"
      ]
    }
  },
  {
    "cvs": "[email protected]",
    "step": {
      "project_type_tags": [
        "android"
      ],
    }
  },
  ...
]

With custom algoliaOptions, you can override any Algolia parameter

const customAlgoliaOptions: Step[] = await stepLib.list({
  query: 'react-native',
  latestOnly: false,
  algoliaOptions: {
    attributesToRetrieve: ['id', 'version', 'cvs', 'info']
  }
});
// customAlgoliaOptions
[
  {
    "cvs": "[email protected]",
    "id": "react-native-bundle",
    "version": "1.0.4",
    "info": {
      "asset_urls": {
        "icon.svg": "https://bitrise-steplib-collection.s3.amazonaws.com/steps/react-native-bundle/assets/icon.svg"
      }
    }
  },
  {
    "cvs": "[email protected]",
    "id": "install-react-native",
    "version": "0.9.2",
    "info": {
      "asset_urls": {
        "icon.svg": "https://bitrise-steplib-collection.s3.amazonaws.com/steps/install-react-native/assets/icon.svg"
      }
    }
  },
  {
    "cvs": "[email protected]",
    "id": "appcenter-codepush-release-react-native",
    "version": "0.0.2",
    "info": {
      "asset_urls": {
        "icon.svg": "https://bitrise-steplib-collection.s3.amazonaws.com/steps/appcenter-codepush-release-react-native/assets/icon.svg"
      }
    }
  }
]

You can leverage Algolia's fuzzy search

const fuzzySteps: Step[] = await stepLib.list({
  query: 'Anbroid Ebulator',
  latestOnly: true,
  algoliaOptions: {
    restrictSearchableAttributes: ['step.title'],
    typoTolerance: true,
    attributesToRetrieve: ['step.title', 'cvs']
  }
});
// fuzzySteps
[
  {
    "cvs": "[email protected]",
    "step": {
      "title": "Start Android emulator"
    }
  },
  {
    "cvs": "[email protected]",
    "step": {
      "title": "Create Android emulator"
    }
  },
  {
    "cvs": "[email protected]",
    "step": {
      "title": "Wait for Android emulator"
    }
  }
]

In ES5 land

Include these scripts

<script src="//unpkg.com/algoliasearch/dist/algoliasearch.min.js"></script>
<script src="//unpkg.com/@bitrise/steplib-search"></script>

Then use it similarly as descibed above

var stepLib = new StepLib('ALGOLIA_APP_ID', 'ALGOLIA_API_KEY');

stepLib.list().then(function(latestSteps) {
  console.log('Yay, steps!', latestSteps);
});

Development

  • Install dependecies: yarn
  • Run tests: yarn test or yarn test --watch

Commit Messages

This repo uses a strict commit message structure that follows the Conventional Commits spec. This is used to automate publishing the package to NPM and generating the changelog with Semantic Release.

Deployment

Using Semantic Release to NPM