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

@expo-up/core

v0.1.4

Published

Shared domain primitives and utilities consumed by both `@expo-up/cli` and `@expo-up/server`.

Readme

@expo-up/core

Shared domain primitives and utilities consumed by both @expo-up/cli and @expo-up/server.

@expo-up/core exists to keep protocol defaults and parsing logic centralized so client/server behavior stays consistent.

Responsibilities

  • Define shared constants (main, __INIT__, embedded rollback marker, default base path).
  • Parse and validate project descriptors (owner + repo).
  • Resolve rollback chains safely (depth guard + cycle detection).
  • Parse Expo Updates URL into serverUrl + projectId.
  • Validate safe asset paths for runtime build roots.
  • Provide shared TS types used across packages.

Exports

From src/index.ts:

  • constants
  • project
  • rollback
  • types
  • url

Constants

From constants.ts:

  • DEFAULT_CHANNEL = "main"
  • INIT_CHANNEL = "__INIT__"
  • EMBEDDED_ROLLBACK_TARGET = "EMBEDDED"

These values are used by CLI defaults and server route/path behavior.

Project Parsing

From project.ts:

  • parseProjectDescriptor(value)

Behavior:

  • Requires an object with non-empty string owner and repo.
  • Throws descriptive errors on invalid payloads.

Used by CLI when reading /projects/:projectId responses.

Rollback Resolution

From rollback.ts:

  • resolveRollbackTarget({ latestBuildId, loadRollbackTarget, maxDepth? })

Behavior:

  • Traverses rollback pointer chain (build -> build -> ...).
  • Supports terminal EMBEDDED target.
  • Detects cycles and throws.
  • Enforces maxDepth (default 25).

Useful for any storage implementation that models rollbacks via pointer files.

URL Utilities

From url.ts:

  • parseExpoUpUpdatesUrl(rawUpdatesUrl, basePath?)
  • isSafeAssetPath(pathValue, runtimeBasePath)

parseExpoUpUpdatesUrl:

  • Extracts { serverUrl, projectId } from Expo updates.url.
  • Returns empty strings on invalid/unexpected URL shape.

isSafeAssetPath:

  • Blocks path traversal (..).
  • Normalizes slashes.
  • Ensures path is under runtime base path prefix.

Types

From types.ts:

  • ProjectDescriptor
  • ParsedExpoUpUrl

How Other Packages Use Core

  • @expo-up/cli
    • uses constants (DEFAULT_CHANNEL, INIT_CHANNEL)
    • parses project response payload with parseProjectDescriptor
  • @expo-up/server
    • can reuse rollback and URL/path primitives for route handling and validations

Usage Examples

import {
  DEFAULT_CHANNEL,
  parseProjectDescriptor,
  parseExpoUpUpdatesUrl,
  resolveRollbackTarget,
} from "@expo-up/core";

const channel = DEFAULT_CHANNEL; // "main"

const project = parseProjectDescriptor({ owner: "glncy", repo: "storage" });

const parsed = parseExpoUpUpdatesUrl(
  "http://localhost:8787/api/expo-up/example-expo-app/manifest",
);
// parsed => { serverUrl: "http://localhost:8787/api/expo-up", projectId: "example-expo-app" }

const rollback = await resolveRollbackTarget({
  latestBuildId: 10,
  loadRollbackTarget: async (buildId) => {
    if (buildId === 10) return "8";
    if (buildId === 8) return "EMBEDDED";
    return null;
  },
});
// rollback => { buildId: 8, target: "EMBEDDED", isEmbedded: true }

Local Development

bun install
bun run build
bun run test
bun run check-types
bun run lint

Workspace-scoped:

bun run --filter @expo-up/core test
bun run --filter @expo-up/core check-types

Package

Published as @expo-up/core.