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

@gabrielbacha/bases-contract

v2.2.0

Published

The shared contract for Obsidian Bases (.base) files: YAML patching, formatting rules, pill colours and the extension blocks.

Readme

@gabrielbacha/bases-contract

The shared contract for Obsidian Bases (.base) files. Each rule about the data that editors of a Base share is defined here once, and every editor imports it.

It contains:

  • YAML patching (readYamlMap, patchYamlMap, editYamlSequence): changes one block and keeps the rest of the file, comments included, byte for byte.
  • The basesStudio block (readStudioBase, readStudioView, writeStudioBase, writeStudioView, updateStudioBase, updateStudioView, migrateToStudio): one block holds everything the apps add to a Base. Writes are field-level three-way merges that keep unknown fields and unreadable rules. They report same-field conflicts, never rewrite a block saved by a newer version, and do not write when nothing changed.
  • Formatting rules (normalizeRule, evaluateRule, ruleColorVariables, studioRules, storedRules): backgroundOpacity is an integer from 0 to 100, and a missing value means 100.
  • Pill colours (pillColor, studioPillContext): an option's own colour first, then the property's pill strategy and the palette.
  • Names, property ids, and row heights (noteNameFrom, uniqueName, canonicalPropertyId, readRowHeight).

The package has one dependency, yaml, and runs in Node, Electron, and the browser.

Where each fact is stored

Obsidian's own keys (filters, formulas, properties, summaries, views and the native view fields) are never copied. Everything else is in basesStudio:

basesStudio:                  # the whole Base
  version: 1
  palette: default
  properties:
    note.status:
      type: select
      options:
        - { value: Shortlist, color: green-sea }   # a preset, "#RRGGBB" or none
        - { value: Bought, category: done }        # todo, active or done: display only
      pills: { mode: status, style: solid, wrap: true }
      style: { tone: muted, bold: true, align: center }
      default: Shortlist
    note.project:
      type: link
      linkTarget: projects/Projects.base          # the Base a link picker lists (studioLinkTarget)
  rules: [ … ]                # Base rules
  detailLayouts: { … }
  tableUi: { … }
  templates:                  # record templates (studioTemplates)
    - id: 9a1e…               # stable; a view's defaultTemplate names it
      name: Bug report
      properties: { status: Open, priority: 3 }   # frontmatter keys, plain values
      body: "## Steps\n\n## Expected\n"
views:
  - type: table
    name: Main
    basesStudio:              # this view only
      id: 3f2c…
      renderer: board
      defaultTemplate: 9a1e…  # the template a new record in this view starts from
      columns:
        note.notes: { wrap: true, style: { tone: faint } }   # wins over the property's style
      rules: [ … ]            # view rules, after the Base rules

Files written before version 2 of this package keep their settings in basesEditor, basesVisuals, basesEditorView, basesVisualsView, basesVisualsColumnAppearance and basesVisualsBase. They are read as if they were basesStudio. Opening a file never changes it; the first intentional save moves the whole file into basesStudio and removes the old blocks.

Short-lived interface state (search text, open panels) is never saved in a .base file.

Development

pnpm install
pnpm run check

To release: raise version in package.json, then run pnpm publish --access public. The prepublishOnly script runs the checks and the build first. Each app picks up the new version when its dependency is updated.