npm package: @stewheart123/hello-pixi-library
Description: A TypeScript library using pixi.js
Latest version: 1.0.0

# Inspinity Library

A TypeScript library using pixi.js for creating interactive graphics applications.

## Installation

```bash
npm install @your-username/inspinity-library
```

## Usage

### Basic Example

```typescript
import { helloWorld, createPixiApp } from '@your-username/inspinity-library';

// Simple hello world
console.log(helloWorld()); // "Hello from inspinity library!"

// Create a PIXI application
const app = await createPixiApp(800, 600);
document.body.appendChild(app.canvas);
```

### Using with React

```typescript
import { useEffect, useRef } from 'react';
import { createPixiApp } from '@your-username/inspinity-library';

function MyComponent() {
  const containerRef = useRef<HTMLDivElement>(null);

  useEffect(() => {
    let app: PIXI.Application | null = null;

    const init = async () => {
      app = await createPixiApp(800, 600);
      if (containerRef.current) {
        containerRef.current.appendChild(app.canvas);
      }
    };

    init();

    return () => {
      if (app) {
        app.destroy(true);
      }
    };
  }, []);

  return <div ref={containerRef} />;
}
```

## Development

```bash
# Install dependencies
npm install

# Build the library
npm run build

# Watch mode for development
npm run dev
```

## Publishing

### Prerequisites

1. **Create an npm account** (if you don't have one):
   - Go to [npmjs.com](https://www.npmjs.com) and sign up
   - Verify your email address

2. **Login to npm from your terminal**:
   ```bash
   npm login
   ```
   Enter your username, password, and email when prompted.

### Before Publishing

1. **Update package name** in `package.json`:
   - Replace `@your-username/inspinity-library` with your desired package name
   - For scoped packages (starting with `@`), use your npm username or organization
   - For unscoped packages, use a unique name (e.g., `inspinity-library`)

2. **Update version** in `package.json`:
   - Start with `1.0.0` for your first release
   - Follow [semantic versioning](https://semver.org/) for future updates

3. **Fill in author and repository** fields in `package.json` (optional but recommended)

4. **Test the build**:
   ```bash
   npm run build
   ```
   This should create a `dist/` folder with compiled files.

### Publishing Steps

1. **Build the library** (automatic via `prepublishOnly` script):
   ```bash
   npm run build
   ```

2. **Publish to npm**:
   ```bash
   # For scoped packages (starting with @)
   npm publish --access public
   
   # For unscoped packages
   npm publish
   ```

3. **Verify publication**:
   - Check your package on npm: `https://www.npmjs.com/package/your-package-name`
   - Test installation: `npm install your-package-name`

### Updating Your Package

When you make changes:

1. Update the version in `package.json` (patch: `1.0.1`, minor: `1.1.0`, major: `2.0.0`)
2. Run `npm publish` again

The `prepublishOnly` script automatically builds the library before each publish.

## License

MIT