2 Commits
v0.0.1 ... main

4 changed files with 44 additions and 10 deletions

View File

@@ -3,6 +3,7 @@ name: Build WASM
on: on:
push: push:
branches: [main] branches: [main]
tags: ['v*']
pull_request: pull_request:
branches: [main] branches: [main]
workflow_dispatch: workflow_dispatch:
@@ -94,3 +95,22 @@ jobs:
dist/anisette_rs.node.js dist/anisette_rs.node.js
dist/anisette_rs.node.wasm dist/anisette_rs.node.wasm
generate_release_notes: true generate_release_notes: true
- name: Setup Node.js
if: startsWith(github.ref, 'refs/tags/v')
uses: actions/setup-node@v4
with:
node-version: '20'
registry-url: 'https://npm.pkg.github.com'
- name: Build TypeScript
if: startsWith(github.ref, 'refs/tags/v')
working-directory: js/
run: npm run build
- name: Publish to GitHub Packages
if: startsWith(github.ref, 'refs/tags/v')
working-directory: js/
run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

View File

@@ -10,7 +10,7 @@ export async function initLibcurl(): Promise<void> {
const wsProto = location.protocol === "https:" ? "wss:" : "ws:"; const wsProto = location.protocol === "https:" ? "wss:" : "ws:";
let wsUrl = `${wsProto}//${location.host}/wisp/`; let wsUrl = `${wsProto}//${location.host}/wisp/`;
libcurl.set_websocket(wsUrl); libcurl.set_websocket(wsUrl);
await libcurl.load_wasm("/libcurl.wasm"); await libcurl.load_wasm();
initialized = true; initialized = true;
})(); })();

View File

@@ -1,21 +1,26 @@
{ {
"name": "anisette-js", "name": "@lbr77/anisette-js",
"version": "0.1.0", "version": "0.1.2",
"description": "High-level JavaScript/TypeScript API for Apple Anisette headers via WASM", "description": "High-level JavaScript/TypeScript API for Apple Anisette headers via WASM",
"type": "module", "type": "module",
"main": "./dist/index.js", "main": "./dist/index.js",
"module": "./dist/index.js",
"types": "./dist/index.d.ts", "types": "./dist/index.d.ts",
"exports": { "exports": {
".": { ".": {
"types": "./dist/index.d.ts", "types": "./dist/index.d.ts",
"default": "./src/browser.ts", "browser": "./dist/browser.js",
"node": "./src/index.ts" "import": "./dist/index.js",
} "default": "./dist/index.js"
},
"./browser": {
"types": "./dist/browser.d.ts",
"default": "./dist/browser.js"
},
"./package.json": "./package.json"
}, },
"files": [ "files": [
"dist", "dist"
"./src/anisette_rs.js",
"./src/anisette_rs.node.js"
], ],
"scripts": { "scripts": {
"build": "tsc && cp src/anisette_rs.js dist/ && cp src/anisette_rs.node.js dist/", "build": "tsc && cp src/anisette_rs.js dist/ && cp src/anisette_rs.node.js dist/",
@@ -26,5 +31,13 @@
}, },
"dependencies": { "dependencies": {
"@types/node": "^25.3.2" "@types/node": "^25.3.2"
},
"publishConfig": {
"registry": "https://registry.npmjs.org/",
"access": "public"
},
"repository": {
"type": "git",
"url": "git+https://github.com/lbr77/anisette-js.git"
} }
} }

View File

@@ -100,7 +100,8 @@ export class Anisette {
mountIdbfsPaths(bridge, libraryPath, provisioningPath); mountIdbfsPaths(bridge, libraryPath, provisioningPath);
try { try {
await bridge.syncIdbfsFromStorage(); await bridge.syncIdbfsFromStorage();
} catch { } catch (err) {
console.log("[anisette] Failed to sync IDBFS from storage:", err);
// Ignore errors - might be first run with no existing data // Ignore errors - might be first run with no existing data
} }