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 🙏

© 2026 – Pkg Stats / Ryan Hefner

@entryscape/blocks-bundler

v0.2.0

Published

Convention-based Rollup plugin + CLI that bundles an EntryScape Blocks source tree into a single window.__entryscape_config script.

Readme

@entryscape/blocks-bundler

Convention-based Rollup plugin + CLI that bundles an EntryScape Blocks source tree into a single IIFE script which assigns to window.__entryscape_config.

Quickstart

From an empty directory on a fresh machine — no install needed, npx fetches the package on demand:

mkdir my-blocks && cd my-blocks
npx @entryscape/blocks-bundler create

(Equivalent on pnpm: pnpm dlx @entryscape/blocks-bundler create.)

If the package is already a devDependency in the project, use the locally installed binary instead:

pnpm add -D @entryscape/blocks-bundler
pnpm exec blocks-bundler create

This bootstraps a full project: the source layout (src/config.js, src/collections.js, src/style.css, src/blocks/example.js, plus a src/README.md orientation note), a top-level README.md and .gitignore, a package.json with dev / build / serve scripts, and a minimal demo/index.html that loads the built bundle alongside the EntryScape Blocks CDN runtime. Existing files are never overwritten. Pass --name <pkg> to set the package.json name (defaults to the cwd basename); path flags (--blocks-dir, --config, --collections, --style) still control source destinations.

After scaffolding:

pnpm install
pnpm start  # runs dev + serve together; demo at http://localhost:5173/demo/

(pnpm dev and pnpm serve are also available individually.)

Or lay out your source like this by hand (all roots are optional):

src/
  config.js          export default { namespaces, bundles, ... }
  collections.js     export default [ ...collections ]
  style.css          (read as a string and attached as `style:`)
  blocks/
    myBlock.js       export default { extends: "template", template: ... }
    other/
      another.js     export default { ... }
    scripts.js       (helper module; not registered as a block)

In each block file omit the block: property — the bundler injects it from the filename. extends: can be a built-in name ("template", "searchList", ...) or an imported block module:

import myBlock from '../myBlock.js';
export default { extends: myBlock, template: `...` };

The build resolves the imported reference to a string at compile time, so the final bundle has extends: "myBlock" directly — no runtime helpers.

Add to your package.json:

{
  "scripts": {
    "build":       "blocks-bundler",
    "build:watch": "blocks-bundler --watch"
  }
}

pnpm build produces dist/blocks.js (readable IIFE) and dist/blocks.min.js (terser-minified). Load dist/blocks.js from your HTML.

CLI options

blocks-bundler [command] [options]

Commands:
  (default)              Bundle the source tree.
  create                 Scaffold the default source structure.

Options:
  -w, --watch            Rebuild on source changes.
      --no-minify        Skip the minified bundle.
      --outfile <path>   Readable bundle output (default: dist/blocks.js).
      --min-outfile <p>  Minified bundle output (default: <outfile>.min.js).
      --banner <text>    Banner comment for both bundles (default: empty).
      --blocks-dir <d>   Blocks source directory (default: src/blocks).
      --config <file>    Config file (default: src/config.js).
      --collections <f>  Collections file (default: src/collections.js).
      --style <file>     Style file (default: src/style.css).
  -h, --help             Show this help.

Conventions

| Path | Role | |-------------------------------------|-----------------------------------------------------| | src/config.js | export default { ... } spread into the bundle | | src/collections.js | export default [ ... ] attached as collections: | | src/style.css | Read as a string, attached as style: | | src/blocks/<name>.js | One block; name = filename without .js | | src/blocks/<group>/<name>.js | Subdirectories are organization only, no namespacing | | src/blocks/scripts.js | Shared helpers; not registered as a block | | src/blocks/**/scripts/*.js | Entire scripts directories are skipped |

Plugin API

If you need a custom rollup.config.js, import the plugin directly:

import blocksBundler from '@entryscape/blocks-bundler';

export default {
  input: 'virtual:blocks-bundler-entry',
  plugins: [blocksBundler({ /* override defaults if needed */ })],
  output: { file: 'dist/blocks.js', format: 'iife' },
};

Output shape

window.__entryscape_config = [].concat(window.__entryscape_config)
  .filter(Boolean)
  .concat([{ ...config, style: "...", collections, blocks: [...] }]);

Blocks are toposorted so each block's extends target appears before it. Cyclic extends chains fail the build with a clear error.