Port remaining plugins to Typescript (#499)

* .js to .ts

* Allow access to _items entries; getItemCount return number

* add permission field to PluginPage interface

* port plugins to typescript

* update Request classes

* fix IpcFlowType
This commit is contained in:
Luciole authored and GitHub committed 2023-08-22 16:17:16 +02:00
1 parent 50f12c719b
commit 0b3550b472
51 files changed
+1033 -1026

No files matched your search

@@ -1,25 +1,20 @@
"use strict";
const fs = require("fs-extra");
const path = require("path");
import type InstanceInfo from "@clusterio/controller/src/InstanceInfo";
import type Controller from "@clusterio/controller/src/Controller";
import type { IpcPlayerData } from "./instance";
const lib = require("@clusterio/lib");
import fs from "fs-extra";
import path from "path";
import * as lib from "@clusterio/lib";
import * as msg from "./messages";
const {
AcquireRequest,
ReleaseRequest,
UploadRequest,
DownloadRequest,
DatabaseStatsRequest,
} = require("./messages");
async function loadDatabase(config, logger) {
async function loadDatabase(config: lib.ControllerConfig, logger: lib.Logger) {
let itemsPath = path.resolve(config.get("controller.database_directory"), "inventories.json");
logger.verbose(`Loading ${itemsPath}`);
try {
let content = await fs.readFile(itemsPath);
let content = await fs.readFile(itemsPath, { encoding: "utf8" });
return new Map(JSON.parse(content));
} catch (err) {
} catch (err: any) {
if (err.code === "ENOENT") {
logger.verbose("Creating new player data database");
return new Map();
@@ -28,7 +23,11 @@ async function loadDatabase(config, logger) {
}
}
async function saveDatabase(controllerConfig, playerDatastore, logger) {
async function saveDatabase(
controllerConfig: lib.ControllerConfig,
playerDatastore: Map<string, IpcPlayerData>,
logger: lib.Logger,
) {
if (playerDatastore) {
let file = path.resolve(controllerConfig.get("controller.database_directory"), "inventories.json");
logger.verbose(`writing ${file}`);
@@ -37,7 +36,11 @@ async function saveDatabase(controllerConfig, playerDatastore, logger) {
}
}
class ControllerPlugin extends lib.BaseControllerPlugin {
export class ControllerPlugin extends lib.BaseControllerPlugin {
acquiredPlayers!: Map<string, { instanceId: number, expires?: number }>;
playerDatastore!: Map<string, IpcPlayerData>;
autosaveId!: ReturnType<typeof setInterval>;
async init() {
this.acquiredPlayers = new Map();
this.playerDatastore = await loadDatabase(this.controller.config, this.logger);
@@ -47,14 +50,14 @@ class ControllerPlugin extends lib.BaseControllerPlugin {
});
}, this.controller.config.get("inventory_sync.autosave_interval") * 1000);
this.controller.handle(AcquireRequest, this.handleAcquireRequest.bind(this));
this.controller.handle(ReleaseRequest, this.handleReleaseRequest.bind(this));
this.controller.handle(UploadRequest, this.handleUploadRequest.bind(this));
this.controller.handle(DownloadRequest, this.handleDownloadRequest.bind(this));
this.controller.handle(DatabaseStatsRequest, this.handleDatabaseStatsRequest.bind(this));
this.controller.handle(msg.AcquireRequest, this.handleAcquireRequest.bind(this));
this.controller.handle(msg.ReleaseRequest, this.handleReleaseRequest.bind(this));
this.controller.handle(msg.UploadRequest, this.handleUploadRequest.bind(this));
this.controller.handle(msg.DownloadRequest, this.handleDownloadRequest.bind(this));
this.controller.handle(msg.DatabaseStatsRequest, this.handleDatabaseStatsRequest.bind(this));
}
async onInstanceStatusChanged(instance) {
async onInstanceStatusChanged(instance: InstanceInfo) {
let instanceId = instance.id;
if (["unassigned", "deleted"].includes(instance.status)) {
for (let [playerName, acquisitionRecord] of this.acquiredPlayers) {
@@ -82,7 +85,7 @@ class ControllerPlugin extends lib.BaseControllerPlugin {
}
}
acquire(instanceId, playerName) {
acquire(instanceId: number, playerName: string): boolean {
let acquisitionRecord = this.acquiredPlayers.get(playerName);
if (
!acquisitionRecord
@@ -97,11 +100,11 @@ class ControllerPlugin extends lib.BaseControllerPlugin {
return false;
}
async handleAcquireRequest(request) {
async handleAcquireRequest(request: msg.AcquireRequest) {
let { instanceId, playerName } = request;
if (!this.acquire(instanceId, playerName)) {
let acquisitionRecord = this.acquiredPlayers.get(playerName);
let instance = this.controller.instances.get(acquisitionRecord.instanceId);
let instance = this.controller.instances.get(acquisitionRecord!.instanceId);
return {
status: "busy",
message: instance.config.get("instance.name"),
@@ -109,14 +112,14 @@ class ControllerPlugin extends lib.BaseControllerPlugin {
}
let playerData = this.playerDatastore.get(playerName);
return new AcquireRequest.Response(
return new msg.AcquireRequest.Response(
"acquired",
playerData ? playerData.generation : 0,
Boolean(playerData),
);
}
async handleReleaseRequest(request) {
async handleReleaseRequest(request: msg.ReleaseRequest) {
let { instanceId, playerName } = request;
let acquisitionRecord = this.acquiredPlayers.get(playerName);
if (!acquisitionRecord) {
@@ -128,7 +131,7 @@ class ControllerPlugin extends lib.BaseControllerPlugin {
}
}
async handleUploadRequest(request) {
async handleUploadRequest(request: msg.UploadRequest) {
let { instanceId, playerName, playerData } = request;
let instanceName = this.controller.instances.get(instanceId).config.get("instance.name");
let store = true;
@@ -162,7 +165,7 @@ class ControllerPlugin extends lib.BaseControllerPlugin {
}
}
async handleDownloadRequest(request) {
async handleDownloadRequest(request: msg.DownloadRequest) {
let { instanceId, playerName } = request;
let instanceName = this.controller.instances.get(instanceId).config.get("instance.name");
@@ -174,7 +177,7 @@ class ControllerPlugin extends lib.BaseControllerPlugin {
}
this.logger.verbose(`Sending player data for ${playerName} to ${instanceName}`);
return new DownloadRequest.Response(this.playerDatastore.get(playerName) || null);
return new msg.DownloadRequest.Response(this.playerDatastore.get(playerName) || null);
}
async onShutdown() {
@@ -189,7 +192,7 @@ class ControllerPlugin extends lib.BaseControllerPlugin {
length: JSON.stringify(this.playerDatastore.get(name)).length,
}))
.sort((a, b) => b.length - a.length);
return new DatabaseStatsRequest.Response(
return new msg.DatabaseStatsRequest.Response(
playerDatastore.map(x => x.length).reduce((a, b) => b - a, 0),
playerDatastore.length,
{
@@ -199,7 +202,3 @@ class ControllerPlugin extends lib.BaseControllerPlugin {
);
}
}
module.exports = {
ControllerPlugin,
};
@@ -1,6 +1,5 @@
"use strict";
const lib = require("@clusterio/lib");
let messages = require("./messages");
import * as lib from "@clusterio/lib";
import * as messages from "./messages";
class ControllerConfigGroup extends lib.PluginConfigGroup { }
ControllerConfigGroup.defaultAccess = ["controller", "host", "control"];
@@ -41,15 +40,15 @@ lib.definePermission({
grantByDefault: true,
});
module.exports.default = {
const info: lib.PluginInfo = {
name: "inventory_sync",
title: "Inventory sync",
description: "Synchronizes players inventories between instances",
instanceEntrypoint: "instance",
instanceEntrypoint: "dist/plugin/instance",
InstanceConfigGroup,
controllerEntrypoint: "controller",
controllerEntrypoint: "dist/plugin/controller",
ControllerConfigGroup,
messages: [
@@ -61,4 +60,6 @@ module.exports.default = {
],
webEntrypoint: "./web",
routes: ["/inventory"],
};
}
export default info;
@@ -1,47 +1,61 @@
/**
* @module
*/
"use strict";
const lib = require("@clusterio/lib");
import * as lib from "@clusterio/lib";
import { AcquireRequest, ReleaseRequest, UploadRequest, DownloadRequest } from "./messages";
const {
AcquireRequest,
ReleaseRequest,
UploadRequest,
DownloadRequest,
} = require("./messages");
type IpcPlayerName = {
player_name: string
}
export type IpcPlayerData = { //.\module\serialize.lua:serialize.serialize_player()
generation: number,
controller: string,
name: string,
color: number[],
chat_color: number[],
tag: string,
force: string,
cheat_mode: boolean,
flashlight: boolean,
ticks_to_respawn?: number,
character?: any,
inventories?: any,
hotbar?: string[],
personal_logistic_slots?: {name:string, min:number, max:number}[],
crafting_queue?: any,
}
/**
* Splits string into array of strings with max of a certain length
* @param {Number} chunkSize - Max length of each chunk
* @param {String} string - String to split into chunks
* @returns {String[]} Chunks
* @param chunkSize - Max length of each chunk
* @param string - String to split into chunks
*/
function chunkify(chunkSize, string) {
return string.match(new RegExp(`.{1,${chunkSize}}`, "g"));
function chunkify(chunkSize: number, string: string): string[] {
return string.match(new RegExp(`.{1,${chunkSize}}`, "g")) || [];
}
class InstancePlugin extends lib.BaseInstancePlugin {
export class InstancePlugin extends lib.BaseInstancePlugin {
playersToRelease!: Set<string>;
disconnecting!: boolean;
async init() {
this.playersToRelease = new Set();
this.disconnecting = false;
// Handle IPC from scenario script
this.instance.server.on("ipc-inventory_sync_acquire", content => this.handleAcquire(content)
this.instance.server.on("ipc-inventory_sync_acquire", (request: IpcPlayerName) => this.handleAcquire(request)
.catch(err => this.logger.error(`Error handling ipc-inventory_sync_acquire:\n${err.stack}`)));
this.instance.server.on("ipc-inventory_sync_release", content => this.handleRelease(content)
this.instance.server.on("ipc-inventory_sync_release", (request: IpcPlayerName) => this.handleRelease(request)
.catch(err => this.logger.error(`Error handling ipc-inventory_sync_release:\n${err.stack}`)));
this.instance.server.on("ipc-inventory_sync_upload", content => this.handleUpload(content)
this.instance.server.on("ipc-inventory_sync_upload", (player_data: IpcPlayerData) => this.handleUpload(player_data)
.catch(err => this.logger.error(`Error handling ipc-inventory_sync_upload:\n${err.stack}`)));
this.instance.server.on("ipc-inventory_sync_download", content => this.handleDownload(content)
this.instance.server.on("ipc-inventory_sync_download", (request: IpcPlayerName) => this.handleDownload(request)
.catch(err => this.logger.error(`Error handling ipc-inventory_sync_download:\n${err.stack}`)));
}
onPrepareControllerDisconnect() {
async onPrepareControllerDisconnect() {
this.disconnecting = true;
}
onControllerConnectionEvent(event) {
onControllerConnectionEvent(event: "connect" | "drop" | "resume" | "close") {
if (event === "connect") {
this.disconnecting = false;
(async () => {
@@ -49,7 +63,7 @@ class InstancePlugin extends lib.BaseInstancePlugin {
if (!this.host.connector.connected || this.disconnecting) {
return;
}
this.playersToRelease.delete(player);
this.playersToRelease.delete(player_name);
await this.instance.sendTo("controller", new ReleaseRequest(this.instance.id, player_name));
}
})().catch(
@@ -58,11 +72,13 @@ class InstancePlugin extends lib.BaseInstancePlugin {
}
}
async handleAcquire(request) {
async handleAcquire(request: IpcPlayerName) {
let response = {
player_name: request.player_name,
status: "error",
message: "Controller is temporarily unavailable",
generation: undefined,
has_data: undefined,
};
if (this.host.connector.connected && !this.disconnecting) {
@@ -78,7 +94,7 @@ class InstancePlugin extends lib.BaseInstancePlugin {
has_data: acquireResponse.hasData,
message: acquireResponse.message,
};
} catch (err) {
} catch (err: any) {
if (!(err instanceof lib.SessionLost)) {
this.logger.error(`Unexpected error sending aquire request:\n${err.stack}`);
response.message = err.message;
@@ -90,23 +106,23 @@ class InstancePlugin extends lib.BaseInstancePlugin {
await this.sendRcon(`/sc inventory_sync.acquire_response("${json}")`, true);
}
async handleRelease(request) {
async handleRelease(request: IpcPlayerName) {
if (!this.host.connector.connected) {
this.playersToRelease.set(request.player_name);
this.playersToRelease.add(request.player_name);
}
try {
await this.instance.sendTo("controller", new ReleaseRequest(this.instance.id, request.player_name));
} catch (err) {
} catch (err: any) {
if (err instanceof lib.SessionLost) {
this.playersToRelease.set(request.player_name);
this.playersToRelease.add(request.player_name);
} else {
this.logger.error(`Unexpected error releasing player ${request.player_name}:\n${err.stack}`);
}
}
}
async handleUpload(player_data) {
async handleUpload(player_data: IpcPlayerData) {
if (!this.host.connector.connected || this.disconnecting) {
return;
}
@@ -118,7 +134,7 @@ class InstancePlugin extends lib.BaseInstancePlugin {
new UploadRequest(this.instance.id, player_data.name, player_data),
);
} catch (err) {
} catch (err: any) {
if (!(err instanceof lib.SessionLost)) {
this.logger.error(`Unexpected error uploading inventory for ${player_data.name}:\n${err.stack}`);
}
@@ -130,7 +146,7 @@ class InstancePlugin extends lib.BaseInstancePlugin {
);
}
async handleDownload(request) {
async handleDownload(request: IpcPlayerName) {
const playerName = request.player_name;
this.logger.verbose(`Downloading ${playerName}`);
@@ -154,7 +170,3 @@ class InstancePlugin extends lib.BaseInstancePlugin {
}
}
}
module.exports = {
InstancePlugin,
};
-229
View File
@@ -1,229 +0,0 @@
"use strict";
class AcquireRequest {
static type = "request";
static src = "instance";
static dst = "controller";
static plugin = "inventory_sync";
/** @type {number} */
instanceId;
/** @type {string} */
playerName;
constructor(instanceId, playerName) {
this.instanceId = instanceId;
this.playerName = playerName;
}
static jsonSchema = {
type: "object",
properties: {
"instanceId": { type: "integer" },
"playerName": { type: "string" },
},
};
static fromJSON(json) {
return new this(json.instanceId, json.playerName);
}
}
AcquireRequest.Response = class Response {
/** @type {string} */
status;
/** @type {number} */
generation;
/** @type {boolean} */
hasData;
/** @type {string} */
message;
constructor(status, generation, hasData, message) {
this.status = status;
if (generation !== undefined) { this.generation = generation; }
if (hasData !== undefined) { this.hasData = hasData; }
if (message !== undefined) { this.message = message; }
}
static jsonSchema = {
type: "object",
required: ["status"],
properties: {
"status": {
type: "string",
enum: ["acquired", "error", "busy"],
},
"generation": { type: "integer" },
"hasData": { type: "boolean" },
"message": { type: "string" },
},
};
static fromJSON(json) {
return new this(json.status, json.generation, json.hasData, json.message);
}
};
class ReleaseRequest {
static type = "request";
static src = "instance";
static dst = "controller";
static plugin = "inventory_sync";
/** @type {boolean} */
instanceId;
/** @type {boolean} */
playerName;
constructor(instanceId, playerName) {
this.instanceId = instanceId;
this.playerName = playerName;
}
static jsonSchema = {
type: "object",
properties: {
"instanceId": { type: "integer" },
"playerName": { type: "string" },
},
};
static fromJSON(json) {
return new this(json.instanceId, json.playerName);
}
}
class UploadRequest {
static type = "request";
static src = "instance";
static dst = "controller";
static plugin = "inventory_sync";
/** @type {boolean} */
instanceId;
/** @type {boolean} */
playerName;
/** @type {object} */
playerData;
constructor(instanceId, playerName, playerData) {
this.instanceId = instanceId;
this.playerName = playerName;
this.playerData = playerData;
}
static jsonSchema = {
type: "object",
required: ["instanceId", "playerName", "playerData"],
properties: {
"instanceId": { type: "integer" },
"playerName": { type: "string" },
"playerData": { type: "object" },
},
};
static fromJSON(json) {
return new this(json.instanceId, json.playerName, json.playerData);
}
}
class DownloadRequest {
static type = "request";
static src = "instance";
static dst = "controller";
static plugin = "inventory_sync";
/** @type {number} */
instanceId;
/** @type {string} */
playerName;
constructor(instanceId, playerName) {
this.instanceId = instanceId;
this.playerName = playerName;
}
static jsonSchema = {
type: "object",
required: ["instanceId", "playerName"],
properties: {
"instanceId": { type: "integer" },
"playerName": { type: "string" },
},
};
static fromJSON(json) {
return new this(json.instanceId, json.playerName);
}
}
DownloadRequest.Response = class Response {
/** @type {?object} */
playerData;
constructor(playerData) {
this.playerData = playerData;
}
static jsonSchema = {
type: "object",
required: ["playerData"],
properties: {
"playerData": { type: ["object", "null"] },
},
};
static fromJSON(json) {
return new this(json.playerData);
}
};
class DatabaseStatsRequest {
static type = "request";
static src = "control";
static dst = "controller";
static plugin = "inventory_sync";
static permission = "inventory_sync.inventory.view";
}
DatabaseStatsRequest.Response = class Response {
/** @type {boolean} */
databaseSize;
/** @type {boolean} */
databaseEntries;
/** @type {object} */
largestEntry;
constructor(databaseSize, databaseEntries, largestEntry) {
this.databaseSize = databaseSize;
this.databaseEntries = databaseEntries;
this.largestEntry = largestEntry;
}
static jsonSchema = {
type: "object",
required: ["databaseSize", "databaseEntries", "largestEntry"],
properties: {
"databaseSize": { type: "integer" },
"databaseEntries": { type: "integer" },
"largestEntry": {
type: "object",
properties: {
name: { type: "string" },
size: { type: "number" },
},
},
},
};
static fromJSON(json) {
return new this(json.databaseSize, json.databaseEntries, json.largestEntry);
}
};
module.exports = {
AcquireRequest,
ReleaseRequest,
UploadRequest,
DownloadRequest,
DatabaseStatsRequest,
};
+172
View File
@@ -0,0 +1,172 @@
import type { IpcPlayerData } from "./instance";
import { Type, Static } from "@sinclair/typebox";
import { StringEnum } from "@clusterio/lib";
const jsonPlayerData = Type.Object({
generation: Type.Number(),
name: Type.String(),
})
class AcquireResponse {
constructor(
public status: string,
public generation?: number,
public hasData?: boolean,
public message?: string,
) {
}
static jsonSchema = Type.Object({
"status": StringEnum(["acquired", "error", "busy"]),
"generation": Type.Optional(Type.Integer()),
"hasData": Type.Optional(Type.Boolean()),
"message": Type.Optional(Type.String()),
});
static fromJSON(json: Static<typeof AcquireResponse.jsonSchema>): AcquireResponse {
return new this(json.status, json.generation, json.hasData, json.message);
}
};
export class AcquireRequest {
declare ["constructor"]: typeof AcquireRequest;
static type = "request" as const;
static src = "instance" as const;
static dst = "controller" as const;
static plugin = "inventory_sync" as const;
static Response = AcquireResponse;
constructor(
public instanceId: number,
public playerName: string,
) {
}
static jsonSchema = Type.Object({
"instanceId": Type.Number(),
"playerName": Type.String(),
})
static fromJSON(json: Static<typeof AcquireRequest.jsonSchema>): AcquireRequest {
return new this(json.instanceId, json.playerName);
}
}
export class ReleaseRequest {
declare ["constructor"]: typeof ReleaseRequest;
static type = "request" as const;
static src = "instance" as const;
static dst = "controller" as const;
static plugin = "inventory_sync" as const;
constructor(
public instanceId: number,
public playerName: string
) {
}
static jsonSchema = Type.Object({
"instanceId": Type.Integer(),
"playerName": Type.String(),
})
static fromJSON(json: Static<typeof ReleaseRequest.jsonSchema>) {
return new this(json.instanceId, json.playerName);
}
}
export class UploadRequest {
declare ["constructor"]: typeof UploadRequest;
static type = "request" as const;
static src = "instance" as const;
static dst = "controller" as const;
static plugin = "inventory_sync" as const;
constructor(
public instanceId: number,
public playerName: string,
public playerData: IpcPlayerData,
) {
}
static jsonSchema = Type.Object({
"instanceId": Type.Integer(),
"playerName": Type.String(),
"playerData": jsonPlayerData,
});
static fromJSON(json: Static<typeof UploadRequest.jsonSchema>) {
return new this(json.instanceId, json.playerName, json.playerData as IpcPlayerData);
}
}
class DownloadResponse {
constructor(
public playerData: IpcPlayerData | null
) {
}
static jsonSchema = Type.Object({
"playerData": Type.Optional(jsonPlayerData),
})
static fromJSON(json: Static<typeof DownloadResponse.jsonSchema>): DownloadResponse {
return new this(json.playerData as IpcPlayerData);
}
}
export class DownloadRequest {
declare ["constructor"]: typeof DownloadRequest;
static type = "request" as const;
static src = "instance" as const;
static dst = "controller" as const;
static plugin = "inventory_sync" as const;
static Response = DownloadResponse;
constructor(
public instanceId: number,
public playerName: string,
) {
}
static jsonSchema = Type.Object({
"instanceId": Type.Integer(),
"playerName": Type.String(),
})
static fromJSON(json: Static<typeof DownloadRequest.jsonSchema>) {
return new this(json.instanceId, json.playerName);
}
}
class DatabaseStatsResponse {
constructor(
public databaseSize: number,
public databaseEntries: number,
public largestEntry: { name: string, size: number },
) {
}
static jsonSchema = Type.Object({
"databaseSize": Type.Integer(),
"databaseEntries": Type.Integer(),
"largestEntry": Type.Object({
"name": Type.String(),
"size": Type.Number(),
})
})
static fromJSON(json: Static<typeof DatabaseStatsResponse.jsonSchema>): DatabaseStatsResponse {
return new this(json.databaseSize, json.databaseEntries, json.largestEntry);
}
}
export class DatabaseStatsRequest {
declare ["constructor"]: typeof DatabaseStatsRequest;
static type = "request" as const;
static src = "control" as const;
static dst = "controller" as const;
static plugin = "inventory_sync" as const;
static permission = "inventory_sync.inventory.view" as const;
static Response = DatabaseStatsResponse;
}
+6 -2
View File
@@ -6,9 +6,9 @@
"homepage": "https://github.com/clusterio/factorioClusterio#readme",
"license": "MIT",
"repository": "clusterio/factorioClusterio",
"main": "./info.js",
"main": "dist/plugin/info.js",
"scripts": {
"prepare": "webpack-cli --env production",
"prepare": "tsc --build && webpack-cli --env production",
"test": "echo \"Error: run tests from root\" && exit 1"
},
"bugs": {
@@ -21,14 +21,18 @@
"@clusterio/lib": "^2.0.0-alpha.0"
},
"dependencies": {
"@sinclair/typebox": "^0.30.4",
"fs-extra": "^8.1.0"
},
"devDependencies": {
"@clusterio/lib": "^2.0.0-alpha.13",
"@clusterio/web_ui": "^2.0.0-alpha.13",
"@types/fs-extra": "^11.0.1",
"@types/node": "^20.4.5",
"antd": "^5.7.3",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"typescript": "^5.1.6",
"webpack": "^5.88.2",
"webpack-cli": "^5.1.4",
"webpack-merge": "^5.9.0"
+16
View File
@@ -0,0 +1,16 @@
{
"include": ["./**/*.ts"],
"exclude": ["test/*", "./dist/*"],
"compilerOptions": {
"lib": ["es2023"],
"module": "commonjs",
"target": "es2022",
"rootDir": ".",
"outDir": "dist/plugin",
"sourceMap": true,
"strict": true,
"alwaysStrict": true,
"esModuleInterop": true,
"skipLibCheck": true
}
}
+1 -1
View File
@@ -2,7 +2,7 @@ import React, { useContext, useEffect, useState } from "react";
import * as lib from "@clusterio/lib";
import { PageLayout, ControlContext } from "@clusterio/web_ui";
import { DatabaseStatsRequest } from "../messages";
import { DatabaseStatsRequest } from "../dist/plugin/messages";
import "./index.css";
+1 -1
View File
@@ -16,7 +16,7 @@ module.exports = (env = {}) => merge(common(env), {
name: "inventory_sync",
library: { type: "var", name: "plugin_inventory_sync" },
exposes: {
"./info": "./info.js",
"./info": "./dist/plugin/info.js",
"./package.json": "./package.json",
"./web": "./web/index.jsx",
},