From 68ae0604aeefd9514bb50d61afd9e04a8f7084be Mon Sep 17 00:00:00 2001 From: JounQin Date: Thu, 4 Jan 2024 13:42:31 +0800 Subject: [PATCH] chore: release synckit (#155) Co-authored-by: github-actions[bot] --- .changeset/neat-rings-joke.md | 5 ----- .changeset/ten-sheep-applaud.md | 5 ----- CHANGELOG.md | 10 ++++++++++ README.md | 18 +++++++++--------- package.json | 4 +++- src/index.ts | 4 +++- yarn.lock | 9 +++------ 7 files changed, 28 insertions(+), 27 deletions(-) delete mode 100644 .changeset/neat-rings-joke.md delete mode 100644 .changeset/ten-sheep-applaud.md diff --git a/.changeset/neat-rings-joke.md b/.changeset/neat-rings-joke.md deleted file mode 100644 index c1f0c3b6b..000000000 --- a/.changeset/neat-rings-joke.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"synckit": patch ---- - -refactor: lazy initialize caches diff --git a/.changeset/ten-sheep-applaud.md b/.changeset/ten-sheep-applaud.md deleted file mode 100644 index fc7e0ef88..000000000 --- a/.changeset/ten-sheep-applaud.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"synckit": minor ---- - -feat!: use a single SharedArrayBuffer, remove useless `bufferSize` option diff --git a/CHANGELOG.md b/CHANGELOG.md index 04291e759..c3b4cf5a4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/README.md b/README.md index 4f509489f..1f324198c 100644 --- a/README.md +++ b/README.md @@ -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 @@ -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 diff --git a/package.json b/package.json index e8736214c..1047a2b2b 100644 --- a/package.json +++ b/package.json @@ -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", @@ -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", @@ -80,6 +81,7 @@ "yarn-deduplicate": "^6.0.2" }, "resolutions": { + "prettier": "^3.1.1", "synckit": "link:." }, "commitlint": { diff --git a/src/index.ts b/src/index.ts index 1df444056..8ef71b1f4 100644 --- a/src/index.ts +++ b/src/index.ts @@ -473,7 +473,9 @@ function startWorkerThread>( // 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, ) diff --git a/yarn.lock b/yarn.lock index f7e0e4fdf..b4bb1e515 100644 --- a/yarn.lock +++ b/yarn.lock @@ -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== @@ -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"