From 9f385eaba658632e4ed6c6dec753f8fbe18871bb Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Carbon=20=E7=A2=B3=E8=8B=AF?= fs for painless drop-in replacement in existing projects; get multi-fold performance in heavy file operations, powered by Rust.
⚠️ Alpha: The package is currently in alpha. API and behavior may change before 0.1.0 stable.
+ ## Installation ```bash -npm install rush-fs +npm install @rush-fs/core # or -pnpm add rush-fs +pnpm add @rush-fs/core ``` -When you install `rush-fs`, the package manager should automatically install the **platform-specific native binding** for your OS/arch via `optionalDependencies` (e.g. `@rush-fs/rush-fs-darwin-arm64` on macOS ARM). If the native binding is missing and you see "Cannot find native binding", try: +When you install `@rush-fs/core`, the package manager should automatically install the **platform-specific native binding** for your OS/arch via `optionalDependencies` (e.g. `@rush-fs/rush-fs-darwin-arm64` on macOS ARM). If the native binding is missing and you see "Cannot find native binding", try: 1. Remove `node_modules` and the lockfile (`package-lock.json` or `pnpm-lock.yaml`), then run `pnpm install` (or `npm i`) again. 2. Or install the platform package explicitly: @@ -34,10 +37,12 @@ When you install `rush-fs`, the package manager should automatically install the **Windows x64:** `pnpm add @rush-fs/rush-fs-win32-x64-msvc` **Linux x64 (glibc):** `pnpm add @rush-fs/rush-fs-linux-x64-gnu` +**Migration from `rush-fs`:** The package was renamed to `@rush-fs/core`. See [CHANGELOG.md](./CHANGELOG.md#010-alpha0) for details. + ## Usage ```ts -import { readdir, stat, readFile, writeFile, mkdir, rm } from 'rush-fs' +import { readdir, stat, readFile, writeFile, mkdir, rm } from '@rush-fs/core' // Read directory const files = await readdir('./src') @@ -192,7 +197,7 @@ We are rewriting `fs` APIs one by one. > > - ✅: Fully Supported > - 🚧: Partially Supported / WIP -> - ✨: New feature from rush-fs +> - ✨: New feature from @rush-fs/core > - ❌: Not Supported Yet ### `readdir` diff --git a/README.zh-CN.md b/README.zh-CN.md index 9d0925a..12e9a83 100644 --- a/README.zh-CN.md +++ b/README.zh-CN.md @@ -6,25 +6,28 @@
与 Node.js fs API 对齐,可无痛替换现有项目中的 fs;在海量文件操作场景下获得数倍于内置 fs 的性能,由 Rust 驱动。
⚠️ Alpha:当前为 alpha 版本,在 0.1.0 正式版前 API 与行为可能变更。
## 安装 ```bash -npm install rush-fs +npm install @rush-fs/core # or -pnpm add rush-fs +pnpm add @rush-fs/core ``` -安装 `rush-fs` 时,包管理器会通过 `optionalDependencies` 自动安装**当前平台**的本地绑定(例如 macOS ARM 上的 `@rush-fs/rush-fs-darwin-arm64`)。若未安装或出现「Cannot find native binding」: +安装 `@rush-fs/core` 时,包管理器会通过 `optionalDependencies` 自动安装**当前平台**的本地绑定(例如 macOS ARM 上的 `@rush-fs/rush-fs-darwin-arm64`)。若未安装或出现「Cannot find native binding」: 1. 删除 `node_modules` 和锁文件(`package-lock.json` 或 `pnpm-lock.yaml`)后重新执行 `pnpm install`(或 `npm i`)。 2. 或手动安装对应平台包: @@ -33,10 +36,12 @@ pnpm add rush-fs **Windows x64:** `pnpm add @rush-fs/rush-fs-win32-x64-msvc` **Linux x64 (glibc):** `pnpm add @rush-fs/rush-fs-linux-x64-gnu` +**从 `rush-fs` 迁移:** 自 0.1.0-alpha 起主包更名为 `@rush-fs/core`,详见 [CHANGELOG.md](./CHANGELOG.md#010-alpha0)。 + ## 用法 ```ts -import { readdir, stat, readFile, writeFile, mkdir, rm } from 'rush-fs' +import { readdir, stat, readFile, writeFile, mkdir, rm } from '@rush-fs/core' // 读取目录 const files = await readdir('./src') @@ -191,7 +196,7 @@ graph TD > > - ✅:完全支持 > - 🚧:部分支持 / 开发中 -> - ✨:rush-fs 的新增能力 +> - ✨:@rush-fs/core 的新增能力 > - ❌:暂未支持 ### `readdir` diff --git a/docs/content/about.mdx b/docs/content/about.mdx index dd8c89f..c63bdd6 100644 --- a/docs/content/about.mdx +++ b/docs/content/about.mdx @@ -5,7 +5,7 @@ Rush-FS is an API-aligned, drop-in replacement for the Node.js `fs` module, powe ## Links - [GitHub](https://github.com/CoderSerio/rush-fs) -- [npm](https://www.npmjs.com/package/rush-fs) +- [npm](https://www.npmjs.com/package/@rush-fs/core) - [API Overview](/api) - [Benchmarks](/benchmarks) diff --git a/docs/content/api/access.mdx b/docs/content/api/access.mdx index 925c527..4adc358 100644 --- a/docs/content/api/access.mdx +++ b/docs/content/api/access.mdx @@ -5,7 +5,7 @@ Check whether the process can access a file with the given mode (F_OK, R_OK, W_O ## Basic usage ```ts -import { access } from 'rush-fs' +import { access } from '@rush-fs/core' import { constants } from 'node:fs' await access('./file.txt') // F_OK default diff --git a/docs/content/api/append-file.mdx b/docs/content/api/append-file.mdx index dd924e3..d846f5e 100644 --- a/docs/content/api/append-file.mdx +++ b/docs/content/api/append-file.mdx @@ -5,7 +5,7 @@ Append data to a file, creating the file if it does not exist. ## Basic usage ```ts -import { appendFile } from 'rush-fs' +import { appendFile } from '@rush-fs/core' await appendFile('./log.txt', 'new line\n') await appendFile('./log.txt', buffer, { encoding: 'utf8', mode: 0o644 }) diff --git a/docs/content/api/chmod.mdx b/docs/content/api/chmod.mdx index ed1a413..e100696 100644 --- a/docs/content/api/chmod.mdx +++ b/docs/content/api/chmod.mdx @@ -5,7 +5,7 @@ Change the permissions of a file or directory (mode bits). ## Basic usage ```ts -import { chmod } from 'rush-fs' +import { chmod } from '@rush-fs/core' await chmod('./script.sh', 0o755) await chmod('./file.txt', 0o644) diff --git a/docs/content/api/chown.mdx b/docs/content/api/chown.mdx index d9af672..74633ec 100644 --- a/docs/content/api/chown.mdx +++ b/docs/content/api/chown.mdx @@ -5,7 +5,7 @@ Change the owner and group of a file or directory (Unix). On Windows this is a n ## Basic usage ```ts -import { chown } from 'rush-fs' +import { chown } from '@rush-fs/core' await chown('./file', uid, gid) ``` diff --git a/docs/content/api/copy-file.mdx b/docs/content/api/copy-file.mdx index 5a1e664..2a9ebb6 100644 --- a/docs/content/api/copy-file.mdx +++ b/docs/content/api/copy-file.mdx @@ -5,7 +5,7 @@ Copy a file from `src` to `dest`. Does not copy directory trees. ## Basic usage ```ts -import { copyFile } from 'rush-fs' +import { copyFile } from '@rush-fs/core' import { constants } from 'node:fs' await copyFile('./a.txt', './b.txt') diff --git a/docs/content/api/cp.mdx b/docs/content/api/cp.mdx index 6eb45c0..405565d 100644 --- a/docs/content/api/cp.mdx +++ b/docs/content/api/cp.mdx @@ -5,7 +5,7 @@ Copy files and directories recursively (Node.js 16.7+). Supports **concurrency** ## Basic usage ```ts -import { cp } from 'rush-fs' +import { cp } from '@rush-fs/core' await cp('./src', './dest', { recursive: true }) await cp('./src', './dest', { recursive: true, force: true, concurrency: 4 }) diff --git a/docs/content/api/exists.mdx b/docs/content/api/exists.mdx index 077b4e5..bd86b96 100644 --- a/docs/content/api/exists.mdx +++ b/docs/content/api/exists.mdx @@ -5,7 +5,7 @@ Check if a path exists (file, directory, or symlink). Returns a boolean; does no ## Basic usage ```ts -import { exists } from 'rush-fs' +import { exists } from '@rush-fs/core' const ok = await exists('./package.json') if (ok) await doSomething() diff --git a/docs/content/api/glob.mdx b/docs/content/api/glob.mdx index 1e3e070..a1cba4d 100644 --- a/docs/content/api/glob.mdx +++ b/docs/content/api/glob.mdx @@ -5,7 +5,7 @@ Match files and directories by glob pattern (e.g. `**/*.js`). Supports **concurr ## Basic usage ```ts -import { glob } from 'rush-fs' +import { glob } from '@rush-fs/core' const files = await glob('**/*.ts', { cwd: './src' }) const entries = await glob('**/*.rs', { cwd: './crate', withFileTypes: true, concurrency: 4, gitIgnore: true }) diff --git a/docs/content/api/index.mdx b/docs/content/api/index.mdx index c97a328..00e3adf 100644 --- a/docs/content/api/index.mdx +++ b/docs/content/api/index.mdx @@ -53,6 +53,6 @@ Each supported API has a **dedicated doc page** in the sidebar (e.g. [readdir](/ ## Sync variants -Supported APIs expose both async (e.g. `readdir`) and sync (e.g. `readdirSync`) forms. Import the same names from `rush-fs` as you would from `node:fs`. +Supported APIs expose both async (e.g. `readdir`) and sync (e.g. `readdirSync`) forms. Import the same names from `@rush-fs/core` as you would from `node:fs`. For full TypeScript signatures and option details, see the [README Status & Roadmap](https://github.com/CoderSerio/rush-fs#status--roadmap) section. diff --git a/docs/content/api/link.mdx b/docs/content/api/link.mdx index 4bff5bc..424683d 100644 --- a/docs/content/api/link.mdx +++ b/docs/content/api/link.mdx @@ -5,7 +5,7 @@ Create a hard link from `existingPath` to `newPath`. Both paths refer to the sam ## Basic usage ```ts -import { link } from 'rush-fs' +import { link } from '@rush-fs/core' await link('./existing.txt', './hardlink.txt') ``` diff --git a/docs/content/api/lstat.mdx b/docs/content/api/lstat.mdx index e8fb2fc..3451240 100644 --- a/docs/content/api/lstat.mdx +++ b/docs/content/api/lstat.mdx @@ -5,7 +5,7 @@ Get file/directory metadata without following symlinks. For the link target, use ## Basic usage ```ts -import { lstat } from 'rush-fs' +import { lstat } from '@rush-fs/core' const s = await lstat('./some-link') console.log(s.isSymbolicLink(), s.size) diff --git a/docs/content/api/mkdir.mdx b/docs/content/api/mkdir.mdx index a5a26dd..322e79c 100644 --- a/docs/content/api/mkdir.mdx +++ b/docs/content/api/mkdir.mdx @@ -5,7 +5,7 @@ Create a directory. With `recursive: true`, creates all parent directories; retu ## Basic usage ```ts -import { mkdir } from 'rush-fs' +import { mkdir } from '@rush-fs/core' await mkdir('./new-dir') await mkdir('./a/b/c', { recursive: true }) diff --git a/docs/content/api/mkdtemp.mdx b/docs/content/api/mkdtemp.mdx index cac38d9..73ef55c 100644 --- a/docs/content/api/mkdtemp.mdx +++ b/docs/content/api/mkdtemp.mdx @@ -5,7 +5,7 @@ Create a unique temporary directory with the given prefix. Uses OS random source ## Basic usage ```ts -import { mkdtemp } from 'rush-fs' +import { mkdtemp } from '@rush-fs/core' const dir = await mkdtemp('/tmp/myapp-') console.log(dir) // e.g. /tmp/myapp-abc123 diff --git a/docs/content/api/read-file.mdx b/docs/content/api/read-file.mdx index 544e758..d58b3cf 100644 --- a/docs/content/api/read-file.mdx +++ b/docs/content/api/read-file.mdx @@ -5,7 +5,7 @@ Read the entire contents of a file. Returns a `Buffer` or a decoded string depen ## Basic usage ```ts -import { readFile } from 'rush-fs' +import { readFile } from '@rush-fs/core' // As UTF-8 string (default) const text = await readFile('./package.json', { encoding: 'utf8' }) diff --git a/docs/content/api/readdir.mdx b/docs/content/api/readdir.mdx index 7736c63..7c7f03c 100644 --- a/docs/content/api/readdir.mdx +++ b/docs/content/api/readdir.mdx @@ -5,7 +5,7 @@ Read the contents of a directory. Supports non-recursive and recursive modes; re ## Basic usage ```ts -import { readdir } from 'rush-fs' +import { readdir } from '@rush-fs/core' // Names only (default) const names = await readdir('./src') diff --git a/docs/content/api/readlink.mdx b/docs/content/api/readlink.mdx index cd16810..e53d0eb 100644 --- a/docs/content/api/readlink.mdx +++ b/docs/content/api/readlink.mdx @@ -5,7 +5,7 @@ Read the target path of a symbolic link. Fails for non-symlinks. ## Basic usage ```ts -import { readlink } from 'rush-fs' +import { readlink } from '@rush-fs/core' const target = await readlink('./mylink') console.log(target) // resolved target path diff --git a/docs/content/api/realpath.mdx b/docs/content/api/realpath.mdx index 26befe3..1952486 100644 --- a/docs/content/api/realpath.mdx +++ b/docs/content/api/realpath.mdx @@ -5,7 +5,7 @@ Resolve the canonical absolute path for a path, resolving `.`, `..`, and symlink ## Basic usage ```ts -import { realpath } from 'rush-fs' +import { realpath } from '@rush-fs/core' const abs = await realpath('./some/relative/path') console.log(abs) // e.g. /home/user/proj/some/relative/path diff --git a/docs/content/api/rename.mdx b/docs/content/api/rename.mdx index 6a5426d..fb6e64f 100644 --- a/docs/content/api/rename.mdx +++ b/docs/content/api/rename.mdx @@ -5,7 +5,7 @@ Rename or move a file or directory from `oldPath` to `newPath`. Cross-device mov ## Basic usage ```ts -import { rename } from 'rush-fs' +import { rename } from '@rush-fs/core' await rename('./old.txt', './new.txt') await rename('./dir', './renamed-dir') diff --git a/docs/content/api/rm.mdx b/docs/content/api/rm.mdx index 12d053f..0536e91 100644 --- a/docs/content/api/rm.mdx +++ b/docs/content/api/rm.mdx @@ -5,7 +5,7 @@ Remove files and directories. Supports recursive removal with optional **concurr ## Basic usage ```ts -import { rm } from 'rush-fs' +import { rm } from '@rush-fs/core' // Remove a file await rm('./tmp.txt') diff --git a/docs/content/api/rmdir.mdx b/docs/content/api/rmdir.mdx index af833a3..63c3aba 100644 --- a/docs/content/api/rmdir.mdx +++ b/docs/content/api/rmdir.mdx @@ -5,7 +5,7 @@ Remove an empty directory. Fails if the directory is not empty; use `rm` with `r ## Basic usage ```ts -import { rmdir } from 'rush-fs' +import { rmdir } from '@rush-fs/core' await rmdir('./empty-dir') ``` diff --git a/docs/content/api/stat.mdx b/docs/content/api/stat.mdx index 5ac3356..b76d1a4 100644 --- a/docs/content/api/stat.mdx +++ b/docs/content/api/stat.mdx @@ -5,7 +5,7 @@ Get file/directory metadata. Follows symlinks; use `lstat` to inspect the link i ## Basic usage ```ts -import { stat } from 'rush-fs' +import { stat } from '@rush-fs/core' const s = await stat('./package.json') console.log(s.size, s.isFile(), s.isDirectory()) diff --git a/docs/content/api/symlink.mdx b/docs/content/api/symlink.mdx index 59732ec..daf09d0 100644 --- a/docs/content/api/symlink.mdx +++ b/docs/content/api/symlink.mdx @@ -5,7 +5,7 @@ Create a symbolic link at `path` pointing to `target`. On Windows, `type` can be ## Basic usage ```ts -import { symlink } from 'rush-fs' +import { symlink } from '@rush-fs/core' await symlink('./target.txt', './link.txt') await symlink('./target-dir', './link-dir', 'dir') // Windows: directory symlink diff --git a/docs/content/api/truncate.mdx b/docs/content/api/truncate.mdx index 39f9a71..0db7512 100644 --- a/docs/content/api/truncate.mdx +++ b/docs/content/api/truncate.mdx @@ -5,7 +5,7 @@ Truncate or extend a file to the given length. If the file is longer, extra byte ## Basic usage ```ts -import { truncate } from 'rush-fs' +import { truncate } from '@rush-fs/core' await truncate('./file.txt', 100) // trim or extend to 100 bytes await truncate('./file.txt') // truncate to 0 diff --git a/docs/content/api/unlink.mdx b/docs/content/api/unlink.mdx index 9c09d8e..fababf3 100644 --- a/docs/content/api/unlink.mdx +++ b/docs/content/api/unlink.mdx @@ -5,7 +5,7 @@ Remove a file. Fails for directories; use `rm` with `recursive: true` for direct ## Basic usage ```ts -import { unlink } from 'rush-fs' +import { unlink } from '@rush-fs/core' await unlink('./temp.txt') ``` diff --git a/docs/content/api/utimes.mdx b/docs/content/api/utimes.mdx index 29b967d..cb70c00 100644 --- a/docs/content/api/utimes.mdx +++ b/docs/content/api/utimes.mdx @@ -5,7 +5,7 @@ Set the access and modification times of a file (atime, mtime). Accepts numbers ## Basic usage ```ts -import { utimes } from 'rush-fs' +import { utimes } from '@rush-fs/core' await utimes('./file.txt', atime, mtime) ``` diff --git a/docs/content/api/write-file.mdx b/docs/content/api/write-file.mdx index 792cf14..3a2c77a 100644 --- a/docs/content/api/write-file.mdx +++ b/docs/content/api/write-file.mdx @@ -5,7 +5,7 @@ Write data to a file, replacing the file if it exists. Supports encodings, `mode ## Basic usage ```ts -import { writeFile } from 'rush-fs' +import { writeFile } from '@rush-fs/core' await writeFile('./out.txt', 'hello world') await writeFile('./out.bin', buffer) diff --git a/docs/content/guide/quick-start.mdx b/docs/content/guide/quick-start.mdx index 9385f7c..955b801 100644 --- a/docs/content/guide/quick-start.mdx +++ b/docs/content/guide/quick-start.mdx @@ -3,17 +3,17 @@ ## Install ```bash -npm install rush-fs +npm install @rush-fs/core # or -pnpm add rush-fs +pnpm add @rush-fs/core ``` ## Use -Import the APIs you need from `rush-fs` — same names as `node:fs`: +Import the APIs you need from `@rush-fs/core` — same names as `node:fs`: ```ts -import { readdir, stat, readFile, writeFile, mkdir, rm } from 'rush-fs' +import { readdir, stat, readFile, writeFile, mkdir, rm } from '@rush-fs/core' // Read directory const files = await readdir('./src') diff --git a/docs/content/guide/what-is-rush-fs.mdx b/docs/content/guide/what-is-rush-fs.mdx index 09adf40..c21a952 100644 --- a/docs/content/guide/what-is-rush-fs.mdx +++ b/docs/content/guide/what-is-rush-fs.mdx @@ -17,7 +17,7 @@ For more detail and diagrams, see the [README — How it works](https://github.c ## Quick example ```ts -import { readdir, readFile, writeFile, rm } from 'rush-fs' +import { readdir, readFile, writeFile, rm } from '@rush-fs/core' const files = await readdir('./src', { recursive: true, withFileTypes: true }) const content = await readFile('./package.json', { encoding: 'utf8' }) diff --git a/docs/content/index.mdx b/docs/content/index.mdx index e0f9cd4..a36e0fd 100644 --- a/docs/content/index.mdx +++ b/docs/content/index.mdx @@ -11,7 +11,7 @@ API-aligned with Node.js `fs` for **painless drop-in replacement** in existing p ## Quick example ```ts -import { readdir, readFile, writeFile, rm } from 'rush-fs' +import { readdir, readFile, writeFile, rm } from '@rush-fs/core' const files = await readdir('./src', { recursive: true, withFileTypes: true }) const content = await readFile('./package.json', { encoding: 'utf8' }) @@ -30,4 +30,4 @@ await rm('./temp', { recursive: true, force: true }) ## Links - [GitHub](https://github.com/CoderSerio/rush-fs) -- [npm](https://www.npmjs.com/package/rush-fs) +- [npm](https://www.npmjs.com/package/@rush-fs/core) diff --git a/index.js b/index.js index 47a8c45..eb1a362 100644 --- a/index.js +++ b/index.js @@ -75,10 +75,10 @@ function requireNative() { loadErrors.push(e) } try { - const binding = require('rush-fs-android-arm64') - const bindingPackageVersion = require('rush-fs-android-arm64/package.json').version - if (bindingPackageVersion !== '0.0.5' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { - throw new Error(`Native binding package version mismatch, expected 0.0.5 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) + const binding = require('@rush-fs/core-android-arm64') + const bindingPackageVersion = require('@rush-fs/core-android-arm64/package.json').version + if (bindingPackageVersion !== '0.1.0-alpha.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { + throw new Error(`Native binding package version mismatch, expected 0.1.0-alpha.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) } return binding } catch (e) { @@ -91,10 +91,10 @@ function requireNative() { loadErrors.push(e) } try { - const binding = require('rush-fs-android-arm-eabi') - const bindingPackageVersion = require('rush-fs-android-arm-eabi/package.json').version - if (bindingPackageVersion !== '0.0.5' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { - throw new Error(`Native binding package version mismatch, expected 0.0.5 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) + const binding = require('@rush-fs/core-android-arm-eabi') + const bindingPackageVersion = require('@rush-fs/core-android-arm-eabi/package.json').version + if (bindingPackageVersion !== '0.1.0-alpha.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { + throw new Error(`Native binding package version mismatch, expected 0.1.0-alpha.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) } return binding } catch (e) { @@ -112,10 +112,10 @@ function requireNative() { loadErrors.push(e) } try { - const binding = require('rush-fs-win32-x64-gnu') - const bindingPackageVersion = require('rush-fs-win32-x64-gnu/package.json').version - if (bindingPackageVersion !== '0.0.5' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { - throw new Error(`Native binding package version mismatch, expected 0.0.5 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) + const binding = require('@rush-fs/core-win32-x64-gnu') + const bindingPackageVersion = require('@rush-fs/core-win32-x64-gnu/package.json').version + if (bindingPackageVersion !== '0.1.0-alpha.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { + throw new Error(`Native binding package version mismatch, expected 0.1.0-alpha.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) } return binding } catch (e) { @@ -128,10 +128,10 @@ function requireNative() { loadErrors.push(e) } try { - const binding = require('rush-fs-win32-x64-msvc') - const bindingPackageVersion = require('rush-fs-win32-x64-msvc/package.json').version - if (bindingPackageVersion !== '0.0.5' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { - throw new Error(`Native binding package version mismatch, expected 0.0.5 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) + const binding = require('@rush-fs/core-win32-x64-msvc') + const bindingPackageVersion = require('@rush-fs/core-win32-x64-msvc/package.json').version + if (bindingPackageVersion !== '0.1.0-alpha.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { + throw new Error(`Native binding package version mismatch, expected 0.1.0-alpha.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) } return binding } catch (e) { @@ -145,10 +145,10 @@ function requireNative() { loadErrors.push(e) } try { - const binding = require('rush-fs-win32-ia32-msvc') - const bindingPackageVersion = require('rush-fs-win32-ia32-msvc/package.json').version - if (bindingPackageVersion !== '0.0.5' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { - throw new Error(`Native binding package version mismatch, expected 0.0.5 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) + const binding = require('@rush-fs/core-win32-ia32-msvc') + const bindingPackageVersion = require('@rush-fs/core-win32-ia32-msvc/package.json').version + if (bindingPackageVersion !== '0.1.0-alpha.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { + throw new Error(`Native binding package version mismatch, expected 0.1.0-alpha.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) } return binding } catch (e) { @@ -161,10 +161,10 @@ function requireNative() { loadErrors.push(e) } try { - const binding = require('rush-fs-win32-arm64-msvc') - const bindingPackageVersion = require('rush-fs-win32-arm64-msvc/package.json').version - if (bindingPackageVersion !== '0.0.5' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { - throw new Error(`Native binding package version mismatch, expected 0.0.5 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) + const binding = require('@rush-fs/core-win32-arm64-msvc') + const bindingPackageVersion = require('@rush-fs/core-win32-arm64-msvc/package.json').version + if (bindingPackageVersion !== '0.1.0-alpha.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { + throw new Error(`Native binding package version mismatch, expected 0.1.0-alpha.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) } return binding } catch (e) { @@ -180,10 +180,10 @@ function requireNative() { loadErrors.push(e) } try { - const binding = require('rush-fs-darwin-universal') - const bindingPackageVersion = require('rush-fs-darwin-universal/package.json').version - if (bindingPackageVersion !== '0.0.5' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { - throw new Error(`Native binding package version mismatch, expected 0.0.5 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) + const binding = require('@rush-fs/core-darwin-universal') + const bindingPackageVersion = require('@rush-fs/core-darwin-universal/package.json').version + if (bindingPackageVersion !== '0.1.0-alpha.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { + throw new Error(`Native binding package version mismatch, expected 0.1.0-alpha.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) } return binding } catch (e) { @@ -196,10 +196,10 @@ function requireNative() { loadErrors.push(e) } try { - const binding = require('rush-fs-darwin-x64') - const bindingPackageVersion = require('rush-fs-darwin-x64/package.json').version - if (bindingPackageVersion !== '0.0.5' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { - throw new Error(`Native binding package version mismatch, expected 0.0.5 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) + const binding = require('@rush-fs/core-darwin-x64') + const bindingPackageVersion = require('@rush-fs/core-darwin-x64/package.json').version + if (bindingPackageVersion !== '0.1.0-alpha.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { + throw new Error(`Native binding package version mismatch, expected 0.1.0-alpha.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) } return binding } catch (e) { @@ -212,10 +212,10 @@ function requireNative() { loadErrors.push(e) } try { - const binding = require('rush-fs-darwin-arm64') - const bindingPackageVersion = require('rush-fs-darwin-arm64/package.json').version - if (bindingPackageVersion !== '0.0.5' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { - throw new Error(`Native binding package version mismatch, expected 0.0.5 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) + const binding = require('@rush-fs/core-darwin-arm64') + const bindingPackageVersion = require('@rush-fs/core-darwin-arm64/package.json').version + if (bindingPackageVersion !== '0.1.0-alpha.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { + throw new Error(`Native binding package version mismatch, expected 0.1.0-alpha.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) } return binding } catch (e) { @@ -232,10 +232,10 @@ function requireNative() { loadErrors.push(e) } try { - const binding = require('rush-fs-freebsd-x64') - const bindingPackageVersion = require('rush-fs-freebsd-x64/package.json').version - if (bindingPackageVersion !== '0.0.5' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { - throw new Error(`Native binding package version mismatch, expected 0.0.5 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) + const binding = require('@rush-fs/core-freebsd-x64') + const bindingPackageVersion = require('@rush-fs/core-freebsd-x64/package.json').version + if (bindingPackageVersion !== '0.1.0-alpha.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { + throw new Error(`Native binding package version mismatch, expected 0.1.0-alpha.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) } return binding } catch (e) { @@ -248,10 +248,10 @@ function requireNative() { loadErrors.push(e) } try { - const binding = require('rush-fs-freebsd-arm64') - const bindingPackageVersion = require('rush-fs-freebsd-arm64/package.json').version - if (bindingPackageVersion !== '0.0.5' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { - throw new Error(`Native binding package version mismatch, expected 0.0.5 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) + const binding = require('@rush-fs/core-freebsd-arm64') + const bindingPackageVersion = require('@rush-fs/core-freebsd-arm64/package.json').version + if (bindingPackageVersion !== '0.1.0-alpha.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { + throw new Error(`Native binding package version mismatch, expected 0.1.0-alpha.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) } return binding } catch (e) { @@ -269,10 +269,10 @@ function requireNative() { loadErrors.push(e) } try { - const binding = require('rush-fs-linux-x64-musl') - const bindingPackageVersion = require('rush-fs-linux-x64-musl/package.json').version - if (bindingPackageVersion !== '0.0.5' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { - throw new Error(`Native binding package version mismatch, expected 0.0.5 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) + const binding = require('@rush-fs/core-linux-x64-musl') + const bindingPackageVersion = require('@rush-fs/core-linux-x64-musl/package.json').version + if (bindingPackageVersion !== '0.1.0-alpha.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { + throw new Error(`Native binding package version mismatch, expected 0.1.0-alpha.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) } return binding } catch (e) { @@ -285,10 +285,10 @@ function requireNative() { loadErrors.push(e) } try { - const binding = require('rush-fs-linux-x64-gnu') - const bindingPackageVersion = require('rush-fs-linux-x64-gnu/package.json').version - if (bindingPackageVersion !== '0.0.5' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { - throw new Error(`Native binding package version mismatch, expected 0.0.5 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) + const binding = require('@rush-fs/core-linux-x64-gnu') + const bindingPackageVersion = require('@rush-fs/core-linux-x64-gnu/package.json').version + if (bindingPackageVersion !== '0.1.0-alpha.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { + throw new Error(`Native binding package version mismatch, expected 0.1.0-alpha.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) } return binding } catch (e) { @@ -303,10 +303,10 @@ function requireNative() { loadErrors.push(e) } try { - const binding = require('rush-fs-linux-arm64-musl') - const bindingPackageVersion = require('rush-fs-linux-arm64-musl/package.json').version - if (bindingPackageVersion !== '0.0.5' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { - throw new Error(`Native binding package version mismatch, expected 0.0.5 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) + const binding = require('@rush-fs/core-linux-arm64-musl') + const bindingPackageVersion = require('@rush-fs/core-linux-arm64-musl/package.json').version + if (bindingPackageVersion !== '0.1.0-alpha.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { + throw new Error(`Native binding package version mismatch, expected 0.1.0-alpha.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) } return binding } catch (e) { @@ -319,10 +319,10 @@ function requireNative() { loadErrors.push(e) } try { - const binding = require('rush-fs-linux-arm64-gnu') - const bindingPackageVersion = require('rush-fs-linux-arm64-gnu/package.json').version - if (bindingPackageVersion !== '0.0.5' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { - throw new Error(`Native binding package version mismatch, expected 0.0.5 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) + const binding = require('@rush-fs/core-linux-arm64-gnu') + const bindingPackageVersion = require('@rush-fs/core-linux-arm64-gnu/package.json').version + if (bindingPackageVersion !== '0.1.0-alpha.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { + throw new Error(`Native binding package version mismatch, expected 0.1.0-alpha.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) } return binding } catch (e) { @@ -337,10 +337,10 @@ function requireNative() { loadErrors.push(e) } try { - const binding = require('rush-fs-linux-arm-musleabihf') - const bindingPackageVersion = require('rush-fs-linux-arm-musleabihf/package.json').version - if (bindingPackageVersion !== '0.0.5' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { - throw new Error(`Native binding package version mismatch, expected 0.0.5 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) + const binding = require('@rush-fs/core-linux-arm-musleabihf') + const bindingPackageVersion = require('@rush-fs/core-linux-arm-musleabihf/package.json').version + if (bindingPackageVersion !== '0.1.0-alpha.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { + throw new Error(`Native binding package version mismatch, expected 0.1.0-alpha.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) } return binding } catch (e) { @@ -353,10 +353,10 @@ function requireNative() { loadErrors.push(e) } try { - const binding = require('rush-fs-linux-arm-gnueabihf') - const bindingPackageVersion = require('rush-fs-linux-arm-gnueabihf/package.json').version - if (bindingPackageVersion !== '0.0.5' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { - throw new Error(`Native binding package version mismatch, expected 0.0.5 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) + const binding = require('@rush-fs/core-linux-arm-gnueabihf') + const bindingPackageVersion = require('@rush-fs/core-linux-arm-gnueabihf/package.json').version + if (bindingPackageVersion !== '0.1.0-alpha.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { + throw new Error(`Native binding package version mismatch, expected 0.1.0-alpha.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) } return binding } catch (e) { @@ -371,10 +371,10 @@ function requireNative() { loadErrors.push(e) } try { - const binding = require('rush-fs-linux-loong64-musl') - const bindingPackageVersion = require('rush-fs-linux-loong64-musl/package.json').version - if (bindingPackageVersion !== '0.0.5' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { - throw new Error(`Native binding package version mismatch, expected 0.0.5 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) + const binding = require('@rush-fs/core-linux-loong64-musl') + const bindingPackageVersion = require('@rush-fs/core-linux-loong64-musl/package.json').version + if (bindingPackageVersion !== '0.1.0-alpha.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { + throw new Error(`Native binding package version mismatch, expected 0.1.0-alpha.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) } return binding } catch (e) { @@ -387,10 +387,10 @@ function requireNative() { loadErrors.push(e) } try { - const binding = require('rush-fs-linux-loong64-gnu') - const bindingPackageVersion = require('rush-fs-linux-loong64-gnu/package.json').version - if (bindingPackageVersion !== '0.0.5' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { - throw new Error(`Native binding package version mismatch, expected 0.0.5 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) + const binding = require('@rush-fs/core-linux-loong64-gnu') + const bindingPackageVersion = require('@rush-fs/core-linux-loong64-gnu/package.json').version + if (bindingPackageVersion !== '0.1.0-alpha.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { + throw new Error(`Native binding package version mismatch, expected 0.1.0-alpha.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) } return binding } catch (e) { @@ -405,10 +405,10 @@ function requireNative() { loadErrors.push(e) } try { - const binding = require('rush-fs-linux-riscv64-musl') - const bindingPackageVersion = require('rush-fs-linux-riscv64-musl/package.json').version - if (bindingPackageVersion !== '0.0.5' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { - throw new Error(`Native binding package version mismatch, expected 0.0.5 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) + const binding = require('@rush-fs/core-linux-riscv64-musl') + const bindingPackageVersion = require('@rush-fs/core-linux-riscv64-musl/package.json').version + if (bindingPackageVersion !== '0.1.0-alpha.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { + throw new Error(`Native binding package version mismatch, expected 0.1.0-alpha.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) } return binding } catch (e) { @@ -421,10 +421,10 @@ function requireNative() { loadErrors.push(e) } try { - const binding = require('rush-fs-linux-riscv64-gnu') - const bindingPackageVersion = require('rush-fs-linux-riscv64-gnu/package.json').version - if (bindingPackageVersion !== '0.0.5' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { - throw new Error(`Native binding package version mismatch, expected 0.0.5 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) + const binding = require('@rush-fs/core-linux-riscv64-gnu') + const bindingPackageVersion = require('@rush-fs/core-linux-riscv64-gnu/package.json').version + if (bindingPackageVersion !== '0.1.0-alpha.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { + throw new Error(`Native binding package version mismatch, expected 0.1.0-alpha.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) } return binding } catch (e) { @@ -438,10 +438,10 @@ function requireNative() { loadErrors.push(e) } try { - const binding = require('rush-fs-linux-ppc64-gnu') - const bindingPackageVersion = require('rush-fs-linux-ppc64-gnu/package.json').version - if (bindingPackageVersion !== '0.0.5' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { - throw new Error(`Native binding package version mismatch, expected 0.0.5 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) + const binding = require('@rush-fs/core-linux-ppc64-gnu') + const bindingPackageVersion = require('@rush-fs/core-linux-ppc64-gnu/package.json').version + if (bindingPackageVersion !== '0.1.0-alpha.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { + throw new Error(`Native binding package version mismatch, expected 0.1.0-alpha.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) } return binding } catch (e) { @@ -454,10 +454,10 @@ function requireNative() { loadErrors.push(e) } try { - const binding = require('rush-fs-linux-s390x-gnu') - const bindingPackageVersion = require('rush-fs-linux-s390x-gnu/package.json').version - if (bindingPackageVersion !== '0.0.5' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { - throw new Error(`Native binding package version mismatch, expected 0.0.5 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) + const binding = require('@rush-fs/core-linux-s390x-gnu') + const bindingPackageVersion = require('@rush-fs/core-linux-s390x-gnu/package.json').version + if (bindingPackageVersion !== '0.1.0-alpha.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { + throw new Error(`Native binding package version mismatch, expected 0.1.0-alpha.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) } return binding } catch (e) { @@ -474,10 +474,10 @@ function requireNative() { loadErrors.push(e) } try { - const binding = require('rush-fs-openharmony-arm64') - const bindingPackageVersion = require('rush-fs-openharmony-arm64/package.json').version - if (bindingPackageVersion !== '0.0.5' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { - throw new Error(`Native binding package version mismatch, expected 0.0.5 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) + const binding = require('@rush-fs/core-openharmony-arm64') + const bindingPackageVersion = require('@rush-fs/core-openharmony-arm64/package.json').version + if (bindingPackageVersion !== '0.1.0-alpha.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { + throw new Error(`Native binding package version mismatch, expected 0.1.0-alpha.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) } return binding } catch (e) { @@ -490,10 +490,10 @@ function requireNative() { loadErrors.push(e) } try { - const binding = require('rush-fs-openharmony-x64') - const bindingPackageVersion = require('rush-fs-openharmony-x64/package.json').version - if (bindingPackageVersion !== '0.0.5' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { - throw new Error(`Native binding package version mismatch, expected 0.0.5 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) + const binding = require('@rush-fs/core-openharmony-x64') + const bindingPackageVersion = require('@rush-fs/core-openharmony-x64/package.json').version + if (bindingPackageVersion !== '0.1.0-alpha.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { + throw new Error(`Native binding package version mismatch, expected 0.1.0-alpha.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) } return binding } catch (e) { @@ -506,10 +506,10 @@ function requireNative() { loadErrors.push(e) } try { - const binding = require('rush-fs-openharmony-arm') - const bindingPackageVersion = require('rush-fs-openharmony-arm/package.json').version - if (bindingPackageVersion !== '0.0.5' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { - throw new Error(`Native binding package version mismatch, expected 0.0.5 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) + const binding = require('@rush-fs/core-openharmony-arm') + const bindingPackageVersion = require('@rush-fs/core-openharmony-arm/package.json').version + if (bindingPackageVersion !== '0.1.0-alpha.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { + throw new Error(`Native binding package version mismatch, expected 0.1.0-alpha.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) } return binding } catch (e) { @@ -538,7 +538,7 @@ if (!nativeBinding || process.env.NAPI_RS_FORCE_WASI) { } if (!nativeBinding || process.env.NAPI_RS_FORCE_WASI) { try { - wasiBinding = require('rush-fs-wasm32-wasi') + wasiBinding = require('@rush-fs/core-wasm32-wasi') nativeBinding = wasiBinding } catch (err) { if (process.env.NAPI_RS_FORCE_WASI) { diff --git a/package.json b/package.json index a57c71f..3b38e57 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { - "name": "rush-fs", - "version": "0.0.5", + "name": "@rush-fs/core", + "version": "0.1.0-alpha.0", "description": "High-performance drop-in replacement for Node.js fs module, powered by Rust", "main": "index.js", "repository": { From 759d53a9d5e58713c00bc118963765e6da681151 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carbon=20=E7=A2=B3=E8=8B=AF?=1024,C&&(t.dump&&W2===t.dump.charCodeAt(0)?S+="?":S+="? "),S+=t.dump,C&&(S+=e_(t,e)),Td(t,e+1,E,!0,C)&&(t.dump&&W2===t.dump.charCodeAt(0)?S+=":":S+=": ",S+=t.dump,a+=S));t.tag=n,t.dump=a||"{}"}function zte(t,e,r){var s,a,n,c,f,p;for(a=r?t.explicitTypes:t.implicitTypes,n=0,c=a.length;n {var n,c;if(Object.getPrototypeOf(s).toString()==="[object Set]")if(typeof a?.coercions<"u"){if(typeof a?.coercion>"u")return mr(a,"Unbound coercion result");let f=[...s],p=[...s];if(!r(p,Object.assign(Object.assign({},a),{coercion:void 0})))return!1;let h=()=>p.some((E,C)=>E!==f[C])?new Set(p):s;return a.coercions.push([(n=a.p)!==null&&n!==void 0?n:".",X2(a.coercion,s,h)]),!0}else{let f=!0;for(let p of s)if(f=t(p,Object.assign({},a))&&f,!f&&a?.errors==null)break;return f}if(typeof a?.coercions<"u"){if(typeof a?.coercion>"u")return mr(a,"Unbound coercion result");let f={value:s};return r(s,Object.assign(Object.assign({},a),{coercion:Wf(f,"value")}))?(a.coercions.push([(c=a.p)!==null&&c!==void 0?c:".",X2(a.coercion,s,()=>new Set(f.value))]),!0):!1}return mr(a,`Expected a set (got ${ti(s)})`)}})}function MWe(t,e){let r=Tx(Rx([t,e])),s=Fx(e,{keys:t});return Wr({test:(a,n)=>{var c,f,p;if(Object.getPrototypeOf(a).toString()==="[object Map]")if(typeof n?.coercions<"u"){if(typeof n?.coercion>"u")return mr(n,"Unbound coercion result");let h=[...a],E=[...a];if(!r(E,Object.assign(Object.assign({},n),{coercion:void 0})))return!1;let C=()=>E.some((S,P)=>S[0]!==h[P][0]||S[1]!==h[P][1])?new Map(E):a;return n.coercions.push([(c=n.p)!==null&&c!==void 0?c:".",X2(n.coercion,a,C)]),!0}else{let h=!0;for(let[E,C]of a)if(h=t(E,Object.assign({},n))&&h,!h&&n?.errors==null||(h=e(C,Object.assign(Object.assign({},n),{p:s0(n,E)}))&&h,!h&&n?.errors==null))break;return h}if(typeof n?.coercions<"u"){if(typeof n?.coercion>"u")return mr(n,"Unbound coercion result");let h={value:a};return Array.isArray(a)?r(a,Object.assign(Object.assign({},n),{coercion:void 0}))?(n.coercions.push([(f=n.p)!==null&&f!==void 0?f:".",X2(n.coercion,a,()=>new Map(h.value))]),!0):!1:s(a,Object.assign(Object.assign({},n),{coercion:Wf(h,"value")}))?(n.coercions.push([(p=n.p)!==null&&p!==void 0?p:".",X2(n.coercion,a,()=>new Map(Object.entries(h.value)))]),!0):!1}return mr(n,`Expected a map (got ${ti(a)})`)}})}function Rx(t,{delimiter:e}={}){let r=Ore(t.length);return Wr({test:(s,a)=>{var n;if(typeof s=="string"&&typeof e<"u"&&typeof a?.coercions<"u"){if(typeof a?.coercion>"u")return mr(a,"Unbound coercion result");s=s.split(e),a.coercions.push([(n=a.p)!==null&&n!==void 0?n:".",a.coercion.bind(null,s)])}if(!Array.isArray(s))return mr(a,`Expected a tuple (got ${ti(s)})`);let c=r(s,Object.assign({},a));for(let f=0,p=s.length;f {var n;if(Array.isArray(s)&&typeof a?.coercions<"u")return typeof a?.coercion>"u"?mr(a,"Unbound coercion result"):r(s,Object.assign(Object.assign({},a),{coercion:void 0}))?(s=Object.fromEntries(s),a.coercions.push([(n=a.p)!==null&&n!==void 0?n:".",a.coercion.bind(null,s)]),!0):!1;if(typeof s!="object"||s===null)return mr(a,`Expected an object (got ${ti(s)})`);let c=Object.keys(s),f=!0;for(let p=0,h=c.length;p `:`[${P}]`)}s.push(...this.arity.leading.map(c=>`<${c}>`)),this.arity.extra===Hl?s.push("..."):s.push(...this.arity.extra.map(c=>`[${c}]`)),s.push(...this.arity.trailing.map(c=>`<${c}>`))}return{usage:s.join(" "),options:a}}compile(){if(typeof this.context>"u")throw new Error("Assertion failed: No context attached");let e=Mre(),r=En.InitialNode,s=this.usage().usage,a=this.options.filter(f=>f.required).map(f=>f.nameSet);r=Ou(e,_l()),Ia(e,En.InitialNode,ei.StartOfInput,r,["setCandidateState",{candidateUsage:s,requiredOptions:a}]);let n=this.arity.proxy?"always":"isNotOptionLike",c=this.paths.length>0?this.paths:[[]];for(let f of c){let p=r;if(f.length>0){let S=Ou(e,_l());BE(e,p,S),this.registerOptions(e,S),p=S}for(let S=0;S1)r=e;else if(this.head)s=this.head.next,r=this.head.value;else throw new TypeError("Reduce of empty list with no initial value");for(var a=0;s!==null;a++)r=t(r,s.value,a),s=s.next;return r};Fn.prototype.reduceReverse=function(t,e){var r,s=this.tail;if(arguments.length>1)r=e;else if(this.tail)s=this.tail.prev,r=this.tail.value;else throw new TypeError("Reduce of empty list with no initial value");for(var a=this.length-1;s!==null;a--)r=t(r,s.value,a),s=s.prev;return r};Fn.prototype.toArray=function(){for(var t=new Array(this.length),e=0,r=this.head;r!==null;e++)t[e]=r.value,r=r.next;return t};Fn.prototype.toArrayReverse=function(){for(var t=new Array(this.length),e=0,r=this.tail;r!==null;e++)t[e]=r.value,r=r.prev;return t};Fn.prototype.slice=function(t,e){e=e||this.length,e<0&&(e+=this.length),t=t||0,t<0&&(t+=this.length);var r=new Fn;if(e0&&(Ae=p.slice(0,E),p=p.slice(E),C-=E),ye&&I===!0&&C>0?(ye=p.slice(0,C),se=p.slice(C)):I===!0?(ye="",se=p):ye=p,ye&&ye!==""&&ye!=="/"&&ye!==p&&Goe(ye.charCodeAt(ye.length-1))&&(ye=ye.slice(0,-1)),r.unescape===!0&&(se&&(se=_oe.removeBackslashes(se)),ye&&W===!0&&(ye=_oe.removeBackslashes(ye)));let Z={prefix:Ae,input:t,start:E,base:ye,glob:se,isBrace:S,isBracket:P,isGlob:I,isExtglob:R,isGlobstar:N,negated:ee,negatedExtglob:ie};if(r.tokens===!0&&(Z.maxDepth=0,Goe(pe)||c.push(Be),Z.tokens=c),r.parts===!0||r.tokens===!0){let De;for(let Re=0;Re("lookup"in r||(r.lookup=this.lookup),e[pI](r,s))}uninstall(e){if(Oue(e),e[pI]){if(e[iH]!==this)throw new Error("The agent is not owned by this CacheableLookup instance");e.createConnection=e[pI],delete e[pI],delete e[iH]}}updateInterfaceInfo(){let{_iface:e}=this;this._iface=Lue(),(e.has4&&!this._iface.has4||e.has6&&!this._iface.has6)&&this._cache.clear()}clear(e){if(e){this._cache.delete(e);return}this._cache.clear()}};sH.exports=HQ;sH.exports.default=HQ});var Gue=_((BMt,oH)=>{"use strict";var _et=typeof URL>"u"?Ie("url").URL:URL,Het="text/plain",jet="us-ascii",Hue=(t,e)=>e.some(r=>r instanceof RegExp?r.test(t):r===t),Get=(t,{stripHash:e})=>{let r=t.match(/^data:([^,]*?),([^#]*?)(?:#(.*))?$/);if(!r)throw new Error(`Invalid URL: ${t}`);let s=r[1].split(";"),a=r[2],n=e?"":r[3],c=!1;s[s.length-1]==="base64"&&(s.pop(),c=!0);let f=(s.shift()||"").toLowerCase(),h=[...s.map(E=>{let[C,S=""]=E.split("=").map(P=>P.trim());return C==="charset"&&(S=S.toLowerCase(),S===jet)?"":`${C}${S?`=${S}`:""}`}).filter(Boolean)];return c&&h.push("base64"),(h.length!==0||f&&f!==Het)&&h.unshift(f),`data:${h.join(";")},${c?a.trim():a}${n?`#${n}`:""}`},jue=(t,e)=>{if(e={defaultProtocol:"http:",normalizeProtocol:!0,forceHttp:!1,forceHttps:!1,stripAuthentication:!0,stripHash:!1,stripWWW:!0,removeQueryParameters:[/^utm_\w+/i],removeTrailingSlash:!0,removeDirectoryIndex:!1,sortQueryParameters:!0,...e},Reflect.has(e,"normalizeHttps"))throw new Error("options.normalizeHttps is renamed to options.forceHttp");if(Reflect.has(e,"normalizeHttp"))throw new Error("options.normalizeHttp is renamed to options.forceHttps");if(Reflect.has(e,"stripFragment"))throw new Error("options.stripFragment is renamed to options.stripHash");if(t=t.trim(),/^data:/i.test(t))return Get(t,e);let r=t.startsWith("//");!r&&/^\.*\//.test(t)||(t=t.replace(/^(?!(?:\w+:)?\/\/)|^\/\//,e.defaultProtocol));let a=new _et(t);if(e.forceHttp&&e.forceHttps)throw new Error("The `forceHttp` and `forceHttps` options cannot be used together");if(e.forceHttp&&a.protocol==="https:"&&(a.protocol="http:"),e.forceHttps&&a.protocol==="http:"&&(a.protocol="https:"),e.stripAuthentication&&(a.username="",a.password=""),e.stripHash&&(a.hash=""),a.pathname&&(a.pathname=a.pathname.replace(/((?!:).|^)\/{2,}/g,(n,c)=>/^(?!\/)/g.test(c)?`${c}/`:"/")),a.pathname&&(a.pathname=decodeURI(a.pathname)),e.removeDirectoryIndex===!0&&(e.removeDirectoryIndex=[/^index\.[a-z]+$/]),Array.isArray(e.removeDirectoryIndex)&&e.removeDirectoryIndex.length>0){let n=a.pathname.split("/"),c=n[n.length-1];Hue(c,e.removeDirectoryIndex)&&(n=n.slice(0,n.length-1),a.pathname=n.slice(1).join("/")+"/")}if(a.hostname&&(a.hostname=a.hostname.replace(/\.$/,""),e.stripWWW&&/^www\.([a-z\-\d]{2,63})\.([a-z.]{2,5})$/.test(a.hostname)&&(a.hostname=a.hostname.replace(/^www\./,""))),Array.isArray(e.removeQueryParameters))for(let n of[...a.searchParams.keys()])Hue(n,e.removeQueryParameters)&&a.searchParams.delete(n);return e.sortQueryParameters&&a.searchParams.sort(),e.removeTrailingSlash&&(a.pathname=a.pathname.replace(/\/$/,"")),t=a.toString(),(e.removeTrailingSlash||a.pathname==="/")&&a.hash===""&&(t=t.replace(/\/$/,"")),r&&!e.normalizeProtocol&&(t=t.replace(/^http:\/\//,"//")),e.stripProtocol&&(t=t.replace(/^(?:https?:)?\/\//,"")),t};oH.exports=jue;oH.exports.default=jue});var Yue=_((vMt,Wue)=>{Wue.exports=que;function que(t,e){if(t&&e)return que(t)(e);if(typeof t!="function")throw new TypeError("need wrapper function");return Object.keys(t).forEach(function(s){r[s]=t[s]}),r;function r(){for(var s=new Array(arguments.length),a=0;a{"use strict";var Ist=DI(),I0e=vR(),qI=Ie("fs"),Cst=GI(),E0e=Ie("path"),aG=FI();w0e.exports=(t,e,r)=>{typeof t=="function"?(r=t,e=null,t={}):Array.isArray(t)&&(e=t,t={}),typeof e=="function"&&(r=e,e=null),e?e=Array.from(e):e=[];let s=Ist(t);if(s.sync&&typeof r=="function")throw new TypeError("callback not supported for sync tar functions");if(!s.file&&typeof r=="function")throw new TypeError("callback only supported with file option");return e.length&&Bst(s,e),s.noResume||wst(s),s.file&&s.sync?vst(s):s.file?Sst(s,r):C0e(s)};var wst=t=>{let e=t.onentry;t.onentry=e?r=>{e(r),r.resume()}:r=>r.resume()},Bst=(t,e)=>{let r=new Map(e.map(n=>[aG(n),!0])),s=t.filter,a=(n,c)=>{let f=c||E0e.parse(n).root||".",p=n===f?!1:r.has(n)?r.get(n):a(E0e.dirname(n),f);return r.set(n,p),p};t.filter=s?(n,c)=>s(n,c)&&a(aG(n)):n=>a(aG(n))},vst=t=>{let e=C0e(t),r=t.file,s=!0,a;try{let n=qI.statSync(r),c=t.maxReadSize||16*1024*1024;if(n.size