# Publishing TFlix to npm

This document provides instructions for publishing the TFlix package to npm so that it can be easily installed on TizenBrew.

## Prerequisites

1. An npm account (create one at https://www.npmjs.com/signup)
2. Node.js and npm installed on your computer
3. The TFlix project built and ready to publish

## Publishing Steps

### 1. Build the project

Run the build script to ensure all files are properly built:

```
npm run build
```

Or use the prepare-npm.bat script:

```
prepare-npm.bat
```

### 2. Log in to npm

Open a terminal/command prompt and log in to your npm account:

```
npm login
```

Follow the prompts to enter your username, password, and email.

### 3. Publish the package

From the root of the TFlix project, run:

```
npm publish --access=public
```

This will publish the package to npm with public access, making it available for installation through TizenBrew.

### 4. Verify publication

Visit https://www.npmjs.com/package/@zyrecx/tflix to confirm that your package has been published successfully.

## Updating the package

To update the package after making changes:

1. Update the version number in package.json
2. Build the project
3. Publish the updated package:

```
npm publish --access=public
```

## Using GitHub Actions (Automated publishing)

A GitHub workflow has been set up to automatically publish to npm when you create a new release on GitHub:

1. Push your changes to GitHub
2. Create a new release on GitHub
3. The workflow will automatically build and publish the package to npm

Note: For this to work, you need to add your NPM_TOKEN as a secret in your GitHub repository settings.

## Installing on TizenBrew

Once published, users can install TFlix on their Samsung TVs with TizenBrew by:

1. Opening TizenBrew on their TV
2. Navigating to the Package Manager
3. Searching for "@zyrecx/tflix"
4. Selecting and installing the package
