mooncake_impact_factor

This manual documents version v0.2.0 of Luna-Flow/mooncake-impact-factor.

Overview

mooncake_impact_factor ranks the packages of the MoonBit registry by how much the ecosystem relies on them. It counts the packages whose latest release depends on each package (those of other owners fully, those of the same owner at a quarter), the recent ones among them, downloads and release age; it places every package in the registry by position, grade and 30-day momentum, and lets you search, filter and compare the result in a web application, at https://impact-factor.lunaflow.cn, that runs locally against SQLite or as a static site.

The MoonBit module owns the rules: the registry signals live in metrics, the score, grades and momentum in score, the search query language in query, its SQL compilation in query_sql and the static site’s search engine in static_search. The rest of the repository calls them and is not MoonBit: the Python index builder and static exporter in scripts/, and the Next.js application in app/, frontend/src/ and lib/. The architecture guide shows how they fit together.

Install

moon add Luna-Flow/mooncake-impact-factor@0.2.0

Then import the package you need in your moon.pkg, for example "Luna-Flow/mooncake-impact-factor/score". score, metrics, query, query_sql and static_search build for every target, and score gives the same bits on every backend; cli builds only for the JavaScript target. The module needs the MoonBit toolchain 0.10.20 or later (moonc ≥ 0.10.20). Running cli and the web application also needs Node.js 20.16, 22.3 or later, and the index builder needs Python 3.

Pages

The MoonBit module has six packages, each with a tutorial, an API reference and a design page. Three guides cover the rest of the repository.

PartTutorialAPIDesign
score: impact score, grades, rank positions, momentum, breakdowntutorialAPIdesign
metrics: registry signals now and 30 days ago, scored populationtutorialAPIdesign
cli: the build-index command that runs metrics on a registry filetutorialAPIdesign
query: query language, query tree, flat parameters, labels, sort keystutorialAPIdesign
query_sql: search requests compiled to SQLite statementstutorialAPIdesign
static_search: the static site’s search enginetutorialAPIdesign
Guide: build the database, run the application, query its HTTP APIgetting started
Guide: the data pipeline from the registry to the browserarchitecture
Guide: documentation rules of this repositoryconventions

Exported items

  • score: Signals, compute_score, score_breakdown, activity_multiplier, weighted_dependents, log_signal, ln, rank_positions, rank_label, compute_momentum_label, score_population, ScoreSnapshot, ScoreBreakdown, the label lists and the constants of the model
  • metrics: Input, Release, DownloadSnapshot, compute, Report, PackageReport, Edge, MetricsError, and the helpers parse_timestamp, format_timestamp, days_between, compare_versions, compare_text, owner_of
  • query: the query tree (Group, Term, Node, Field, Operator, GroupOp), parse_expression, serialize, validate, encode, decode, derive_ast and the other flat-parameter functions, the label sets, SortKey, page_limit, page_offset, number_value, trim, and string-based exports for JavaScript
  • query_sql: compile_ast, plan_search, resolve_order_by, compile_fts_expression and their helpers
  • static_search: parse_index, evaluate, relevance, search_items, sort_indices, normalize_text, collate, runtime_version, and the JavaScript exports load_index and search
  • cli: no MoonBit names; its interface is the command build-index --input <path> [--output <path>]

The score tutorial computes, ranks and explains scores, the score API lists every function and threshold, and the score design derives the formula, the grades and the momentum rules; the metrics design defines the signals.

Validation

Recommended release checks:

moon check src/score src/metrics --target all
moon check src/query src/query_sql src/static_search --target all
moon check src/cli --target js
moon test src/score src/metrics --target all
moon test src/query src/query_sql src/static_search --target all

CONTRIBUTING.md adds the Python, TypeScript and static-site checks.

The rankings come from a local copy of the registry index plus optional download counts from mooncakes.io. They are not an authoritative ranking of the MoonBit ecosystem, and they change whenever the database is rebuilt from a newer snapshot.