Skip to content

Commit

Permalink
fix: move wasm to ridb-core
Browse files Browse the repository at this point in the history
  • Loading branch information
elribonazo committed Jan 1, 2025
1 parent fbfeb70 commit 964827b
Show file tree
Hide file tree
Showing 37 changed files with 43 additions and 70 deletions.
73 changes: 23 additions & 50 deletions package-lock.json

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

File renamed without changes.
File renamed without changes.

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

Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "ridb-wasm"
version = "1.0.2"
name = "ridb-core"
version = "1.0.0"
edition = "2021"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
Expand Down
File renamed without changes.
File renamed without changes.
6 changes: 3 additions & 3 deletions packages/ridb-wasm/build.sh → packages/ridb-core/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,16 @@ is_mac() {


PACKAGEJSON=./pkg/package.json
IMPORTFILE=./pkg/ridb_wasm.js
IMPORTFILE=./pkg/ridb_core.js

echo "Building the rust library"
wasm-pack --log-level error build --target=web --scope trust0


if is_mac; then
sed -i '' 's/"module": "ridb_wasm.js",/"main": "ridb_wasm.js",/' $PACKAGEJSON
sed -i '' 's/"module": "ridb_core.js",/"main": "ridb_core.js",/' $PACKAGEJSON
sed -i '' "/if (typeof input === 'undefined') {/,/}/d" $IMPORTFILE
else
sed -i 's/"module": "ridb_wasm.js",/"main": "ridb_wasm.js",/' $PACKAGEJSON
sed -i 's/"module": "ridb_core.js",/"main": "ridb_core.js",/' $PACKAGEJSON
sed -i "/if (typeof input === 'undefined') {/,/}/d" $IMPORTFILE
fi
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
{
"name": "@trust0/ridb-wasm",
"name": "@trust0/ridb-core",
"description": "Ridb Wasm",
"type": "module",
"publishConfig": {
"access": "public"
},
"version": "1.0.0",
"main": "./pkg/ridb_wasm.js",
"types": "./pkg/ridb_wasm.d.ts",
"main": "./pkg/ridb_core.js",
"types": "./pkg/ridb_core.d.ts",
"sideEffects": [
"./pkg/snippets/*"
],
Expand All @@ -17,8 +17,8 @@
"build": "sh build.sh"
},
"files": [
"./pkg/ridb_wasm_bg.wasm",
"./pkg/ridb_wasm.js",
"./pkg/ridb_wasm.d.ts"
"./pkg/ridb_core_bg.wasm",
"./pkg/ridb_core.js",
"./pkg/ridb_core.d.ts"
]
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion packages/ridb-level/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import type {
Operation,
QueryType,
BaseStorage as BaseStorageWasm
} from "@trust0/ridb-wasm";
} from "@trust0/ridb-core";
import type { ClassicLevel } from "classic-level";
type Level = ClassicLevel<string, string>

Expand Down
2 changes: 1 addition & 1 deletion packages/ridb/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
"@semantic-release/npm": "^12.0.1",
"@semantic-release/release-notes-generator": "^14.0.2",
"@trust0/ridb-testing": "^0.0.1",
"@trust0/ridb-wasm": "1.0.0-rc.1",
"@trust0/ridb-core": "1.0.0",
"@types/node": "^20.14.2",
"@vitest/browser": "^1.6.0",
"@vitest/coverage-istanbul": "^1.6.0",
Expand Down
Loading

0 comments on commit 964827b

Please sign in to comment.