npm-library-setup

Configure npm libraries with ES Modules, TypeScript, and React.

8|Updated Aug 21, 2023
One-click install
npx skills add https://github.com/seanmcquaid/scaffolding-templates --skill npm-library-setup
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: npm-library-setup
Source: https://github.com/seanmcquaid/scaffolding-templates/tree/main/.agents/skills/npm-library-setup
Command: npx skills add https://github.com/seanmcquaid/scaffolding-templates --skill npm-library-setup

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires typescript, react, and includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill helps developers create and configure modern npm libraries using ES Modules, TypeScript, and React, streamlining the process of library setup and configuration.

Core Features & Use Cases

  • ESM Setup: Provides guidance on configuring package.json for ESM support.
  • TypeScript Configuration: Offers steps for setting up TypeScript packages and component libraries.
  • React Component Libraries: Includes instructions for creating React component libraries.
  • Use Case: Imagine you're starting a new project and want to set up a TypeScript library with React component support. This Skill walks you through the entire process.

Quick Start

Initialize your npm library by running: npm init -y.

Frequently Asked Questions about npm-library-setup

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I set up an npm library with ES Modules and TypeScript?

To set up an npm library with ES Modules and TypeScript, you need to configure your package.json for ESM support and define a TypeScript configuration file. This provides a comprehensive guide for structuring modern, ESM-compatible npm packages.

What's the best way to create a React component library using TypeScript?

Creating a React component library using TypeScript involves initializing your npm package and configuring TypeScript settings specifically for React. This provides step-by-step instructions for building and structuring your React components within a modern ESM package.

Do I need React installed to use this npm library setup guide?

Yes, you need React installed to use this npm library setup guide. It requires both TypeScript and React to be installed in your development environment to properly configure and structure your modern npm package.

How do I configure package.json for ES Modules in a TypeScript library?

Configuring package.json for ES Modules in a TypeScript library requires setting the correct module type and entry points. This setup provides the necessary steps to ensure your npm package is fully ESM-compatible and properly structured.

Can I use this setup for an npm library without React?

This setup specifically targets developers creating npm libraries with React component support and requires React to be installed. If you are building a library without React, you would only use the TypeScript and ESM configuration portions of the guide.