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

@easyv/dtable-blocks-cli

v1.1.11

Published

Official command line tool for Airtable blocks development

Downloads

13

Readme

@airtable/blocks-cli

Command line tool for Airtable Blocks development. This README is specifically for the v2 version of the CLI, which is in public beta

Installation

To install or update the block cli, run:

npm install --global @airtable/[email protected]

Usage

$ npm install -g @airtable/blocks-cli
$ block COMMAND
running command...
$ block (-v|--version|version)
@airtable/blocks-cli/2.0.0-beta.3 darwin-x64 node-v12.20.1
$ block --help [COMMAND]
USAGE
  $ block COMMAND
...

Commands

block add-remote BLOCKIDENTIFIER REMOTENAME

[Beta] Add a new remote configuration

USAGE
  $ block add-remote BLOCKIDENTIFIER REMOTENAME

OPTIONS
  -h, --help  show CLI help

EXAMPLE
  $ block add-remote app12345678/blk12345678 new-remote

block help [COMMAND]

display help for block

USAGE
  $ block help [COMMAND]

ARGUMENTS
  COMMAND  command to show help for

OPTIONS
  --all  see all commands in CLI

See code: @oclif/plugin-help

block init BLOCKIDENTIFIER BLOCKDIRPATH

Initialize an Airtable app project

USAGE
  $ block init BLOCKIDENTIFIER BLOCKDIRPATH

OPTIONS
  -h, --help           show CLI help
  --template=template  [default: https://github.com/Airtable/apps-hello-world]

EXAMPLE
  $ block init app12345678/blk12345678 hellow-world-app --template https://github.com/Airtable/apps-hello-world

block list-remotes

[Beta] List remote configurations

USAGE
  $ block list-remotes

OPTIONS
  -h, --help  show CLI help

EXAMPLE
  $ block list-remotes

block release

Release a build to an Airtable base

USAGE
  $ block release

OPTIONS
  -h, --help       show CLI help
  --remote=remote  [Beta] Configure which remote to use

EXAMPLE
  $ block release

block remove-remote REMOTENAME

[Beta] Remove a remote configuration

USAGE
  $ block remove-remote REMOTENAME

OPTIONS
  -h, --help  show CLI help

EXAMPLE
  $ block remove-remote old-remote

block run

Run the app locally

USAGE
  $ block run

OPTIONS
  -h, --help       show CLI help
  --port=port      [default: 9000] HTTPS port the server listens on. The server will listen for HTTP on PORT + 1.
  --remote=remote  [Beta] Configure which remote to use

EXAMPLE
  $ block run

block set-api-key [APIKEY]

Set an api key for an airtable account to upload to

USAGE
  $ block set-api-key [APIKEY]

OPTIONS
  -h, --help             show CLI help
  --location=(user|app)  [default: user]

EXAMPLE
  $ block set-api-key
  $ block set-api-key APIKEY
  $ block set-api-key --location app APIKEY

block submit

Submit app for review for listing in the the Airtable Marketplace

USAGE
  $ block submit

OPTIONS
  -h, --help       show CLI help
  --remote=remote  Configure which remote to use

EXAMPLE
  $ block submit

New features in v2

Using code from other directories

The new CLI allows this method of code-sharing by allowing “sibling directories” outside the source directory to be bundled. Those other directories can include npm imports based on link or file.

Using a custom bundler

Custom bundlers allow users to replace the CLI's built-in bundling functionality that turns app source code into publishable artifacts. Your custom bundler's output must conform to the Airtable platform's expected format, calling convention, and file structure.

Unlike other bundling systems, which allow configurability by composing multiple single-purpose plugins (or replacing just part of the bundling pipeline), this CLI exposes a simpler bundler extension API that expects a single, complete replacement of bundling functionality.

To use a custom bundler:

  1. Save your bundler as a TypeScript file (i.e. index.ts).
  2. Then, change the block.json ‘bundler.module’ option to point at your new bundler entry file; i.e.:
// block.json
{
    “bundler”: {
        “module”: “./bundler/index.ts”
    }
}
  1. Once the change is made, restart your dev server (if running on a dev server).

A bundler needs to implement the following APIs:

class Bundler {
    async bundleAsync(options: ReleaseBundleOptions): Promise<void> {
        // implement release build
    }

    async startDevServerAsync(options: RunDevServerOptions & RunDevServerMethods): Promise<void> {
        // implement run development build
    }

    async teardownAsync(): Promise<void> {
        // implement any work needed to gracefully
        // close bundler process
    }
}

export default function() {
    return new Bundler();
}

For more details about the bundler API, see src/bundler/bundler.ts

Static assets are still not supported by default, but you can now swap in your own bundler that supports this.