Skip to content

Commit

Permalink
fix: add "web-streams-polyfill" to "ic_oss_ts" for Safari browser com…
Browse files Browse the repository at this point in the history
…patibility
  • Loading branch information
zensh committed Oct 12, 2024
1 parent 350266c commit 3df28d9
Show file tree
Hide file tree
Showing 8 changed files with 108 additions and 98 deletions.
132 changes: 71 additions & 61 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 8 additions & 7 deletions src/ic_oss_ts/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@ldclabs/ic_oss_ts",
"version": "0.9.3",
"version": "0.9.4",
"type": "module",
"description": "The Typescript version of the client SDK for the ic-oss cluster.",
"license": "MIT",
Expand Down Expand Up @@ -37,21 +37,22 @@
"@dfinity/agent": "^2.1.2",
"@dfinity/candid": "^2.1.2",
"@dfinity/principal": "^2.1.2",
"@dfinity/utils": "^2.5.1",
"@dfinity/utils": "^2.5.2",
"@noble/hashes": "^1.5.0",
"mime": "^4.0.4"
"mime": "^4.0.4",
"web-streams-polyfill": "^4.0.0"
},
"devDependencies": {
"@types/node": "22.7.4",
"@types/eslint": "^9.6.1",
"@typescript-eslint/eslint-plugin": "^8.8.0",
"@typescript-eslint/parser": "^8.8.0",
"typescript": "^5.6.2",
"@types/node": "22.7.5",
"@typescript-eslint/eslint-plugin": "^8.8.1",
"@typescript-eslint/parser": "^8.8.1",
"eslint": "^9.12.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-import": "^2.31.0",
"eslint-plugin-prettier": "^5.2.1",
"prettier": "^3.3.3",
"typescript": "^5.6.3",
"vitest": "^2.1.2"
}
}
10 changes: 5 additions & 5 deletions src/ic_oss_ts/src/bucket.canister.ts
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
import { Canister, createServices } from '@dfinity/utils'
import type { _SERVICE as BucketService } from '../candid/ic_oss_bucket/ic_oss_bucket.did.js'
import { idlFactory } from '../candid/ic_oss_bucket/ic_oss_bucket.did.js'
import type {
BucketInfo,
_SERVICE as BucketService,
CanisterStatusResponse,
CreateFileInput,
CreateFileOutput,
CreateFolderInput,
FolderName,
FileInfo,
FolderInfo,
FolderName,
MoveInput,
UpdateFileOutput,
UpdateFileChunkInput,
UpdateFileChunkOutput,
UpdateFileInput,
UpdateFileOutput,
UpdateFolderInput
} from '../candid/ic_oss_bucket/ic_oss_bucket.did.js'
import { idlFactory } from '../candid/ic_oss_bucket/ic_oss_bucket.did.js'
import type { CanisterOptions } from './types.js'
import { resultOk, FileChunk } from './types.js'
import { FileChunk, resultOk } from './types.js'

export class BucketCanister extends Canister<BucketService> {
#resultOk: typeof resultOk = resultOk
Expand Down
12 changes: 6 additions & 6 deletions src/ic_oss_ts/src/cluster.canister.ts
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
import type { Principal } from '@dfinity/principal'
import { Canister, createServices } from '@dfinity/utils'
import type { _SERVICE as ClusterService } from '../candid/ic_oss_cluster/ic_oss_cluster.did.js'
import { idlFactory } from '../candid/ic_oss_cluster/ic_oss_cluster.did.js'
import type {
ClusterInfo,
AddWasmInput,
Token,
DeployWasmInput,
BucketDeploymentInfo,
ClusterInfo,
_SERVICE as ClusterService,
DeployWasmInput,
Token,
WasmInfo
} from '../candid/ic_oss_cluster/ic_oss_cluster.did.js'
import { idlFactory } from '../candid/ic_oss_cluster/ic_oss_cluster.did.js'
import type { CanisterOptions } from './types.js'
import { resultOk } from './types.js'
import type { Principal } from '@dfinity/principal'

export class ClusterCanister extends Canister<ClusterService> {
#resultOk: typeof resultOk = resultOk
Expand Down
7 changes: 4 additions & 3 deletions src/ic_oss_ts/src/stream.test.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
import { open } from 'node:fs/promises'
import { expect, test } from 'vitest'
import { type ReadableStream } from 'web-streams-polyfill'
import {
uint8ArrayToFixedChunkSizeReadable,
readableStreamAsyncIterator,
readAll,
streamToFixedChunkSizeReadable,
readAll
uint8ArrayToFixedChunkSizeReadable
} from './stream'
import { open } from 'node:fs/promises'

test('uint8ArrayToFixedChunkSizeReadable', async () => {
const src = new Uint8Array([0, 1, 2, 3, 4, 5, 6, 7, 8, 9])
Expand Down
Loading

0 comments on commit 3df28d9

Please sign in to comment.