Projects

Packages

Library · TypeScript · npm

The npm packages under this site, Mêlée, Séance and on-record, typed as far as the compiler goes.

Small TypeScript packages with no third-party runtime dependency, published on npm, each lifted out of a project once a second one needed it. One translates, and knows at compile time what each message asks for; one says whether something worked, without throwing and without null; the others keep the chosen theme from flashing, take the throw out of localStorage and the clipboard, and share the reset, the focus ring and the compiler and linter settings every project starts from.

  • TypeScript
  • React
  • Intl
  • Vitest
  • Biome
  • Changesets
  • GitHub Actions
@adrienlcp/i18n
Refused3 errors
const EN = defineDictionary({ greeting: 'Hello {name}' })

translate('greeting', { name: 'Ada' })

translate('greeting')
Refused by the compiler: Expected 2 arguments, but got 1

translate('greeting', { nom: 'Ada' })
Refused by the compiler: 'nom' does not exist in type '{ name: string }'

translate('greting', { name: 'Ada' })
Refused by the compiler: not assignable to '"greeting"'

A message’s arguments are read off the message itself: leave out {name} and the call does not compile. No code generation, no build plugin.

Packages
11
under @adrienlcp
Installed by
9 projects
Mêlée, on-record, Scoreboard, Analytics, Séance, Pastime, Arbor, List, this site
Coverage
96%
lines run by the tests of every package, read 2026-10-02
Latest release
October 4, 2026
to npm, with provenance

At a glance

  • The French dictionary is typed against the English one, down to each placeholder: a missing key or a {nom} written for {name} fails the build instead of showing on screen.
  • Every rule it enforces is a compile error, so those tests are written as types and checked by tsc.
  • browser copies to the clipboard even over plain HTTP, where the Clipboard API does not exist.
  • Released with Changesets and published from GitHub Actions with npm provenance, never from a laptop.
  • This site, Mêlée, Séance and on-record install them from npm, down to their TypeScript and Biome configs.

As the compiler reads it

Set the way an editor shows it: a wavy line is a build that refuses, a violet line is what the compiler works out on its own.

  1. @adrienlcp/result
    Compiles0 errors
    const parse = (input: string): Result<number, 'not_a_number'> => {
      const value = Number(input)
      return Number.isNaN(value)
        ? Result.failure('not_a_number')
        : Result.success(value)
    }
    
    const result = parse(raw)
    if (result.status === 'failure') return result.error
    Worked out by the compiler: 'not_a_number'
    result.data
    Worked out by the compiler: number
    

    Result fits in thirty lines. A success that carries nothing has no data key at all, so nobody reads undefined off it.

  2. export const themeStore = createThemePreferenceStore({
      storageKey: 'app:theme'
    })
    
    // vite.config.ts: runs before the first paint
    plugins: [themePreferencePlugin(themeStore)]
    
    themeStore.setPreference('dark')
    Worked out by the compiler: <html data-theme="dark">
    Worked out by the compiler: dark theme-color: media="all"
    Worked out by the compiler: light theme-color: media="not all"
    

    A phone paints its toolbar from the theme-color tags, which follow the system, not the visitor. The theme package rewrites their media query before the first paint, so a dark choice on a light phone gets a dark toolbar too.

  3. @adrienlcp/safe-storage
    Compiles0 errors
    const locale = readRecognizedText({
      key: 'app:locale',
      isRecognized: isLocale
    })
    
    if (locale.status === 'failure') {
      locale.error
      Worked out by the compiler: 'unavailable' | 'unrecognized'
    } else {
      locale.data
      Worked out by the compiler: 'en' | 'fr' | null
    }
    

    Safari’s private window once threw on every localStorage write; safe-storage returns a Result there instead, as for a full quota or a value an older version stored.

All 11

Each at its version on npm, and which project installs it.

Your team, perhaps?

I am looking for my next job. Write to me, or take the CV: a designed one, and a plain one for applicant tracking systems.