Skip to content

Commit 359da34

Browse files
authored
Full bun and deno support (#30)
1 parent 0455545 commit 359da34

File tree

11 files changed

+1124
-388
lines changed

11 files changed

+1124
-388
lines changed

.github/workflows/ci.yml

Lines changed: 55 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -120,11 +120,60 @@ jobs:
120120
name: build-artifacts
121121
path: dist/
122122

123+
runtime-compatibility:
124+
name: Runtime Compatibility
125+
runs-on: ubuntu-latest
126+
needs: [build]
127+
128+
steps:
129+
- name: Checkout code
130+
uses: actions/checkout@v5
131+
132+
- name: Setup Node.js
133+
uses: actions/setup-node@v4
134+
with:
135+
node-version: 20
136+
cache: 'npm'
137+
138+
- name: Install dependencies
139+
run: npm ci
140+
141+
- name: Build the library
142+
run: npm run build
143+
144+
- name: Setup Deno
145+
uses: denoland/setup-deno@v2
146+
with:
147+
deno-version: v2.x
148+
149+
- name: Test with Deno
150+
run: deno run --allow-read tests/runtime-tests/deno-test.ts
151+
152+
- name: Setup Bun
153+
uses: oven-sh/setup-bun@v2
154+
with:
155+
bun-version: latest
156+
157+
- name: Test with Bun
158+
run: bun tests/runtime-tests/bun-test.ts
159+
160+
- name: Test CLI with Deno
161+
run: |
162+
echo "Testing CLI with Deno..."
163+
deno run --allow-read bin/nano-string.js slugify "Hello Deno World"
164+
echo "hello-world" | deno run --allow-read bin/nano-string.js kebabCase
165+
166+
- name: Test CLI with Bun
167+
run: |
168+
echo "Testing CLI with Bun..."
169+
bun bin/nano-string.js camelCase "hello-bun-world"
170+
echo "bun-test" | bun bin/nano-string.js constantCase
171+
123172
validate:
124173
name: Validate Package
125174
runs-on: ubuntu-latest
126175
needs: [build]
127-
176+
128177
steps:
129178
- name: Checkout code
130179
uses: actions/checkout@v5
@@ -154,21 +203,23 @@ jobs:
154203
ci-success:
155204
name: CI Success
156205
runs-on: ubuntu-latest
157-
needs: [typecheck, test, build, validate]
206+
needs: [typecheck, test, build, validate, runtime-compatibility]
158207
if: always()
159-
208+
160209
steps:
161210
- name: Check all jobs status
162211
run: |
163212
if [[ "${{ needs.typecheck.result }}" != "success" || \
164213
"${{ needs.test.result }}" != "success" || \
165214
"${{ needs.build.result }}" != "success" || \
166-
"${{ needs.validate.result }}" != "success" ]]; then
215+
"${{ needs.validate.result }}" != "success" || \
216+
"${{ needs.runtime-compatibility.result }}" != "success" ]]; then
167217
echo "❌ One or more CI checks failed"
168218
echo "TypeCheck: ${{ needs.typecheck.result }}"
169219
echo "Test: ${{ needs.test.result }}"
170220
echo "Build: ${{ needs.build.result }}"
171221
echo "Validate: ${{ needs.validate.result }}"
222+
echo "Runtime Compatibility: ${{ needs.runtime-compatibility.result }}"
172223
exit 1
173224
fi
174225
echo "✅ All CI checks passed successfully!"

CHANGELOG.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,38 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## [Unreleased]
99

10+
## [0.14.0] - 2025-09-21
11+
12+
### Added
13+
14+
- **Full Deno and Bun Runtime Support** - nano-string-utils now works seamlessly across all modern JavaScript runtimes
15+
- CLI tool now runs natively in Deno and Bun without any modifications
16+
- Added runtime abstraction layer (`bin/runtime-utils.js`) for unified cross-runtime behavior
17+
- New runtime compatibility tests for Deno (`tests/runtime-tests/deno-test.ts`) and Bun (`tests/runtime-tests/bun-test.ts`)
18+
- CI/CD pipeline extended with automated runtime compatibility testing
19+
- All 41 utility functions verified to work identically across Node.js, Deno, and Bun
20+
21+
### Improved
22+
23+
- **CLI Tool** - Enhanced with multi-runtime support
24+
- Automatic runtime detection (Node.js, Deno, or Bun)
25+
- Unified stdin handling across all runtimes
26+
- Cross-runtime path resolution and dynamic imports
27+
- Works with `deno run`, `bun run`, and Node.js execution
28+
- Maintains zero runtime dependencies
29+
30+
- **Documentation** - Updated README with runtime compatibility matrix
31+
- Added runtime badges (Node.js, Deno, Bun) to showcase support
32+
- Installation instructions for each runtime
33+
- CLI usage examples for Node.js, Deno, and Bun
34+
- Clear compatibility matrix showing full support across all runtimes
35+
36+
### Technical
37+
38+
- GitHub Actions workflow now includes runtime compatibility job
39+
- Tests run against Deno v2.x and latest Bun version
40+
- CLI tested with both core functionality and pipe operations in all runtimes
41+
1042
## [0.13.0] - 2025-09-19
1143

1244
### Added

0 commit comments

Comments
 (0)