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

@mostajs/deployment

v0.1.0

Published

Orchestrateur de séquences de déploiement réutilisables — plan d’étapes idempotentes (definePlan) exécuté en dry-run/apply/rollback/resume avec snapshot, auto-rollback et validation post-déploiement. Zéro dépendance runtime.

Readme

@mostajs/deployment

Orchestrateur de séquences de déploiement réutilisables — dry-run, apply, rollback. Cron-ready, CI-ready, on-prem-ready.

Auteur : Dr Hamid MADANI [email protected] License : AGPL-3.0-or-later Statut : 🚧 v0.0.1 — design + plan livrés. Pas encore publié sur npm.

Voir docs/PLAN-V0.1.0.md pour le plan de développement et docs/ARCHITECTURE.md pour les concepts.


Pourquoi ce module ?

Les déploiements applicatifs (migration de schéma DB, bascule de service, hot-reload de config, séparation système / métier comme le chantier system dialect dans @mostajs/net 2.7.5) suivent toujours le même squelette :

  1. Inventaire (qu'est-ce qu'on a en place ?)
  2. Backup (rollback possible ?)
  3. Préparer (créer ressources, écrire configs, sans toucher au runtime)
  4. Migrer (déplacer les données — souvent via @mostajs/orm-copy-data)
  5. Activer (restart pm2, reload Apache — point de bascule)
  6. Vérifier (smoke E2E — souvent via @mostajs/validation)
  7. Rollback automatique en cas d'échec à 5 ou 6

@mostajs/deployment formalise ce squelette en DSL TypeScript : tu exprimes ton plan, le runtime exécute (en mode dry-run, apply, ou rollback).


Pas encore publié — pourquoi ?

Le module sort d'un cas concret (migration system dialect en prod amia.fr) documenté dans Entreprise/octonet-mcp/docs/MIGRATION-SYSTEM-DIALECT-PROD.md. Pour éviter le piège YAGNI (« inventer une mauvaise abstraction avant 2-3 cas concrets »), on attend d'avoir traversé au moins 2 migrations différentes avant de figer l'API publique.

Cible v0.1.0 : après le 2ᵉ cas d'usage (probablement la séparation octonet_meta → 3 bases : octonet_meta_system + octonet_meta_business + octonet_meta_audit, ou un déploiement multi-tenant), l'API se stabilise → publish npm.


Aperçu API (cible v0.1.0)

import { definePlan, run } from '@mostajs/deployment'

const migrationSystemDialect = definePlan({
  name: 'system-dialect-prod',
  steps: [
    {
      name: 'inventaire',
      idempotent: true,
      run: async (ctx) => {
        ctx.log('count tables…')
        ctx.set('tables.before', await ctx.psql.tables('octonet_meta'))
      },
    },
    {
      name: 'backup',
      idempotent: false,                    // skip si déjà fait
      run: async (ctx) => {
        await ctx.exec(`pg_dump octonet_meta > ${ctx.workdir}/backup.sql`)
      },
      rollback: async (ctx) => { /* no-op : backup ne s'annule pas */ },
    },
    {
      name: 'migrate-data',
      run: async (ctx) => {
        const { copyData } = await import('@mostajs/orm-copy-data')
        await copyData({
          source: { type: 'db', dialect: 'postgres', uri: ctx.env.OCTONET_META },
          dests:  [{ type: 'db', dialect: 'postgres', uri: ctx.env.OCTONET_META_SYSTEM }],
          tables: ctx.env.SYSTEM_TABLES,
        })
      },
      rollback: async (ctx) => {
        await ctx.exec(`dropdb octonet_meta_system && createdb octonet_meta_system`)
      },
    },
    // … etc.
  ],
  validate: async (ctx) => {
    const { defineSuite, run } = await import('@mostajs/validation')
    return run(defineSuite('post-deploy', /* phases… */))
  },
})

await run(migrationSystemDialect, { mode: 'dry-run' })   // simule, log, pas d'effet
await run(migrationSystemDialect, { mode: 'apply' })     // exécute, snapshot pour rollback
await run(migrationSystemDialect, { mode: 'rollback' }) // re-applique steps en sens inverse

Roadmap

Voir docs/PLAN-V0.1.0.md. Synthèse :

  • v0.0.1 (actuelle) : design + plan + script template
  • v0.1.0 : API minimale definePlan / run / hooks pre/post / dry-run / apply / rollback. Adapter SSH+sudo
  • v0.2.0 : adapter pm2 + Apache + Postgres builtin. Plan persistant (reprise après crash)
  • v0.3.0 : Docker + K8s adapters. CI runner GitHub Actions
  • v1.0.0 : API stable. Publish npm.

License

AGPL-3.0-or-later — usage libre tant que le code dérivé reste open-source. Licence commerciale disponible : [email protected].

— (c) 2026 Dr Hamid MADANI <[email protected]>