-
Notifications
You must be signed in to change notification settings - Fork 0
feat: add cargo fmt check command to package.json #6
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
Changes from 4 commits
c86b597
2c0214d
b15e90d
d0aca4b
44ac7e3
15cb2c8
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -45,35 +45,35 @@ export declare class Stats { | |||||||||||||||||||||||||||||||||
| get birthtime(): Date | ||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| export declare function access(path: string, mode?: number | undefined | null): Promise<void> | ||||||||||||||||||||||||||||||||||
| export declare function access(path: string, mode?: number | undefined | null): Promise<unknown> | ||||||||||||||||||||||||||||||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chain🏁 Script executed: # First, explore the repository structure to understand the project layout
find . -type f -name "*.rs" -o -name "*.toml" -o -name "*.d.ts" | head -20
echo "---"
ls -laRepository: CoderSerio/hyper-fs Length of output: 2295 🏁 Script executed: # Check the index.d.ts file to confirm the Promise<unknown> issue
head -250 index.d.ts | tail -200Repository: CoderSerio/hyper-fs Length of output: 6578 🏁 Script executed: # Look for Rust source files with NAPI annotations
fd -e rs . | head -20Repository: CoderSerio/hyper-fs Length of output: 328 🏁 Script executed: # Check the Rust lib.rs to see how async functions are defined and annotated
cat -n src/lib.rsRepository: CoderSerio/hyper-fs Length of output: 1305 🏁 Script executed: # Look at a few specific async function implementations to check their return types
echo "=== src/exists.rs ===" && cat src/exists.rs
echo -e "\n=== src/stat.rs ===" && cat src/stat.rs
echo -e "\n=== src/read_file.rs ===" && cat src/read_file.rsRepository: CoderSerio/hyper-fs Length of output: 9227 🏁 Script executed: # Check Cargo.toml to see NAPI-RS version and configuration
cat Cargo.tomlRepository: CoderSerio/hyper-fs Length of output: 629 🏁 Script executed: # Check the build.rs to see if there's any custom NAPI-RS configuration
cat build.rsRepository: CoderSerio/hyper-fs Length of output: 99 🏁 Script executed: # Verify the JSDoc placement concern by looking at the exact structure around readdir
sed -n '130,155p' index.d.ts | cat -nRepository: CoderSerio/hyper-fs Length of output: 1020 Async functions return All async functions return The Rust source code correctly specifies return types in Task implementations ( Also applies to: 56, 64, 68, 72, 76, 94, 98, 113, 117, 121, 130, 134, 167, 176, 180, 184, 188, 190, 215, 219, 223, 227, 231, 239 JSDoc block (lines 136–148) describes a callback-style API that doesn't match the promise-based function signature. The JSDoc mentions a callback parameter and 🤖 Prompt for AI Agents
Owner
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is caused by N-API itself and won't be resolved for now. We may add a TypeScript type library for it later. 🐰 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
✏️ Learnings added
|
||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| export declare function accessSync(path: string, mode?: number | undefined | null): void | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| export declare function appendFile( | ||||||||||||||||||||||||||||||||||
| path: string, | ||||||||||||||||||||||||||||||||||
| data: string | Buffer, | ||||||||||||||||||||||||||||||||||
| options?: WriteFileOptions | undefined | null, | ||||||||||||||||||||||||||||||||||
| ): Promise<void> | ||||||||||||||||||||||||||||||||||
| ): Promise<unknown> | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| export declare function appendFileSync( | ||||||||||||||||||||||||||||||||||
| path: string, | ||||||||||||||||||||||||||||||||||
| data: string | Buffer, | ||||||||||||||||||||||||||||||||||
| options?: WriteFileOptions | undefined | null, | ||||||||||||||||||||||||||||||||||
| ): void | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| export declare function chmod(path: string, mode: number): Promise<void> | ||||||||||||||||||||||||||||||||||
| export declare function chmod(path: string, mode: number): Promise<unknown> | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| export declare function chmodSync(path: string, mode: number): void | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| export declare function chown(path: string, uid: number, gid: number): Promise<void> | ||||||||||||||||||||||||||||||||||
| export declare function chown(path: string, uid: number, gid: number): Promise<unknown> | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| export declare function chownSync(path: string, uid: number, gid: number): void | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| export declare function copyFile(src: string, dest: string, mode?: number | undefined | null): Promise<void> | ||||||||||||||||||||||||||||||||||
| export declare function copyFile(src: string, dest: string, mode?: number | undefined | null): Promise<unknown> | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| export declare function copyFileSync(src: string, dest: string, mode?: number | undefined | null): void | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| export declare function cp(src: string, dest: string, options?: CpOptions | undefined | null): Promise<void> | ||||||||||||||||||||||||||||||||||
| export declare function cp(src: string, dest: string, options?: CpOptions | undefined | null): Promise<unknown> | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| export interface CpOptions { | ||||||||||||||||||||||||||||||||||
| recursive?: boolean | ||||||||||||||||||||||||||||||||||
|
|
@@ -91,21 +91,17 @@ export interface CpOptions { | |||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| export declare function cpSync(src: string, dest: string, options?: CpOptions | undefined | null): void | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| export declare function exists(path: string): Promise<boolean> | ||||||||||||||||||||||||||||||||||
| export declare function exists(path: string): Promise<unknown> | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| export declare function existsSync(path: string): boolean | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| export declare function glob( | ||||||||||||||||||||||||||||||||||
| pattern: string, | ||||||||||||||||||||||||||||||||||
| options?: GlobOptions | undefined | null, | ||||||||||||||||||||||||||||||||||
| ): Promise<Array<string> | Array<Dirent>> | ||||||||||||||||||||||||||||||||||
| export declare function glob(pattern: string, options?: GlobOptions | undefined | null): Promise<unknown> | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| export interface GlobOptions { | ||||||||||||||||||||||||||||||||||
| cwd?: string | ||||||||||||||||||||||||||||||||||
| withFileTypes?: boolean | ||||||||||||||||||||||||||||||||||
| exclude?: Array<string> | ||||||||||||||||||||||||||||||||||
| concurrency?: number | ||||||||||||||||||||||||||||||||||
| /** Respect .gitignore / .ignore files (default: true) */ | ||||||||||||||||||||||||||||||||||
| gitIgnore?: boolean | ||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
|
|
@@ -114,15 +110,15 @@ export declare function globSync( | |||||||||||||||||||||||||||||||||
| options?: GlobOptions | undefined | null, | ||||||||||||||||||||||||||||||||||
| ): Array<string> | Array<Dirent> | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| export declare function link(existingPath: string, newPath: string): Promise<void> | ||||||||||||||||||||||||||||||||||
| export declare function link(existingPath: string, newPath: string): Promise<unknown> | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| export declare function linkSync(existingPath: string, newPath: string): void | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| export declare function lstat(path: string): Promise<Stats> | ||||||||||||||||||||||||||||||||||
| export declare function lstat(path: string): Promise<unknown> | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| export declare function lstatSync(path: string): Stats | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| export declare function mkdir(path: string, options?: MkdirOptions | undefined | null): Promise<string | null> | ||||||||||||||||||||||||||||||||||
| export declare function mkdir(path: string, options?: MkdirOptions | undefined | null): Promise<unknown> | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| export interface MkdirOptions { | ||||||||||||||||||||||||||||||||||
| recursive?: boolean | ||||||||||||||||||||||||||||||||||
|
|
@@ -131,19 +127,29 @@ export interface MkdirOptions { | |||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| export declare function mkdirSync(path: string, options?: MkdirOptions | undefined | null): string | null | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| export declare function mkdtemp(prefix: string): Promise<string> | ||||||||||||||||||||||||||||||||||
| export declare function mkdtemp(prefix: string): Promise<unknown> | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| export declare function mkdtempSync(prefix: string): string | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| export declare function readdir( | ||||||||||||||||||||||||||||||||||
| path: string, | ||||||||||||||||||||||||||||||||||
| options?: ReaddirOptions | undefined | null, | ||||||||||||||||||||||||||||||||||
| ): Promise<Array<string> | Array<Dirent>> | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| export declare function readdir(path: string, options?: ReaddirOptions | undefined | null): Promise<unknown> | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| /** * Reads the contents of a directory. | ||||||||||||||||||||||||||||||||||
| * @param {string | Buffer | URL} path | ||||||||||||||||||||||||||||||||||
| * @param {string | { | ||||||||||||||||||||||||||||||||||
| * encoding?: string; | ||||||||||||||||||||||||||||||||||
| * withFileTypes?: boolean; | ||||||||||||||||||||||||||||||||||
| * recursive?: boolean; | ||||||||||||||||||||||||||||||||||
| * }} [options] | ||||||||||||||||||||||||||||||||||
| * @param {( | ||||||||||||||||||||||||||||||||||
| * err?: Error, | ||||||||||||||||||||||||||||||||||
| * files?: string[] | Buffer[] | Dirent[] | ||||||||||||||||||||||||||||||||||
| * ) => any} callback | ||||||||||||||||||||||||||||||||||
| * @returns {void} | ||||||||||||||||||||||||||||||||||
| */ | ||||||||||||||||||||||||||||||||||
|
Comment on lines
+136
to
+148
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Misleading JSDoc: documents a callback-based API that doesn't exist here. This JSDoc block describes a callback-style If this file is truly auto-generated, this block will either be overwritten or is a manual addition that shouldn't be here. Either way, it should be removed to avoid confusing consumers. Proposed fix: remove the misplaced JSDoc export declare function readdir(path: string, options?: ReaddirOptions | undefined | null): Promise<unknown>
-
-/** * Reads the contents of a directory.
- * `@param` {string | Buffer | URL} path
- * `@param` {string | {
- * encoding?: string;
- * withFileTypes?: boolean;
- * recursive?: boolean;
- * }} [options]
- * `@param` {(
- * err?: Error,
- * files?: string[] | Buffer[] | Dirent[]
- * ) => any} callback
- * `@returns` {void}
- */
+
export interface ReaddirOptions {📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||||||||
| export interface ReaddirOptions { | ||||||||||||||||||||||||||||||||||
| /** | ||||||||||||||||||||||||||||||||||
| * File name encoding. 'utf8' (default) returns strings. | ||||||||||||||||||||||||||||||||||
| * 'buffer' returns Buffer objects for each name (not yet supported, treated as 'utf8'). | ||||||||||||||||||||||||||||||||||
| * 'buffer' returns Buffer objects for each name. | ||||||||||||||||||||||||||||||||||
| * Other values are treated as 'utf8'. | ||||||||||||||||||||||||||||||||||
| */ | ||||||||||||||||||||||||||||||||||
| encoding?: string | ||||||||||||||||||||||||||||||||||
|
|
@@ -158,7 +164,7 @@ export declare function readdirSync( | |||||||||||||||||||||||||||||||||
| options?: ReaddirOptions | undefined | null, | ||||||||||||||||||||||||||||||||||
| ): Array<string> | Array<Dirent> | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| export declare function readFile(path: string, options?: ReadFileOptions | undefined | null): Promise<string | Buffer> | ||||||||||||||||||||||||||||||||||
| export declare function readFile(path: string, options?: ReadFileOptions | undefined | null): Promise<unknown> | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| export interface ReadFileOptions { | ||||||||||||||||||||||||||||||||||
| encoding?: string | ||||||||||||||||||||||||||||||||||
|
|
@@ -167,21 +173,21 @@ export interface ReadFileOptions { | |||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| export declare function readFileSync(path: string, options?: ReadFileOptions | undefined | null): string | Buffer | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| export declare function readlink(path: string): Promise<string> | ||||||||||||||||||||||||||||||||||
| export declare function readlink(path: string): Promise<unknown> | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| export declare function readlinkSync(path: string): string | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| export declare function realpath(path: string): Promise<string> | ||||||||||||||||||||||||||||||||||
| export declare function realpath(path: string): Promise<unknown> | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| export declare function realpathSync(path: string): string | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| export declare function rename(oldPath: string, newPath: string): Promise<void> | ||||||||||||||||||||||||||||||||||
| export declare function rename(oldPath: string, newPath: string): Promise<unknown> | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| export declare function renameSync(oldPath: string, newPath: string): void | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| export declare function rm(path: string, options?: RmOptions | undefined | null): Promise<void> | ||||||||||||||||||||||||||||||||||
| export declare function rm(path: string, options?: RmOptions | undefined | null): Promise<unknown> | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| export declare function rmdir(path: string): Promise<void> | ||||||||||||||||||||||||||||||||||
| export declare function rmdir(path: string): Promise<unknown> | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| export declare function rmdirSync(path: string): void | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
|
|
@@ -191,7 +197,8 @@ export declare function rmdirSync(path: string): void | |||||||||||||||||||||||||||||||||
| * - `force`: When true, silently ignore errors when path does not exist. | ||||||||||||||||||||||||||||||||||
| * - `recursive`: When true, remove directory and all its contents. | ||||||||||||||||||||||||||||||||||
| * - `maxRetries`: If an `EBUSY`, `EMFILE`, `ENFILE`, `ENOTEMPTY`, or `EPERM` error is | ||||||||||||||||||||||||||||||||||
| * encountered, retries with a linear backoff of `retryDelay` ms on each try. | ||||||||||||||||||||||||||||||||||
| * encountered, Node.js retries the operation with a linear backoff of `retryDelay` ms longer on | ||||||||||||||||||||||||||||||||||
| * each try. This option represents the number of retries. | ||||||||||||||||||||||||||||||||||
| * - `retryDelay`: The amount of time in milliseconds to wait between retries (default 100ms). | ||||||||||||||||||||||||||||||||||
| * - `concurrency` (hyper-fs extension): Number of parallel threads for recursive removal. | ||||||||||||||||||||||||||||||||||
| */ | ||||||||||||||||||||||||||||||||||
|
|
@@ -205,41 +212,31 @@ export interface RmOptions { | |||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| export declare function rmSync(path: string, options?: RmOptions | undefined | null): void | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| export declare function stat(path: string): Promise<Stats> | ||||||||||||||||||||||||||||||||||
| export declare function stat(path: string): Promise<unknown> | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| export declare function statSync(path: string): Stats | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| export declare function symlink( | ||||||||||||||||||||||||||||||||||
| target: string, | ||||||||||||||||||||||||||||||||||
| path: string, | ||||||||||||||||||||||||||||||||||
| /** On Windows: 'file' | 'dir' | 'junction'. Ignored on Unix. */ | ||||||||||||||||||||||||||||||||||
| symlinkType?: string | undefined | null, | ||||||||||||||||||||||||||||||||||
| ): Promise<void> | ||||||||||||||||||||||||||||||||||
| export declare function symlink(target: string, path: string, symlinkType?: string | undefined | null): Promise<unknown> | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| export declare function symlinkSync( | ||||||||||||||||||||||||||||||||||
| target: string, | ||||||||||||||||||||||||||||||||||
| path: string, | ||||||||||||||||||||||||||||||||||
| /** On Windows: 'file' | 'dir' | 'junction'. Ignored on Unix. */ | ||||||||||||||||||||||||||||||||||
| symlinkType?: string | undefined | null, | ||||||||||||||||||||||||||||||||||
| ): void | ||||||||||||||||||||||||||||||||||
| export declare function symlinkSync(target: string, path: string, symlinkType?: string | undefined | null): void | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| export declare function truncate(path: string, len?: number | undefined | null): Promise<void> | ||||||||||||||||||||||||||||||||||
| export declare function truncate(path: string, len?: number | undefined | null): Promise<unknown> | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| export declare function truncateSync(path: string, len?: number | undefined | null): void | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| export declare function unlink(path: string): Promise<void> | ||||||||||||||||||||||||||||||||||
| export declare function unlink(path: string): Promise<unknown> | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| export declare function unlinkSync(path: string): void | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| export declare function utimes(path: string, atime: number, mtime: number): Promise<void> | ||||||||||||||||||||||||||||||||||
| export declare function utimes(path: string, atime: number, mtime: number): Promise<unknown> | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| export declare function utimesSync(path: string, atime: number, mtime: number): void | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| export declare function writeFile( | ||||||||||||||||||||||||||||||||||
| path: string, | ||||||||||||||||||||||||||||||||||
| data: string | Buffer, | ||||||||||||||||||||||||||||||||||
| options?: WriteFileOptions | undefined | null, | ||||||||||||||||||||||||||||||||||
| ): Promise<void> | ||||||||||||||||||||||||||||||||||
| ): Promise<unknown> | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| export interface WriteFileOptions { | ||||||||||||||||||||||||||||||||||
| encoding?: string | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Uh oh!
There was an error while loading. Please reload this page.