Skip to content

Commit

Permalink
dep
Browse files Browse the repository at this point in the history
  • Loading branch information
toyobayashi committed May 13, 2024
1 parent c024ead commit b590695
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 13 deletions.
4 changes: 2 additions & 2 deletions packages/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@
},
"./dist/emnapi-core.min.mjs": {
"types": "./dist/emnapi-core.d.mts",
"import": "./dist/emnapi-core.min.mjs",
"require": null
"default": "./dist/emnapi-core.min.mjs"
}
},
"dependencies": {
"@emnapi/wasi-threads": "1.0.0",
"tslib": "^2.4.0"
},
"scripts": {
Expand Down
10 changes: 5 additions & 5 deletions packages/core/script/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ function build () {
}
},
{
input: createInput(ts.ScriptTarget.ES2019, false, ['tslib']),
input: createInput(ts.ScriptTarget.ES2019, false, ['tslib', '@emnapi/wasi-threads']),
output: {
file: path.join(dist, 'emnapi-core.cjs.js'),
format: 'cjs',
Expand All @@ -118,7 +118,7 @@ function build () {
}
},
{
input: createInput(ts.ScriptTarget.ES2019, true, ['tslib']),
input: createInput(ts.ScriptTarget.ES2019, true, ['tslib', '@emnapi/wasi-threads']),
output: {
file: path.join(dist, 'emnapi-core.cjs.min.js'),
format: 'cjs',
Expand All @@ -128,7 +128,7 @@ function build () {
}
},
{
input: createInput(ts.ScriptTarget.ES2019, false, ['tslib']),
input: createInput(ts.ScriptTarget.ES2019, false, ['tslib', '@emnapi/wasi-threads']),
output: {
file: path.join(dist, 'emnapi-core.mjs'),
format: 'esm',
Expand All @@ -138,7 +138,7 @@ function build () {
}
},
{
input: createInput(ts.ScriptTarget.ES2019, true, ['tslib']),
input: createInput(ts.ScriptTarget.ES2019, true, ['tslib', '@emnapi/wasi-threads']),
output: {
file: path.join(dist, 'emnapi-core.min.mjs'),
format: 'esm',
Expand All @@ -148,7 +148,7 @@ function build () {
}
},
{
input: createInput(ts.ScriptTarget.ES5, false, ['tslib']),
input: createInput(ts.ScriptTarget.ES5, false, ['tslib', '@emnapi/wasi-threads']),
output: {
file: path.join(dist, 'emnapi-core.esm-bundler.js'),
format: 'esm',
Expand Down
2 changes: 1 addition & 1 deletion packages/emnapi/script/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ async function build () {
})
const parsedCode = compiler.parseCode(code)
return `import { _WebAssembly as WebAssembly } from '@/util'
import * as wasiThreads from '@emnapi/wasi-threads'
import { ThreadManager } from '@emnapi/wasi-threads'
export function createNapiModule (options) {
${parsedCode}
Expand Down
2 changes: 1 addition & 1 deletion packages/emnapi/src/core/init.ts
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ function emnapiAddSendListener (worker: any): boolean {

napiModule.emnapi.addSendListener = emnapiAddSendListener

export var PThread = new wasiThreads.ThreadManager({
export var PThread = new ThreadManager({
printErr: err,
beforeLoad: (worker) => {
emnapiAddSendListener(worker)
Expand Down
4 changes: 2 additions & 2 deletions packages/emnapi/src/core/scope.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ declare interface CreateOptions {
// factory parameter
declare const options: CreateOptions

declare const wasiThreads: typeof import('../../../wasi-threads/lib/typings/index')

declare type ThreadManagerOptions = import('../../../wasi-threads/lib/typings/index').ThreadManagerOptions
declare const ThreadManager: typeof import('../../../wasi-threads/lib/typings/index').ThreadManager
// eslint-disable-next-line @typescript-eslint/no-redeclare
declare type ThreadManager = import('../../../wasi-threads/lib/typings/index').ThreadManager
3 changes: 1 addition & 2 deletions packages/runtime/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,7 @@
},
"./dist/emnapi.min.mjs": {
"types": "./dist/emnapi.d.mts",
"import": "./dist/emnapi.min.mjs",
"require": null
"default": "./dist/emnapi.min.mjs"
}
},
"dependencies": {
Expand Down

0 comments on commit b590695

Please sign in to comment.