Skip to content

Typescript#102

Draft
lalalune wants to merge 17 commits intohyperfy-xyz:mainfrom
lalalune:ts
Draft

Typescript#102
lalalune wants to merge 17 commits intohyperfy-xyz:mainfrom
lalalune:ts

Conversation

@lalalune
Copy link
Copy Markdown
Contributor

@lalalune lalalune commented Jun 23, 2025

This is a complete working end-to-end Typescript build of Hyperfy.

A few things were changed to accommodate Typescript and common practices, but the core is the same.

Oh, I added a Runescape RPG too.

tcm390 and others added 17 commits May 13, 2025 17:38
I've set up the project for NPM packaging of the Node.js client.

Key changes include:
- Updates `src/node-client/index.js` to export System, Node, and World.
- Modifies `scripts/build-node-client.mjs` to:
  - Output to `dist/npm/`.
  - Copy PhysX assets to `dist/npm/vendor/`.
  - Generate a `package.json` for the NPM package in `dist/npm/`.
  - Generate a fallback `index.d.ts` in `dist/npm/` (automated generation via dts-bundle-generator failed when I checked it).
- Adds `typescript` and `dts-bundle-generator` as devDependencies.
- Updates the main `package.json` with a `publish:node` script and adds `dist/npm/` to the `files` array.
- Adds a GitHub Actions workflow (`.github/workflows/npm-publish.yml`) to automate publishing to NPM on new GitHub releases.
- Updates `README.md` with installation and publishing instructions.

Note: Further work is required to address:
- A runtime error "navigator is not defined" when using the client in Node.js.
- Issues with the accuracy and completeness of the generated `index.d.ts` TypeScript definitions.

This commit includes all preparatory work up to the point of encountering these critical issues when I checked it.
Export required modules for plugin-hyperfy
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants