Commit Graph
35 Commits
Author SHA1 Message Date
bbassieandClaude Fable 5.1 7fd66c6ac7 Migrate to ES modules
Clusterio #984 converted its packages to ESM, so a CommonJS plugin can
no longer import @clusterio/lib and plugin entrypoints must name the
full file. Every package gets "type": "module", entrypoints and relative
imports carry the .js extension, and the webpack configs become .cjs as
webpack-cli loads them with require. tsconfig.node.json moves from
node16 to nodenext to match clusterio, which needs it for the JSON
import attributes in its sources.

The tap tests and the shared test helpers use import and
import.meta.dirname. The test scripts pass --type-strip-only so tap
leaves lib's .ts subpath imports to Node's own type stripping, as its
TypeScript loader compiled them without a default export. The lua
runner resolves fengari from the test file it is given, since a bare
import from the shared test directory does not reach the plugin's
devDependencies.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-12 01:10:02 +01:00
bbassieandClaude Fable 5.1 30f1b5ea75 Declare permissions on the plugin declaration
Clusterio #988 added a permissions array to PluginDeclaration and a
type level Permissions registry, and made checkPermission and the web
UI hasPermission helpers take PermissionName. Move the definePermission
calls of exp_groups and exp_scenario into the declaration and add the
names to the registry so the web pages type check. The browser
tsconfigs include index.ts so the augmentation is visible to the web
bundle, matching the in-repo plugins.

The exp_scenario table keeps its tuple form and derives the name union
from it, so a new row is still one line. Seed role permissions are typed
as PermissionName, so a typo in seed.ts is now a compile error rather
than a warning at seed time. The tests register the declared
permissions through registerPluginPermissions instead of importing
permissions.ts for its side effect.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-11 23:27:17 +00:00
bbassieandClaude Fable 5.1 51786c5df9 Export messages and controller types from exp_roles and exp_groups
exp_scenario reached into @expcluster/roles/dist/node/* for the message
classes and the controller plugin type. The package index now re-exports
messages and the ControllerPlugin type, so consumers import from the
package name like they do with @clusterio/lib. The controller export is
type only, which keeps node code out of the web bundle. The test still
requires the controller classes from dist since they cannot be
re-exported at runtime.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-09 17:31:31 +00:00
BastiaanandClaude Fable 5.1 24efb82d0f Encode group permissions as a 1-based array (#472)
encode_group_permissions filled the whitelist and blacklist starting at
index 0. Factorio's table_to_json only serialises a table as a JSON array
when its keys run 1..n, so the permissions reached the instance plugin as
an object and every GroupUpdateRequest failed schema validation.

Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-09 15:47:01 +01:00
Cooldude2606 810269971b fix: bump to 7.0.1 2026-09-05 17:14:37 +01:00
phidias 72cd203c25 Update GroupViewPage.tsx 2026-09-05 00:57:13 +09:00
bbassieandClaude Opus 5 0bb92966eb Fix type annotations the linter found to be wrong
Async ids come from `get_function_name`, which returns a string, but
were documented as numbers.

`setmetatable` in clusterio's compat module loses `LibCompat` on the
module return, so the require is cast.

`GuiData.__index` accepts a `DataKey` but emmylua needs that as an
index signature on the class.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-07 15:31:18 +00:00
bbassieandClaude Opus 5 c233a9ab06 Defer need-check-nil and clean up stale suppressions
emmylua deserialises an unknown diagnostic code to a catch all that
matches no checker, so every `invisible`, `nil-check` and
`global-element` suppression was silently doing nothing. Renamed to the
emmylua codes. `name-style-check` has no equivalent and is dropped, it
was already disabled under luals.

The `get_tile` suppressions referenced an api typedef bug from 2024
which no longer reproduces.

need-check-nil is deferred rather than disabled on merit: a third of the
407 findings come from MapPosition and BoundingBox being aliased as
`struct|[double, double]`, so every `entity.position.x` reads as
possibly nil. The rest need per site knowledge of runtime invariants.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-07 15:31:18 +00:00
Cooldude2606 a07be7b7ed Bump version in package jsons 2026-07-14 00:50:00 +01:00
Cooldude2606 9019be307c Update to new version of SubscriptionRequest 2026-06-26 14:51:43 +01:00
Cooldude2606 f4766cd20e Fix redirect after group creation 2026-06-26 14:21:28 +01:00
Cooldude2606 9755ec8e3a Use /sc rather than /c 2026-06-26 14:20:32 +01:00
Cooldude2606 6b99378fa2 Fix use of MapSubscriber 2026-06-26 14:20:10 +01:00
Cooldude2606 7318fc3602 Fix lint for global usage 2026-05-27 00:29:12 +01:00
Cooldude2606 bb788f33da Final Cleanup 2026-05-25 20:43:51 +01:00
Cooldude2606 2248f23a8d Added web UI 2026-05-23 03:51:16 +01:00
Cooldude2606 a521cdd901 Change to dev env to fix building 2026-05-22 20:15:36 +01:00
Cooldude2606 230c835103 Add controller plugin 2026-05-21 00:30:17 +01:00
Cooldude2606 dca5086ce3 Add instance plugin 2026-05-20 22:39:44 +01:00
Cooldude2606 7ddfa8e735 Add messages and permissions 2026-05-20 22:39:33 +01:00
Cooldude2606 90d63952d3 Add lua module code 2026-05-20 01:51:09 +01:00
Cooldude2606 b64e109bf1 Plugin Setup exp_groups 2026-05-20 01:48:26 +01:00
Cooldude2606 538714acdb Remove existing plugin 2026-05-19 22:23:47 +01:00
Cooldude2606 9be43e9896 Bump dependencies 2026-01-14 20:15:23 +00:00
Cooldude2606 ce80ae9021 Refactored UPS monitor as clusterio plugin (#398)
* Refactor server ups

* Use catalogs

* Move to own plugin

* Use web config

* Remove External.get_server_ups

* Update workspace version requirement

* Remove need for storage

* Add locale

* Fix CI
2025-08-08 16:36:22 +01:00
phidias ed01de3feb Fix Dependencies Version (#396)
* Update package.json

* Update package.json

* Update package.json

* Update package.json

* Update package.json

* Update package.json
2025-08-04 20:58:23 +01:00
Cooldude2606 aedc3cff6b Fix lint errors on new luals version (#384) 2025-04-06 17:05:40 +01:00
Cooldude2606 3dbdb2071f Update deps 2025-04-06 16:03:58 +01:00
Cooldude2606 d489615542 Add missing type def dep for exp_groups 2024-12-27 20:43:29 +00:00
Cooldude2606 974b28c3b0 Prepare repo for publish 2024-12-24 20:50:48 +00:00
Cooldude2606 99ab54da0a Enable stricter type checks 2024-11-21 00:03:19 +00:00
Cooldude2606 48f55b0547 Resolve all Luals warnings 2024-11-19 22:37:15 +00:00
Cooldude2606 377fb69152 Migration for new helpers library 2024-11-19 22:34:39 +00:00
Cooldude2606 292c1a1b68 Update all code styles 2024-11-19 22:29:35 +00:00
Cooldude2606 446e87b610 Add Clusterio Plugins 2024-11-19 21:51:13 +00:00