Skip to content

Reorganize modules/exports and auto-generate docs#104

Open
DocDvorak wants to merge 25 commits into
masterfrom
typedoc
Open

Reorganize modules/exports and auto-generate docs#104
DocDvorak wants to merge 25 commits into
masterfrom
typedoc

Conversation

@DocDvorak

@DocDvorak DocDvorak commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

Pulled the socket API event types and some class organization concepts from the typescript branch.

Added auto-generated API documentation and a CI workflow to deploy it to Github Pages. Also wrote several guides.

Breaking Changes:

  • Flattened the endpoint method structure on ScreepsAPI
    • Almost every endpoint method has been renamed
  • Renamed ScreepsAPI to ScreepsHttpClient

Features:

  • Exported most of the package's types/classes/enums
    • ConfigManager is now exported as ScreepsConfigManager
    • Socket is now exported as ScreepsSocketClient
  • Replaced all (or almost all) discriminated union of literal values with enums
  • ScreepsConfigManager now checks for config files in the default value of $XDG_CONFIG_HOME if it is not defined (Linux/*BSD only)
  • ScreepsConfigManager now checks $HOME/Library/Application Support for config files on macOS.
  • Added screepsapi:config debug namespace for ScreepsConfigManager
  • Added ScreepsHttpClient.setServer() (which was removed in the initial TypeScript migration)

Docs:

  • Added typedoc dev dependency to generate documentation from docblocks
  • Added more docblocks
  • Moved guides from docs/ to guides/
    • docs/ is now the output directory for Typedoc and has been added to .gitignore
  • Wrote several new guides
  • Added examples/terminal-client.ts script
  • Migrated code from README and examples/ to v2
    • TypeScript example scripts can still be run from the command line:
yarn exec tsx examples/file-name.ts

Chores:

  • Added a Github Actions workflow to generate and deploy docs to Github Pages
  • Removed Api namespace:
    • Moved common types/enums (used by HTTP/WebSocket APIs) to src/common/
    • Moved HTTP types/enums to src/http

Pulled the socket API event types and some class organization
concepts from the `typescript` branch.

Added auto-generated API documentation and a CI workflow to
deploy it to Github Pages. Also wrote several guides.

Breaking Changes:
* Flattened the endpoint method structure on `ScreepsAPI`
  * Almost every endpoint method has been renamed
* Changed type of `ScreepsAPI.rateLimits` to `RateLimitTracker`
* Renamed `ScreepsAPI` to `ScreepsHttpClient`

Features:
* Exported `ScreepsSocketClient` (formerly `Socket`) and many other
  types
* `ConfigManager` is now exported as `ScreepsConfigManager`
* `ScreepsConfigManager` now checks for config files in the default
  value of `$XDG_CONFIG_HOME` if it is not defined (Linux/*BSD only)
* `ScreepsConfigManager` now checks `$HOME/Library/Application Support`
  for config files on macOS.
* Added `screepsapi:config` debug namespace for `ScreepsConfigManager`

Docs:
* Added `typedoc` dev dependency to generate documentation from
  docblocks
* Added more docblocks
* Moved guides from `docs/` to `guides/`
* Wrote several new guides
* Migrated code from README and examples/ to v2
  * TypeScript example scripts can still be run from the command line:
    ```sh
yarn exec tsx examples/file-name.ts
    ```

Chores:
* Added a Github Actions workflow to generate and deploy docs to Github
  Pages
@DocDvorak DocDvorak requested a review from AlinaNova21 June 11, 2026 02:46
@DocDvorak

Copy link
Copy Markdown
Contributor Author

I've created a test PR on my fork to allow for a preview of the generated API docs (and to test the doc generation/deployment CI workflow).

@DocDvorak

Copy link
Copy Markdown
Contributor Author

TODO:

  • Rename ClientConfig.client to ClientConfig.app for consistency with ScreepsHttpClient.appConfig
  • Add more details to rate limit guide on how global/endpoint retry functionality works out
  • Add note to ScreepsHttpClient.gameRoomTerrainUnencoded(): Warning: In rare circumstances (unofficial servers that are using maps generated via the map.generateRoom CLI command), this endpoint will return encoded terrain data instead of unencoded data.

@DocDvorak DocDvorak linked an issue Jun 13, 2026 that may be closed by this pull request
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.

Docs link broken

1 participant