Skip to content

privanote/core

Repository files navigation

core

Core utilities used by PrivaNote

Install a package

Before installing the packages, you need to have a GitHub token with read:packages checked. You can create one here

Replace {GITHUB_TOKEN} with your token in the first step of one of the following methods when setting the GITHUB_TOKEN env variable.

Bun Environment (Recommended)

refer to: https://bun.sh/docs/install/registries

  1. Set the GITHUB_TOKEN in .env file in your project root:
echo "GITHUB_TOKEN={GITHUB_TOKEN}" >> .env

# Ensure .env is in .gitignore or run:
echo ".env" >> .gitignore
  1. Add privanote registry to bunfig.toml file in your project root:
# bunfig.toml - reads GITHUB_TOKEN from .env
[install.scopes]
"@privanote" = { token = "$GITHUB_TOKEN", url = "https://npm.pkg.github.com" }
  1. Install the package:
bun add @privanote/collaborators

Node Environment:

  1. Set the GITHUB_TOKEN in your environment:
export GITHUB_TOKEN={GITHUB_TOKEN}
  1. Add privanote registry to .npmrc file in your project root:
@privanote:registry=https://npm.pkg.github.com
//npm.pkg.github.com/:_authToken=${GITHUB_TOKEN}
  1. Install the package:
npm install @privanote/collaborators

Development

  1. Setup
git clone git@github.com:privanote/core.git
cd core
bun install
  1. Managing the repo
  • To create a package:
bun run add-bun-pkg <pkg-name>
bun run add-vite-pkg <pkg-name>
  • To execute a package's script:
# one single package
bun run pkg <pkg-name> <script-name>
# all packages
bun run pkg-all <script-name>