@earthmover/icechunk 1.0.3 → 2.0.0-alpha.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +107 -77
- package/index.d.ts +118 -1
- package/index.js +225 -52
- package/package.json +38 -32
- package/LICENSE +0 -21
package/README.md
CHANGED
|
@@ -1,112 +1,142 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Icechunk JS
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
JavaScript/TypeScript library for Icechunk Zarr Stores. Works as a native Node.js addon and in the browser via WASM.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
## Getting Started
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
1. Click **Use this template**.
|
|
10
|
-
2. **Clone** your project.
|
|
11
|
-
3. Run `yarn install` to install dependencies.
|
|
12
|
-
4. Run `yarn napi rename -n [@your-scope/package-name] -b [binary-name]` command under the project folder to rename your package.
|
|
13
|
-
|
|
14
|
-
## Install this test package
|
|
7
|
+
Install with `npm`
|
|
15
8
|
|
|
16
9
|
```
|
|
17
|
-
|
|
10
|
+
npm install @earthmover/icechunk@alpha
|
|
18
11
|
```
|
|
19
12
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
### Build
|
|
23
|
-
|
|
24
|
-
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
|
-
|
|
26
|
-
### Test
|
|
27
|
-
|
|
28
|
-
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.
|
|
29
|
-
|
|
30
|
-
### CI
|
|
13
|
+
> [!NOTE]
|
|
14
|
+
> When using in the browser, you must specify to install the wasm package with `--cpu=wasm32`
|
|
31
15
|
|
|
32
|
-
|
|
16
|
+
```typescript
|
|
17
|
+
import { Repository, Storage } from '@earthmover/icechunk'
|
|
18
|
+
import * as zarr from 'zarrita'
|
|
33
19
|
|
|
34
|
-
|
|
20
|
+
const storage = await Storage.newInMemory()
|
|
21
|
+
const repo = await Repository.create(storage)
|
|
35
22
|
|
|
36
|
-
|
|
23
|
+
const session = await repo.writableSession('main')
|
|
24
|
+
const store = session.store
|
|
37
25
|
|
|
38
|
-
|
|
26
|
+
// zarrita uses the store directly via duck-typing
|
|
27
|
+
const root = zarr.root(store)
|
|
28
|
+
const arr = await zarr.create(root.resolve('/foo'), {
|
|
29
|
+
shape: [100], dtype: '<i4', chunks: [10],
|
|
30
|
+
})
|
|
39
31
|
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
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.
|
|
32
|
+
const snapshotId = await session.commit('Create foo array')
|
|
33
|
+
```
|
|
43
34
|
|
|
44
|
-
|
|
35
|
+
## Features
|
|
36
|
+
|
|
37
|
+
### Storage Backends
|
|
38
|
+
|
|
39
|
+
In-memory storage works on all platforms. The following backends are available on native (non-WASM) builds:
|
|
40
|
+
|
|
41
|
+
- **S3** — `Storage.newS3(bucket, prefix?, credentials?, options?)`
|
|
42
|
+
- **R2** — `Storage.newR2(bucket?, prefix?, accountId?, credentials?, options?)`
|
|
43
|
+
- **GCS** — `Storage.newGcs(bucket, prefix?, credentials?, config?)`
|
|
44
|
+
- **Azure Blob** — `Storage.newAzureBlob(account, container, prefix?, credentials?, config?)`
|
|
45
|
+
- **Tigris** — `Storage.newTigris(bucket, prefix?, credentials?, options?)`
|
|
46
|
+
- **HTTP** — `Storage.newHttp(baseUrl, config?)`
|
|
47
|
+
- **Local Filesystem** — `Storage.newLocalFilesystem(path)`
|
|
48
|
+
|
|
49
|
+
### Custom Storage Backends
|
|
50
|
+
|
|
51
|
+
For WASM builds (or any environment where the built-in backends aren't suitable), you can provide your own storage implementation in JavaScript using `Storage.newCustom()`:
|
|
52
|
+
|
|
53
|
+
```typescript
|
|
54
|
+
const storage = Storage.newCustom({
|
|
55
|
+
canWrite: async () => true,
|
|
56
|
+
getObjectRange: async ({ path, rangeStart, rangeEnd }) => {
|
|
57
|
+
const headers: Record<string, string> = {}
|
|
58
|
+
if (rangeStart != null && rangeEnd != null) {
|
|
59
|
+
headers['Range'] = `bytes=${rangeStart}-${rangeEnd - 1}`
|
|
60
|
+
}
|
|
61
|
+
const resp = await fetch(`https://my-bucket.example.com/${path}`, { headers })
|
|
62
|
+
return { data: new Uint8Array(await resp.arrayBuffer()), version: { etag: resp.headers.get('etag') ?? undefined } }
|
|
63
|
+
},
|
|
64
|
+
putObject: async ({ path, data, contentType }) => { /* ... */ },
|
|
65
|
+
copyObject: async ({ from, to }) => { /* ... */ },
|
|
66
|
+
listObjects: async (prefix) => { /* return [{ id, createdAt, sizeBytes }] */ },
|
|
67
|
+
deleteBatch: async ({ prefix, batch }) => { /* return { deletedObjects, deletedBytes } */ },
|
|
68
|
+
getObjectLastModified: async (path) => { /* return Date */ },
|
|
69
|
+
getObjectConditional: async ({ path, previousVersion }) => { /* ... */ },
|
|
70
|
+
})
|
|
71
|
+
```
|
|
45
72
|
|
|
46
|
-
|
|
73
|
+
This is the primary way to use cloud storage in the browser, where native Rust networking is unavailable. Each callback method maps to an operation on the underlying `Storage` trait. See the exported `Storage*` TypeScript interfaces for the full type signatures.
|
|
47
74
|
|
|
48
|
-
|
|
49
|
-
- Install `Node.js@10+` which fully supported `Node-API`
|
|
50
|
-
- Install `yarn@1.x`
|
|
75
|
+
### Virtual Chunks
|
|
51
76
|
|
|
52
|
-
|
|
77
|
+
Virtual chunks are supported in node but not in WASM builds.
|
|
53
78
|
|
|
54
|
-
|
|
55
|
-
- yarn build
|
|
56
|
-
- yarn test
|
|
79
|
+
## Using in the Browser (WASM)
|
|
57
80
|
|
|
58
|
-
|
|
81
|
+
Install the package with the `--cpu=wasm32` flag to get the WASM binary:
|
|
59
82
|
|
|
60
83
|
```bash
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
✔ sync function from native code
|
|
64
|
-
✔ sleep function from native code (201ms)
|
|
65
|
-
─
|
|
66
|
-
|
|
67
|
-
2 tests passed
|
|
68
|
-
✨ Done in 1.12s.
|
|
84
|
+
npm install @earthmover/icechunk --cpu=wasm32
|
|
69
85
|
```
|
|
70
86
|
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
Ensure you have set your **NPM_TOKEN** in the `GitHub` project setting.
|
|
74
|
-
|
|
75
|
-
In `Settings -> Secrets`, add **NPM_TOKEN** into it.
|
|
76
|
-
|
|
77
|
-
When you want to release the package:
|
|
87
|
+
The WASM build uses `SharedArrayBuffer` for threading, which requires your server to send these headers:
|
|
78
88
|
|
|
79
89
|
```
|
|
80
|
-
|
|
90
|
+
Cross-Origin-Opener-Policy: same-origin
|
|
91
|
+
Cross-Origin-Embedder-Policy: require-corp
|
|
92
|
+
```
|
|
81
93
|
|
|
82
|
-
|
|
94
|
+
With Vite, you'll also need the `vite-plugin-wasm` and `vite-plugin-top-level-await` plugins, and must exclude the icechunk packages from dependency optimization:
|
|
95
|
+
|
|
96
|
+
```typescript
|
|
97
|
+
// vite.config.ts
|
|
98
|
+
import wasm from 'vite-plugin-wasm'
|
|
99
|
+
import topLevelAwait from 'vite-plugin-top-level-await'
|
|
100
|
+
|
|
101
|
+
export default defineConfig({
|
|
102
|
+
plugins: [wasm(), topLevelAwait()],
|
|
103
|
+
optimizeDeps: {
|
|
104
|
+
exclude: ['@earthmover/icechunk', '@earthmover/icechunk-wasm32-wasi'],
|
|
105
|
+
},
|
|
106
|
+
server: {
|
|
107
|
+
headers: {
|
|
108
|
+
'Cross-Origin-Opener-Policy': 'same-origin',
|
|
109
|
+
'Cross-Origin-Embedder-Policy': 'require-corp',
|
|
110
|
+
},
|
|
111
|
+
},
|
|
112
|
+
})
|
|
83
113
|
```
|
|
84
114
|
|
|
85
|
-
|
|
115
|
+
See the [NAPI-RS WebAssembly docs](https://napi.rs/docs/concepts/webassembly) for more details.
|
|
86
116
|
|
|
87
|
-
|
|
117
|
+
## Examples
|
|
88
118
|
|
|
89
|
-
|
|
90
|
-
```
|
|
91
|
-
yarn build --target wasm32-wasip1-threads -o npm/wasm32-wasi
|
|
92
|
-
```
|
|
119
|
+
See [`examples/react-wasm`](examples/react-wasm) for an interactive React app demonstrating repository management, branching, tagging, and Zarr store operations in the browser.
|
|
93
120
|
|
|
94
|
-
|
|
95
|
-
```
|
|
96
|
-
yarn napi create-npm-dirs
|
|
97
|
-
```
|
|
121
|
+
## For Development
|
|
98
122
|
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
123
|
+
```bash
|
|
124
|
+
cd icechunk-js
|
|
125
|
+
yarn install
|
|
126
|
+
yarn build
|
|
127
|
+
yarn test
|
|
102
128
|
```
|
|
103
129
|
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
https://github.com/gyscos/zstd-rs/issues/93#issuecomment-2110684816
|
|
130
|
+
For WASM:
|
|
107
131
|
|
|
132
|
+
```bash
|
|
133
|
+
# Requires brew install llvm and env vars (see docs/docs/contributing.md)
|
|
134
|
+
yarn build --target wasm32-wasip1-threads
|
|
135
|
+
NAPI_RS_FORCE_WASI=1 yarn test
|
|
108
136
|
```
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
137
|
+
|
|
138
|
+
> [!IMPORTANT]
|
|
139
|
+
> Building the WASM target requires Rust 1.95+ (or a nightly after 2026-01-19).
|
|
140
|
+
> Rust 1.94 has a bug where `std::thread::spawn` is unconditionally disabled on all WASI targets,
|
|
141
|
+
> including `wasm32-wasip1-threads` which supports threading.
|
|
142
|
+
> See [rust-lang/rust#151309](https://github.com/rust-lang/rust/pull/151309) for the fix.
|
package/index.d.ts
CHANGED
|
@@ -1,3 +1,120 @@
|
|
|
1
1
|
/* auto-generated by NAPI-RS */
|
|
2
2
|
/* eslint-disable */
|
|
3
|
-
export declare
|
|
3
|
+
export declare class Repository {
|
|
4
|
+
static create(storage: JsStorage, config?: RepositoryConfig | undefined | null, specVersion?: number | undefined | null, authorizeVirtualChunkAccess?: Record<string, JsCredentials | undefined | null> | undefined | null, checkCleanRoot?: boolean | undefined | null): Promise<Repository>
|
|
5
|
+
static open(storage: JsStorage, config?: RepositoryConfig | undefined | null, authorizeVirtualChunkAccess?: Record<string, JsCredentials | undefined | null> | undefined | null): Promise<Repository>
|
|
6
|
+
static openOrCreate(storage: JsStorage, config?: RepositoryConfig | undefined | null, specVersion?: number | undefined | null, authorizeVirtualChunkAccess?: Record<string, JsCredentials | undefined | null> | undefined | null, checkCleanRoot?: boolean | undefined | null): Promise<Repository>
|
|
7
|
+
static exists(storage: JsStorage, storageSettings?: StorageSettings | undefined | null): Promise<boolean>
|
|
8
|
+
readonlySession(options?: ReadonlySessionOptions | undefined | null): Promise<JsSession>
|
|
9
|
+
writableSession(branch: string): Promise<JsSession>
|
|
10
|
+
listBranches(): Promise<Array<string>>
|
|
11
|
+
createBranch(name: string, snapshotId: string): Promise<void>
|
|
12
|
+
listTags(): Promise<Array<string>>
|
|
13
|
+
createTag(name: string, snapshotId: string): Promise<void>
|
|
14
|
+
lookupManifestFiles(snapshotId: string): Promise<Array<JsManifestFileInfo>>
|
|
15
|
+
}
|
|
16
|
+
export type JsRepository = Repository
|
|
17
|
+
|
|
18
|
+
export declare class Session {
|
|
19
|
+
get readOnly(): boolean
|
|
20
|
+
get snapshotId(): string
|
|
21
|
+
get branch(): string | null
|
|
22
|
+
get hasUncommittedChanges(): boolean
|
|
23
|
+
get store(): JsStore
|
|
24
|
+
commit(message: string): Promise<string>
|
|
25
|
+
discardChanges(): Promise<void>
|
|
26
|
+
}
|
|
27
|
+
export type JsSession = Session
|
|
28
|
+
|
|
29
|
+
export declare class Storage {
|
|
30
|
+
static newInMemory(): Promise<Storage>
|
|
31
|
+
}
|
|
32
|
+
export type JsStorage = Storage
|
|
33
|
+
|
|
34
|
+
export declare class Store {
|
|
35
|
+
get(key: string): Promise<Buffer | null>
|
|
36
|
+
getRange(key: string, offset: number, length?: number | undefined | null): Promise<Buffer | null>
|
|
37
|
+
set(key: string, value: Buffer): Promise<void>
|
|
38
|
+
exists(key: string): Promise<boolean>
|
|
39
|
+
delete(key: string): Promise<void>
|
|
40
|
+
list(): Promise<Array<string>>
|
|
41
|
+
listPrefix(prefix: string): Promise<Array<string>>
|
|
42
|
+
listDir(prefix: string): Promise<Array<string>>
|
|
43
|
+
get supportsWrites(): boolean
|
|
44
|
+
get supportsDeletes(): boolean
|
|
45
|
+
get supportsListing(): boolean
|
|
46
|
+
}
|
|
47
|
+
export type JsStore = Store
|
|
48
|
+
|
|
49
|
+
/** Caching configuration */
|
|
50
|
+
export interface CachingConfig {
|
|
51
|
+
numSnapshotNodes?: number
|
|
52
|
+
numChunkRefs?: number
|
|
53
|
+
numTransactionChanges?: number
|
|
54
|
+
numBytesAttributes?: number
|
|
55
|
+
numBytesChunks?: number
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
/** Compression algorithm */
|
|
59
|
+
export declare const enum CompressionAlgorithm {
|
|
60
|
+
Zstd = 0
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
/** Compression configuration */
|
|
64
|
+
export interface CompressionConfig {
|
|
65
|
+
algorithm?: CompressionAlgorithm
|
|
66
|
+
level?: number
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
export interface ManifestFileInfo {
|
|
70
|
+
id: string
|
|
71
|
+
sizeBytes: number
|
|
72
|
+
numChunkRefs: number
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
export interface ReadonlySessionOptions {
|
|
76
|
+
branch?: string
|
|
77
|
+
tag?: string
|
|
78
|
+
snapshotId?: string
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
/** Repository configuration (WASM build — no virtual chunk support) */
|
|
82
|
+
export interface RepositoryConfig {
|
|
83
|
+
inlineChunkThresholdBytes?: number
|
|
84
|
+
getPartialValuesConcurrency?: number
|
|
85
|
+
compression?: CompressionConfig
|
|
86
|
+
maxConcurrentRequests?: number
|
|
87
|
+
caching?: CachingConfig
|
|
88
|
+
storage?: StorageSettings
|
|
89
|
+
/**
|
|
90
|
+
* Manifest configuration, passed as a JSON-compatible object.
|
|
91
|
+
* The object is deserialized using serde, matching the Rust ManifestConfig structure.
|
|
92
|
+
*/
|
|
93
|
+
manifest?: any
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
/** Storage concurrency settings */
|
|
97
|
+
export interface StorageConcurrencySettings {
|
|
98
|
+
maxConcurrentRequestsForObject?: number
|
|
99
|
+
idealConcurrentRequestSize?: number
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
/** Storage retries settings */
|
|
103
|
+
export interface StorageRetriesSettings {
|
|
104
|
+
maxTries?: number
|
|
105
|
+
initialBackoffMs?: number
|
|
106
|
+
maxBackoffMs?: number
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
/** Storage settings */
|
|
110
|
+
export interface StorageSettings {
|
|
111
|
+
concurrency?: StorageConcurrencySettings
|
|
112
|
+
retries?: StorageRetriesSettings
|
|
113
|
+
unsafeUseConditionalUpdate?: boolean
|
|
114
|
+
unsafeUseConditionalCreate?: boolean
|
|
115
|
+
unsafeUseMetadata?: boolean
|
|
116
|
+
storageClass?: string
|
|
117
|
+
metadataStorageClass?: string
|
|
118
|
+
chunksStorageClass?: string
|
|
119
|
+
minimumSizeForMultipartUpload?: number
|
|
120
|
+
}
|
package/index.js
CHANGED
|
@@ -66,30 +66,40 @@ const isMuslFromChildProcess = () => {
|
|
|
66
66
|
function requireNative() {
|
|
67
67
|
if (process.env.NAPI_RS_NATIVE_LIBRARY_PATH) {
|
|
68
68
|
try {
|
|
69
|
-
|
|
69
|
+
return require(process.env.NAPI_RS_NATIVE_LIBRARY_PATH);
|
|
70
70
|
} catch (err) {
|
|
71
71
|
loadErrors.push(err)
|
|
72
72
|
}
|
|
73
73
|
} else if (process.platform === 'android') {
|
|
74
74
|
if (process.arch === 'arm64') {
|
|
75
75
|
try {
|
|
76
|
-
return require('./icechunk
|
|
76
|
+
return require('./icechunk.android-arm64.node')
|
|
77
77
|
} catch (e) {
|
|
78
78
|
loadErrors.push(e)
|
|
79
79
|
}
|
|
80
80
|
try {
|
|
81
|
-
|
|
81
|
+
const binding = require('@earthmover/icechunk-android-arm64')
|
|
82
|
+
const bindingPackageVersion = require('@earthmover/icechunk-android-arm64/package.json').version
|
|
83
|
+
if (bindingPackageVersion !== '2.0.0-alpha.6' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
84
|
+
throw new Error(`Native binding package version mismatch, expected 2.0.0-alpha.6 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
85
|
+
}
|
|
86
|
+
return binding
|
|
82
87
|
} catch (e) {
|
|
83
88
|
loadErrors.push(e)
|
|
84
89
|
}
|
|
85
90
|
} else if (process.arch === 'arm') {
|
|
86
91
|
try {
|
|
87
|
-
return require('./icechunk
|
|
92
|
+
return require('./icechunk.android-arm-eabi.node')
|
|
88
93
|
} catch (e) {
|
|
89
94
|
loadErrors.push(e)
|
|
90
95
|
}
|
|
91
96
|
try {
|
|
92
|
-
|
|
97
|
+
const binding = require('@earthmover/icechunk-android-arm-eabi')
|
|
98
|
+
const bindingPackageVersion = require('@earthmover/icechunk-android-arm-eabi/package.json').version
|
|
99
|
+
if (bindingPackageVersion !== '2.0.0-alpha.6' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
100
|
+
throw new Error(`Native binding package version mismatch, expected 2.0.0-alpha.6 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
101
|
+
}
|
|
102
|
+
return binding
|
|
93
103
|
} catch (e) {
|
|
94
104
|
loadErrors.push(e)
|
|
95
105
|
}
|
|
@@ -99,34 +109,49 @@ function requireNative() {
|
|
|
99
109
|
} else if (process.platform === 'win32') {
|
|
100
110
|
if (process.arch === 'x64') {
|
|
101
111
|
try {
|
|
102
|
-
return require('./icechunk
|
|
112
|
+
return require('./icechunk.win32-x64-msvc.node')
|
|
103
113
|
} catch (e) {
|
|
104
114
|
loadErrors.push(e)
|
|
105
115
|
}
|
|
106
116
|
try {
|
|
107
|
-
|
|
117
|
+
const binding = require('@earthmover/icechunk-win32-x64-msvc')
|
|
118
|
+
const bindingPackageVersion = require('@earthmover/icechunk-win32-x64-msvc/package.json').version
|
|
119
|
+
if (bindingPackageVersion !== '2.0.0-alpha.6' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
120
|
+
throw new Error(`Native binding package version mismatch, expected 2.0.0-alpha.6 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
121
|
+
}
|
|
122
|
+
return binding
|
|
108
123
|
} catch (e) {
|
|
109
124
|
loadErrors.push(e)
|
|
110
125
|
}
|
|
111
126
|
} else if (process.arch === 'ia32') {
|
|
112
127
|
try {
|
|
113
|
-
return require('./icechunk
|
|
128
|
+
return require('./icechunk.win32-ia32-msvc.node')
|
|
114
129
|
} catch (e) {
|
|
115
130
|
loadErrors.push(e)
|
|
116
131
|
}
|
|
117
132
|
try {
|
|
118
|
-
|
|
133
|
+
const binding = require('@earthmover/icechunk-win32-ia32-msvc')
|
|
134
|
+
const bindingPackageVersion = require('@earthmover/icechunk-win32-ia32-msvc/package.json').version
|
|
135
|
+
if (bindingPackageVersion !== '2.0.0-alpha.6' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
136
|
+
throw new Error(`Native binding package version mismatch, expected 2.0.0-alpha.6 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
137
|
+
}
|
|
138
|
+
return binding
|
|
119
139
|
} catch (e) {
|
|
120
140
|
loadErrors.push(e)
|
|
121
141
|
}
|
|
122
142
|
} else if (process.arch === 'arm64') {
|
|
123
143
|
try {
|
|
124
|
-
return require('./icechunk
|
|
144
|
+
return require('./icechunk.win32-arm64-msvc.node')
|
|
125
145
|
} catch (e) {
|
|
126
146
|
loadErrors.push(e)
|
|
127
147
|
}
|
|
128
148
|
try {
|
|
129
|
-
|
|
149
|
+
const binding = require('@earthmover/icechunk-win32-arm64-msvc')
|
|
150
|
+
const bindingPackageVersion = require('@earthmover/icechunk-win32-arm64-msvc/package.json').version
|
|
151
|
+
if (bindingPackageVersion !== '2.0.0-alpha.6' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
152
|
+
throw new Error(`Native binding package version mismatch, expected 2.0.0-alpha.6 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
153
|
+
}
|
|
154
|
+
return binding
|
|
130
155
|
} catch (e) {
|
|
131
156
|
loadErrors.push(e)
|
|
132
157
|
}
|
|
@@ -135,34 +160,49 @@ function requireNative() {
|
|
|
135
160
|
}
|
|
136
161
|
} else if (process.platform === 'darwin') {
|
|
137
162
|
try {
|
|
138
|
-
return require('./icechunk
|
|
163
|
+
return require('./icechunk.darwin-universal.node')
|
|
139
164
|
} catch (e) {
|
|
140
165
|
loadErrors.push(e)
|
|
141
166
|
}
|
|
142
167
|
try {
|
|
143
|
-
|
|
168
|
+
const binding = require('@earthmover/icechunk-darwin-universal')
|
|
169
|
+
const bindingPackageVersion = require('@earthmover/icechunk-darwin-universal/package.json').version
|
|
170
|
+
if (bindingPackageVersion !== '2.0.0-alpha.6' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
171
|
+
throw new Error(`Native binding package version mismatch, expected 2.0.0-alpha.6 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
172
|
+
}
|
|
173
|
+
return binding
|
|
144
174
|
} catch (e) {
|
|
145
175
|
loadErrors.push(e)
|
|
146
176
|
}
|
|
147
177
|
if (process.arch === 'x64') {
|
|
148
178
|
try {
|
|
149
|
-
return require('./icechunk
|
|
179
|
+
return require('./icechunk.darwin-x64.node')
|
|
150
180
|
} catch (e) {
|
|
151
181
|
loadErrors.push(e)
|
|
152
182
|
}
|
|
153
183
|
try {
|
|
154
|
-
|
|
184
|
+
const binding = require('@earthmover/icechunk-darwin-x64')
|
|
185
|
+
const bindingPackageVersion = require('@earthmover/icechunk-darwin-x64/package.json').version
|
|
186
|
+
if (bindingPackageVersion !== '2.0.0-alpha.6' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
187
|
+
throw new Error(`Native binding package version mismatch, expected 2.0.0-alpha.6 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
188
|
+
}
|
|
189
|
+
return binding
|
|
155
190
|
} catch (e) {
|
|
156
191
|
loadErrors.push(e)
|
|
157
192
|
}
|
|
158
193
|
} else if (process.arch === 'arm64') {
|
|
159
194
|
try {
|
|
160
|
-
return require('./icechunk
|
|
195
|
+
return require('./icechunk.darwin-arm64.node')
|
|
161
196
|
} catch (e) {
|
|
162
197
|
loadErrors.push(e)
|
|
163
198
|
}
|
|
164
199
|
try {
|
|
165
|
-
|
|
200
|
+
const binding = require('@earthmover/icechunk-darwin-arm64')
|
|
201
|
+
const bindingPackageVersion = require('@earthmover/icechunk-darwin-arm64/package.json').version
|
|
202
|
+
if (bindingPackageVersion !== '2.0.0-alpha.6' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
203
|
+
throw new Error(`Native binding package version mismatch, expected 2.0.0-alpha.6 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
204
|
+
}
|
|
205
|
+
return binding
|
|
166
206
|
} catch (e) {
|
|
167
207
|
loadErrors.push(e)
|
|
168
208
|
}
|
|
@@ -172,23 +212,33 @@ function requireNative() {
|
|
|
172
212
|
} else if (process.platform === 'freebsd') {
|
|
173
213
|
if (process.arch === 'x64') {
|
|
174
214
|
try {
|
|
175
|
-
return require('./icechunk
|
|
215
|
+
return require('./icechunk.freebsd-x64.node')
|
|
176
216
|
} catch (e) {
|
|
177
217
|
loadErrors.push(e)
|
|
178
218
|
}
|
|
179
219
|
try {
|
|
180
|
-
|
|
220
|
+
const binding = require('@earthmover/icechunk-freebsd-x64')
|
|
221
|
+
const bindingPackageVersion = require('@earthmover/icechunk-freebsd-x64/package.json').version
|
|
222
|
+
if (bindingPackageVersion !== '2.0.0-alpha.6' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
223
|
+
throw new Error(`Native binding package version mismatch, expected 2.0.0-alpha.6 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
224
|
+
}
|
|
225
|
+
return binding
|
|
181
226
|
} catch (e) {
|
|
182
227
|
loadErrors.push(e)
|
|
183
228
|
}
|
|
184
229
|
} else if (process.arch === 'arm64') {
|
|
185
230
|
try {
|
|
186
|
-
return require('./icechunk
|
|
231
|
+
return require('./icechunk.freebsd-arm64.node')
|
|
187
232
|
} catch (e) {
|
|
188
233
|
loadErrors.push(e)
|
|
189
234
|
}
|
|
190
235
|
try {
|
|
191
|
-
|
|
236
|
+
const binding = require('@earthmover/icechunk-freebsd-arm64')
|
|
237
|
+
const bindingPackageVersion = require('@earthmover/icechunk-freebsd-arm64/package.json').version
|
|
238
|
+
if (bindingPackageVersion !== '2.0.0-alpha.6' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
239
|
+
throw new Error(`Native binding package version mismatch, expected 2.0.0-alpha.6 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
240
|
+
}
|
|
241
|
+
return binding
|
|
192
242
|
} catch (e) {
|
|
193
243
|
loadErrors.push(e)
|
|
194
244
|
}
|
|
@@ -199,23 +249,33 @@ function requireNative() {
|
|
|
199
249
|
if (process.arch === 'x64') {
|
|
200
250
|
if (isMusl()) {
|
|
201
251
|
try {
|
|
202
|
-
return require('./icechunk
|
|
252
|
+
return require('./icechunk.linux-x64-musl.node')
|
|
203
253
|
} catch (e) {
|
|
204
254
|
loadErrors.push(e)
|
|
205
255
|
}
|
|
206
256
|
try {
|
|
207
|
-
|
|
257
|
+
const binding = require('@earthmover/icechunk-linux-x64-musl')
|
|
258
|
+
const bindingPackageVersion = require('@earthmover/icechunk-linux-x64-musl/package.json').version
|
|
259
|
+
if (bindingPackageVersion !== '2.0.0-alpha.6' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
260
|
+
throw new Error(`Native binding package version mismatch, expected 2.0.0-alpha.6 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
261
|
+
}
|
|
262
|
+
return binding
|
|
208
263
|
} catch (e) {
|
|
209
264
|
loadErrors.push(e)
|
|
210
265
|
}
|
|
211
266
|
} else {
|
|
212
267
|
try {
|
|
213
|
-
return require('./icechunk
|
|
268
|
+
return require('./icechunk.linux-x64-gnu.node')
|
|
214
269
|
} catch (e) {
|
|
215
270
|
loadErrors.push(e)
|
|
216
271
|
}
|
|
217
272
|
try {
|
|
218
|
-
|
|
273
|
+
const binding = require('@earthmover/icechunk-linux-x64-gnu')
|
|
274
|
+
const bindingPackageVersion = require('@earthmover/icechunk-linux-x64-gnu/package.json').version
|
|
275
|
+
if (bindingPackageVersion !== '2.0.0-alpha.6' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
276
|
+
throw new Error(`Native binding package version mismatch, expected 2.0.0-alpha.6 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
277
|
+
}
|
|
278
|
+
return binding
|
|
219
279
|
} catch (e) {
|
|
220
280
|
loadErrors.push(e)
|
|
221
281
|
}
|
|
@@ -223,23 +283,33 @@ function requireNative() {
|
|
|
223
283
|
} else if (process.arch === 'arm64') {
|
|
224
284
|
if (isMusl()) {
|
|
225
285
|
try {
|
|
226
|
-
return require('./icechunk
|
|
286
|
+
return require('./icechunk.linux-arm64-musl.node')
|
|
227
287
|
} catch (e) {
|
|
228
288
|
loadErrors.push(e)
|
|
229
289
|
}
|
|
230
290
|
try {
|
|
231
|
-
|
|
291
|
+
const binding = require('@earthmover/icechunk-linux-arm64-musl')
|
|
292
|
+
const bindingPackageVersion = require('@earthmover/icechunk-linux-arm64-musl/package.json').version
|
|
293
|
+
if (bindingPackageVersion !== '2.0.0-alpha.6' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
294
|
+
throw new Error(`Native binding package version mismatch, expected 2.0.0-alpha.6 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
295
|
+
}
|
|
296
|
+
return binding
|
|
232
297
|
} catch (e) {
|
|
233
298
|
loadErrors.push(e)
|
|
234
299
|
}
|
|
235
300
|
} else {
|
|
236
301
|
try {
|
|
237
|
-
return require('./icechunk
|
|
302
|
+
return require('./icechunk.linux-arm64-gnu.node')
|
|
238
303
|
} catch (e) {
|
|
239
304
|
loadErrors.push(e)
|
|
240
305
|
}
|
|
241
306
|
try {
|
|
242
|
-
|
|
307
|
+
const binding = require('@earthmover/icechunk-linux-arm64-gnu')
|
|
308
|
+
const bindingPackageVersion = require('@earthmover/icechunk-linux-arm64-gnu/package.json').version
|
|
309
|
+
if (bindingPackageVersion !== '2.0.0-alpha.6' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
310
|
+
throw new Error(`Native binding package version mismatch, expected 2.0.0-alpha.6 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
311
|
+
}
|
|
312
|
+
return binding
|
|
243
313
|
} catch (e) {
|
|
244
314
|
loadErrors.push(e)
|
|
245
315
|
}
|
|
@@ -247,23 +317,67 @@ function requireNative() {
|
|
|
247
317
|
} else if (process.arch === 'arm') {
|
|
248
318
|
if (isMusl()) {
|
|
249
319
|
try {
|
|
250
|
-
return require('./icechunk
|
|
320
|
+
return require('./icechunk.linux-arm-musleabihf.node')
|
|
321
|
+
} catch (e) {
|
|
322
|
+
loadErrors.push(e)
|
|
323
|
+
}
|
|
324
|
+
try {
|
|
325
|
+
const binding = require('@earthmover/icechunk-linux-arm-musleabihf')
|
|
326
|
+
const bindingPackageVersion = require('@earthmover/icechunk-linux-arm-musleabihf/package.json').version
|
|
327
|
+
if (bindingPackageVersion !== '2.0.0-alpha.6' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
328
|
+
throw new Error(`Native binding package version mismatch, expected 2.0.0-alpha.6 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
329
|
+
}
|
|
330
|
+
return binding
|
|
331
|
+
} catch (e) {
|
|
332
|
+
loadErrors.push(e)
|
|
333
|
+
}
|
|
334
|
+
} else {
|
|
335
|
+
try {
|
|
336
|
+
return require('./icechunk.linux-arm-gnueabihf.node')
|
|
337
|
+
} catch (e) {
|
|
338
|
+
loadErrors.push(e)
|
|
339
|
+
}
|
|
340
|
+
try {
|
|
341
|
+
const binding = require('@earthmover/icechunk-linux-arm-gnueabihf')
|
|
342
|
+
const bindingPackageVersion = require('@earthmover/icechunk-linux-arm-gnueabihf/package.json').version
|
|
343
|
+
if (bindingPackageVersion !== '2.0.0-alpha.6' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
344
|
+
throw new Error(`Native binding package version mismatch, expected 2.0.0-alpha.6 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
345
|
+
}
|
|
346
|
+
return binding
|
|
347
|
+
} catch (e) {
|
|
348
|
+
loadErrors.push(e)
|
|
349
|
+
}
|
|
350
|
+
}
|
|
351
|
+
} else if (process.arch === 'loong64') {
|
|
352
|
+
if (isMusl()) {
|
|
353
|
+
try {
|
|
354
|
+
return require('./icechunk.linux-loong64-musl.node')
|
|
251
355
|
} catch (e) {
|
|
252
356
|
loadErrors.push(e)
|
|
253
357
|
}
|
|
254
358
|
try {
|
|
255
|
-
|
|
359
|
+
const binding = require('@earthmover/icechunk-linux-loong64-musl')
|
|
360
|
+
const bindingPackageVersion = require('@earthmover/icechunk-linux-loong64-musl/package.json').version
|
|
361
|
+
if (bindingPackageVersion !== '2.0.0-alpha.6' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
362
|
+
throw new Error(`Native binding package version mismatch, expected 2.0.0-alpha.6 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
363
|
+
}
|
|
364
|
+
return binding
|
|
256
365
|
} catch (e) {
|
|
257
366
|
loadErrors.push(e)
|
|
258
367
|
}
|
|
259
368
|
} else {
|
|
260
369
|
try {
|
|
261
|
-
return require('./icechunk
|
|
370
|
+
return require('./icechunk.linux-loong64-gnu.node')
|
|
262
371
|
} catch (e) {
|
|
263
372
|
loadErrors.push(e)
|
|
264
373
|
}
|
|
265
374
|
try {
|
|
266
|
-
|
|
375
|
+
const binding = require('@earthmover/icechunk-linux-loong64-gnu')
|
|
376
|
+
const bindingPackageVersion = require('@earthmover/icechunk-linux-loong64-gnu/package.json').version
|
|
377
|
+
if (bindingPackageVersion !== '2.0.0-alpha.6' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
378
|
+
throw new Error(`Native binding package version mismatch, expected 2.0.0-alpha.6 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
379
|
+
}
|
|
380
|
+
return binding
|
|
267
381
|
} catch (e) {
|
|
268
382
|
loadErrors.push(e)
|
|
269
383
|
}
|
|
@@ -271,46 +385,66 @@ function requireNative() {
|
|
|
271
385
|
} else if (process.arch === 'riscv64') {
|
|
272
386
|
if (isMusl()) {
|
|
273
387
|
try {
|
|
274
|
-
return require('./icechunk
|
|
388
|
+
return require('./icechunk.linux-riscv64-musl.node')
|
|
275
389
|
} catch (e) {
|
|
276
390
|
loadErrors.push(e)
|
|
277
391
|
}
|
|
278
392
|
try {
|
|
279
|
-
|
|
393
|
+
const binding = require('@earthmover/icechunk-linux-riscv64-musl')
|
|
394
|
+
const bindingPackageVersion = require('@earthmover/icechunk-linux-riscv64-musl/package.json').version
|
|
395
|
+
if (bindingPackageVersion !== '2.0.0-alpha.6' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
396
|
+
throw new Error(`Native binding package version mismatch, expected 2.0.0-alpha.6 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
397
|
+
}
|
|
398
|
+
return binding
|
|
280
399
|
} catch (e) {
|
|
281
400
|
loadErrors.push(e)
|
|
282
401
|
}
|
|
283
402
|
} else {
|
|
284
403
|
try {
|
|
285
|
-
return require('./icechunk
|
|
404
|
+
return require('./icechunk.linux-riscv64-gnu.node')
|
|
286
405
|
} catch (e) {
|
|
287
406
|
loadErrors.push(e)
|
|
288
407
|
}
|
|
289
408
|
try {
|
|
290
|
-
|
|
409
|
+
const binding = require('@earthmover/icechunk-linux-riscv64-gnu')
|
|
410
|
+
const bindingPackageVersion = require('@earthmover/icechunk-linux-riscv64-gnu/package.json').version
|
|
411
|
+
if (bindingPackageVersion !== '2.0.0-alpha.6' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
412
|
+
throw new Error(`Native binding package version mismatch, expected 2.0.0-alpha.6 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
413
|
+
}
|
|
414
|
+
return binding
|
|
291
415
|
} catch (e) {
|
|
292
416
|
loadErrors.push(e)
|
|
293
417
|
}
|
|
294
418
|
}
|
|
295
419
|
} else if (process.arch === 'ppc64') {
|
|
296
420
|
try {
|
|
297
|
-
return require('./icechunk
|
|
421
|
+
return require('./icechunk.linux-ppc64-gnu.node')
|
|
298
422
|
} catch (e) {
|
|
299
423
|
loadErrors.push(e)
|
|
300
424
|
}
|
|
301
425
|
try {
|
|
302
|
-
|
|
426
|
+
const binding = require('@earthmover/icechunk-linux-ppc64-gnu')
|
|
427
|
+
const bindingPackageVersion = require('@earthmover/icechunk-linux-ppc64-gnu/package.json').version
|
|
428
|
+
if (bindingPackageVersion !== '2.0.0-alpha.6' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
429
|
+
throw new Error(`Native binding package version mismatch, expected 2.0.0-alpha.6 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
430
|
+
}
|
|
431
|
+
return binding
|
|
303
432
|
} catch (e) {
|
|
304
433
|
loadErrors.push(e)
|
|
305
434
|
}
|
|
306
435
|
} else if (process.arch === 's390x') {
|
|
307
436
|
try {
|
|
308
|
-
return require('./icechunk
|
|
437
|
+
return require('./icechunk.linux-s390x-gnu.node')
|
|
309
438
|
} catch (e) {
|
|
310
439
|
loadErrors.push(e)
|
|
311
440
|
}
|
|
312
441
|
try {
|
|
313
|
-
|
|
442
|
+
const binding = require('@earthmover/icechunk-linux-s390x-gnu')
|
|
443
|
+
const bindingPackageVersion = require('@earthmover/icechunk-linux-s390x-gnu/package.json').version
|
|
444
|
+
if (bindingPackageVersion !== '2.0.0-alpha.6' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
445
|
+
throw new Error(`Native binding package version mismatch, expected 2.0.0-alpha.6 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
446
|
+
}
|
|
447
|
+
return binding
|
|
314
448
|
} catch (e) {
|
|
315
449
|
loadErrors.push(e)
|
|
316
450
|
}
|
|
@@ -320,34 +454,49 @@ function requireNative() {
|
|
|
320
454
|
} else if (process.platform === 'openharmony') {
|
|
321
455
|
if (process.arch === 'arm64') {
|
|
322
456
|
try {
|
|
323
|
-
return require('./icechunk
|
|
457
|
+
return require('./icechunk.openharmony-arm64.node')
|
|
324
458
|
} catch (e) {
|
|
325
459
|
loadErrors.push(e)
|
|
326
460
|
}
|
|
327
461
|
try {
|
|
328
|
-
|
|
462
|
+
const binding = require('@earthmover/icechunk-openharmony-arm64')
|
|
463
|
+
const bindingPackageVersion = require('@earthmover/icechunk-openharmony-arm64/package.json').version
|
|
464
|
+
if (bindingPackageVersion !== '2.0.0-alpha.6' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
465
|
+
throw new Error(`Native binding package version mismatch, expected 2.0.0-alpha.6 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
466
|
+
}
|
|
467
|
+
return binding
|
|
329
468
|
} catch (e) {
|
|
330
469
|
loadErrors.push(e)
|
|
331
470
|
}
|
|
332
471
|
} else if (process.arch === 'x64') {
|
|
333
472
|
try {
|
|
334
|
-
return require('./icechunk
|
|
473
|
+
return require('./icechunk.openharmony-x64.node')
|
|
335
474
|
} catch (e) {
|
|
336
475
|
loadErrors.push(e)
|
|
337
476
|
}
|
|
338
477
|
try {
|
|
339
|
-
|
|
478
|
+
const binding = require('@earthmover/icechunk-openharmony-x64')
|
|
479
|
+
const bindingPackageVersion = require('@earthmover/icechunk-openharmony-x64/package.json').version
|
|
480
|
+
if (bindingPackageVersion !== '2.0.0-alpha.6' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
481
|
+
throw new Error(`Native binding package version mismatch, expected 2.0.0-alpha.6 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
482
|
+
}
|
|
483
|
+
return binding
|
|
340
484
|
} catch (e) {
|
|
341
485
|
loadErrors.push(e)
|
|
342
486
|
}
|
|
343
487
|
} else if (process.arch === 'arm') {
|
|
344
488
|
try {
|
|
345
|
-
return require('./icechunk
|
|
489
|
+
return require('./icechunk.openharmony-arm.node')
|
|
346
490
|
} catch (e) {
|
|
347
491
|
loadErrors.push(e)
|
|
348
492
|
}
|
|
349
493
|
try {
|
|
350
|
-
|
|
494
|
+
const binding = require('@earthmover/icechunk-openharmony-arm')
|
|
495
|
+
const bindingPackageVersion = require('@earthmover/icechunk-openharmony-arm/package.json').version
|
|
496
|
+
if (bindingPackageVersion !== '2.0.0-alpha.6' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
497
|
+
throw new Error(`Native binding package version mismatch, expected 2.0.0-alpha.6 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
498
|
+
}
|
|
499
|
+
return binding
|
|
351
500
|
} catch (e) {
|
|
352
501
|
loadErrors.push(e)
|
|
353
502
|
}
|
|
@@ -362,22 +511,32 @@ function requireNative() {
|
|
|
362
511
|
nativeBinding = requireNative()
|
|
363
512
|
|
|
364
513
|
if (!nativeBinding || process.env.NAPI_RS_FORCE_WASI) {
|
|
514
|
+
let wasiBinding = null
|
|
515
|
+
let wasiBindingError = null
|
|
365
516
|
try {
|
|
366
|
-
|
|
517
|
+
wasiBinding = require('./icechunk.wasi.cjs')
|
|
518
|
+
nativeBinding = wasiBinding
|
|
367
519
|
} catch (err) {
|
|
368
520
|
if (process.env.NAPI_RS_FORCE_WASI) {
|
|
369
|
-
|
|
521
|
+
wasiBindingError = err
|
|
370
522
|
}
|
|
371
523
|
}
|
|
372
524
|
if (!nativeBinding) {
|
|
373
525
|
try {
|
|
374
|
-
|
|
526
|
+
wasiBinding = require('@earthmover/icechunk-wasm32-wasi')
|
|
527
|
+
nativeBinding = wasiBinding
|
|
375
528
|
} catch (err) {
|
|
376
529
|
if (process.env.NAPI_RS_FORCE_WASI) {
|
|
530
|
+
wasiBindingError.cause = err
|
|
377
531
|
loadErrors.push(err)
|
|
378
532
|
}
|
|
379
533
|
}
|
|
380
534
|
}
|
|
535
|
+
if (process.env.NAPI_RS_FORCE_WASI === 'error' && !wasiBinding) {
|
|
536
|
+
const error = new Error('WASI binding not found and NAPI_RS_FORCE_WASI is set to error')
|
|
537
|
+
error.cause = wasiBindingError
|
|
538
|
+
throw error
|
|
539
|
+
}
|
|
381
540
|
}
|
|
382
541
|
|
|
383
542
|
if (!nativeBinding) {
|
|
@@ -386,11 +545,25 @@ if (!nativeBinding) {
|
|
|
386
545
|
`Cannot find native binding. ` +
|
|
387
546
|
`npm has a bug related to optional dependencies (https://github.com/npm/cli/issues/4828). ` +
|
|
388
547
|
'Please try `npm i` again after removing both package-lock.json and node_modules directory.',
|
|
389
|
-
{
|
|
548
|
+
{
|
|
549
|
+
cause: loadErrors.reduce((err, cur) => {
|
|
550
|
+
cur.cause = err
|
|
551
|
+
return cur
|
|
552
|
+
}),
|
|
553
|
+
},
|
|
390
554
|
)
|
|
391
555
|
}
|
|
392
556
|
throw new Error(`Failed to load native binding`)
|
|
393
557
|
}
|
|
394
558
|
|
|
395
559
|
module.exports = nativeBinding
|
|
396
|
-
module.exports.
|
|
560
|
+
module.exports.Repository = nativeBinding.Repository
|
|
561
|
+
module.exports.JsRepository = nativeBinding.JsRepository
|
|
562
|
+
module.exports.Session = nativeBinding.Session
|
|
563
|
+
module.exports.JsSession = nativeBinding.JsSession
|
|
564
|
+
module.exports.Storage = nativeBinding.Storage
|
|
565
|
+
module.exports.JsStorage = nativeBinding.JsStorage
|
|
566
|
+
module.exports.Store = nativeBinding.Store
|
|
567
|
+
module.exports.JsStore = nativeBinding.JsStore
|
|
568
|
+
module.exports.CompressionAlgorithm = nativeBinding.CompressionAlgorithm
|
|
569
|
+
module.exports.JsCompressionAlgorithm = nativeBinding.JsCompressionAlgorithm
|
package/package.json
CHANGED
|
@@ -1,35 +1,40 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@earthmover/icechunk",
|
|
3
|
-
"version": "
|
|
4
|
-
"description": "
|
|
5
|
-
"browser": "browser.js",
|
|
3
|
+
"version": "2.0.0-alpha.10",
|
|
4
|
+
"description": "JavaScript/TypeScript bindings for Icechunk",
|
|
6
5
|
"main": "index.js",
|
|
7
|
-
"repository":
|
|
8
|
-
|
|
6
|
+
"repository": {
|
|
7
|
+
"type": "git",
|
|
8
|
+
"url": "git+https://github.com/earth-mover/icechunk.git",
|
|
9
|
+
"directory": "icechunk-js"
|
|
10
|
+
},
|
|
11
|
+
"license": "Apache 2",
|
|
12
|
+
"browser": "browser.js",
|
|
9
13
|
"keywords": [
|
|
10
|
-
"
|
|
11
|
-
"
|
|
12
|
-
"
|
|
13
|
-
"
|
|
14
|
-
"
|
|
15
|
-
"
|
|
14
|
+
"icechunk",
|
|
15
|
+
"zarr",
|
|
16
|
+
"zarrita",
|
|
17
|
+
"version-control",
|
|
18
|
+
"data",
|
|
19
|
+
"science",
|
|
20
|
+
"geospatial"
|
|
16
21
|
],
|
|
17
22
|
"files": [
|
|
18
23
|
"index.d.ts",
|
|
19
|
-
"index.js"
|
|
24
|
+
"index.js",
|
|
25
|
+
"browser.js"
|
|
20
26
|
],
|
|
21
27
|
"napi": {
|
|
22
|
-
"binaryName": "icechunk
|
|
28
|
+
"binaryName": "icechunk",
|
|
23
29
|
"targets": [
|
|
24
30
|
"x86_64-pc-windows-msvc",
|
|
25
|
-
"x86_64-apple-darwin",
|
|
26
31
|
"x86_64-unknown-linux-gnu",
|
|
27
32
|
"aarch64-apple-darwin",
|
|
28
33
|
"wasm32-wasip1-threads"
|
|
29
34
|
]
|
|
30
35
|
},
|
|
31
36
|
"engines": {
|
|
32
|
-
"node": ">=
|
|
37
|
+
"node": ">= 12.22.0 < 13 || >= 14.17.0 < 15 || >= 15.12.0 < 16 || >= 16.0.0"
|
|
33
38
|
},
|
|
34
39
|
"publishConfig": {
|
|
35
40
|
"registry": "https://registry.npmjs.org/",
|
|
@@ -45,27 +50,29 @@
|
|
|
45
50
|
"format:toml": "taplo format",
|
|
46
51
|
"format:rs": "cargo fmt",
|
|
47
52
|
"lint": "oxlint .",
|
|
48
|
-
"prepublishOnly": "napi prepublish -t npm",
|
|
53
|
+
"prepublishOnly": "napi prepublish -t npm --no-gh-release",
|
|
49
54
|
"test": "ava",
|
|
55
|
+
"preversion": "napi build --platform && git add .",
|
|
50
56
|
"version": "napi version",
|
|
51
57
|
"prepare": "husky"
|
|
52
58
|
},
|
|
53
59
|
"devDependencies": {
|
|
54
|
-
"@emnapi/core": "^1.
|
|
55
|
-
"@emnapi/runtime": "^1.
|
|
56
|
-
"@napi-rs/cli": "^3.0
|
|
57
|
-
"@
|
|
60
|
+
"@emnapi/core": "^1.8.1",
|
|
61
|
+
"@emnapi/runtime": "^1.8.1",
|
|
62
|
+
"@napi-rs/cli": "^3.2.0",
|
|
63
|
+
"@napi-rs/wasm-runtime": "^1.1.1",
|
|
64
|
+
"@oxc-node/core": "^0.0.35",
|
|
58
65
|
"@taplo/cli": "^0.7.0",
|
|
59
|
-
"@tybys/wasm-util": "^0.10.
|
|
66
|
+
"@tybys/wasm-util": "^0.10.1",
|
|
60
67
|
"ava": "^6.4.1",
|
|
61
|
-
"chalk": "^5.
|
|
68
|
+
"chalk": "^5.6.2",
|
|
62
69
|
"husky": "^9.1.7",
|
|
63
|
-
"lint-staged": "^16.1.
|
|
70
|
+
"lint-staged": "^16.1.6",
|
|
64
71
|
"npm-run-all2": "^8.0.4",
|
|
65
|
-
"oxlint": "^1.
|
|
72
|
+
"oxlint": "^1.14.0",
|
|
66
73
|
"prettier": "^3.6.2",
|
|
67
|
-
"tinybench": "^
|
|
68
|
-
"typescript": "^5.
|
|
74
|
+
"tinybench": "^6.0.0",
|
|
75
|
+
"typescript": "^5.9.2"
|
|
69
76
|
},
|
|
70
77
|
"lint-staged": {
|
|
71
78
|
"*.@(js|ts|tsx)": [
|
|
@@ -99,12 +106,11 @@
|
|
|
99
106
|
"singleQuote": true,
|
|
100
107
|
"arrowParens": "always"
|
|
101
108
|
},
|
|
102
|
-
"packageManager": "yarn@4.
|
|
109
|
+
"packageManager": "yarn@4.12.0",
|
|
103
110
|
"optionalDependencies": {
|
|
104
|
-
"@earthmover/icechunk-win32-x64-msvc": "
|
|
105
|
-
"@earthmover/icechunk-
|
|
106
|
-
"@earthmover/icechunk-
|
|
107
|
-
"@earthmover/icechunk-
|
|
108
|
-
"@earthmover/icechunk-wasm32-wasi": "1.0.3"
|
|
111
|
+
"@earthmover/icechunk-win32-x64-msvc": "2.0.0-alpha.10",
|
|
112
|
+
"@earthmover/icechunk-linux-x64-gnu": "2.0.0-alpha.10",
|
|
113
|
+
"@earthmover/icechunk-darwin-arm64": "2.0.0-alpha.10",
|
|
114
|
+
"@earthmover/icechunk-wasm32-wasi": "2.0.0-alpha.10"
|
|
109
115
|
}
|
|
110
116
|
}
|
package/LICENSE
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2020 N-API for Rust
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
SOFTWARE.
|