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

bsb-vscode-task-adaptor

v1.0.0

Published

A script that integrates the output from bsb into vscode tasks using problem matchers

Downloads

251

Readme

bsb-vscode-task-adaptor

A small Node.js script that reads the output from BuckleScript build tool (bsb) and adapts it so it can be consumed from vscode tasks, so they appear in the "Problems" panel of vscode that shows project diagnostics.

Demo

Getting started

  1. Install the adaptor:
npm install --save-dev bsb-vscode-task-adaptor

or with yarn:

yarn add bsb-vscode-task-adaptor --dev
  1. Create a file tasks.json in .vscode folder:
{
  "version": "2.0.0",
  "tasks": [
    {
      "label": "bsb watch",
      "command": "npx",
      "type": "shell",
      "args": ["parse-bsb", "bsb -make-world -w"],
      "group": {
        "kind": "build",
        "isDefault": true
      },
      "presentation": {
        "echo": true,
        "reveal": "always",
        "focus": false,
        "panel": "shared"
      },
      "isBackground": true,
      "problemMatcher": {
        "fileLocation": "absolute",
        "owner": "ocaml",
        "background": {
          "activeOnStart": true,
          "beginsPattern": ">>>> Start compiling",
          "endsPattern": ">>>> Finish compiling"
        },
        "pattern": [
          {
            "regexp": "^File \"(.*)\", lines (\\d+)-(\\d+)(?:, characters (\\d+)-(\\d+))?:$",
            "file": 1,
            "line": 2,
            "endLine": 3,
            "column": 4,
            "endColumn": 5
          },
          {
            "regexp": "^(?:(?:Parse\\s+)?([Ww]arning|[Ee]rror)(?:\\s+\\d+)?:)?\\s+(.*)$",
            "severity": 1,
            "message": 2,
            "loop": true
          }
        ]
      }
    }
  ]
}
  1. Run the task by pressing ⇧⌘B or running "Run Build Task" from the Terminal menu.

You should see the diagnostics

Why

Some of the reasons why this tool might be useful for you:

  • vscode problem matchers do not support multiline messages, so using a plain task would only show the first line of the message, leaving useful information out of the diagnostics panel. See https://github.com/Microsoft/vscode/issues/9635
  • bsb uses super-errors by default for Reason projects. While super errors are really nice to better understand what's happening in the console, the format is very different from the original OCaml / BuckleScript errors, which makes them harder to parse. Unfortunately, super-errors can't be disabled for Reason projects and this configuration is not editable. See https://github.com/BuckleScript/bucklescript/issues/3446
  • Existing Reason / OCaml extensions for vscode that call bsb behind the scenes might lead to conflicts over files when the build commands are started manually too. The lack of transparency in the process leads often to confusion as well, as the output from bsb when it is called from the extension is not made visible for users. This adaptor shows the raw output from bsb, as well as the parsed string in the "Terminal" panel of vscode.