ui-action-library
v1.4.1
Published
## Overview
Downloads
5
Readme
UI Action Library
Overview
UI Action Library is a collection of utility functions designed for wide spread use. It provides various helpers, including string manipulation, date handling, and more.
Table of Contents
Installation
To install this package in your project, run the following command:
bun add ui-action-library
Development Setup
Clone the Repository:
First, clone the repository to your local machine:
git clone https://github.com/@xallindrome-dev/ui-action-library.git cd my-library
Install Dependencies:
Install all project dependencies:
bun install
or alternatively, use npm:
npm install
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 "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
Packages Setup
This package is distributed via NPM Packages and only accessible to members of the organization.
Authentication:
npm login
Publish to NPM:
After building the package, publish it using:
npm publish
This will publish the package to the NPM 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
This project uses NPM 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.
License
This project is licensed under the terms of the MIT License, available within the repository.