A fast 2D and 3D game engine — TypeScript SDK, C++/WebAssembly core, visual editor. Ship one project to web, desktop, WeChat MiniGames, playable ads, and native Android / iOS.
TypeScript 2d-game-engine3d3d-game-engineandroidcppecsgame-editorgame-enginegamedeviostypescriptwebassemblywebglwebgpuwechat-minigame
feat(plugins): an LDtk importer, written the way anyone else would write one
yhhe65d3b2bf679
diff --git a/plugins/ldtk/README.md b/plugins/ldtk/README.mdnew file mode 100644index 000000000..15b012112--- /dev/null+++ b/plugins/ldtk/README.md@@ -0,0 +1,43 @@+# estella-plugin-ldtk++Import [LDtk](https://ldtk.io) levels into Estella as Tiled maps, which the engine+loads natively.++```bash+npm install estella-plugin-ldtk+```++The editor lists it in **Window ▸ Plugins**, where it needs your approval before+it runs — like any plugin, and again after an update.++## What it does++Drop a `.ldtk` file anywhere in your project. Every time it changes, each level is+written as a `.tmj` beside it, in a folder named after the source:++```+assets/levels/world.ldtk+assets/levels/world/Level_0.tmj ← generated+assets/levels/world/Level_1.tmj ← generated+```++Point a `TilemapLayer` at one of those and it draws. **Reimport** in the Content+Browser re-runs the conversion by hand.++What crosses over: tile layers and auto-layers, their tilesets (image, grid,+spacing, padding), tile flips, layer order and opacity. Tileset images are+re-based onto the map's own folder, so the map resolves them wherever it lands.++What does not, yet: entity layers, IntGrid values, level fields, and worlds laid+out in LDtk's world grid — a level becomes a map of its own, not a tile in a+larger one.++## Built on the public API++Nothing here reaches into the engine: it is an editor plugin using+`ctx.assets.registerImporter`, `ctx.fs.readProject` / `writeProject` (which is why+it declares the `fs:project` capability), and one agent tool so the built-in agent+can run the import too. The conversion itself is a pure function over JSON —+`src/convert.ts`, tested on its own.++Apache-2.0.diff --git a/plugins/ldtk/package.json b/plugins/ldtk/package.jsonnew file mode 100644index 000000000..88eceaa56--- /dev/null+++ b/plugins/ldtk/package.json@@ -0,0 +1,11 @@+{+ "name": "estella-plugin-ldtk",+ "version": "0.1.0",+ "description": "Import LDtk levels into Estella, as Tiled maps the engine loads natively.",+ "license": "Apache-2.0",+ "type": "module",+ "files": ["plugin.json", "src", "README.md"],+ "keywords": ["estella", "estella-plugin", "ldtk", "tilemap"],+ "scripts": { "test": "vitest run" },+ "devDependencies": { "vitest": "^2.1.9" }+}diff --git a/plugins/ldtk/plugin.json b/plugins/ldtk/plugin.jsonnew file mode 100644index 000000000..c9037a623--- /dev/null+++ b/plugins/ldtk/plugin.json@@ -0,0 +1,13 @@+{+ "id": "estella.ldtk",+ "name": "LDtk Importer",+ "version": "0.1.0",+ "description": {+ "en": "Import LDtk levels as Tiled maps the engine loads natively.",+ "zh-CN": "把 LDtk 关卡导入成引擎原生读取的 Tiled 地图。"+ },+ "publisher": "estella",+ "engines": { "editor": ">=0.51" },+ "main": { "editor": "src/editor.ts" },+ "capabilities": ["fs:project"]+}diff --git a/plugins/ldtk/src/convert.ts b/plugins/ldtk/src/convert.tsnew file mode 100644index 000000000..2ec6b13cf--- /dev/null+++ b/plugins/ldtk/src/convert.ts@@ -0,0 +1,190 @@+// SPDX-License-Identifier: Apache-2.0+// SPDX-FileCopyrightText: Copyright (c) 2024-present ESEngine Team+/**+ * @file convert.ts — an LDtk project as Tiled maps, which the engine reads natively.+ *+ * Pure: JSON in, files out. The editor half only reads and writes.+ */++/** The parts of an `.ldtk` file this reads. Everything else is ignored. */+export interface LdtkProject {+ defs?: { tilesets?: LdtkTileset[] };+ levels?: LdtkLevel[];+}++export interface LdtkTileset {+ uid: number;+ identifier: string;+ /** Image path, relative to the `.ldtk` file. Absent for an internal icon set. */+ relPath?: string | null;+ pxWid: number;+ pxHei: number;+ tileGridSize: number;+ spacing?: number;+ padding?: number;+}++export interface LdtkLevel {+ identifier: string;+ layerInstances?: LdtkLayer[] | null;+}++export interface LdtkLayer {+ __identifier: string;+ __type: string;+ __gridSize: number;+ __cWid: number;+ __cHei: number;+ __tilesetDefUid?: number | null;+ __opacity?: number;+ visible?: boolean;+ gridTiles?: LdtkTile[];+ autoLayerTiles?: LdtkTile[];+}++export interface LdtkTile {+ /** Pixel position in the layer. */+ px: [number, number];+ /** Tile id within its tileset. */+ t: number;+ /** Flip bits: 1 = X, 2 = Y. */+ f?: number;+}++/** One file the importer should write, project-relative. */+export interface ConvertedFile {+ path: string;+ text: string;+}++// Tiled's flip flags live in the high bits of a gid; the engine's parser reads+// exactly these three.+const FLIP_H = 0x80000000;+const FLIP_V = 0x40000000;++const dirOf = (path: string): string => path.slice(0, Math.max(0, path.lastIndexOf('/')));+const stemOf = (path: string): string => {+ const base = path.slice(path.lastIndexOf('/') + 1);+ const dot = base.lastIndexOf('.');+ return dot < 0 ? base : base.slice(0, dot);+};++/** Resolve `rel` against `from` (a directory), collapsing `.` and `..`. */+function resolveRel(from: string, rel: string): string {+ const out = from === '' ? [] : from.split('/');+ for (const part of rel.split('/')) {+ if (part === '' || part === '.') continue;+ if (part === '..') out.pop();+ else out.push(part);+ }+ return out.join('/');+}++/** `to` expressed relative to the directory `from`. */+function relativeTo(from: string, to: string): string {+ const a = from === '' ? [] : from.split('/');+ const b = to.split('/');+ let i = 0;+ while (i < a.length && i < b.length && a[i] === b[i]) i++;+ return [...Array(a.length - i).fill('..'), ...b.slice(i)].join('/');+}++/** Whether a layer carries tiles at all — an IntGrid used as pure data has none,+ * and an empty tile layer in Tiled is a layer that draws nothing. */+const tilesOf = (layer: LdtkLayer): LdtkTile[] => [...(layer.gridTiles ?? []), ...(layer.autoLayerTiles ?? [])];++/**+ * Every level of `project` as a Tiled map, written under a folder named after the+ * source file so a reimport overwrites its own output and nothing else.+ *+ * `sourcePath` is the `.ldtk` file's project-relative path — tileset images are+ * declared relative to it, and Tiled declares them relative to the map.+ */+export function tiledFromLdtk(project: LdtkProject, sourcePath: string): ConvertedFile[] {+ const srcDir = dirOf(sourcePath);+ const outDir = srcDir === '' ? stemOf(sourcePath) : `${srcDir}/${stemOf(sourcePath)}`;++ // One gid space per map, assigned in tileset order. A tileset with no image is+ // skipped: it cannot be drawn, and giving it a gid range would shift every+ // tileset after it.+ const usable = (project.defs?.tilesets ?? []).filter((t) => !!t.relPath);+ let nextGid = 1;+ const tilesets = usable.map((ts) => {+ const columns = Math.max(1, Math.floor((ts.pxWid - (ts.padding ?? 0) * 2 + (ts.spacing ?? 0))+ / (ts.tileGridSize + (ts.spacing ?? 0))));+ const rows = Math.max(1, Math.floor((ts.pxHei - (ts.padding ?? 0) * 2 + (ts.spacing ?? 0))+ / (ts.tileGridSize + (ts.spacing ?? 0))));+ const firstgid = nextGid;+ nextGid += columns * rows;+ return {+ uid: ts.uid,+ firstgid,+ json: {+ firstgid,+ name: ts.identifier,+ image: relativeTo(outDir, resolveRel(srcDir, ts.relPath!)),+ imagewidth: ts.pxWid,+ imageheight: ts.pxHei,+ tilewidth: ts.tileGridSize,+ tileheight: ts.tileGridSize,+ margin: ts.padding ?? 0,+ spacing: ts.spacing ?? 0,+ columns,+ tilecount: columns * rows,+ },+ };+ });+ const gidOf = new Map(tilesets.map((t) => [t.uid, t.firstgid]));++ return (project.levels ?? []).map((level) => {+ const drawn = (level.layerInstances ?? []).filter((l) => tilesOf(l).length > 0);+ // LDtk lists layers top-first; Tiled draws its array in order, so the first+ // entry is the BOTTOM one. Reversing is what keeps a background behind.+ const ordered = [...drawn].reverse();+ const first = ordered[0];+ const tileSize = first?.__gridSize ?? 16;+ const width = Math.max(...ordered.map((l) => l.__cWid), 0);+ const height = Math.max(...ordered.map((l) => l.__cHei), 0);++ const layers = ordered.map((layer) => {+ const firstgid = gidOf.get(layer.__tilesetDefUid ?? -1) ?? 1;+ const data = new Array<number>(layer.__cWid * layer.__cHei).fill(0);+ for (const tile of tilesOf(layer)) {+ const cx = Math.floor(tile.px[0] / layer.__gridSize);+ const cy = Math.floor(tile.px[1] / layer.__gridSize);+ if (cx < 0 || cy < 0 || cx >= layer.__cWid || cy >= layer.__cHei) continue;+ const flip = ((tile.f ?? 0) & 1 ? FLIP_H : 0) | ((tile.f ?? 0) & 2 ? FLIP_V : 0);+ // A later tile in the same cell is the one drawn on top, and a Tiled tile+ // layer holds one per cell — so it wins, rather than the first winning.+ data[cy * layer.__cWid + cx] = (firstgid + tile.t) | flip;+ }+ return {+ type: 'tilelayer',+ name: layer.__identifier,+ width: layer.__cWid,+ height: layer.__cHei,+ x: 0,+ y: 0,+ opacity: layer.__opacity ?? 1,+ visible: layer.visible !== false,+ data,+ };+ });++ const map = {+ type: 'map',+ version: '1.10',+ tiledversion: 'estella-plugin-ldtk',+ orientation: 'orthogonal',+ renderorder: 'right-down',+ infinite: false,+ width,+ height,+ tilewidth: tileSize,+ tileheight: tileSize,+ tilesets: tilesets.map((t) => t.json),+ layers,+ };+ return { path: `${outDir}/${level.identifier}.tmj`, text: `${JSON.stringify(map, null, 2)}\n` };+ });+}diff --git a/plugins/ldtk/src/editor.ts b/plugins/ldtk/src/editor.tsnew file mode 100644index 000000000..d7bf769b7--- /dev/null+++ b/plugins/ldtk/src/editor.ts@@ -0,0 +1,39 @@+// SPDX-License-Identifier: Apache-2.0+// SPDX-FileCopyrightText: Copyright (c) 2024-present ESEngine Team+import { definePlugin, type PluginContext } from '@estella/editor-api';+import { tiledFromLdtk, type LdtkProject } from './convert';++export default definePlugin({+ activate(ctx: PluginContext) {+ ctx.assets.registerType({+ id: 'level',+ extensions: ['ldtk'],+ badge: 'LDTK',+ tint: 'var(--info-warm)',+ });++ ctx.assets.registerImporter({+ id: 'levels',+ extensions: ['ldtk'],+ async import(path) {+ const project = JSON.parse(await ctx.fs.readProject(path)) as LdtkProject;+ const files = tiledFromLdtk(project, path);+ for (const file of files) await ctx.fs.writeProject(file.path, file.text);+ ctx.log.info(`${path} → ${files.length} map(s)`);+ },+ });++ ctx.agentTools.register({+ name: 'estella.ldtk.import',+ description: 'Convert an LDtk project (.ldtk) into Tiled maps the engine loads. '+ + 'Use after adding or editing a .ldtk file; the maps land in a folder named after it.',+ schema: { type: 'object', properties: { path: { type: 'string' } }, required: ['path'] },+ effect: 'journaled',+ run: async (input) => {+ const { path } = input as { path: string };+ await ctx.assets.reimport(path);+ return { imported: path };+ },+ });+ },+});diff --git a/plugins/ldtk/tests/convert.test.ts b/plugins/ldtk/tests/convert.test.tsnew file mode 100644index 000000000..d1d3d94c2--- /dev/null+++ b/plugins/ldtk/tests/convert.test.ts@@ -0,0 +1,130 @@+// SPDX-License-Identifier: Apache-2.0+// SPDX-FileCopyrightText: Copyright (c) 2024-present ESEngine Team+/**+ * @file What an LDtk level has to become for the engine to draw it.+ *+ * The conversion is where a format's assumptions meet another's, so these are+ * the disagreements: layer order, the gid space, flip bits, and where an image+ * path is relative to.+ */+import { describe, it, expect } from 'vitest';+import { tiledFromLdtk, type LdtkProject } from '../src/convert';++const TILESET = {+ uid: 1,+ identifier: 'Terrain',+ relPath: '../art/terrain.png',+ pxWid: 64,+ pxHei: 32,+ tileGridSize: 16,+};++const tile = (x: number, y: number, t: number, f?: number) => ({ px: [x, y] as [number, number], t, ...(f ? { f } : {}) });++const oneLevel = (layerInstances: unknown[]): LdtkProject => ({+ defs: { tilesets: [TILESET] },+ levels: [{ identifier: 'Level_0', layerInstances: layerInstances as never }],+});++const layer = (over: Record<string, unknown> = {}) => ({+ __identifier: 'Ground',+ __type: 'Tiles',+ __gridSize: 16,+ __cWid: 2,+ __cHei: 2,+ __tilesetDefUid: 1,+ gridTiles: [tile(0, 0, 0)],+ ...over,+});++const convert = (p: LdtkProject, path = 'assets/levels/world.ldtk') => tiledFromLdtk(p, path);+const mapOf = (files: { text: string }[], i = 0) => JSON.parse(files[i].text) as Record<string, never>;++describe('an LDtk level as a Tiled map', () => {+ it('lands beside the source, in a folder of its own', () => {+ const files = convert(oneLevel([layer()]));+ expect(files.map((f) => f.path)).toEqual(['assets/levels/world/Level_0.tmj']);+ });++ it('writes one map per level', () => {+ const files = convert({+ defs: { tilesets: [TILESET] },+ levels: [+ { identifier: 'A', layerInstances: [layer()] as never },+ { identifier: 'B', layerInstances: [layer()] as never },+ ],+ });+ expect(files.map((f) => f.path)).toEqual(['assets/levels/world/A.tmj', 'assets/levels/world/B.tmj']);+ });++ it('reverses the layer order, because the two formats stack opposite ways', () => {+ // LDtk lists the topmost layer first; Tiled draws its array in order. Copying+ // the order across puts the background over everything.+ const files = convert(oneLevel([+ layer({ __identifier: 'Foreground' }),+ layer({ __identifier: 'Background' }),+ ]));+ expect((mapOf(files).layers as { name: string }[]).map((l) => l.name)).toEqual(['Background', 'Foreground']);+ });++ it('makes the tileset image relative to the MAP, not to the source', () => {+ // The .ldtk said `../art/terrain.png` from assets/levels; the map lives one+ // folder deeper, so the same image is two levels up.+ const files = convert(oneLevel([layer()]));+ expect((mapOf(files).tilesets as { image: string }[])[0].image).toBe('../../art/terrain.png');+ });++ it('gives each tileset its own gid range, sized by the tiles it holds', () => {+ const second = { ...TILESET, uid: 2, identifier: 'Props', relPath: 'props.png' };+ const files = convert({+ defs: { tilesets: [TILESET, second] },+ levels: [{ identifier: 'L', layerInstances: [layer({ __tilesetDefUid: 2, gridTiles: [tile(0, 0, 0)] })] as never }],+ });+ const sets = mapOf(files).tilesets as { name: string; firstgid: number; tilecount: number }[];+ expect(sets.map((t) => [t.name, t.firstgid, t.tilecount])).toEqual([['Terrain', 1, 8], ['Props', 9, 8]]);+ // …and a tile is placed in the range of ITS tileset, not the first one.+ expect((mapOf(files).layers as { data: number[] }[])[0].data[0]).toBe(9);+ });++ it('skips a tileset with no image rather than reserving gids for it', () => {+ // An internal icon set cannot be drawn; giving it a range would shift every+ // tileset after it and every tile would land on the wrong image.+ const files = convert({+ defs: { tilesets: [{ ...TILESET, uid: 9, relPath: null }, TILESET] },+ levels: [{ identifier: 'L', layerInstances: [layer()] as never }],+ });+ const sets = mapOf(files).tilesets as { firstgid: number }[];+ expect(sets).toHaveLength(1);+ expect(sets[0].firstgid).toBe(1);+ });++ it('carries flips through as the high gid bits Tiled uses', () => {+ const files = convert(oneLevel([layer({ gridTiles: [tile(0, 0, 3, 1), tile(16, 0, 3, 2), tile(0, 16, 3, 3)] })]));+ const data = (mapOf(files).layers as { data: number[] }[])[0].data;+ expect(data[0] >>> 0).toBe((4 | 0x80000000) >>> 0);+ expect(data[1] >>> 0).toBe((4 | 0x40000000) >>> 0);+ expect(data[2] >>> 0).toBe((4 | 0x80000000 | 0x40000000) >>> 0);+ });++ it('puts a tile in the cell its pixel position falls in', () => {+ const files = convert(oneLevel([layer({ gridTiles: [tile(16, 16, 5)] })]));+ expect((mapOf(files).layers as { data: number[] }[])[0].data).toEqual([0, 0, 0, 6]);+ });++ it('lets the last tile in a cell win, the way LDtk draws them', () => {+ const files = convert(oneLevel([layer({ autoLayerTiles: [tile(0, 0, 1), tile(0, 0, 7)], gridTiles: [] })]));+ expect((mapOf(files).layers as { data: number[] }[])[0].data[0]).toBe(8);+ });++ it('drops a layer that holds no tiles — an IntGrid is data, not a picture', () => {+ const files = convert(oneLevel([+ layer({ __identifier: 'Collision', __type: 'IntGrid', gridTiles: [], autoLayerTiles: [] }),+ layer(),+ ]));+ expect((mapOf(files).layers as { name: string }[]).map((l) => l.name)).toEqual(['Ground']);+ });++ it('has nothing to write for a project with no levels', () => {+ expect(convert({ defs: { tilesets: [TILESET] }, levels: [] })).toEqual([]);+ });+});diff --git a/plugins/ldtk/tsconfig.json b/plugins/ldtk/tsconfig.jsonnew file mode 100644index 000000000..1e3cb400b--- /dev/null+++ b/plugins/ldtk/tsconfig.json@@ -0,0 +1,13 @@+{+ "compilerOptions": {+ "strict": true,+ "target": "ES2020",+ "module": "ESNext",+ "moduleResolution": "bundler",+ "noEmit": true,+ "skipLibCheck": true,+ "types": ["vitest/globals"],+ "paths": { "@estella/editor-api": ["../../desktop/src/plugins/types.ts"] }+ },+ "include": ["src", "tests"]+}diff --git a/pnpm-lock.yaml b/pnpm-lock.yamlindex 14550a371..dd3a90720 100644--- a/pnpm-lock.yaml+++ b/pnpm-lock.yaml@@ -113,6 +113,12 @@ importers:specifier: ^2.1.0version: 2.1.9(@types/[email protected])(@vitest/[email protected])([email protected])([email protected])([email protected])([email protected])+ plugins/ldtk:+ devDependencies:+ vitest:+ specifier: ^2.1.9+ version: 2.1.9(@types/[email protected])(@vitest/[email protected])([email protected])([email protected])([email protected])([email protected])+sdk:devDependencies:'@rollup/plugin-terser':@@ -797,84 +803,72 @@ packages:engines: {node: ^20.19.0 || >=22.12.0}cpu: [arm64]os: [linux]- libc: [glibc]'@rolldown/[email protected]':resolution: {integrity: sha512-QI5SEDY8cbiYWHx0VO4vIc3UlS6a32vXHjU8Qy/17adEmZIPuByJg13UEvo9c/UCiUkdcVWY83C+b+JrwnNyUg==}engines: {node: ^20.19.0 || >=22.12.0}cpu: [arm64]os: [linux]- libc: [glibc]'@rolldown/[email protected]':resolution: {integrity: sha512-VWkUHwWriDciit80wleYwKILoR/KMvxh/IdwS/paX+ZgpuRpCrKLUdadJbc0NpBEiyhpYawsJ73j9aCvOH+f7Q==}engines: {node: ^20.19.0 || >=22.12.0}cpu: [arm64]os: [linux]- libc: [musl]'@rolldown/[email protected]':resolution: {integrity: sha512-Sm41FyCeXqmYcERoYOCbGIL5hNfd8w9LQ7Y61Bev48HkcjaJqV/iiVOaiDxjVTRMS+QKrZmD8cfPt4uMVnvM+A==}engines: {node: ^20.19.0 || >=22.12.0}cpu: [arm64]os: [linux]- libc: [musl]'@rolldown/[email protected]':resolution: {integrity: sha512-5f1laC0SlIR0yDbFCd8acUhvJIag6N3zC5P7oUPN6wX0aOma+uKJ0wBDH5aq7I1PVI2ttTlhJwzwRIBnLiSGEg==}engines: {node: ^20.19.0 || >=22.12.0}cpu: [ppc64]os: [linux]- libc: [glibc]'@rolldown/[email protected]':resolution: {integrity: sha512-2x+WhXTGl9yJYPbltW/BSEPTVz9OIWQyER4N+gJEDWkkn904eRcBzELqh/Hf7K0w/ubGbKNMv0ZC+94QK/IFEg==}engines: {node: ^20.19.0 || >=22.12.0}cpu: [ppc64]os: [linux]- libc: [glibc]'@rolldown/[email protected]':resolution: {integrity: sha512-Iq4ko0r4XsgbrF/LunNgHtAGLRRVE2kXonAXQ/MV0mC6jQpMOhW1SvtZja2EhC/kd05++bP78dsqBeIQyYJ6Yg==}engines: {node: ^20.19.0 || >=22.12.0}cpu: [s390x]os: [linux]- libc: [glibc]'@rolldown/[email protected]':resolution: {integrity: sha512-eEjmQpuRQayHPWWnywaWHkFT3ToPbP3RYy42VVd/B9aBGDA+Ol25EIWHxKQST3IiWJjikCWUF7KtbfqwZrzVwQ==}engines: {node: ^20.19.0 || >=22.12.0}cpu: [s390x]os: [linux]- libc: [glibc]'@rolldown/[email protected]':resolution: {integrity: sha512-B8m6tD5+/N5FeNQFbKlLA/2yVq9ycQP1SeedyEYYKWBNR3ZQbkvIUcNnDNM03lO1l5F2roiiFJGgvoLLyZXtSg==}engines: {node: ^20.19.0 || >=22.12.0}cpu: [x64]os: [linux]- libc: [glibc]'@rolldown/[email protected]':resolution: {integrity: sha512-/Orga1fZYkLc/56jBICcHrKchl8Z2UKdDSr3LG9ToWO1lQ6a4Livk9Xz+9WN91zsz5QR3XQz2NNoSDEvP6qadw==}engines: {node: ^20.19.0 || >=22.12.0}cpu: [x64]os: [linux]- libc: [glibc]'@rolldown/[email protected]':resolution: {integrity: sha512-pSdpdUJHkuCxun9LE7jvgUB9qsRgaiyNNCX7m/AvHTcq67AiT/Yhoxvw5zPfhrM8k/BfP8ce/hMOpthKDpEUow==}engines: {node: ^20.19.0 || >=22.12.0}cpu: [x64]os: [linux]- libc: [musl]'@rolldown/[email protected]':resolution: {integrity: sha512-xxBJRL+0q0Kce7orznGWLuylHDY65vuARXZRpX+hPdv+DqK2c3NlCsVA98tlWzWNEE7yPqA/1NQ5nnCrj49Y5A==}engines: {node: ^20.19.0 || >=22.12.0}cpu: [x64]os: [linux]- libc: [musl]'@rolldown/[email protected]':resolution: {integrity: sha512-OXXS3RKJgX2uLwM+gYyuH5omcH8fL1LJs96pZGgtetVCahON57+d4SJHzTgZiOjxgGkSnpXpOsWuPDGAKAigEg==}@@ -989,79 +983,66 @@ packages:resolution: {integrity: sha512-F8sWbhZ7tyuEfsmOxwc2giKDQzN3+kuBLPwwZGyVkLlKGdV1nvnNwYD0fKQ8+XS6hp9nY7B+ZeK01EBUE7aHaw==}cpu: [arm]os: [linux]- libc: [glibc]'@rollup/[email protected]':resolution: {integrity: sha512-rGfNUfn0GIeXtBP1wL5MnzSj98+PZe/AXaGBCRmT0ts80lU5CATYGxXukeTX39XBKsxzFpEeK+Mrp9faXOlmrw==}cpu: [arm]os: [linux]- libc: [musl]'@rollup/[email protected]':resolution: {integrity: sha512-MMtej3YHWeg/0klK2Qodf3yrNzz6CGjo2UntLvk2RSPlhzgLvYEB3frRvbEF2wRKh1Z2fDIg9KRPe1fawv7C+g==}cpu: [arm64]os: [linux]- libc: [glibc]'@rollup/[email protected]':resolution: {integrity: sha512-1a/qhaaOXhqXGpMFMET9VqwZakkljWHLmZOX48R0I/YLbhdxr1m4gtG1Hq7++VhVUmf+L3sTAf9op4JlhQ5u1Q==}cpu: [arm64]os: [linux]- libc: [musl]'@rollup/[email protected]':resolution: {integrity: sha512-QWO6RQTZ/cqYtJMtxhkRkidoNGXc7ERPbZN7dVW5SdURuLeVU7lwKMpo18XdcmpWYd0qsP1bwKPf7DNSUinhvA==}cpu: [loong64]os: [linux]- libc: [glibc]'@rollup/[email protected]':resolution: {integrity: sha512-xpObYIf+8gprgWaPP32xiN5RVTi/s5FCR+XMXSKmhfoJjrpRAjCuuqQXyxUa/eJTdAE6eJ+KDKaoEqjZQxh3Gw==}cpu: [loong64]os: [linux]- libc: [musl]'@rollup/[email protected]':resolution: {integrity: sha512-4BrCgrpZo4hvzMDKRqEaW1zeecScDCR+2nZ86ATLhAoJ5FQ+lbHVD3ttKe74/c7tNT9c6F2viwB3ufwp01Oh2w==}cpu: [ppc64]os: [linux]- libc: [glibc]'@rollup/[email protected]':resolution: {integrity: sha512-NOlUuzesGauESAyEYFSe3QTUguL+lvrN1HtwEEsU2rOwdUDeTMJdO5dUYl/2hKf9jWydJrO9OL/XSSf65R5+Xw==}cpu: [ppc64]os: [linux]- libc: [musl]'@rollup/[email protected]':resolution: {integrity: sha512-ptA88htVp0AwUUqhVghwDIKlvJMD/fmL/wrQj99PRHFRAG6Z5nbWoWG4o81Nt9FT+IuqUQi+L31ZKAFeJ5Is+A==}cpu: [riscv64]os: [linux]- libc: [glibc]'@rollup/[email protected]':resolution: {integrity: sha512-S51t7aMMTNdmAMPpBg7OOsTdn4tySRQvklmL3RpDRyknk87+Sp3xaumlatU+ppQ+5raY7sSTcC2beGgvhENfuw==}cpu: [riscv64]os: [linux]- libc: [musl]'@rollup/[email protected]':resolution: {integrity: sha512-Bl00OFnVFkL82FHbEqy3k5CUCKH6OEJL54KCyx2oqsmZnFTR8IoNqBF+mjQVcRCT5sB6yOvK8A37LNm/kPJiZg==}cpu: [s390x]os: [linux]- libc: [glibc]'@rollup/[email protected]':resolution: {integrity: sha512-ABca4ceT4N+Tv/GtotnWAeXZUZuM/9AQyCyKYyKnpk4yoA7QIAuBt6Hkgpw8kActYlew2mvckXkvx0FfoInnLg==}cpu: [x64]os: [linux]- libc: [glibc]'@rollup/[email protected]':resolution: {integrity: sha512-HFps0JeGtuOR2convgRRkHCekD7j+gdAuXM+/i6kGzQtFhlCtQkpwtNzkNj6QhCDp7DRJ7+qC/1Vg2jt5iSOFw==}cpu: [x64]os: [linux]- libc: [musl]'@rollup/[email protected]':resolution: {integrity: sha512-H+hXEv9gdVQuDTgnqD+SQffoWoc0Of59AStSzTEj/feWTBAnSfSD3+Dql1ZruJQxmykT/JVY0dE8Ka7z0DH1hw==}@@ -2389,28 +2370,24 @@ packages:engines: {node: '>= 12.0.0'}cpu: [arm64]os: [linux]- libc: [glibc]resolution: {integrity: sha512-UpQkoenr4UJEzgVIYpI80lDFvRmPVg6oqboNHfoH4CQIfNA+HOrZ7Mo7KZP02dC6LjghPQJeBsvXhJod/wnIBg==}engines: {node: '>= 12.0.0'}cpu: [arm64]os: [linux]- libc: [musl]resolution: {integrity: sha512-V7Qr52IhZmdKPVr+Vtw8o+WLsQJYCTd8loIfpDaMRWGUZfBOYEJeyJIkqGIDMZPwPx24pUMfwSxxI8phr/MbOA==}engines: {node: '>= 12.0.0'}cpu: [x64]os: [linux]- libc: [glibc]resolution: {integrity: sha512-bYcLp+Vb0awsiXg/80uCRezCYHNg1/l3mt0gzHnWV9XP1W5sKa5/TCdGWaR/zBM2PeF/HbsQv/j2URNOiVuxWg==}engines: {node: '>= 12.0.0'}cpu: [x64]os: [linux]- libc: [musl]resolution: {integrity: sha512-8SbC8BR40pS6baCM8sbtYDSwEVQd4JlFTOlaD3gWGHfThTcABnNDBda6eTZeqbofalIJhFx0qKzgHJmcPTnGdw==}diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yamlindex 6ac9f3e3a..25116438a 100644--- a/pnpm-workspace.yaml+++ b/pnpm-workspace.yaml@@ -1,6 +1,7 @@packages:- 'sdk'- 'desktop'+ - 'plugins/*'onlyBuiltDependencies:- esbuild- electrondiff --git a/tools/gates.mjs b/tools/gates.mjsindex c7074f552..50a313120 100644--- a/tools/gates.mjs+++ b/tools/gates.mjs@@ -49,6 +49,11 @@ export const GATES = [{ id: 'api-surface-dts', run: 'node tools/api-surface.mjs --check-dts' },// The editor imports `esengine` — it reads dist, not the SDK's sources.{ id: 'tsc-editor', run: 'pnpm --filter @estella/editor exec tsc --noEmit' },+ // The shipped plugins type-check against the editor's LIVE plugin API surface+ // (types.ts, the file authors are handed), so a change to it that no plugin+ // could survive fails here rather than in someone else's project.+ { id: 'tsc-plugins', run: 'pnpm -r --filter "./plugins/*" exec tsc --noEmit' },+ { id: 'plugin-tests', run: 'pnpm -r --filter "./plugins/*" test' },{ id: 'cycles', run: 'node tools/check-cycles.mjs' },{ id: 'layers', run: 'node tools/check-layers.mjs' },{ id: 'project-settings', run: 'node tools/check-project-settings.mjs' },