Skip to content

Commit a4f5e6c

Browse files
committed
doc: πŸ“š add the project status and roadmap into README.md
1 parent b2a79ec commit a4f5e6c

File tree

2 files changed

+145
-46
lines changed

2 files changed

+145
-46
lines changed

β€ŽPR_TEMPLATE.mdβ€Ž

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
## Description
2+
3+
This PR optimizes/implements....
4+
5+
## Changes
6+
7+
- **Feature 1**:
8+
- Desc1...
9+
- Desc2...
10+
11+
- **Feature 2**:
12+
- Desc1...
13+
- Desc2...
14+
15+
## Benchmarks
16+
17+
_(Benchmarks show that...)_
18+
19+
## Checklist
20+
21+
- [ ] Code compiles and passes linter (`cargo check`, `npm run lint`)
22+
- [ ] Added/Updated tests in `__test__/xxx.spec.ts`
23+
- [ ] Verified performance improvements with `benchmark/xxx.ts`
24+
- [ ] Updated type definitions

β€ŽREADME.mdβ€Ž

Lines changed: 121 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -1,83 +1,158 @@
11
# Hyper-FS
22

3-
# Development
3+
<p align="center">
4+
<img src="https://img.shields.io/badge/Written%20in-Rust-orange?style=flat-square" alt="Written in Rust">
5+
<img src="https://img.shields.io/npm/v/hyper-fs?style=flat-square" alt="NPM Version">
6+
<img src="https://img.shields.io/npm/l/hyper-fs?style=flat-square" alt="License">
7+
</p>
48

5-
1. Run `pnpm install` to install dependencies.
6-
2. Edit files in `/src`
7-
3. Run `pnpm build` to build the lib could be invoked by Node.js
8-
4. Run `pnpm test` to check if everything is ok
9+
<p align="center">
10+
A high-performance, drop-in replacement for Node.js <code>fs</code> module, powered by Rust.
11+
</p>
912

10-
## Install this test package
13+
## Installation (⚠️ Not Ready Yet)
1114

1215
```bash
13-
yarn add @napi-rs/package-template
16+
npm install hyper-fs
17+
# or
18+
pnpm add hyper-fs
1419
```
1520

16-
## Ability
21+
## Status & Roadmap
1722

18-
### Build
23+
We are rewriting `fs` APIs one by one.
1924

20-
After `yarn build/npm run build` command, you can see `package-template.[darwin|win32|linux].node` file in project root. This is the native addon built from [lib.rs](./src/lib.rs).
25+
> **Legend**
26+
>
27+
> - βœ…: Fully Supported
28+
> - 🚧: Partially Supported / WIP
29+
> - ✨:New feature from hyper-fs
30+
> - ❌: Not Supported Yet
2131
22-
### Test
32+
### `readdir`
2333

