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

@diglot/action

v0.2.2

Published

GitHub Action that keeps diglot translations in sync with their sources

Readme

@diglot/action

A GitHub Action for diglot translations repositories. On each run it extracts every source, diffs it against the stored manifests, machine-translates what changed for each locale with machine translation enabled, rebuilds dist/<locale>.json (unless build-dist is false), and commits the result as one commit.

- uses: actions/checkout@v4
- id: diglot
  uses: danielroe/diglot/packages/action@main
  with:
    git-user-name: translations-bot
    git-user-email: [email protected]
  env:
    AI_GATEWAY_API_KEY: ${{ secrets.AI_GATEWAY_API_KEY }}
- if: steps.diglot.outputs.committed == 'true'
  run: git pull --rebase origin ${{ github.ref_name }} && git push
  env:
    GIT_COMMITTER_NAME: translations-bot
    GIT_COMMITTER_EMAIL: [email protected]

The Action commits to the checked-out branch and never pushes; pushing is the workflow's step, so the job needs contents: write and no other token. See examples/nuxt for a complete translations repository and workflow.

What a run does

  1. Loads diglot.config.ts and sources.yml. Sources with a repo and a ref whose path does not exist (default .diglot/checkouts/<repo>) are fetched shallowly into a bare repository; existing working copies are read as they are.
  2. Extracts the segments of each source at its ref and diffs them file by file against .diglot/manifest/<source>.json. Modified segments are paired with their predecessor; the pairing is kept in .diglot/lineage.json so a later run can still find it.
  3. For each locale whose <locale>/locale.yml has mt.enabled: true, every live segment without a record is handled once (identical text across sources and branches shares one record):
    • with a predecessor whose record is not rejected: updateTranslation from @diglot/mt, which carries the text over without a model call when the skeleton is identical and only the hash changed (a context salt, derived: carry), and otherwise updates it from the word diff (derived: update), case and punctuation edits included;
    • otherwise: translateSegments, one request per page, with the locale's glossary and style.
  4. Writes records with review: none and prev where there is a predecessor (origin: mt, except carries, which keep the predecessor's origin and mt; carried and updated records read as pending-review), updates manifests, and, unless build-dist is false, builds dist/<locale>.json from the live records of every locale.
  5. Commits the changed records and state (and the bundles, when build-dist is not false) as the given identity with a summary message, for example chore(fr): translate 78 segments, update 12, carry 31.

Records a reviewer rejected (review: rejected) are kept as they are and shipped in the bundles, so their segments are not translated again until their source changes. Segments rejected by QA are listed in .diglot/rejected/<locale>.json with the reasons and skipped by later runs until their source changes (or retry-rejected is set). Locales with machine translation disabled get no new records, but their bundles are still rebuilt when build-dist is not false. A run with no source changes makes no model calls and no commit.

Inputs

| Input | Default | Description | | --- | --- | --- | | working-directory | . | Root of the translations repository | | locales | all | Only these locales (comma or space separated) | | sources | all | Only these sources | | model | mt.model, then DIGLOT_MT_MODEL | Model id for the Vercel AI Gateway | | ai-gateway-api-key | AI_GATEWAY_API_KEY | Gateway key | | limit | none | Most segments per locale sent to the model in one run; the rest wait for the next run | | retry-rejected | false | Translate previously rejected segments again | | commit | true | Commit the changes | | build-dist | true | Build dist/<locale>.json and add it to the commit | | git-user-name | diglot[bot] | Commit author | | git-user-email | diglot[bot]@users.noreply.github.com | Commit author email |

Outputs

| Output | Description | | --- | --- | | translated | Segments translated from scratch | | updated | Translations updated from their predecessor | | carried | Translations carried over from their predecessor | | rejected | Segments rejected by QA | | costUsd | Model cost in USD, when the provider reports it | | committed | true when a commit was made | | sha | The new commit |

The job summary has a table per locale and source, and the segments rejected by QA with their issues. Its Skipped column counts the live segments of each locale whose record a reviewer rejected.

As a library

import { run, summary } from '@diglot/action'

const result = await run({ cwd: '.', locales: ['fr'], limit: 200, commit: false })
console.log(summary(result))