Skip to content

Commit b50aea3

Browse files
committed
Merge remote-tracking branch 'origin/main' into feat/availableParallelism
2 parents ae7d776 + 6422505 commit b50aea3

File tree

12 files changed

+421
-83
lines changed

12 files changed

+421
-83
lines changed

.github/workflows/publish.yml

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
name: CI
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
release-type:
7+
type: choice
8+
description: Type of the release
9+
options:
10+
- patch
11+
- minor
12+
- major
13+
14+
permissions:
15+
contents: read
16+
id-token: write
17+
18+
jobs:
19+
publish:
20+
runs-on: ubuntu-latest
21+
steps:
22+
- uses: actions/checkout@v4
23+
with:
24+
fetch-depth: 0
25+
26+
- uses: pnpm/action-setup@v2
27+
28+
- uses: actions/setup-node@v4
29+
with:
30+
node-version: 22
31+
registry-url: 'https://registry.npmjs.org'
32+
33+
# OICD requires updated npm even when pnpm is used
34+
- name: Update npm
35+
run: |
36+
npm --version
37+
npm install -g npm@latest
38+
npm --version
39+
40+
- name: Install Dependencies
41+
run: pnpm install
42+
43+
- name: Build
44+
run: pnpm build
45+
46+
- name: Typecheck
47+
run: pnpm typecheck
48+
49+
- name: Lint
50+
run: pnpm lint
51+
52+
- name: Test
53+
run: pnpm test
54+
55+
- name: Configure github-actions git
56+
run: |
57+
git config --global user.name 'github-actions'
58+
git config --global user.email '[email protected]'
59+
60+
- name: Bump version
61+
run: pnpm version ${{ github.event.inputs.release-type }}
62+
63+
- name: Push release tag
64+
run: git push origin main --follow-tags
65+
66+
- name: Publish to npm
67+
run: pnpm publish

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
> Piscina: A fast, efficient Node.js Worker Thread Pool implementation
44
5-
Tinypool is a fork of piscina. What we try to achieve in this library, is to eliminate some dependencies and features that our target users don't need (currently, our main user will be Vitest). Tinypool's install size (38KB) can then be smaller than Piscina's install size (6MB). If you need features like [utilization](https://github.com/piscinajs/piscina#property-utilization-readonly) or OS-specific thread priority setting, [Piscina](https://github.com/piscinajs/piscina) is a better choice for you. We think that Piscina is an amazing library, and we may try to upstream some of the dependencies optimization in this fork.
5+
Tinypool is a fork of piscina. What we try to achieve in this library, is to eliminate some dependencies and features that our target users don't need (currently, our main user will be Vitest). Tinypool's install size (38KB) can then be smaller than Piscina's install size (6MB when Tinypool was created, Piscina has since reduced it's size to ~800KB). If you need features like [utilization](https://github.com/piscinajs/piscina#property-utilization-readonly) or OS-specific thread priority setting, [Piscina](https://github.com/piscinajs/piscina) is a better choice for you. We think that Piscina is an amazing library, and we may try to upstream some of the dependencies optimization in this fork.
66

77
- ✅ Smaller install size, 38KB
88
- ✅ Minimal
@@ -180,6 +180,7 @@ We have a similar API to Piscina, so for more information, you can read Piscina'
180180
- `runtime`: Used to pick worker runtime. Default value is `worker_threads`.
181181
- `worker_threads`: Runs workers in [`node:worker_threads`](https://nodejs.org/api/worker_threads.html). For `main thread <-> worker thread` communication you can use [`MessagePort`](https://nodejs.org/api/worker_threads.html#class-messageport) in the `pool.run()` method's [`transferList` option](https://nodejs.org/api/worker_threads.html#portpostmessagevalue-transferlist). See [example](#main-thread---worker-thread-communication).
182182
- `child_process`: Runs workers in [`node:child_process`](https://nodejs.org/api/child_process.html). For `main thread <-> worker process` communication you can use `TinypoolChannel` in the `pool.run()` method's `channel` option. For filtering out the Tinypool's internal messages see `TinypoolWorkerMessage`. See [example](#main-process---worker-process-communication).
183+
- `teardown`: name of the function in file that should be called before worker is terminated. Must be named exported.
183184
184185
#### Pool methods
185186

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "tinypool",
33
"type": "module",
4-
"version": "1.0.2",
4+
"version": "1.1.1",
55
"packageManager": "[email protected]",
66
"description": "A minimal and tiny Node.js Worker Thread Pool implementation, a fork of piscina, but with fewer features",
77
"license": "MIT",
@@ -37,7 +37,7 @@
3737
"scripts": {
3838
"test": "vitest",
3939
"bench": "vitest bench",
40-
"dev": "tsdown --watch",
40+
"dev": "tsdown --watch ./src",
4141
"build": "tsdown",
4242
"publish": "clean-publish",
4343
"lint": "eslint --max-warnings=0",
@@ -55,7 +55,7 @@
5555
"typescript": "^5.4.5",
5656
"typescript-eslint": "^7.13.0",
5757
"vite": "^5.2.11",
58-
"vitest": "^3.1.3"
58+
"vitest": "^3.2.3"
5959
},
6060
"pnpm": {
6161
"overrides": {

0 commit comments

Comments
 (0)