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

obix-compiler-sfc

v0.5.0

Published

The canonical SFC boundary of the .obix VueTS compiler: one Vue-independent, frozen representation of template / script / script setup / style / custom blocks (lang, src, scoped, module, attributes, source locations) and a check that treats two SFCs as eq

Readme

obix-compiler-sfc

Previous name: @obinexusltd/obix-compiler-sfc — OBIX packages are named without an npm scope since decision D-102 (2026-09-29); the package, its version and its exports are unchanged.

The canonical SFC boundary of the .obix VueTS compiler.

npm install obix-compiler-sfc
Counter.obix ──► parseObix (official Vue SFC parser) ──► toObixSfc ──► ObixSfc   canonical, Vue-independent, frozen
Counter.vue  ──► parseVueReference ───────────────────► toObixSfc ──► ObixSfc
                                                    sfcDifferences(vue, obix) = []     ← the Phase 1 gate
import { parseObix } from "obix-compiler-parser";
import { toObixSfc, sfcDifferences } from "obix-compiler-sfc";

const sfc = toObixSfc(parseObix(source, "Counter.obix"));
sfc.scriptSetup?.lang;   // "ts"
sfc.styles[0]?.scoped;   // true
sfc.template?.loc;       // { start: { line, column, offset }, end: { … } }

sfcDifferences(toObixSfc(parseVueReference(source, "Counter.vue")), sfc); // [] — equivalent up to the filename

| Export | Role | |---|---| | toObixSfc(parseResult) | the canonical ObixSfc of a parseObix / parseVueReference result; throws TypeError for anything else | | sfcDifferences(a, b) | every place two canonical SFCs differ — { path, a, b }, deterministic order — or [] when they are equivalent up to their filename | | types | ObixSfc, SfcTemplateBlock, SfcScriptBlock, SfcStyleBlock, SfcCustomBlock, SfcAttributes, SfcDifference — the position and range types (SourcePosition, SourceRange) are the diagnostic contract's, from obix-compiler-diagnostics |

What is canonical

template, script, scriptSetup, styles[], customBlocks[], each with its content, every attribute (attrs), lang, src and its source location; scoped and module on a style; setup on a script; cssVars and slotted; the whole source; and the parse diagnostics. Locations are the official parser's: 1-based line and column, 0-based offset; a block's loc spans its content.

The value is plain, deep-frozen data that shares no object with the official descriptor and survives a JSON round trip unchanged. It carries no Vue type, no Vue template AST (descriptor.template.ast is not OBIX semantics), no source-map object and no script-analysis field. It is a frontend boundary: the semantic authority of OBIX is the canonical DOP IR (D-44), which later phases lower into.

Equivalence is the filename and nothing else

sfcDifferences normalizes exactly two things: the top-level filename, and — inside a diagnostic — that diagnostic's own filename, as the field and where the official parser quotes it in a message. Nothing else is absorbed: not a directive, a binding, a slot, a style flag, a location, a diagnostic, and not the deliberate from "vue" / from "obix" import difference. That mapping is a documented rule of the equivalence phase; until then it is reported, as a difference of the script content. The tests pin all of this, mutation by mutation.

Dependency role

Depends on obix-compiler-parser (for the parse result it consumes) and on obix-compiler-diagnostics (for ObixCompilerDiagnostic, SourcePosition and SourceRange) — for types only: no runtime import, the built package imports nothing. Consumed by the later phases of the compiler. A compile-time package; graph rule R5 keeps it out of every browser graph.

Tests

npm test -w obix-compiler-sfc — the corpus tests/corpus/vuets (OBIX monorepo record) (31 byte-identical .vue / .obix pairs, 23 valid and 8 invalid); the expected canonical value of every fixture is rebuilt from the official parser by independent test code, and source locations are re-derived from the offsets.

Installation

npm install obix-compiler-sfc

API surface

  • obix-compiler-sfc — 2 value exports: sfcDifferences, toObixSfc
  • Type declarations: ./dist/index.d.ts (and a declaration next to every JS entry point).

Architecture role

obix-compiler-sfc is part of the OBIX compiler (build-time tooling): it never runs in an application's browser graph.

The architecture of OBIX — the package families and which packages are public API — is indexed in the umbrella: docs/architecture.md.

Package relationships

Testing

  • 1 test file ships in the npm package (test/): the evidence of the package's contract, published so that its verification can be inspected — not runtime code (no entry point reaches it).
  • Standalone: none.
  • Need the OBIX development / test harness: 1 — it reads the OBIX monorepo's shared harness, oracles or fixtures, so it does not run from an npm install or from this package's repository alone; it is shipped for inspection and provenance:
    • test/sfc.test.mjs — its code climbs three directories up, out of the package
  • Run them with npm test (node --test "test/*.test.mjs") in the OBIX monorepo, which provides the test tooling (Node's test runner, TypeScript) and the harness.

Documentation

Repository

  • https://github.com/obinexus/obix-compiler-sfc — [email protected]:obinexus/obix-compiler-sfc.git
  • Issues: https://github.com/obinexus/obix-compiler-sfc/issues
  • The repository is a clean export of the package from the OBIX monorepo. Its lineage — the sources it was recovered from and its earlier names — is PROVENANCE.json, shipped in this package; the repository's copy also records the monorepo commit it was exported from.

License

MIT — see LICENSE.