fix(deps): update dependency screeps-api to v2 #102
Reference in New Issue
Block a user
Delete Branch "renovate/screeps-api-2.x"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
This PR contains the following updates:
^1.7.2→^2.0.0Release Notes
screepers/node-screeps-api (screeps-api)
v2.0.1Compare Source
This is a re-release of v2.0.0 that fixes a packaging issue. Original release notes follow:
Please see the v2 Migration Guide for tips and examples for migrating from v1.x.
Breaking Changes
General:
HTTP API:
ScreepsAPIclass toScreepsHttpClientScreepsHttpClient.fromConfig()parameters have been changed'main'to prevent accidental usage of the'main'serverScreepsHttpClient:name: stringparameter toScreepsHttpClient.changeFlagColor()_id: stringparameter toScreepsHttpClient.gameAddObjectIntent()encodedparameter fromScreepsHttpClient.gameRoomTerrain()ScreepsHttpClient.gameRoomTerrainUnencoded()ScreepsHttpClient.userCodeSet()request params into an object so they could share types withScreepsHttpClient.userCodeGet()responsesScreepsClientConfig.defaultShardis not defined'shard0'is no longer used as a default to prevent accidental operations on the wrong shardScreepsHttpClientnow only fires therateLimitevent when a rate limit is exceeded.experimentalRetry429option:retry429GlobalScreepsClientConfigoption instead of being part of the server configWebSocket API:
connect()no longer acceptsScreepsSocketConfigoptionsappConfiglike they are for the HTTP client (see related change in "New Features")resubscribe()no longer subscribes to events that were fully unsubscribed before disconnectingsubscribe()no longer registers duplicate instances of the same callback to the same eventstruefor newforceparamScreepsHttpClient.setServer()now triggersdisconnect()authed,connected, andreconnectingproperties now have private setterswsandhttpproperties are now protectedCLI:
memoryoutput format:New Features and Improvements
General:
screeps.jsoncredential files: https://screepers.github.io/node-screeps-api/documents/Configuration_and_Credential_Files.htmlScreepsConfigManagernow checks for config files in the default$XDG_CONFIG_HOMEdirectory if the env var is not definedScreepsConfigManagernow checks$HOME/Library/Application Supportfor config files.ScreepsClientConfig.defaultShardoptionScreepsHttpClient.debug()method to enable/disable debug logging: https://screepers.github.io/node-screeps-api/documents/Debugging.html#event-loggingHTTP API:
ScreepsHttpClientnow authenticates automatically as neededScreepsHttpClient.userCpuShardsendpointScreepsHttpClient.seasonsCurrentendpointScreepsHttpClient.userActivatePtrendpointScreepsClientConfigoptionsretry429InitDelay,retry429MaxDelay, andretry429MaxRetriesWebSocket API:
ScreepsSocketClientnow authenticates automatically as neededsubscribe___()/unsubscribe____()methods:subscribe()/unsubscribe()automatically determine theeventSpecargument and enforce appropriate type constraints on callback argumentsScreepsHttpClientScreepsSocketClientoptions can now be loaded from config filesCLI:
memory --prettyoption to pretty-print output to files or stdoutFixes
WebSocket API:
ScreepsSocketClientasync bug when trying to process gzipped dataCLI:
memory -f <file>segment -d <dir> <segmentNumber>Full Changelog: https://github.com/screepers/node-screeps-api/compare/8b6ad48b41526c47125807fb83ac279928e53e6e...v2.0
Please see the this package's npm versions page for releases between v1.0.0 and v2.0.0: https://www.npmjs.com/package/screeps-api?activeTab=versions
v2.0.0Compare Source
Please see the v2 Migration Guide for tips and examples for migrating from v1.x.
Breaking Changes
General:
HTTP API:
ScreepsAPIclass toScreepsHttpClientScreepsHttpClient.fromConfig()parameters have been changed'main'to prevent accidental usage of the'main'serverScreepsHttpClient:name: stringparameter toScreepsHttpClient.changeFlagColor()_id: stringparameter toScreepsHttpClient.gameAddObjectIntent()encodedparameter fromScreepsHttpClient.gameRoomTerrain()ScreepsHttpClient.gameRoomTerrainUnencoded()ScreepsHttpClient.userCodeSet()request params into an object so they could share types withScreepsHttpClient.userCodeGet()responsesScreepsClientConfig.defaultShardis not defined'shard0'is no longer used as a default to prevent accidental operations on the wrong shardScreepsHttpClientnow only fires therateLimitevent when a rate limit is exceeded.experimentalRetry429option:retry429GlobalScreepsClientConfigoption instead of being part of the server configWebSocket API:
connect()no longer acceptsScreepsSocketConfigoptionsappConfiglike they are for the HTTP client (see related change in "New Features")resubscribe()no longer subscribes to events that were fully unsubscribed before disconnectingsubscribe()no longer registers duplicate instances of the same callback to the same eventstruefor newforceparamScreepsHttpClient.setServer()now triggersdisconnect()authed,connected, andreconnectingproperties now have private setterswsandhttpproperties are now protectedCLI:
memoryoutput format:New Features and Improvements
General:
screeps.jsoncredential files: https://screepers.github.io/node-screeps-api/documents/Configuration_and_Credential_Files.htmlScreepsConfigManagernow checks for config files in the default$XDG_CONFIG_HOMEdirectory if the env var is not definedScreepsConfigManagernow checks$HOME/Library/Application Supportfor config files.ScreepsClientConfig.defaultShardoptionScreepsHttpClient.debug()method to enable/disable debug logging: https://screepers.github.io/node-screeps-api/documents/Debugging.html#event-loggingHTTP API:
ScreepsHttpClientnow authenticates automatically as neededScreepsHttpClient.userCpuShardsendpointScreepsHttpClient.seasonsCurrentendpointScreepsHttpClient.userActivatePtrendpointScreepsClientConfigoptionsretry429InitDelay,retry429MaxDelay, andretry429MaxRetriesWebSocket API:
ScreepsSocketClientnow authenticates automatically as neededsubscribe___()/unsubscribe____()methods:subscribe()/unsubscribe()automatically determine theeventSpecargument and enforce appropriate type constraints on callback argumentsScreepsHttpClientScreepsSocketClientoptions can now be loaded from config filesCLI:
memory --prettyoption to pretty-print output to files or stdoutFixes
WebSocket API:
ScreepsSocketClientasync bug when trying to process gzipped dataCLI:
memory -f <file>segment -d <dir> <segmentNumber>Full Changelog: https://github.com/screepers/node-screeps-api/compare/8b6ad48b41526c47125807fb83ac279928e53e6e...v2.0
Please see the this package's npm versions page for releases between v1.0.0 and v2.0.0: https://www.npmjs.com/package/screeps-api?activeTab=versions
Configuration
📅 Schedule: (UTC)
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
This PR has been generated by Mend Renovate.
⚠️ Artifact update problem
Renovate failed to update an artifact related to this branch. You probably do not want to merge this PR as-is.
♻ Renovate will retry this branch, including artifacts, only when one of the following happens:
The artifact failure details are included below:
File name: package.json
Summary
screeps-apiv1.x to v2.x introduces major breaking changes. Specifically,ScreepsAPIis no longer exported by the library, which causes the build step (npm run buildutilizing@vercel/ncc) to fail with an export error. Merging this PR as-is package will completely break the GitHub/Gitea Action.__tests__/index.test.js) still import and mockScreepsAPIfromscreeps-api, which must be updated alongside any v2 migration refactoring.ScreepsHttpClientandScreepsSocketClient).@@ -1,1 +1,1 @@import { ScreepsAPI } from "screeps-api";The build fails here because
ScreepsAPIis no longer a valid export inscreeps-apiv2. Version 2 is a rewrite that exposes specialized modules (likeScreepsHttpClientandScreepsSocketClient) rather than a singleScreepsAPIclass.This instantiation will fail under
screeps-apiv2 sinceScreepsAPIis no longer exported. The logic here must be rewritten to match v2's new API client structure.View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.