24-
With [ava](https://github.com/avajs/ava), run `yarn test/npm run test` to testing native addon. You can also switch to another testing framework if you want.
34+
- **Node.js Arguments**:
35+
```ts
36+
path: string; // βœ…
37+
options?: {
38+
encoding?: string; // ❌
39+
withFileTypes?: boolean; // βœ…
40+
recursive?: boolean; // βœ…
41+
};
42+
```
43+
- **Return Type Diff**: `Buffer` return not supported yet.
44+
- **Performance**: TBD
45+
- **Supported Version**: TBD
46+
- **Notes**:
47+
- ✨ Supports `options.concurrency` to control parallelism.
2548

26-
### CI
49+
### `readFile`
2750

28-
With GitHub Actions, each commit and pull request will be built and tested automatically in [`node@20`, `@node22`] x [`macOS`, `Linux`, `Windows`] matrix. You will never be afraid of the native addon broken in these platforms.
51+
- **Status**: ❌
2952

30-
### Release
53+
### `writeFile`
3154

32-
Release native package is very difficult in old days. Native packages may ask developers who use it to install `build toolchain` like `gcc/llvm`, `node-gyp` or something more.
55+
- **Status**: ❌
3356

34-
With `GitHub actions`, we can easily prebuild a `binary` for major platforms. And with `N-API`, we should never be afraid of **ABI Compatible**.
57+
### `copyFile`
3558

36-
The other problem is how to deliver prebuild `binary` to users. Downloading it in `postinstall` script is a common way that most packages do it right now. The problem with this solution is it introduced many other packages to download binary that has not been used by `runtime codes`. The other problem is some users may not easily download the binary from `GitHub/CDN` if they are behind a private network (But in most cases, they have a private NPM mirror).
59+
- **Status**: ❌
3760

38-
In this package, we choose a better way to solve this problem. We release different `npm packages` for different platforms. And add it to `optionalDependencies` before releasing the `Major` package to npm.
61+
### `mkdir`
3962

40-
`NPM` will choose which native package should download from `registry` automatically. You can see [npm](./npm) dir for details. And you can also run `yarn add @napi-rs/package-template` to see how it works.
63+
- **Status**: ❌
4164

42-
## Develop requirements
65+
### `rm`
4366

44-
- Install the latest `Rust`
45-
- Install `Node.js@10+` which fully supported `Node-API`
46-
- Install `yarn@1.x`
67+
- **Status**: ❌
4768

48-
## Test in local
69+
### `rmdir`
4970

50-
- yarn
51-
- yarn build
52-
- yarn test
71+
- **Status**: ❌
5372

54-
And you will see:
73+
### `stat`
5574

56-
```bash
57-
$ ava --verbose
75+
- **Status**: ❌
5876

59-
βœ” sync function from native code
60-
βœ” sleep function from native code (201ms)
61-
─
77+
### `lstat`
6278

63-
2 tests passed
64-
✨ Done in 1.12s.
65-
```
79+
- **Status**: ❌
6680

67-
## Release package
81+
### `fstat`
6882

69-
Ensure you have set your **NPM_TOKEN** in the `GitHub` project setting.
83+
- **Status**: ❌
7084

71-
In `Settings -> Secrets`, add **NPM_TOKEN** into it.
85+
### `access`
7286

73-
When you want to release the package:
87+
- **Status**: ❌
7488

75-
```bash
76-
npm version [<newversion> | major | minor | patch | premajor | preminor | prepatch | prerelease [--preid=<prerelease-id>] | from-git]
89+
### `open`
90+
91+
- **Status**: ❌
92+
93+
### `opendir`
94+
95+
- **Status**: ❌
96+
97+
### `close`
98+
99+
- **Status**: ❌
100+
101+
### `unlink`
102+
103+
- **Status**: ❌
104+
105+
### `rename`
106+
107+
- **Status**: ❌
108+
109+
### `readlink`
110+
111+
- **Status**: ❌
112+
113+
### `realpath`
114+
115+
- **Status**: ❌
116+
117+
### `chmod`
118+
119+
- **Status**: ❌
120+
121+
### `chown`
122+
123+
- **Status**: ❌
124+
125+
### `utimes`
126+
127+
- **Status**: ❌
128+
129+
### `truncate`
130+
131+
- **Status**: ❌
132+
133+
### `appendFile`
134+
135+
- **Status**: ❌
136+
137+
### `watch`
138+
139+
- **Status**: ❌
140+
141+
## Usage
142+
143+
```ts
144+
import { readdir } from 'hyper-fs'
145+
146+
// Basic usage
147+
const files = await readdir('./src')
77148

78-
git push
149+
// Recursive with file types
150+
const entries = await readdir('./src', {
151+
recursive: true,
152+
withFileTypes: true,
153+
})
79154
```
80155

81-
GitHub actions will do the rest job for you.
156+
## License
82157

83-
> WARN: Don't run `npm publish` manually.
158+
MIT

0 commit comments

Comments
Β (0)