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

@opentray/packaging

v0.18.0

Published

Bundler-neutral OpenTray runtime artifact packaging contract.

Readme

@opentray/packaging

Bundler-neutral packaging contract for app-owned OpenTray runtime hosts.

The package stages declared runtime artifacts into output paths derived from app.id, then writes a manifest that runtime diagnostics and adapters can read without guessing workspace layout.

import { stageOpenTrayPackage } from "@opentray/packaging";

await stageOpenTrayPackage({
  app: { id: "com.example.build", name: "Build" },
  outDir: "dist",
  entry: "src/main.ts",
  adapter: { name: "custom", mode: "production" },
  runtimeHost: { source: "target/release/build-tray-host" },
  nativeArtifacts: {
    "darwin-arm64": { source: "target/release/libbuild_tray.dylib" },
  },
});

Runtime discovery reads the emitted manifest instead of guessing file names:

import { resolveOpenTrayPackage } from "@opentray/packaging";

const packaged = await resolveOpenTrayPackage(
  "dist/com-example-build-cdd5538b13/opentray-app-manifest.json",
);

console.log(packaged.runtimeHostPath);

If the manifest is written outside the default app artifact directory, pass artifactRoot so runtime discovery resolves staged paths from the distributable root instead of the manifest directory.

app.id is the artifact address source. app.name is the human label. Missing or empty identity fails packaging instead of inventing a generic opentray artifact name.

Darwin App Bundles

buildDarwinAppBundle() is the one bundle generator used by the Vite, esbuild, webpack, and tsdown adapters. It copies the selected broker into Contents/MacOS/opentray, projects the caller identity into Info.plist, writes the default ICNS into Contents/Resources, and commits opentray-app-bundle.json last. Runtime managed mode and plugin prebuilds therefore produce the same manifest and layout.

ensureDarwinAppBundle({ reinitialize: false }) validates the immutable bundle assets without writing them. It rejects target, identity, broker, template, or icon drift with DarwinAppBundleError.

The mutable last invocation is stored separately at Contents/Resources/opentray-launch.json. updateDarwinAppLaunchDescriptor() uses the same stable-bundle lock and atomic sibling replacement as managed generation. The strict schema contains only schemaVersion, command, args, and cwd; it never contains a shell string or environment map. The opentray SDK commits this state after a successful local broker handshake, including for validated prebuilt bundles.

After that commit, the runtime converges dead OpenTray-owned bundles with the same CFBundleIdentifier under ~/.opentray/apps and the known legacy carrier path. It unregisters stale paths from LaunchServices before removal, preserves the current path and any live owner marker, and reports skipped/removal failures to the caller runtime log. This is deliberately a runtime operation; plugin-generated prebuilt assets remain read-only.