ui-action-library
v1.0.0
Published
## Overview
Downloads
58
Readme
UI Action Library
Overview
UI Action Library is a collection of utility functions designed for internal use within our company. It provides various helpers, including string manipulation, date handling, and more. This package is private and distributed via GitHub Packages within our organization.
Table of Contents
- Installation
- Development Setup
- Usage
- Testing
- Building
- Publishing
- Contributing
- Package Management & GitHub Packages
- License
Installation
To install this package in your project, authenticate to GitHub Packages and run the following command:
npm install @umbrage-studios/ui-action-library --registry=https://npm.pkg.github.com/
Make sure you have your GitHub Personal Access Token (PAT) with the necessary permissions configured in your .npmrc
.
Development Setup
Clone the Repository:
First, clone the repository to your local machine:
git clone https://github.com/@umbrage-studios/ui-action-library.git cd my-library
Install Dependencies:
Install all project dependencies:
bun install
or alternatively, use npm:
npm install
Configure Authentication for GitHub Packages:
Make sure you have a
.npmrc
file in the root of the project with your GitHub Packages authentication details://npm.pkg.github.com/:_authToken=YOUR_PERSONAL_ACCESS_TOKEN
Build the Project:
You can start the project for development using the following command:
bun run build
Usage
This package provides various utility functions for string manipulation, date formatting, and more. Example usage:
import {
toTitleCase,
nameToTwoLetters,
} from "@@umbrage-studios/ui-action-library";
const title = toTitleCase("hello world"); // "Hello World"
const initials = nameToTwoLetters("John Doe"); // "JD"
For detailed API documentation, see the source code and comments.
Testing
Tests are written using Vitest and cover all critical functions in the library. You can run the tests using the following command:
bun run test
or using npm:
npm run test
Running Tests with Coverage
To run the tests with coverage:
bun run test:coverage
Building
To build the package for distribution (ESM and UMD formats), run:
bun run build
The build files will be placed in the dist/
directory.
Publishing
GitHub Packages Setup
This package is distributed via GitHub Packages and only accessible to members of the organization.
Authentication:
Make sure your
.npmrc
file contains your GitHub Personal Access Token (PAT) with the necessary scopes (read:packages
,write:packages
, andrepo
)://npm.pkg.github.com/:_authToken=YOUR_PERSONAL_ACCESS_TOKEN
Publish to GitHub Packages:
After building the package, publish it using:
npm publish
This will publish the package to the GitHub Packages registry.
Contributing
When contributing to this repository, please follow these guidelines:
- Branching: Always branch off from
main
for new features or bug fixes. - Pull Requests: Submit pull requests with detailed descriptions.
- Code Style: Use ESLint and Prettier for consistent code formatting.
- Testing: Ensure all changes are covered with unit tests and that existing tests pass.
Package Management & GitHub Packages
This project uses GitHub Packages to distribute the library internally. Make sure to:
- Use a Personal Access Token (PAT) with the appropriate scopes to authenticate.
- Ensure that the repository is private to restrict public access.
- Verify that npm is configured correctly in the
.npmrc
file for internal installations.
License
This project is licensed under the terms of the MIT License, available within the repository.