Skip to content

Instantly share code, notes, and snippets.

View anicioalexandre's full-sized avatar
🏠
Working from home

Alexandre Anício anicioalexandre

🏠
Working from home
View GitHub Profile
@anicioalexandre
anicioalexandre / replace-catalogs.js
Last active October 23, 2024 14:37
Replacing pnpm catalogs on a monorepo library system for local development or to use with remote git sources.
const fs = require('fs')
const path = require('path')
const YAML = require('yaml')
const { execSync } = require('child_process')
const workspaceConfigPath = path.resolve(__dirname, 'pnpm-workspace.yaml')
const loadWorkspaceCatalogs = () => {
const workspaceContent = fs.readFileSync(workspaceConfigPath, 'utf8')
const workspaceConfig = YAML.parse(workspaceContent)