Skip to content

Commit

Permalink
perf: try add type to dist
Browse files Browse the repository at this point in the history
  • Loading branch information
X3ZvaWQ committed Feb 15, 2024
1 parent e874e6e commit ce983d2
Show file tree
Hide file tree
Showing 4 changed files with 73 additions and 63 deletions.
120 changes: 60 additions & 60 deletions package-lock.json

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

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "wasmoon-lua5.1",
"version": "1.18.8",
"version": "1.18.9",
"description": "A real lua 5.1 VM with JS bindings made with webassembly",
"main": "dist/index.js",
"scripts": {
Expand Down
12 changes: 11 additions & 1 deletion rollup.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import json from '@rollup/plugin-json';
import dts from 'rollup-plugin-dts';
import copy from 'rollup-plugin-copy';
import nodePolyfills from 'rollup-plugin-polyfill-node';
import fs from 'fs';

const production = !process.env.ROLLUP_WATCH;

Expand Down Expand Up @@ -37,6 +38,15 @@ export default [
{
input: './src/index.ts',
output: { file: 'dist/index.d.ts', format: 'es' },
plugins: [dts()],
plugins: [
dts(),
{
name: 'reference',
banner: fs
.readdirSync(`types`)
.map((s) => `/// <reference path="../types/${s}" />`)
.join('\n'),
},
],
},
];
2 changes: 1 addition & 1 deletion src/thread.ts
Original file line number Diff line number Diff line change
Expand Up @@ -407,7 +407,7 @@ export default class LuaThread {
}, 'vii');
}

this.luaApi.lua_sethook(this.address, this.hookFunctionPointer, LuaEventMasks.Count, INSTRUCTION_HOOK_COUNT);
this.luaApi.lua_sethook(this.address, this.hookFunctionPointer as number, LuaEventMasks.Count, INSTRUCTION_HOOK_COUNT);

Check failure on line 410 in src/thread.ts

View workflow job for this annotation

GitHub Actions / publish

This assertion is unnecessary since it does not change the type of the expression
this.timeout = timeout;
} else if (this.hookFunctionPointer) {
this.hookFunctionPointer = undefined;
Expand Down

0 comments on commit ce983d2

Please sign in to comment.