erkobridee / use-my-ghp-lib

project example of how to consume the @erkobridee/my-ghp-lib from the GitHub Packages

Home Page:https://erkobridee.github.io/use-my-ghp-lib

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

use-my-ghp-lib

This is a Next.js project bootstrapped with create-next-app.

Goal

test project to use the @erkobridee/my-ghp-lib from the GitHub Packages

Project setup

npx create-next-app use-my-ghp-lib --use-npm

cd use-my-ghp-lib

npm i -D @types/react @types/react-dom @types/node typescript

touch tsconfig.json

next dev

Configuring npm for use with GitHub Packages

TODO: create a GITHUB_PAT with the access to only read packages

Configuring npm for use with GitHub Packages | GitHub Docs

There are 2 possible ways to access and use packages from the GitHub packages

.npmrc

useful to use on CI/CD pipelines

//npm.pkg.github.com/:_authToken=${GITHUB_PAT}

@erkobridee:registry=https://npm.pkg.github.com/

login into the GitHub Packages

recommended on the developer machine, this will add the access to the global .npmrc file

$ npm login --scope=@erkobridee --registry=https://npm.pkg.github.com

> Username: USERNAME
> Password: GITHUB_PAT
> Email: PUBLIC-EMAIL-ADDRESS

$ echo "@erkobridee:registry=https://npm.pkg.github.com/" >> ~/.npmrc

CLI commands

Documentation

Useful reference


GitHub Action know issue

if you're consuming a GitHub package from a different account or from a GitHub organization, you'll need to have a GitHub Personal Access Token from there with the rights to read GitHub Packages

About

project example of how to consume the @erkobridee/my-ghp-lib from the GitHub Packages

https://erkobridee.github.io/use-my-ghp-lib

License:ISC License


Languages

Language:TypeScript 46.5%Language:CSS 43.5%Language:JavaScript 10.0%