cozy-games/scripts/publish-lib.js
Ayo 969ebba067 chore: restructure to new cozy-games monorepo
Reviewed-on: https://git.ayo.run/ayo/cozy-games/pulls/1
Co-authored-by: Ayo <ayo@ayco.io>
Co-committed-by: Ayo <ayo@ayco.io>
2026-07-03 13:53:13 +00:00

18 lines
781 B
JavaScript

// Publishes @ayo-run/mnswpr to npm using the mnswpr app README.md as the
// package's README (what npmjs.com displays).
//
// packages/mnswpr/README.md is a generated copy (gitignored) — the source of
// truth is apps/mnswpr/README.md. The library's own guide lives in
// packages/mnswpr/TUTORIAL.md.
import { execSync } from 'node:child_process'
import { copyFileSync } from 'node:fs'
import { resolve } from 'node:path'
const root = resolve(import.meta.dirname, '..')
const libDir = resolve(root, 'packages/mnswpr')
console.log('Copying apps/mnswpr/README.md into packages/mnswpr/ for the published package')
copyFileSync(resolve(root, 'apps/mnswpr/README.md'), resolve(libDir, 'README.md'))
execSync('npm login')
execSync('npm publish', { cwd: libDir, stdio: 'inherit' })