Skip to content

Commit

Permalink
fix: exporting types (why)
Browse files Browse the repository at this point in the history
  • Loading branch information
JadlionHD committed Oct 12, 2024
1 parent 16f1afb commit 353b8ba
Show file tree
Hide file tree
Showing 13 changed files with 38 additions and 137 deletions.
20 changes: 20 additions & 0 deletions .vscode/c_cpp_properties.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"configurations": [
{
"name": "Win32",
"includePath": [
"${default}"
],
"defines": [
"_DEBUG",
"UNICODE",
"_UNICODE"
],
"compilerPath": "D:\\msys64\\ucrt64\\bin\\gcc.exe",
"cStandard": "c17",
"cppStandard": "gnu++17",
"intelliSenseMode": "windows-gcc-x64"
}
],
"version": 4
}
10 changes: 9 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,13 @@
"lib/include",
"${env:LOCALAPPDATA}\\node-gyp\\Cache\\18.16.0\\include\\node",
"${workspaceFolder}\\node_modules\\node-addon-api"
]
],
"files.associations": {
"*.ejs": "html",
"array": "cpp",
"string": "cpp",
"string_view": "cpp",
"span": "cpp"
},
"editor.tabSize": 2
}
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,19 +1,20 @@
{
"name": "growtopia.js",
"version": "1.6.1",
"version": "1.6.2",
"description": "A package to create a growtopia private servers.",
"main": "dist/index.js",
"types": "dist/index.d.ts",
"type": "module",
"scripts": {
"test": "npm run build:prebuild && npm run build:ts && node test/basic-example/index.js",
"test": "npm run build:prebuild && npm run build:ts && node test/basic.js",
"dev": "rimraf dist && npm run build && npm run build:ts && node test/basic-example/index.js",
"dev:nonative": "rimraf dist && npm run build:ts",
"docs:gen": "rimraf docs && typedoc",
"build:prebuild": "prebuildify --napi",
"build": "node-gyp-build",
"build:gyp": "node-gyp configure rebuild",
"build:ts": "tsc",
"prepare": "rimraf dist && tsc && cp -r src/types dist/types",
"install": "node-gyp-build"
},
"homepage": "https://github.com/JadlionHD/growtopia.js#readme",
Expand Down
2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ export * from "./structures/Peer.js";
export * from "./structures/ItemsDat.js";
export * from "./util/Constants.js";
export * from "./util/Utils.js";

export * from "./packets/TankPacket.js";
export * from "./packets/TextPacket.js";
export * from "./packets/Variant.js";
export type * from "../types/index";
2 changes: 1 addition & 1 deletion src/packets/Variant.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { TankPacket } from "./TankPacket.js";

// Types
import type { VariantArg, VariantArray, VariantOptions } from "../../types/packets";
import type { VariantArg, VariantArray, VariantOptions } from "../../types/packets.js";
import { VariantTypes } from "../util/Constants.js";

/**
Expand Down
4 changes: 1 addition & 3 deletions test/basic-example/index.js → test/basic.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { Client, TextPacket, Peer } from "../../dist/index.js";

import { Client, TextPacket, Peer, Tank } from "../dist/index";
const client = new Client({
enet: {
ip: "0.0.0.0"
Expand All @@ -8,7 +7,6 @@ const client = new Client({

client.on("ready", () => {
console.log(`ENet server: port ${client.config.enet.port} on ${client.config.enet.ip}`);
process.exit(0); // Stop event loop when testing
});

client.on("error", (err) => {
Expand Down
17 changes: 0 additions & 17 deletions test/items-builder-v16/index.js

This file was deleted.

Binary file removed test/items-builder-v16/items.dat
Binary file not shown.
18 changes: 0 additions & 18 deletions test/items-builder-v17-and-v18/index.js

This file was deleted.

Binary file removed test/items-builder-v17-and-v18/items.dat
Binary file not shown.
21 changes: 0 additions & 21 deletions test/module-system/index.js

This file was deleted.

70 changes: 0 additions & 70 deletions test/module-system/module.js

This file was deleted.

6 changes: 3 additions & 3 deletions types/packets.d.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { TankPacket } from "../src/packets/TankPacket";
import { TextPacket } from "../src/packets/TextPacket";
import { Variant } from "../src/packets/Variant";
import { TankPacket } from "../packets/TankPacket";
import { TextPacket } from "../packets/TextPacket";
import { Variant } from "../packets/Variant";

/**
* Represents the data needed for the TankPacket.
Expand Down

0 comments on commit 353b8ba

Please sign in to comment.