npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

create-szafir-app

v1.1.2

Published

Create a new Szafir Vite app with TypeScript, Tailwind CSS, Fractal Generation Library, and modern tooling

Downloads

7

Readme

create-szafir-app

Narzędzie CLI do tworzenia nowych aplikacji Vite z TypeScript, Tailwind CSS, zaawansowanymi komponentami fraktali i nowoczesnym zestawem narzędzi.

Instalacja

npm install -g create-szafir-app

Użycie

Podstawowe użycie:

npm create szafir-app@latest

Z konkretną nazwą projektu:

npm create szafir-app@latest moja-aplikacja

Alternatywnie:

npx create-szafir-app moja-aplikacja

Co zawiera szablon

  • Vite - szybki bundler dla aplikacji webowych
  • 🔷 TypeScript - typowany JavaScript
  • 🎨 Tailwind CSS - framework CSS z podejściem utility-first
  • 🏗️ Preact - lekka alternatywa dla React z pełną kompatybilnością
  • 🔄 Hot Module Replacement - natychmiastowe odświeżanie podczas developmentu
  • 🧪 Vitest - szybkie testowanie jednostkowe
  • 📚 Storybook - dokumentacja komponentów
  • 🎯 Fractal Generation Library - zaawansowane generatory fraktali:
    • Operacje na liczbach zespolonych
    • Generator zbioru Mandelbrot
    • Generator zbioru Julia z predefiniowanymi presetami
    • Interaktywne komponenty z kontrolkami
    • System renderowania z paletami kolorów
    • Optymalizacje wydajnościowe
  • 🎯 Modern ESLint - lintowanie kodu
  • 🎭 TypeScript konfiguracja - pełna obsługa typów

Struktura projektu

moja-aplikacja/
├── src/
│   ├── components/          # Komponenty Preact + Komponenty fraktali
│   │   ├── FractalCanvas.tsx       # Canvas do renderowania fraktali
│   │   ├── MandelbrotViewer.tsx    # Interaktywny viewer Mandelbrot
│   │   ├── JuliaViewer.tsx         # Interaktywny viewer Julia
│   │   └── ...              # Inne komponenty UI
│   ├── fractals/            # Biblioteka matematyczna fraktali
│   │   ├── complex.ts       # Operacje na liczbach zespolonych
│   │   ├── mandelbrot.ts    # Generator zbioru Mandelbrot
│   │   ├── julia.ts         # Generator zbioru Julia
│   │   ├── renderer.ts      # System renderowania z paletami
│   │   └── types.ts         # Typy dla biblioteki
│   ├── pages/              # Strony aplikacji
│   ├── stores/             # Stan aplikacji (@preact/signals)
│   ├── styles/             # Style CSS i Tailwind
│   ├── types/              # Typy TypeScript
│   ├── hooks/              # Własne hooki Preact
│   └── assets/             # Zasoby (obrazki, ikony)
├── public/                 # Pliki publiczne
├── config/                 # Konfiguracja aplikacji
├── .storybook/            # Konfiguracja Storybook
├── index.html             # Główny plik HTML
├── package.json           # Zależności i skrypty
├── vite.config.ts         # Konfiguracja Vite
├── tsconfig.json          # Konfiguracja TypeScript
└── vitest.config.ts       # Konfiguracja Vitest

🎯 Przykłady użycia biblioteki fraktali

Podstawowe użycie komponentów:

import { MandelbrotViewer, JuliaViewer } from "./components/index.js";
import { JULIA_PRESETS } from "./fractals/index.js";

function App() {
  return (
    <div>
      {/* Interaktywny viewer Mandelbrot */}
      <MandelbrotViewer
        width={800}
        height={600}
        maxIterations={100}
        showControls={true}
      />

      {/* Julia z predefiniowanym presetem */}
      <JuliaViewer
        width={600}
        height={600}
        juliaC={JULIA_PRESETS.DRAGON}
        showControls={true}
      />
    </div>
  );
}

Programowe generowanie fraktali:

import {
  generateMandelbrot,
  generateJulia,
  JULIA_PRESETS,
} from "./fractals/index.js";

// Generator Mandelbrot
const mandelbrotResult = generateMandelbrot({
  width: 800,
  height: 600,
  maxIterations: 100,
  minReal: -2.5,
  maxReal: 1.0,
  minImaginary: -1.25,
  maxImaginary: 1.25,
});

// Generator Julia
const juliaResult = generateJulia({
  width: 600,
  height: 600,
  maxIterations: 100,
  juliaC: JULIA_PRESETS.SPIRAL,
});

console.log(`Mandelbrot wygenerowany w ${mandelbrotResult.generationTime}ms`);
console.log(`Julia wygenerowany w ${juliaResult.generationTime}ms`);

Dostępne skrypty

Po utworzeniu projektu, w katalogu projektu:

  • npm run dev - uruchomienie serwera deweloperskiego
  • npm run build - budowanie wersji produkcyjnej
  • npm run preview - podgląd wersji produkcyjnej
  • npm run test - uruchomienie testów
  • npm run storybook - uruchomienie Storybook
  • npm run build-storybook - budowanie Storybook

Przykład użycia

# Utworzenie nowego projektu
npm create szafir-app@latest moja-super-apka

# Przejście do katalogu
cd moja-super-apka

# Instalacja zależności
npm install

# Uruchomienie serwera deweloperskiego
npm run dev

Rozwój

Jeśli chcesz rozwijać ten generator:

  1. Sklonuj repozytorium
  2. Zmodyfikuj pliki w katalogu template/
  3. Testuj zmiany lokalnie: node bin/create-szafir-app.js test-projekt

Licencja

MIT