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

ccl-test-runner-ts

v0.2.0

Published

TypeScript CCL test runner with vitest integration for ccl-test-data.

Readme

ccl-test-runner-ts

TypeScript test runner for validating CCL implementations against the ccl-test-data test suite.

Features

  • Zero configuration - Test data is bundled; no download required
  • Vitest integration - Declarative API for wiring up your implementation
  • Capability filtering - Run only tests matching your implementation
  • Type-safe - Full TypeScript support

Installation

npm install ccl-test-runner-ts

Quick Start

Create a test file that wires up your CCL implementation:

import { describe, expect, test } from "vitest";
import {
  Behavior,
  Variant,
  createCCLTestCases,
  defineCCLTests,
} from "ccl-test-runner-ts/vitest";
import { parse, buildHierarchy, getString } from "./my-ccl";

export const cclConfig = defineCCLTests({
  name: "my-ccl",
  functions: {
    parse,
    build_hierarchy: buildHierarchy,
    get_string: getString,
  },
  behaviors: [Behavior.BooleanLenient, Behavior.CRLFNormalize],
  variant: Variant.ProposedBehavior,
});

describe("CCL", async () => {
  const { byFunction } = await createCCLTestCases(cclConfig);

  for (const [fn, testEntries] of byFunction) {
    describe(fn, () => {
      for (const { categorization, run } of testEntries) {
        const { testCase } = categorization;

        switch (categorization.type) {
          case "skip":
            test.skip(testCase.name, () => {});
            break;
          case "todo":
            test.todo(testCase.name);
            break;
          case "run":
            test(testCase.name, () => {
              const result = run();
              expect(result.passed).toBe(true);
            });
            break;
        }
      }
    });
  }
});

CCL Function Signatures

Implement functions following these signatures. Functions should throw on errors (standard JS/TS pattern).

Core Functions

interface Entry {
  key: string;
  value: string;
}

type CCLObject = Record<string, string | string[] | CCLObject>;

// Parse CCL text to flat key-value entries
function parse(input: string): Entry[]

// Build nested object from flat entries
function build_hierarchy(entries: Entry[]): CCLObject

Typed Access

// Get typed values at path - throw if missing or wrong type
function get_string(obj: CCLObject, path: string): string
function get_int(obj: CCLObject, path: string): number
function get_bool(obj: CCLObject, path: string): boolean
function get_float(obj: CCLObject, path: string): number
function get_list(obj: CCLObject, path: string): string[]

Processing Functions

// Filter entries by predicate
function filter(entries: Entry[], predicate: (e: Entry) => boolean): Entry[]

// Compose/merge entry lists
function compose(base: Entry[], overlay: Entry[]): Entry[]

// Expand dotted keys (e.g., "a.b" -> nested structure)
function expand_dotted(entries: Entry[]): Entry[]

Configuration

Behaviors

import { Behavior } from "ccl-test-runner-ts/vitest";

behaviors: [
  // Boolean parsing
  Behavior.BooleanStrict,       // Only "true"/"false"
  Behavior.BooleanLenient,      // Also "yes"/"no", "1"/"0"

  // Line endings
  Behavior.CRLFNormalize,       // Normalize CRLF to LF
  Behavior.CRLFPreserve,        // Preserve as-is

  // Whitespace
  Behavior.TabsToSpaces,        // Convert tabs to spaces
  Behavior.TabsPreserve,        // Keep tabs
  Behavior.LooseSpacing,        // Trim whitespace

  // Lists
  Behavior.ListCoercionEnabled,   // Single values coerce to lists
  Behavior.ListCoercionDisabled,  // No coercion
]

Variants

import { Variant } from "ccl-test-runner-ts/vitest";

variant: Variant.ProposedBehavior   // Modern spec behavior
variant: Variant.ReferenceCompliant // Strict reference compliance

Features

features: [
  "comments",      // /= comment syntax
  "empty_keys",    // Allow empty key names
  "multiline",     // Multiline values
  "unicode",       // Unicode handling
  "whitespace",    // Whitespace handling
]

Test Categorization

Tests are automatically categorized:

  • run - Requirements met, test executes
  • skip - Function/feature not supported
  • todo - Function declared but not implemented

Custom Test Data

Test data is bundled by default. To use custom data:

import { downloadTestData } from "ccl-test-runner-ts";

await downloadTestData({ outputDir: "./my-tests", force: true });

const config = defineCCLTests({
  testDataPath: "./my-tests",
  // ...
});

API Reference

Main Exports

import {
  // Capabilities
  createCapabilities,
  Behavior,
  Variant,

  // Test data
  loadTestData,
  loadAllTests,
  getBundledTestDataPath,

  // Types
  type Entry,
  type CCLObject,
  type TestCase,
} from "ccl-test-runner-ts";

Vitest Integration

import {
  defineCCLTests,
  createCCLTestCases,
  getCCLTestSuiteInfo,
  Behavior,
  Variant,
} from "ccl-test-runner-ts/vitest";

License

MIT