Skip to content

Commit 68ae060

Browse files
chore: release synckit (#155)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
1 parent be4648c commit 68ae060

7 files changed

Lines changed: 28 additions & 27 deletions

File tree

.changeset/neat-rings-joke.md

Lines changed: 0 additions & 5 deletions
This file was deleted.

.changeset/ten-sheep-applaud.md

Lines changed: 0 additions & 5 deletions
This file was deleted.

CHANGELOG.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,15 @@
11
# synckit
22

3+
## 0.9.0
4+
5+
### Minor Changes
6+
7+
- [#154](https://github.com/un-ts/synckit/pull/154) [`2541a1e`](https://github.com/un-ts/synckit/commit/2541a1e9b3d0e8f01f29f78ac53cb835936f6a30) Thanks [@onigoetz](https://github.com/onigoetz)! - feat!: use a single SharedArrayBuffer, remove useless `bufferSize` option
8+
9+
### Patch Changes
10+
11+
- [#156](https://github.com/un-ts/synckit/pull/156) [`be4648c`](https://github.com/un-ts/synckit/commit/be4648c45a698aee1be8e267b78542b13c8596aa) Thanks [@JounQin](https://github.com/JounQin)! - refactor: lazy initialize caches
12+
313
## 0.8.8
414

515
### Patch Changes

README.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
[![JavaScript Style Guide](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](https://standardjs.com)
1212
[![Code Style: Prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)
1313

14-
Perform async work synchronously in Node.js using `worker_threads` with first-class TypeScript support.
14+
Perform async work synchronously in Node.js using `worker_threads` with first-class TypeScript and Yarn P'n'P support.
1515

1616
## TOC <!-- omit in toc -->
1717

@@ -111,18 +111,18 @@ export interface GlobalShim {
111111

112112
### Options
113113

114-
1. `timeout` same as env `SYNCKIT_TIMEOUT`
115-
2. `execArgv` same as env `SYNCKIT_EXEC_ARGV`
116-
3. `tsRunner` same as env `SYNCKIT_TS_RUNNER`
114+
1. `execArgv` same as env `SYNCKIT_EXEC_ARGV`
115+
2. `globalShims`: Similar like env `SYNCKIT_GLOBAL_SHIMS` but much more flexible which can be a `GlobalShim` `Array`, see `GlobalShim`'s [definition](#types) for more details
116+
3. `timeout` same as env `SYNCKIT_TIMEOUT`
117117
4. `transferList`: Please refer Node.js [`worker_threads`](https://nodejs.org/api/worker_threads.html#:~:text=Default%3A%20true.-,transferList,-%3CObject%5B%5D%3E%20If) documentation
118-
5. `globalShims`: Similar like env `SYNCKIT_GLOBAL_SHIMS` but much more flexible which can be a `GlobalShim` `Array`, see `GlobalShim`'s [definition](#types) for more details
118+
5. `tsRunner` same as env `SYNCKIT_TS_RUNNER`
119119

120120
### Envs
121121

122-
1. `SYNCKIT_TIMEOUT`: `timeout` for performing the async job (no default)
123-
2. `SYNCKIT_EXEC_ARGV`: List of node CLI options passed to the worker, split with comma `,`. (default as `[]`), see also [`node` docs](https://nodejs.org/api/worker_threads.html)
124-
3. `SYNCKIT_TS_RUNNER`: Which TypeScript runner to be used, it could be very useful for development, could be `'ts-node' | 'esbuild-register' | 'esbuild-runner' | 'swc' | 'tsx'`, `'ts-node'` is used by default, make sure you have installed them already
125-
4. `SYNCKIT_GLOBAL_SHIMS`: Whether to enable the default `DEFAULT_GLOBAL_SHIMS_PRESET` as `globalShims`
122+
1. `SYNCKIT_EXEC_ARGV`: List of node CLI options passed to the worker, split with comma `,`. (default as `[]`), see also [`node` docs](https://nodejs.org/api/worker_threads.html)
123+
2. `SYNCKIT_GLOBAL_SHIMS`: Whether to enable the default `DEFAULT_GLOBAL_SHIMS_PRESET` as `globalShims`
124+
3. `SYNCKIT_TIMEOUT`: `timeout` for performing the async job (no default)
125+
4. `SYNCKIT_TS_RUNNER`: Which TypeScript runner to be used, it could be very useful for development, could be `'ts-node' | 'esbuild-register' | 'esbuild-runner' | 'swc' | 'tsx'`, `'ts-node'` is used by default, make sure you have installed them already
126126

127127
### TypeScript
128128

package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "synckit",
3-
"version": "0.8.8",
3+
"version": "0.9.0",
44
"type": "module",
55
"description": "Perform async work synchronously in Node.js using `worker_threads` with first-class TypeScript support.",
66
"repository": "git+https://github.com/un-ts/synckit.git",
@@ -70,6 +70,7 @@
7070
"execa": "^8.0.1",
7171
"jest": "^29.7.0",
7272
"patch-package": "^8.0.0",
73+
"prettier": "^3.1.1",
7374
"sync-threads": "^1.0.1",
7475
"ts-expect": "^1.3.0",
7576
"ts-jest": "^29.1.1",
@@ -80,6 +81,7 @@
8081
"yarn-deduplicate": "^6.0.2"
8182
},
8283
"resolutions": {
84+
"prettier": "^3.1.1",
8385
"synckit": "link:."
8486
},
8587
"commitlint": {

src/index.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -473,7 +473,9 @@ function startWorkerThread<R, T extends AnyAsyncFn<R>>(
473473
// We store a single Byte in the SharedArrayBuffer
474474
// for the notification, we can used a fixed size
475475
sharedBufferView ??= new Int32Array(
476-
(sharedBuffer ??= new SharedArrayBuffer(INT32_BYTES)),
476+
/* istanbul ignore next */ (sharedBuffer ??= new SharedArrayBuffer(
477+
INT32_BYTES,
478+
)),
477479
0,
478480
1,
479481
)

yarn.lock

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9438,12 +9438,7 @@ prettier-plugin-toml@^2.0.1:
94389438
dependencies:
94399439
"@taplo/lib" "^0.4.0-alpha.2"
94409440

9441-
prettier@2, prettier@>=2.3, prettier@^2.7.1:
9442-
version "2.8.8"
9443-
resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.8.8.tgz#e8c5d7e98a4305ffe3de2e1fc4aca1a71c28b1da"
9444-
integrity sha512-tdN8qQGvNjw4CHbY+XXk0JgCXn9QiF21a55rBe5LJAU+kDyC4WQn4+awm2Xfk2lQMk5fKup9XgzTZtGkjBdP9Q==
9445-
9446-
prettier@^3.1.1:
9441+
prettier@2, prettier@>=2.3, prettier@^2.7.1, prettier@^3.1.1:
94479442
version "3.1.1"
94489443
resolved "https://registry.yarnpkg.com/prettier/-/prettier-3.1.1.tgz#6ba9f23165d690b6cbdaa88cb0807278f7019848"
94499444
integrity sha512-22UbSzg8luF4UuZtzgiUOfcGM8s4tjBv6dJRT7j275NXsy2jb4aJa4NNveul5x4eqlF1wuhuR2RElK71RvmVaw==
@@ -11275,9 +11270,11 @@ sync-threads@^1.0.1:
1127511270

1127611271
synckit@^0.8.5:
1127711272
version "0.0.0"
11273+
uid ""
1127811274

1127911275
synckit@^0.8.6:
1128011276
version "0.0.0"
11277+
uid ""
1128111278

1128211279
"synckit@link:.":
1128311280
version "0.0.0"

0 commit comments

Comments
 (0)