diff --git a/README.md b/README.md index c826e69..7a85a41 100644 --- a/README.md +++ b/README.md @@ -53,60 +53,47 @@ KompKit provides essential utility functions that work seamlessly across Web (Ty ### Installation -> **Note**: Alpha packages are not yet published to registries. Clone the repository for local development. - -#### Web Development +#### Web (npm) ```bash -# Clone the repository -git clone https://github.com/Kompkit/KompKit.git -cd KompKit +npm i kompkit-core +``` + +> Published on [npmjs.com/package/kompkit-core](https://www.npmjs.com/package/kompkit-core) -# Install dependencies -npm install +#### Flutter / Dart (pub.dev) -# Build the web package -npm run build +Add to your `pubspec.yaml`: -# Run tests -npm run test:web +```yaml +dependencies: + kompkit_core: ^0.2.0-alpha.0 ``` -#### Android Development +Then run: ```bash -# Clone the repository -git clone https://github.com/Kompkit/KompKit.git +flutter pub get +``` + +> Published on [pub.dev/packages/kompkit_core](https://pub.dev/packages/kompkit_core) + +#### Android (Kotlin) — Local only -# Include in your Android project's settings.gradle.kts +> **Note**: The Android/Kotlin package is not yet published to Maven. Use a local project reference for now. + +```kotlin +// settings.gradle.kts include(":kompkit-core") project(":kompkit-core").projectDir = file("path/to/KompKit/packages/core/android") -# Add to your app's build.gradle.kts +// app/build.gradle.kts dependencies { implementation(project(":kompkit-core")) implementation("org.jetbrains.kotlinx:kotlinx-coroutines-android:1.10.2") } ``` -#### Flutter Development - -```bash -# Clone the repository -git clone https://github.com/Kompkit/KompKit.git - -# Add to your Flutter project's pubspec.yaml -dependencies: - kompkit_core: - path: path/to/KompKit/packages/core/flutter - -# Get dependencies -flutter pub get - -# Run tests -flutter test -``` - ### Quick Start Once installed, you can import and use KompKit utilities: @@ -114,7 +101,7 @@ Once installed, you can import and use KompKit utilities: **TypeScript/JavaScript:** ```typescript -import { debounce, isEmail, formatCurrency } from "@kompkit/core"; +import { debounce, isEmail, formatCurrency } from "kompkit-core"; const search = debounce((query: string) => { console.log("Searching:", query); diff --git a/docs/android.md b/docs/android.md index b49a958..0f5d953 100644 --- a/docs/android.md +++ b/docs/android.md @@ -6,11 +6,20 @@ Status: `V0.2.0-alpha`. ## Installation -Add the dependency to your module `build.gradle.kts`: +> **Note**: The Android/Kotlin package is not yet published to Maven. Use a local project reference for now. + +Add the project reference to your `settings.gradle.kts`: + +```kotlin +include(":kompkit-core") +project(":kompkit-core").projectDir = file("path/to/KompKit/packages/core/android") +``` + +Then add the dependency to your module `build.gradle.kts`: ```kotlin dependencies { - implementation("com.kompkit:core:") + implementation(project(":kompkit-core")) implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.10.2") } ``` diff --git a/docs/flutter.md b/docs/flutter.md index 01460f1..e871ebf 100644 --- a/docs/flutter.md +++ b/docs/flutter.md @@ -12,8 +12,7 @@ Add KompKit Core to your `pubspec.yaml`: ```yaml dependencies: - kompkit_core: - path: path/to/KompKit/packages/core/flutter + kompkit_core: ^0.2.0-alpha.0 ``` Then run: @@ -22,14 +21,15 @@ Then run: flutter pub get ``` +> Published on [pub.dev/packages/kompkit_core](https://pub.dev/packages/kompkit_core) + ### Dart Projects For server-side Dart projects, add to your `pubspec.yaml`: ```yaml dependencies: - kompkit_core: - path: path/to/KompKit/packages/core/flutter + kompkit_core: ^0.2.0-alpha.0 ``` Then run: diff --git a/docs/getting-started.md b/docs/getting-started.md index 4415637..2cf035b 100644 --- a/docs/getting-started.md +++ b/docs/getting-started.md @@ -6,31 +6,40 @@ Status: `V0.2.0-alpha`. ## Install -### Web (React/Vue) +### Web (npm) ```bash -npm i @kompkit/core +npm i kompkit-core ``` -### Android (Gradle) +> [npmjs.com/package/kompkit-core](https://www.npmjs.com/package/kompkit-core) -Add the dependency to your module build file: +### Flutter / Dart (pub.dev) -```kotlin -dependencies { - implementation("com.kompkit:core:") - implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.10.2") -} +Add to your `pubspec.yaml`: + +```yaml +dependencies: + kompkit_core: ^0.2.0-alpha.0 +``` + +Then run: + +```bash +flutter pub get ``` -### Flutter (pubspec.yaml) +> [pub.dev/packages/kompkit_core](https://pub.dev/packages/kompkit_core) -Add the dependency to your pubspec.yaml: +### Android (Gradle) — Local only -```yaml -dependencies: - kompkit_core: - path: path/to/KompKit/packages/core/flutter +> Not yet published to Maven. Use a local project reference for now. + +```kotlin +dependencies { + implementation(project(":kompkit-core")) + implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.10.2") +} ``` ## Build and test locally diff --git a/docs/recipes.md b/docs/recipes.md index 17f4a1e..75e0bef 100644 --- a/docs/recipes.md +++ b/docs/recipes.md @@ -6,7 +6,7 @@ Real-world examples using KompKit Core utilities. ```tsx import { useState, useEffect } from "react"; -import { debounce } from "@kompkit/core"; +import { debounce } from "kompkit-core"; function SearchComponent() { const [query, setQuery] = useState(""); @@ -160,7 +160,7 @@ class _SearchScreenState extends State { ```tsx import { useState } from "react"; -import { formatCurrency } from "@kompkit/core"; +import { formatCurrency } from "kompkit-core"; function PriceDisplay({ amount }: { amount: number }) { const [locale, setLocale] = useState<"en-US" | "es-ES" | "ja-JP">("en-US"); @@ -191,7 +191,7 @@ function PriceDisplay({ amount }: { amount: number }) { ```tsx import { useState } from "react"; -import { isEmail } from "@kompkit/core"; +import { isEmail } from "kompkit-core"; function ContactForm() { const [email, setEmail] = useState(""); @@ -231,22 +231,22 @@ import 'package:kompkit_core/kompkit_core.dart'; class PriceDisplay extends StatefulWidget { final double amount; - + const PriceDisplay({Key? key, required this.amount}) : super(key: key); - + @override _PriceDisplayState createState() => _PriceDisplayState(); } class _PriceDisplayState extends State { String _selectedLocale = 'en_US'; - + final Map> _localeConfig = { 'en_US': {'currency': 'USD', 'locale': 'en_US'}, 'es_ES': {'currency': 'EUR', 'locale': 'es_ES'}, 'ja_JP': {'currency': 'JPY', 'locale': 'ja_JP'}, }; - + @override Widget build(BuildContext context) { final config = _localeConfig[_selectedLocale]!; @@ -255,7 +255,7 @@ class _PriceDisplayState extends State { currency: config['currency']!, locale: config['locale']!, ); - + return Column( children: [ Text( @@ -297,7 +297,7 @@ class ContactForm extends StatefulWidget { class _ContactFormState extends State { final TextEditingController _emailController = TextEditingController(); final GlobalKey _formKey = GlobalKey(); - + void _handleSubmit() { if (_formKey.currentState!.validate()) { // Submit form @@ -307,7 +307,7 @@ class _ContactFormState extends State { ); } } - + String? _validateEmail(String? value) { if (value == null || value.isEmpty) { return 'Email is required'; @@ -317,7 +317,7 @@ class _ContactFormState extends State { } return null; } - + @override Widget build(BuildContext context) { return Scaffold( diff --git a/docs/web.md b/docs/web.md index bfaa9ce..b815d1f 100644 --- a/docs/web.md +++ b/docs/web.md @@ -7,7 +7,7 @@ Status: `V0.2.0-alpha`. ## Installation ```bash -npm i @kompkit/core +npm i kompkit-core ``` ## Imports @@ -15,13 +15,13 @@ npm i @kompkit/core ESM: ```ts -import { debounce, isEmail, formatCurrency } from "@kompkit/core"; +import { debounce, isEmail, formatCurrency } from "kompkit-core"; ``` CommonJS: ```js -const { debounce, isEmail, formatCurrency } = require("@kompkit/core"); +const { debounce, isEmail, formatCurrency } = require("kompkit-core"); ``` ## Usage examples @@ -29,7 +29,7 @@ const { debounce, isEmail, formatCurrency } = require("@kompkit/core"); ### debounce ```ts -import { debounce } from "@kompkit/core"; +import { debounce } from "kompkit-core"; const onType = debounce((value: string) => { console.log("Search:", value); @@ -43,7 +43,7 @@ onType("kompkit"); // only this call will execute after ~300ms ### isEmail ```ts -import { isEmail } from "@kompkit/core"; +import { isEmail } from "kompkit-core"; isEmail("test@example.com"); // true isEmail("invalid@"); // false @@ -52,7 +52,7 @@ isEmail("invalid@"); // false ### formatCurrency ```ts -import { formatCurrency } from "@kompkit/core"; +import { formatCurrency } from "kompkit-core"; formatCurrency(1234.56); // "1.234,56 €" (es-ES by default) formatCurrency(1234.56, "USD", "en-US"); // "$1,234.56" @@ -62,7 +62,7 @@ formatCurrency(1234.56, "USD", "en-US"); // "$1,234.56" ```tsx import { useState } from "react"; -import { debounce } from "@kompkit/core"; +import { debounce } from "kompkit-core"; export function SearchBox() { const [value, setValue] = useState(""); @@ -85,7 +85,7 @@ export function SearchBox() { ```vue