Skip to content

Commit

Permalink
fix module (#362)
Browse files Browse the repository at this point in the history
  • Loading branch information
ermalkaleci authored Aug 9, 2023
1 parent 02c4851 commit af673ff
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 9 deletions.
2 changes: 1 addition & 1 deletion executor/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@acala-network/chopsticks-executor",
"description": "Chopsticks executor",
"version": "0.8.0-0",
"version": "0.8.0-1",
"license": "Apache-2.0",
"repository": {
"type": "git",
Expand Down
2 changes: 1 addition & 1 deletion packages/chopsticks/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@acala-network/chopsticks",
"version": "0.8.0-0",
"version": "0.8.0-1",
"author": "Bryan Chen <xlchen1291@gmail.com>",
"license": "Apache-2.0",
"bin": "./chopsticks.js",
Expand Down
2 changes: 1 addition & 1 deletion packages/core/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@acala-network/chopsticks-core",
"version": "0.8.0-0",
"version": "0.8.0-1",
"author": "Bryan Chen <xlchen1291@gmail.com>",
"license": "Apache-2.0",
"scripts": {
Expand Down
7 changes: 5 additions & 2 deletions packages/core/src/db/browser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,14 @@ import { DataSource } from 'typeorm'
import { createInstance } from 'localforage'
import initSqlJs from 'sql.js'

globalThis.localforage = createInstance({ name: 'chopsticks' })

import * as entities from './entities'

export const openDb = async (dbPath: string): Promise<DataSource> => {
if (!globalThis.localforage) {
globalThis.localforage = createInstance({ name: 'chopsticks' })
}
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
const wasmUrl = new URL('../../../../node_modules/sql.js/dist/sql-wasm.wasm', import.meta.url)
const wasmBinary = await fetch(wasmUrl).then((response) => response.arrayBuffer())
const source = new DataSource({
Expand Down
5 changes: 2 additions & 3 deletions packages/core/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,8 @@
"compilerOptions": {
"outDir": "lib",
"rootDir": "src",
"target": "es2015",
"lib": ["es5", "dom", "dom.iterable"],
"module": "es2020",
"target": "es2016",
"lib": ["es6", "dom", "dom.iterable"],
"isolatedModules": true
},
"include": ["src/**/*"],
Expand Down
2 changes: 1 addition & 1 deletion packages/testing/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@acala-network/chopsticks-testing",
"version": "0.8.0-0",
"version": "0.8.0-1",
"author": "Bryan Chen <xlchen1291@gmail.com>",
"license": "Apache-2.0",
"scripts": {
Expand Down

0 comments on commit af673ff

Please sign in to comment.