Skip to content

Commit

Permalink
fix: missing wasi files (#37)
Browse files Browse the repository at this point in the history
  • Loading branch information
Brooooooklyn authored Jul 21, 2024
1 parent 378d506 commit 5abee95
Show file tree
Hide file tree
Showing 6 changed files with 552 additions and 509 deletions.
8 changes: 7 additions & 1 deletion .cargo/config.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
[target.aarch64-unknown-linux-musl]
linker = "aarch64-linux-musl-gcc"
linker = "aarch64-linux-musl-gcc"
rustflags = ["-C", "target-feature=-crt-static"]

[target.x86_64-pc-windows-msvc]
rustflags = ["-C", "target-feature=+crt-static"]

[target.i686-pc-windows-msvc]
rustflags = ["-C", "target-feature=+crt-static"]
15 changes: 8 additions & 7 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@ version = "0.1.0"
crate-type = ["cdylib"]

[dependencies]
anyhow = "1"
bzip2 = "0.4"
flate2 = "1"
lzma-rs = { version = "0.3", features = ["stream"] }
infer = "0.16"
anyhow = "1"
bzip2 = "0.4"
flate2 = "1"
infer = "0.16"
lzma-rs = { version = "0.3", features = ["stream"] }
napi = { version = "2", features = ["anyhow", "napi6"] }
napi-derive = "2"
tar = "0.4"
tar = "0.4"

[target.'cfg(all(not(target_os = "linux"), not(target_family = "wasm")))'.dependencies]
mimalloc = "0.1"
Expand All @@ -29,4 +29,5 @@ mimalloc = { version = "0.1", features = ["local_dynamic_tls"] }
napi-build = "2"

[profile.release]
lto = true
codegen-units = 1
lto = true
12 changes: 6 additions & 6 deletions index.d.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* auto-generated by NAPI-RS */
/* eslint-disable */
export class Archive {
export declare class Archive {
/** Create a new archive with the underlying path. */
constructor(input: string | Buffer)
entries(): Entries
Expand Down Expand Up @@ -73,11 +73,11 @@ export class Archive {
setIgnoreZeros(ignoreZeros: boolean): void
}

export class Entries {
export declare class Entries {
[Symbol.iterator](): Iterator<Entry, void, void>
}

export class Entry {
export declare class Entry {
/**
* Returns the path name for this entry.
*
Expand All @@ -96,7 +96,7 @@ export class Entry {
header(): ReadonlyHeader
}

export class Header {
export declare class Header {
/** Returns a view into this header as a byte array. */
asBytes(): Buffer
/**
Expand Down Expand Up @@ -282,7 +282,7 @@ export class Header {
setCksum(): void
}

export class ReadonlyHeader {
export declare class ReadonlyHeader {
/** Returns a view into this header as a byte array. */
asBytes(): Buffer
/**
Expand Down Expand Up @@ -393,7 +393,7 @@ export class ReadonlyHeader {
* which can be used to inspect what the header is describing.
* A non-exhaustive enum representing the possible entry types
*/
export const enum EntryType {
export declare const enum EntryType {
/** Regular file */
Regular = 0,
/** Hard link */
Expand Down
8 changes: 6 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,11 @@
"files": [
"index.d.ts",
"index.js",
"browser.js"
"browser.js",
"tar.wasi.cjs",
"tar.wasi-browser.js",
"wasi-worker-browser.mjs",
"wasi-worker.mjs"
],
"napi": {
"binaryName": "tar",
Expand Down Expand Up @@ -60,7 +64,7 @@
"version": "napi version"
},
"devDependencies": {
"@napi-rs/cli": "^3.0.0-alpha.54",
"@napi-rs/cli": "^3.0.0-alpha.60",
"@napi-rs/lzma": "^1.3.0",
"@swc-node/register": "^1.9.0",
"@swc/core": "^1.4.17",
Expand Down
2 changes: 1 addition & 1 deletion tar.wasi-browser.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ const {
const worker = new Worker(new URL('./wasi-worker-browser.mjs', import.meta.url), {
type: 'module',
})

return worker
},
overwriteImports(importObject) {
Expand Down
Loading

0 comments on commit 5abee95

Please sign in to comment.