Skip to content

Commit

Permalink
fix: otoroshi js/ts templates
Browse files Browse the repository at this point in the history
Merge between default template and speicific otoroshi index.js / index.ts
caused inconsistency between function name in index file and plugin.d.ts file.

Fix #41
  • Loading branch information
ptitFicus committed Jul 15, 2024
1 parent 5874838 commit 1747c9b
Show file tree
Hide file tree
Showing 6 changed files with 5 additions and 5 deletions.
Binary file modified server/templates/js.zip
Binary file not shown.
4 changes: 2 additions & 2 deletions server/templates/js/index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
function greet() {
function execute() {
const name = Host.inputString()
Host.outputString(`Hello, ${name}`)
}

module.exports = { greet }
module.exports = { execute }
2 changes: 1 addition & 1 deletion server/templates/js/plugin.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@
DO NOT DELETE THIS FILE
*/
declare module 'main' {
export function greet(): I32;
export function execute(): I32;
}
Binary file modified server/templates/ts.zip
Binary file not shown.
2 changes: 1 addition & 1 deletion server/templates/ts/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
export declare var Host: any;

export function greet() {
export function execute() {
let name = Host.inputString() as String;

Host.outputString(`Hello, ${name}`);
Expand Down
2 changes: 1 addition & 1 deletion server/templates/ts/plugin.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@
DO NOT DELETE THIS FILE
*/
declare module 'main' {
export function greet(): I32;
export function execute(): I32;
}

0 comments on commit 1747c9b

Please sign in to comment.