Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: release synckit #155

Merged
merged 4 commits into from
Jan 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions .changeset/neat-rings-joke.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/ten-sheep-applaud.md

This file was deleted.

10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
# synckit

## 0.9.0

### Minor Changes

- [#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

### Patch Changes

- [#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

## 0.8.8

### Patch Changes
Expand Down
18 changes: 9 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
[![JavaScript Style Guide](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](https://standardjs.com)
[![Code Style: Prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)

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

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

Expand Down Expand Up @@ -111,18 +111,18 @@ export interface GlobalShim {

### Options

1. `timeout` same as env `SYNCKIT_TIMEOUT`
2. `execArgv` same as env `SYNCKIT_EXEC_ARGV`
3. `tsRunner` same as env `SYNCKIT_TS_RUNNER`
1. `execArgv` same as env `SYNCKIT_EXEC_ARGV`
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
3. `timeout` same as env `SYNCKIT_TIMEOUT`
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
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
5. `tsRunner` same as env `SYNCKIT_TS_RUNNER`

### Envs

1. `SYNCKIT_TIMEOUT`: `timeout` for performing the async job (no default)
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)
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
4. `SYNCKIT_GLOBAL_SHIMS`: Whether to enable the default `DEFAULT_GLOBAL_SHIMS_PRESET` as `globalShims`
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)
2. `SYNCKIT_GLOBAL_SHIMS`: Whether to enable the default `DEFAULT_GLOBAL_SHIMS_PRESET` as `globalShims`
3. `SYNCKIT_TIMEOUT`: `timeout` for performing the async job (no default)
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

### TypeScript

Expand Down
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "synckit",
"version": "0.8.8",
"version": "0.9.0",
"type": "module",
"description": "Perform async work synchronously in Node.js using `worker_threads` with first-class TypeScript support.",
"repository": "git+https://github.com/un-ts/synckit.git",
Expand Down Expand Up @@ -70,6 +70,7 @@
"execa": "^8.0.1",
"jest": "^29.7.0",
"patch-package": "^8.0.0",
"prettier": "^3.1.1",
"sync-threads": "^1.0.1",
"ts-expect": "^1.3.0",
"ts-jest": "^29.1.1",
Expand All @@ -80,6 +81,7 @@
"yarn-deduplicate": "^6.0.2"
},
"resolutions": {
"prettier": "^3.1.1",
"synckit": "link:."
},
"commitlint": {
Expand Down
4 changes: 3 additions & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -473,7 +473,9 @@ function startWorkerThread<R, T extends AnyAsyncFn<R>>(
// We store a single Byte in the SharedArrayBuffer
// for the notification, we can used a fixed size
sharedBufferView ??= new Int32Array(
(sharedBuffer ??= new SharedArrayBuffer(INT32_BYTES)),
/* istanbul ignore next */ (sharedBuffer ??= new SharedArrayBuffer(
INT32_BYTES,
)),
0,
1,
)
Expand Down
9 changes: 3 additions & 6 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -9438,12 +9438,7 @@ prettier-plugin-toml@^2.0.1:
dependencies:
"@taplo/lib" "^0.4.0-alpha.2"

prettier@2, prettier@>=2.3, prettier@^2.7.1:
version "2.8.8"
resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.8.8.tgz#e8c5d7e98a4305ffe3de2e1fc4aca1a71c28b1da"
integrity sha512-tdN8qQGvNjw4CHbY+XXk0JgCXn9QiF21a55rBe5LJAU+kDyC4WQn4+awm2Xfk2lQMk5fKup9XgzTZtGkjBdP9Q==

prettier@^3.1.1:
prettier@2, prettier@>=2.3, prettier@^2.7.1, prettier@^3.1.1:
version "3.1.1"
resolved "https://registry.yarnpkg.com/prettier/-/prettier-3.1.1.tgz#6ba9f23165d690b6cbdaa88cb0807278f7019848"
integrity sha512-22UbSzg8luF4UuZtzgiUOfcGM8s4tjBv6dJRT7j275NXsy2jb4aJa4NNveul5x4eqlF1wuhuR2RElK71RvmVaw==
Expand Down Expand Up @@ -11275,9 +11270,11 @@ sync-threads@^1.0.1:

synckit@^0.8.5:
version "0.0.0"
uid ""

synckit@^0.8.6:
version "0.0.0"
uid ""

"synckit@link:.":
version "0.0.0"
Expand Down
Loading