Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 0dc4eaba52 | |||
| 31ab561859 |
@@ -1,5 +1,14 @@
|
|||||||
# Changelog
|
# Changelog
|
||||||
|
|
||||||
|
## 2025-11-30 - 5.0.0 - BREAKING CHANGE(@push.rocks/smartwatch)
|
||||||
|
Rename package and update branding/docs: switch from @push.rocks/smartchok to @push.rocks/smartwatch, update repository/homepage/bugs URLs and author, and refresh README examples and install instructions.
|
||||||
|
|
||||||
|
- Package name changed from @push.rocks/smartchok to @push.rocks/smartwatch in package.json
|
||||||
|
- Repository, homepage and issue URLs updated to point to the new smartwatch repository
|
||||||
|
- Author changed to Task Venture Capital GmbH in package metadata
|
||||||
|
- README updated: install commands, import examples and references now use @push.rocks/smartwatch
|
||||||
|
- Documentation text and branding updated throughout README (project name, internal references)
|
||||||
|
|
||||||
## 2025-11-30 - 4.0.1 - fix(readme)
|
## 2025-11-30 - 4.0.1 - fix(readme)
|
||||||
Update README: refine description and clarify trademark/legal information
|
Update README: refine description and clarify trademark/legal information
|
||||||
|
|
||||||
|
|||||||
12
package.json
12
package.json
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@push.rocks/smartchok",
|
"name": "@push.rocks/smartwatch",
|
||||||
"version": "4.0.1",
|
"version": "5.0.0",
|
||||||
"private": false,
|
"private": false,
|
||||||
"description": "A cross-runtime file watcher with glob pattern support for Node.js, Deno, and Bun.",
|
"description": "A cross-runtime file watcher with glob pattern support for Node.js, Deno, and Bun.",
|
||||||
"main": "dist_ts/index.js",
|
"main": "dist_ts/index.js",
|
||||||
@@ -13,14 +13,14 @@
|
|||||||
},
|
},
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://code.foss.global/push.rocks/smartchok.git"
|
"url": "https://code.foss.global/push.rocks/smartwatch.git"
|
||||||
},
|
},
|
||||||
"author": "Lossless GmbH",
|
"author": "Task Venture Capital GmbH",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"bugs": {
|
"bugs": {
|
||||||
"url": "https://gitlab.com/push.rocks/smartchok/issues"
|
"url": "https://gitlab.com/push.rocks/smartwatch/issues"
|
||||||
},
|
},
|
||||||
"homepage": "https://code.foss.global/push.rocks/smartchok",
|
"homepage": "https://code.foss.global/push.rocks/smartwatch",
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=20.0.0"
|
"node": ">=20.0.0"
|
||||||
},
|
},
|
||||||
|
|||||||
22
readme.md
22
readme.md
@@ -1,4 +1,4 @@
|
|||||||
# @push.rocks/smartchok
|
# @push.rocks/smartwatch
|
||||||
|
|
||||||
A lightweight, cross-runtime file watcher with glob pattern support for **Node.js**, **Deno**, and **Bun**. Zero heavyweight dependencies — just native file watching APIs for maximum performance. 🚀
|
A lightweight, cross-runtime file watcher with glob pattern support for **Node.js**, **Deno**, and **Bun**. Zero heavyweight dependencies — just native file watching APIs for maximum performance. 🚀
|
||||||
|
|
||||||
@@ -9,9 +9,9 @@ For reporting bugs, issues, or security vulnerabilities, please visit [community
|
|||||||
## Install
|
## Install
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
npm install @push.rocks/smartchok
|
npm install @push.rocks/smartwatch
|
||||||
# or
|
# or
|
||||||
pnpm add @push.rocks/smartchok
|
pnpm add @push.rocks/smartwatch
|
||||||
```
|
```
|
||||||
|
|
||||||
## Features
|
## Features
|
||||||
@@ -30,7 +30,7 @@ pnpm add @push.rocks/smartchok
|
|||||||
### Basic Setup
|
### Basic Setup
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
import { Smartwatch } from '@push.rocks/smartchok';
|
import { Smartwatch } from '@push.rocks/smartwatch';
|
||||||
|
|
||||||
// Create a watcher with glob patterns
|
// Create a watcher with glob patterns
|
||||||
const watcher = new Smartwatch([
|
const watcher = new Smartwatch([
|
||||||
@@ -110,7 +110,7 @@ await watcher.stop();
|
|||||||
### Complete Example
|
### Complete Example
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
import { Smartwatch } from '@push.rocks/smartchok';
|
import { Smartwatch } from '@push.rocks/smartwatch';
|
||||||
|
|
||||||
async function watchProject() {
|
async function watchProject() {
|
||||||
// Initialize with patterns
|
// Initialize with patterns
|
||||||
@@ -155,7 +155,7 @@ watchProject();
|
|||||||
|
|
||||||
## How It Works
|
## How It Works
|
||||||
|
|
||||||
smartchok uses native file watching APIs for each runtime:
|
smartwatch uses native file watching APIs for each runtime:
|
||||||
|
|
||||||
| Runtime | API Used |
|
| Runtime | API Used |
|
||||||
|-----------------|----------------------------------|
|
|-----------------|----------------------------------|
|
||||||
@@ -165,7 +165,7 @@ smartchok uses native file watching APIs for each runtime:
|
|||||||
|
|
||||||
### Under the Hood
|
### Under the Hood
|
||||||
|
|
||||||
Native file watching APIs don't support glob patterns directly, so smartchok handles pattern matching internally:
|
Native file watching APIs don't support glob patterns directly, so smartwatch handles pattern matching internally:
|
||||||
|
|
||||||
1. **Base path extraction** — Extracts the static portion from each glob pattern (e.g., `./src/` from `./src/**/*.ts`)
|
1. **Base path extraction** — Extracts the static portion from each glob pattern (e.g., `./src/` from `./src/**/*.ts`)
|
||||||
2. **Efficient watching** — Native watchers monitor only the base directories
|
2. **Efficient watching** — Native watchers monitor only the base directories
|
||||||
@@ -174,7 +174,7 @@ Native file watching APIs don't support glob patterns directly, so smartchok han
|
|||||||
|
|
||||||
### Write Stabilization
|
### Write Stabilization
|
||||||
|
|
||||||
smartchok includes built-in write stabilization (similar to chokidar's `awaitWriteFinish`). When a file is being written, events are held until the file size stabilizes, preventing multiple events for a single write operation.
|
smartwatch includes built-in write stabilization (similar to chokidar's `awaitWriteFinish`). When a file is being written, events are held until the file size stabilizes, preventing multiple events for a single write operation.
|
||||||
|
|
||||||
Default settings:
|
Default settings:
|
||||||
- **Stability threshold**: 300ms
|
- **Stability threshold**: 300ms
|
||||||
@@ -226,9 +226,9 @@ type TFsEvent = 'add' | 'addDir' | 'change' | 'error' | 'unlink' | 'unlinkDir' |
|
|||||||
type TSmartwatchStatus = 'idle' | 'starting' | 'watching';
|
type TSmartwatchStatus = 'idle' | 'starting' | 'watching';
|
||||||
```
|
```
|
||||||
|
|
||||||
## Why smartchok?
|
## Why smartwatch?
|
||||||
|
|
||||||
| Feature | smartchok | chokidar |
|
| Feature | smartwatch | chokidar |
|
||||||
|-------------------------|----------------------|--------------------|
|
|-------------------------|----------------------|--------------------|
|
||||||
| Native API | ✅ Direct `fs.watch` | ❌ FSEvents bindings |
|
| Native API | ✅ Direct `fs.watch` | ❌ FSEvents bindings |
|
||||||
| Cross-runtime | ✅ Node, Deno, Bun | ❌ Node only |
|
| Cross-runtime | ✅ Node, Deno, Bun | ❌ Node only |
|
||||||
@@ -237,7 +237,7 @@ type TSmartwatchStatus = 'idle' | 'starting' | 'watching';
|
|||||||
| Glob support | ✅ picomatch | ✅ anymatch |
|
| Glob support | ✅ picomatch | ✅ anymatch |
|
||||||
| Bundle size | ~15KB | ~200KB+ |
|
| Bundle size | ~15KB | ~200KB+ |
|
||||||
|
|
||||||
If you need a lightweight file watcher without native compilation headaches, smartchok has you covered.
|
If you need a lightweight file watcher without native compilation headaches, smartwatch has you covered.
|
||||||
|
|
||||||
## License and Legal Information
|
## License and Legal Information
|
||||||
|
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
* autocreated commitinfo by @push.rocks/commitinfo
|
* autocreated commitinfo by @push.rocks/commitinfo
|
||||||
*/
|
*/
|
||||||
export const commitinfo = {
|
export const commitinfo = {
|
||||||
name: '@push.rocks/smartchok',
|
name: '@push.rocks/smartwatch',
|
||||||
version: '4.0.1',
|
version: '5.0.0',
|
||||||
description: 'A cross-runtime file watcher with glob pattern support for Node.js, Deno, and Bun.'
|
description: 'A cross-runtime file watcher with glob pattern support for Node.js, Deno, and Bun.'
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user