2026-03-13 12:21:09 -06:00
|
|
|
{
|
|
|
|
|
"name": "@gsd/native",
|
|
|
|
|
"version": "0.1.0",
|
2026-03-13 13:22:09 -06:00
|
|
|
"description": "Native Rust bindings for GSD \u2014 high-performance native modules via N-API",
|
2026-03-13 12:21:09 -06:00
|
|
|
"type": "module",
|
2026-03-13 14:05:41 -06:00
|
|
|
"main": "./dist/index.js",
|
|
|
|
|
"types": "./dist/index.d.ts",
|
2026-03-13 12:21:09 -06:00
|
|
|
"scripts": {
|
2026-03-13 14:05:41 -06:00
|
|
|
"build": "tsc -p tsconfig.json",
|
2026-03-13 12:21:09 -06:00
|
|
|
"build:native": "node ../../native/scripts/build.js",
|
|
|
|
|
"build:native:dev": "node ../../native/scripts/build.js --dev",
|
2026-03-13 13:22:09 -06:00
|
|
|
"test": "node --test src/__tests__/grep.test.mjs src/__tests__/ps.test.mjs src/__tests__/glob.test.mjs src/__tests__/clipboard.test.mjs src/__tests__/highlight.test.mjs src/__tests__/html.test.mjs src/__tests__/text.test.mjs src/__tests__/fd.test.mjs src/__tests__/image.test.mjs"
|
2026-03-13 12:21:09 -06:00
|
|
|
},
|
|
|
|
|
"exports": {
|
|
|
|
|
".": {
|
2026-03-13 14:05:41 -06:00
|
|
|
"types": "./dist/index.d.ts",
|
|
|
|
|
"import": "./dist/index.js"
|
2026-03-13 12:21:09 -06:00
|
|
|
},
|
|
|
|
|
"./grep": {
|
2026-03-13 14:05:41 -06:00
|
|
|
"types": "./dist/grep/index.d.ts",
|
|
|
|
|
"import": "./dist/grep/index.js"
|
2026-03-13 12:43:50 -06:00
|
|
|
},
|
|
|
|
|
"./ps": {
|
2026-03-13 14:05:41 -06:00
|
|
|
"types": "./dist/ps/index.d.ts",
|
|
|
|
|
"import": "./dist/ps/index.js"
|
feat: add native glob and fs_cache modules with gitignore-aware discovery (#226)
Port glob, glob_util, and fs_cache modules from Oh My Pi's pi-natives crate,
adapted for napi-rs v2. Provides gitignore-respecting filesystem discovery
with a TTL-based scan cache, mtime sorting, file-type filtering, and
node_modules exclusion.
Includes a task module for async N-API work scheduling with cooperative
cancellation (timeout-based), TypeScript type declarations and wrapper,
and 12 integration tests covering pattern matching, recursion, gitignore,
maxResults, sortByMtime, fileType filtering, and cache invalidation.
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-13 12:45:56 -06:00
|
|
|
},
|
|
|
|
|
"./glob": {
|
2026-03-13 14:05:41 -06:00
|
|
|
"types": "./dist/glob/index.d.ts",
|
|
|
|
|
"import": "./dist/glob/index.js"
|
2026-03-13 12:48:27 -06:00
|
|
|
},
|
|
|
|
|
"./clipboard": {
|
2026-03-13 14:05:41 -06:00
|
|
|
"types": "./dist/clipboard/index.d.ts",
|
|
|
|
|
"import": "./dist/clipboard/index.js"
|
2026-03-13 13:01:41 -06:00
|
|
|
},
|
|
|
|
|
"./ast": {
|
2026-03-13 14:05:41 -06:00
|
|
|
"types": "./dist/ast/index.d.ts",
|
|
|
|
|
"import": "./dist/ast/index.js"
|
2026-03-13 13:11:40 -06:00
|
|
|
},
|
2026-03-13 12:40:22 -06:00
|
|
|
"./html": {
|
2026-03-13 14:05:41 -06:00
|
|
|
"types": "./dist/html/index.d.ts",
|
|
|
|
|
"import": "./dist/html/index.js"
|
2026-03-13 13:12:40 -06:00
|
|
|
},
|
2026-03-13 12:42:42 -06:00
|
|
|
"./text": {
|
2026-03-13 14:05:41 -06:00
|
|
|
"types": "./dist/text/index.d.ts",
|
|
|
|
|
"import": "./dist/text/index.js"
|
2026-03-13 13:13:43 -06:00
|
|
|
},
|
|
|
|
|
"./fd": {
|
2026-03-13 14:05:41 -06:00
|
|
|
"types": "./dist/fd/index.d.ts",
|
|
|
|
|
"import": "./dist/fd/index.js"
|
2026-03-13 13:22:09 -06:00
|
|
|
},
|
feat: add native image module — decode, encode, and resize via Rust image crate
Port image processing from Oh My Pi's pi-natives crate, adapted for napi-rs v2.
Exposes NativeImage class with async parse/encode/resize methods backed by the
Rust `image` crate (PNG, JPEG, WebP, GIF support).
Includes:
- task.rs: lightweight async task scheduling for libuv thread pool
- image.rs: NativeImage class with SamplingFilter enum
- TypeScript types and wrapper (parseImage, ImageFormat, SamplingFilter)
- 8 passing tests covering decode, encode, resize, round-trip, error cases
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-13 12:51:49 -06:00
|
|
|
"./image": {
|
2026-03-13 14:05:41 -06:00
|
|
|
"types": "./dist/image/index.d.ts",
|
|
|
|
|
"import": "./dist/image/index.js"
|
2026-03-13 16:46:08 -06:00
|
|
|
},
|
|
|
|
|
"./xxhash": {
|
|
|
|
|
"types": "./dist/xxhash/index.d.ts",
|
|
|
|
|
"import": "./dist/xxhash/index.js"
|
2026-03-17 18:01:56 -06:00
|
|
|
},
|
|
|
|
|
"./diff": {
|
|
|
|
|
"types": "./dist/diff/index.d.ts",
|
|
|
|
|
"import": "./dist/diff/index.js"
|
|
|
|
|
},
|
|
|
|
|
"./gsd-parser": {
|
|
|
|
|
"types": "./dist/gsd-parser/index.d.ts",
|
|
|
|
|
"import": "./dist/gsd-parser/index.js"
|
|
|
|
|
},
|
|
|
|
|
"./highlight": {
|
|
|
|
|
"types": "./dist/highlight/index.d.ts",
|
|
|
|
|
"import": "./dist/highlight/index.js"
|
|
|
|
|
},
|
|
|
|
|
"./json-parse": {
|
|
|
|
|
"types": "./dist/json-parse/index.d.ts",
|
|
|
|
|
"import": "./dist/json-parse/index.js"
|
|
|
|
|
},
|
|
|
|
|
"./stream-process": {
|
|
|
|
|
"types": "./dist/stream-process/index.d.ts",
|
|
|
|
|
"import": "./dist/stream-process/index.js"
|
|
|
|
|
},
|
|
|
|
|
"./truncate": {
|
|
|
|
|
"types": "./dist/truncate/index.d.ts",
|
|
|
|
|
"import": "./dist/truncate/index.js"
|
|
|
|
|
},
|
|
|
|
|
"./ttsr": {
|
|
|
|
|
"types": "./dist/ttsr/index.d.ts",
|
|
|
|
|
"import": "./dist/ttsr/index.js"
|
2026-03-13 12:21:09 -06:00
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
"files": [
|
2026-03-13 14:05:41 -06:00
|
|
|
"dist"
|
2026-03-13 12:21:09 -06:00
|
|
|
],
|
|
|
|
|
"license": "MIT"
|
|
|
|
|
}
|