From 74dc37ee6b2e2c4017d4888fbf3e95673f15541c Mon Sep 17 00:00:00 2001 From: SirEdvin Date: Sun, 26 Jul 2026 14:44:57 +0000 Subject: [PATCH] feat: integrate typed peripheral package --- build.gradle.kts | 4 +- .../typed-peripheral-turtlematic/.gitignore | 3 + .../automata/end.ts | 25 ++ .../automata/husbandry.ts | 28 ++ .../automata/mason.ts | 19 ++ .../automata/protective.ts | 23 ++ .../automata/regular.ts | 17 ++ .../automata/smithing.ts | 22 ++ .../build.gradle.kts | 40 +++ .../mics/chatter.ts | 29 ++ .../mics/lava_bucket.ts | 16 ++ .../mics/mimic.ts | 12 + .../mics/piston.ts | 28 ++ .../mics/sticky_piston.ts | 32 +++ .../package-lock.json | 256 ++++++++++++++++++ .../typed-peripheral-turtlematic/package.json | 57 ++++ .../tsconfig.json | 22 ++ settings.gradle.kts | 3 +- 18 files changed, 634 insertions(+), 2 deletions(-) create mode 100644 projects/typed-peripheral-turtlematic/.gitignore create mode 100644 projects/typed-peripheral-turtlematic/automata/end.ts create mode 100644 projects/typed-peripheral-turtlematic/automata/husbandry.ts create mode 100644 projects/typed-peripheral-turtlematic/automata/mason.ts create mode 100644 projects/typed-peripheral-turtlematic/automata/protective.ts create mode 100644 projects/typed-peripheral-turtlematic/automata/regular.ts create mode 100644 projects/typed-peripheral-turtlematic/automata/smithing.ts create mode 100644 projects/typed-peripheral-turtlematic/build.gradle.kts create mode 100644 projects/typed-peripheral-turtlematic/mics/chatter.ts create mode 100644 projects/typed-peripheral-turtlematic/mics/lava_bucket.ts create mode 100644 projects/typed-peripheral-turtlematic/mics/mimic.ts create mode 100644 projects/typed-peripheral-turtlematic/mics/piston.ts create mode 100644 projects/typed-peripheral-turtlematic/mics/sticky_piston.ts create mode 100644 projects/typed-peripheral-turtlematic/package-lock.json create mode 100644 projects/typed-peripheral-turtlematic/package.json create mode 100644 projects/typed-peripheral-turtlematic/tsconfig.json diff --git a/build.gradle.kts b/build.gradle.kts index e6faccb..c3dfa4c 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -18,7 +18,9 @@ subprojectShaking { val setupSubproject = subprojectShaking::setupSubproject subprojects { - setupSubproject(this) + if (name != "typed-peripheral-turtlematic") { + setupSubproject(this) + } } githubShaking { diff --git a/projects/typed-peripheral-turtlematic/.gitignore b/projects/typed-peripheral-turtlematic/.gitignore new file mode 100644 index 0000000..2310dc5 --- /dev/null +++ b/projects/typed-peripheral-turtlematic/.gitignore @@ -0,0 +1,3 @@ +*.lua +*.d.ts +node_modules \ No newline at end of file diff --git a/projects/typed-peripheral-turtlematic/automata/end.ts b/projects/typed-peripheral-turtlematic/automata/end.ts new file mode 100644 index 0000000..1aca028 --- /dev/null +++ b/projects/typed-peripheral-turtlematic/automata/end.ts @@ -0,0 +1,25 @@ +import { IPeripheralProvider } from "@siredvin/typed-peripheral-base"; +import { FuelApi } from "@siredvin/typed-peripheral-api/fuel"; +import { InteractionApi } from "@siredvin/typed-peripheral-api/interaction"; +import { ConfigurationAPI } from "@siredvin/typed-peripheral-api/configuration"; +import { OperationApi } from "@siredvin/typed-peripheral-api/operations"; +import { LookApi } from "@siredvin/typed-peripheral-api/look"; +import { CaptureAPI } from "@siredvin/typed-peripheral-api/capture"; +import { SuckAPI } from "@siredvin/typed-peripheral-api/suck"; +import { WarpAPI } from "@siredvin/typed-peripheral-api/warp"; + +/** @noSelf **/ +export declare interface EndAutomata + extends FuelApi, + InteractionApi, + ConfigurationAPI, + OperationApi, + LookApi, + CaptureAPI, + SuckAPI, + WarpAPI {} + +export const endAutomataProvider = new IPeripheralProvider( + "endAutomata", + () => null +); diff --git a/projects/typed-peripheral-turtlematic/automata/husbandry.ts b/projects/typed-peripheral-turtlematic/automata/husbandry.ts new file mode 100644 index 0000000..fb9af79 --- /dev/null +++ b/projects/typed-peripheral-turtlematic/automata/husbandry.ts @@ -0,0 +1,28 @@ +import { IPeripheralProvider } from "@siredvin/typed-peripheral-base"; +import { FuelApi, FuelAPIConfiguration } from "@siredvin/typed-peripheral-api/fuel"; +import { InteractionApi } from "@siredvin/typed-peripheral-api/interaction"; +import { ConfigurationAPI } from "@siredvin/typed-peripheral-api/configuration"; +import { OperationApi } from "@siredvin/typed-peripheral-api/operations"; +import { LookApi } from "@siredvin/typed-peripheral-api/look"; +import { CaptureAPI } from "@siredvin/typed-peripheral-api/capture"; + +export declare interface HusbandryConfiguration extends FuelAPIConfiguration { + maxHusbandryPoints: number; + simulationGrowCost: number; +} + +/** @noSelf **/ +export declare interface HusbandryAutomata + extends FuelApi, + InteractionApi, + ConfigurationAPI, + OperationApi, + LookApi, + CaptureAPI { + harvest(direction?: "up" | "down"): Result; + getHusbandryPoints(): number; + simulateGrow(): Result; +} + +export const husbandryAutomataProvider = + new IPeripheralProvider("husbandryAutomata", () => null); diff --git a/projects/typed-peripheral-turtlematic/automata/mason.ts b/projects/typed-peripheral-turtlematic/automata/mason.ts new file mode 100644 index 0000000..c270702 --- /dev/null +++ b/projects/typed-peripheral-turtlematic/automata/mason.ts @@ -0,0 +1,19 @@ +import { IPeripheralProvider } from "@siredvin/typed-peripheral-base"; +import { DummyFuelApi, FuelApi } from "@siredvin/typed-peripheral-api/fuel"; + +/** @noSelf **/ +export declare interface MasonAutomata extends FuelApi { + chisel(mode: "block", target: string, direction?: Direction): Result; +} + +/** @noSelf **/ +class DummyMasonAutomata extends DummyFuelApi implements MasonAutomata { + chisel(mode: "block", target: string, direction?: Direction): Result { + return $multi(true, null); + } +} + +export const masonProvider = new IPeripheralProvider( + "masonAutomata", + () => new DummyMasonAutomata() +); diff --git a/projects/typed-peripheral-turtlematic/automata/protective.ts b/projects/typed-peripheral-turtlematic/automata/protective.ts new file mode 100644 index 0000000..aa24ec0 --- /dev/null +++ b/projects/typed-peripheral-turtlematic/automata/protective.ts @@ -0,0 +1,23 @@ +import { IPeripheralProvider } from "@siredvin/typed-peripheral-base"; +import { DummyFuelApi, FuelApi } from "@siredvin/typed-peripheral-api/fuel"; +import { InteractionApi } from "@siredvin/typed-peripheral-api/interaction"; +import { ConfigurationAPI } from "@siredvin/typed-peripheral-api/configuration"; +import { CaptureAPI } from "@siredvin/typed-peripheral-api/capture"; +import { OperationApi } from "@siredvin/typed-peripheral-api/operations"; +import { LookApi } from "@siredvin/typed-peripheral-api/look"; +import { SuckAPI } from "@siredvin/typed-peripheral-api/suck"; + +/** @noSelf **/ +export declare interface ProtectiveAutomata + extends FuelApi, + InteractionApi, + ConfigurationAPI, + CaptureAPI, + OperationApi, + LookApi, + SuckAPI {} + +export const protectiveProvider = new IPeripheralProvider( + "protectiveAutomata", + () => null +); diff --git a/projects/typed-peripheral-turtlematic/automata/regular.ts b/projects/typed-peripheral-turtlematic/automata/regular.ts new file mode 100644 index 0000000..57e7fed --- /dev/null +++ b/projects/typed-peripheral-turtlematic/automata/regular.ts @@ -0,0 +1,17 @@ +import { IPeripheralProvider } from "@siredvin/typed-peripheral-base"; +import { FuelApi } from "@siredvin/typed-peripheral-api/fuel"; +import { InteractionApi } from "@siredvin/typed-peripheral-api/interaction"; +import { ConfigurationAPI } from "@siredvin/typed-peripheral-api/configuration"; +import { OperationApi } from "@siredvin/typed-peripheral-api/operations"; + +/** @noSelf **/ +export declare interface Automata + extends FuelApi, + InteractionApi, + ConfigurationAPI, + OperationApi {} + +export const automataProvider = new IPeripheralProvider( + "automata", + () => null +); diff --git a/projects/typed-peripheral-turtlematic/automata/smithing.ts b/projects/typed-peripheral-turtlematic/automata/smithing.ts new file mode 100644 index 0000000..0f4b044 --- /dev/null +++ b/projects/typed-peripheral-turtlematic/automata/smithing.ts @@ -0,0 +1,22 @@ +import { IPeripheralProvider } from "@siredvin/typed-peripheral-base"; +import { DummyFuelApi, FuelApi } from "@siredvin/typed-peripheral-api/fuel"; + +/** @noSelf **/ +export declare interface SmithingAutomata extends FuelApi { + smelt(mode: "block", direction?: Direction): Result; + smelt(mode: "inventory", limit: number): Result; +} + +/** @noSelf **/ +class DummySmithingAutomata extends DummyFuelApi implements SmithingAutomata { + smelt(mode: "block", direction?: Direction): Result; + smelt(mode: "inventory", limit: number): Result; + smelt(mode: unknown, limit?: unknown): Result { + return $multi(true, null); + } +} + +export const smithingProvider = new IPeripheralProvider( + "smithingAutomata", + () => new DummySmithingAutomata() +); diff --git a/projects/typed-peripheral-turtlematic/build.gradle.kts b/projects/typed-peripheral-turtlematic/build.gradle.kts new file mode 100644 index 0000000..a9281a5 --- /dev/null +++ b/projects/typed-peripheral-turtlematic/build.gradle.kts @@ -0,0 +1,40 @@ +import com.github.gradle.node.npm.task.NpmTask + +plugins { + base + id("com.github.node-gradle.node") version "7.1.0" +} + +node { + version.set("22.14.0") + download.set(true) + nodeProjectDir.set(projectDir) + workDir.set(rootProject.layout.projectDirectory.dir(".gradle/nodejs")) + npmWorkDir.set(rootProject.layout.projectDirectory.dir(".gradle/npm")) + npmInstallCommand.set("ci") +} + +val typeScriptSources = fileTree(projectDir) { + include("**/*.ts") + exclude("node_modules/**") +} + +val compileTypeScript by tasks.registering(NpmTask::class) { + dependsOn(tasks.npmInstall) + npmCommand.set(listOf("run", "build")) + inputs.files("package.json", "package-lock.json", "tsconfig.json", typeScriptSources) + outputs.files(typeScriptSources.files.flatMap { source -> + val output = source.relativeTo(projectDir).invariantSeparatorsPath.removeSuffix(".ts") + listOf(file("$output.d.ts"), file("$output.lua")) + } + file("lualib_bundle.lua")) +} + +tasks.assemble { + dependsOn(compileTypeScript) +} + +tasks.clean { + delete(fileTree(projectDir) { + include("**/*.d.ts", "**/*.lua") + }) +} diff --git a/projects/typed-peripheral-turtlematic/mics/chatter.ts b/projects/typed-peripheral-turtlematic/mics/chatter.ts new file mode 100644 index 0000000..1bafc54 --- /dev/null +++ b/projects/typed-peripheral-turtlematic/mics/chatter.ts @@ -0,0 +1,29 @@ +import { IPeripheralProvider } from "@siredvin/typed-peripheral-base"; + +let DUMMY_MESSAGE: string | null = null; + +/** @noSelf **/ +export interface Chatter extends IPeripheral { + getMessage(): string | null; + setMessage(text: string): void; + clearMessage(): void; +} + +/** @noSelf **/ +export class DummyChatter implements Chatter { + getMessage(): string | null { + return DUMMY_MESSAGE; + } + setMessage(text: string): void { + DUMMY_MESSAGE = text; + print("Setting message to chatter", DUMMY_MESSAGE); + } + clearMessage(): void { + DUMMY_MESSAGE = null; + } +} + +export const chatterProvider = new IPeripheralProvider( + "chatter", + () => new DummyChatter() +); diff --git a/projects/typed-peripheral-turtlematic/mics/lava_bucket.ts b/projects/typed-peripheral-turtlematic/mics/lava_bucket.ts new file mode 100644 index 0000000..88a09f8 --- /dev/null +++ b/projects/typed-peripheral-turtlematic/mics/lava_bucket.ts @@ -0,0 +1,16 @@ +import { IPeripheralProvider } from "@siredvin/typed-peripheral-base"; + +/** @noSelf **/ +export interface LavaBucket extends IPeripheral { + void(): void; +} + +/** @noSelf **/ +export class DummyLavaBucket implements LavaBucket { + void(): void {} +} + +export const lavaBucketProvider = new IPeripheralProvider( + "lava_bucket", + () => new DummyLavaBucket() +); diff --git a/projects/typed-peripheral-turtlematic/mics/mimic.ts b/projects/typed-peripheral-turtlematic/mics/mimic.ts new file mode 100644 index 0000000..36864ee --- /dev/null +++ b/projects/typed-peripheral-turtlematic/mics/mimic.ts @@ -0,0 +1,12 @@ +import { IPeripheralProvider } from "@siredvin/typed-peripheral-base"; + +/** @noSelf **/ +export interface Mimic extends IPeripheral { + reset(); + setTransformation(rlm: string); + getTransformation(): string; + setMimic(block: LuaTable, nbtData?: string); + getMimic(): LuaMultiReturn<[LuaTable | null, string | null]>; +} + +export const mimicProvider = new IPeripheralProvider("mimic"); diff --git a/projects/typed-peripheral-turtlematic/mics/piston.ts b/projects/typed-peripheral-turtlematic/mics/piston.ts new file mode 100644 index 0000000..31296a8 --- /dev/null +++ b/projects/typed-peripheral-turtlematic/mics/piston.ts @@ -0,0 +1,28 @@ +import { IPeripheralProvider } from "@siredvin/typed-peripheral-base"; + +let IS_SILENT_GLOBAL = false; + +/** @noSelf **/ +export interface Piston extends IPeripheral { + push(direction?: Direction): Result; + isSilent(): boolean; + setSilent(value: boolean): void; +} + +/** @noSelf **/ +export class DummyPiston implements Piston { + isSilent(): boolean { + return IS_SILENT_GLOBAL; + } + setSilent(value: boolean): void { + IS_SILENT_GLOBAL = value; + } + push(direction?: Direction): Result { + return $multi(true, null); + } +} + +export const pistonProvider = new IPeripheralProvider( + "piston", + () => new DummyPiston() +); diff --git a/projects/typed-peripheral-turtlematic/mics/sticky_piston.ts b/projects/typed-peripheral-turtlematic/mics/sticky_piston.ts new file mode 100644 index 0000000..081db7b --- /dev/null +++ b/projects/typed-peripheral-turtlematic/mics/sticky_piston.ts @@ -0,0 +1,32 @@ +import { IPeripheralProvider } from "@siredvin/typed-peripheral-base"; + +let IS_SILENT_GLOBAL = false; + +/** @noSelf **/ +export interface StickyPiston extends IPeripheral { + pull(direction?: Direction): Result; + push(direction?: Direction): Result; + isSilent(): boolean; + setSilent(value: boolean): void; +} + +/** @noSelf **/ +export class DummyStickyPiston implements StickyPiston { + isSilent(): boolean { + return IS_SILENT_GLOBAL; + } + setSilent(value: boolean): void { + IS_SILENT_GLOBAL = value; + } + push(direction?: Direction): Result { + return $multi(true, null); + } + pull(direction?: Direction): Result { + return $multi(true, null); + } +} + +export const stickyPistonProvider = new IPeripheralProvider( + "stickyPiston", + () => new DummyStickyPiston() +); diff --git a/projects/typed-peripheral-turtlematic/package-lock.json b/projects/typed-peripheral-turtlematic/package-lock.json new file mode 100644 index 0000000..5a176f3 --- /dev/null +++ b/projects/typed-peripheral-turtlematic/package-lock.json @@ -0,0 +1,256 @@ +{ + "name": "@siredvin/typed-peripheral-turtlematic", + "version": "0.1.0", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "@siredvin/typed-peripheral-turtlematic", + "version": "0.1.0", + "license": "MIT", + "dependencies": { + "@jackmacwindows/lua-types": "^2.13.1", + "@siredvin/api-types": "1.1.0", + "@siredvin/cc-types": "1.1.0", + "@siredvin/craftos-types": "1.2.0", + "@siredvin/typed-peripheral-api": "0.1.0", + "@siredvin/typed-peripheral-base": "0.4.0" + }, + "devDependencies": { + "typescript": "*", + "typescript-to-lua": "*" + } + }, + "node_modules/@jackmacwindows/lua-types": { + "version": "2.13.2", + "resolved": "https://registry.npmjs.org/@jackmacwindows/lua-types/-/lua-types-2.13.2.tgz", + "integrity": "sha512-XoqHmgtG1SLWzmMx8wQc0sJtPmrzjCFbiwNiBIZE7HOEXWdJi7NDKVlE1nl9A5745Yb5jIkfz2deOzMtHiHVcQ==", + "license": "MIT" + }, + "node_modules/@siredvin/api-types": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@siredvin/api-types/-/api-types-1.1.0.tgz", + "integrity": "sha512-jsyXqMMW9XIjYzRb4FBpbH5AnCr+QORwRzFU00Ail1pf+7qEvRepEUy6ybh0O3h/4jLlikjFfDGUkMCF18imRg==", + "license": "MIT" + }, + "node_modules/@siredvin/cc-types": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@siredvin/cc-types/-/cc-types-1.1.0.tgz", + "integrity": "sha512-f2FsQDBep0cxxRnOcL8HSlF9yMbFvSHOXJY1aIIN7JFcQzzVBT4TNTQ01kTPf8hG2dRjgIM74sbzu2dB/3gLkQ==", + "license": "MIT" + }, + "node_modules/@siredvin/craftos-types": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/@siredvin/craftos-types/-/craftos-types-1.2.0.tgz", + "integrity": "sha512-7QJsHifAXkzAT/BTMRzIKXXsfk8rYCV69J47yo4a+0e/iQh1T7YMoSRGZde/5tBcgRIM5bnZb92l+hjKa63aDw==", + "license": "MIT" + }, + "node_modules/@siredvin/typed-peripheral-api": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/@siredvin/typed-peripheral-api/-/typed-peripheral-api-0.1.0.tgz", + "integrity": "sha512-Jd2oHeJ/kfJ3u2E+T1i36SoPod6UZZulB4Q0OOeH6oGkygpcGn6ssfVuTv/vRhWof84FJK2EnSd1dOrAa2ZAiA==", + "license": "MIT", + "dependencies": { + "@jackmacwindows/lua-types": "^2.13.1", + "@siredvin/api-types": "1.1.0", + "@siredvin/cc-types": "1.1.0", + "@siredvin/craftos-types": "1.2.0", + "@siredvin/typed-peripheral-base": "0.4.0" + } + }, + "node_modules/@siredvin/typed-peripheral-base": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/@siredvin/typed-peripheral-base/-/typed-peripheral-base-0.4.0.tgz", + "integrity": "sha512-/QwXoEViQi2/T6zMDAVaqIyxhtNYxbK12y47VxQ9J7fTBcJBpI06rEKl2NLgb9n1eUvsHak5IcitR3Pyu2/zsA==", + "license": "MIT", + "dependencies": { + "@jackmacwindows/lua-types": "^2.13.1", + "@siredvin/api-types": "1.1.0", + "@siredvin/cc-types": "1.1.0", + "@siredvin/craftos-types": "1.2.0" + } + }, + "node_modules/@typescript-to-lua/language-extensions": { + "version": "1.19.0", + "resolved": "https://registry.npmjs.org/@typescript-to-lua/language-extensions/-/language-extensions-1.19.0.tgz", + "integrity": "sha512-Os5wOKwviTD4LeqI29N0btYOjokSJ97iCf45EOjIABlb5IwNQy7AE/AqZJobRw3ywHH8+KzJUMkEirWPzh2tUA==", + "dev": true, + "license": "MIT" + }, + "node_modules/enhanced-resolve": { + "version": "5.8.2", + "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.8.2.tgz", + "integrity": "sha512-F27oB3WuHDzvR2DOGNTaYy0D5o0cnrv8TeI482VM4kYgQd/FT9lUQwuNsJ0oOHtBUq7eiW5ytqzp7nBFknL+GA==", + "dev": true, + "license": "MIT", + "dependencies": { + "graceful-fs": "^4.2.4", + "tapable": "^2.2.0" + }, + "engines": { + "node": ">=10.13.0" + } + }, + "node_modules/function-bind": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", + "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==", + "dev": true, + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/graceful-fs": { + "version": "4.2.11", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz", + "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==", + "dev": true, + "license": "ISC" + }, + "node_modules/hasown": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.2.tgz", + "integrity": "sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "function-bind": "^1.1.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/is-core-module": { + "version": "2.16.1", + "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.16.1.tgz", + "integrity": "sha512-UfoeMA6fIJ8wTYFEUjelnaGI67v6+N7qXJEvQuIGa99l4xsCruSYOVSQ0uPANn4dAzm8lkYPaKLrrijLq7x23w==", + "dev": true, + "license": "MIT", + "dependencies": { + "hasown": "^2.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/path-parse": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz", + "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==", + "dev": true, + "license": "MIT" + }, + "node_modules/picomatch": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", + "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8.6" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, + "node_modules/resolve": { + "version": "1.22.11", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.11.tgz", + "integrity": "sha512-RfqAvLnMl313r7c9oclB1HhUEAezcpLjz95wFH4LVuhk9JF/r22qmVP9AMmOU4vMX7Q8pN8jwNg/CSpdFnMjTQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "is-core-module": "^2.16.1", + "path-parse": "^1.0.7", + "supports-preserve-symlinks-flag": "^1.0.0" + }, + "bin": { + "resolve": "bin/resolve" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/source-map": { + "version": "0.7.6", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.7.6.tgz", + "integrity": "sha512-i5uvt8C3ikiWeNZSVZNWcfZPItFQOsYTUAOkcUPGd8DqDy1uOUikjt5dG+uRlwyvR108Fb9DOd4GvXfT0N2/uQ==", + "dev": true, + "license": "BSD-3-Clause", + "engines": { + "node": ">= 12" + } + }, + "node_modules/supports-preserve-symlinks-flag": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz", + "integrity": "sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/tapable": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/tapable/-/tapable-2.3.0.tgz", + "integrity": "sha512-g9ljZiwki/LfxmQADO3dEY1CbpmXT5Hm2fJ+QaGKwSXUylMybePR7/67YW7jOrrvjEgL1Fmz5kzyAjWVWLlucg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/webpack" + } + }, + "node_modules/typescript": { + "version": "5.9.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.9.3.tgz", + "integrity": "sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw==", + "dev": true, + "license": "Apache-2.0", + "bin": { + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" + }, + "engines": { + "node": ">=14.17" + } + }, + "node_modules/typescript-to-lua": { + "version": "1.33.2", + "resolved": "https://registry.npmjs.org/typescript-to-lua/-/typescript-to-lua-1.33.2.tgz", + "integrity": "sha512-A/o3JgPuKDn3f5nPOM8GiL1Eo5Ngw+wKGe0OxtWuwqU099ZKccpi9JG4Y3WQRHPpPkPmjD/eEQFo4UAehxO8DQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@typescript-to-lua/language-extensions": "1.19.0", + "enhanced-resolve": "5.8.2", + "picomatch": "^2.3.1", + "resolve": "^1.15.1", + "source-map": "^0.7.3" + }, + "bin": { + "tstl": "dist/tstl.js" + }, + "engines": { + "node": ">=16.10.0" + }, + "peerDependencies": { + "typescript": "5.9.3" + } + } + } +} diff --git a/projects/typed-peripheral-turtlematic/package.json b/projects/typed-peripheral-turtlematic/package.json new file mode 100644 index 0000000..2819ca2 --- /dev/null +++ b/projects/typed-peripheral-turtlematic/package.json @@ -0,0 +1,57 @@ +{ + "name": "@siredvin/typed-peripheral-turtlematic", + "version": "0.3.1", + "description": "Typed peripheral library for Turtlematic peripherals", + "files": [ + "./*.d.ts", + "./*.lua", + "./**/*.d.ts", + "./**/*.lua" + ], + "publishConfig": { + "access": "public" + }, + "author": "SirEdvin", + "license": "MIT", + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1", + "build": "tstl", + "clean": "rm -f *.lua", + "lint": "eslint . --ext .ts,.js", + "depcheck": "depcheck" + }, + "dependencies": { + "@siredvin/cc-types": "^1.1.0", + "@siredvin/craftos-types": "^1.2.0", + "@siredvin/api-types": "^1.1.0", + "@jackmacwindows/lua-types": "^2.13.1", + "@siredvin/typed-peripheral-base": "*", + "@siredvin/typed-peripheral-api": "*" + }, + "devDependencies": { + "typescript-to-lua": "*", + "typescript": "*" + }, + "nx": { + "targets": { + "lint": { + "executor": "@nx/linter:eslint", + "outputs": [ + "{options.outputFile}" + ], + "options": { + "lintFilePatterns": [ + "packages/typed-peripheral/**/*.{ts,tsx,js,jsx}" + ] + } + }, + "depcheck": { + "executor": "nx:run-commands", + "options": { + "command": "depcheck", + "cwd": "packages/typed-peripheral" + } + } + } + } +} diff --git a/projects/typed-peripheral-turtlematic/tsconfig.json b/projects/typed-peripheral-turtlematic/tsconfig.json new file mode 100644 index 0000000..3c5b0de --- /dev/null +++ b/projects/typed-peripheral-turtlematic/tsconfig.json @@ -0,0 +1,22 @@ +{ + "$schema": "https://raw.githubusercontent.com/MCJack123/TypeScriptToLua/master/tsconfig-schema.json", + "compilerOptions": { + "target": "ESNext", + "lib": ["ESNext"], + "moduleResolution": "node", + "declaration": true, + "strict": false, + "types": [ + "@jackmacwindows/lua-types/cc", + "@siredvin/craftos-types", + "@siredvin/cc-types", + "@siredvin/api-types" + ] + }, + "tstl": { + "luaTarget": "5.1", + "luaLibImport": "require-minimal", + "buildMode": "library" + }, + "include": ["./*.ts", "./**/*.ts"] +} diff --git a/settings.gradle.kts b/settings.gradle.kts index 20d938b..044fdee 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -35,8 +35,9 @@ rootProject.name = "Turtlematic $minecraftVersion" include(":core") include(":forge") include(":fabric") +include(":typed-peripheral-turtlematic") for (project in rootProject.children) { project.projectDir = file("projects/${project.name}") -} \ No newline at end of file +}