From c9fc39e5d747f47375ad961a399d8dd61bcf76ef Mon Sep 17 00:00:00 2001 From: Gnlow Date: Wed, 20 Dec 2023 13:04:04 +0900 Subject: [PATCH] refactor: omit unused info --- api/js.ts | 12 ++++++++++++ deno.lock | 10 ++++++++++ 2 files changed, 22 insertions(+) diff --git a/api/js.ts b/api/js.ts index 014289c..69b435c 100644 --- a/api/js.ts +++ b/api/js.ts @@ -5,12 +5,24 @@ import { Object_, cg, Block, + Project, } from "../deps/enz.ts" import JSON5 from "https://esm.sh/json5@2.2.3?pin=v135" import { format } from "./util/format.ts" class PixiVisitor extends Visitor { + getInitData(project: Project) { + return { + ...project, + objects: project.objects.map( + ({sprite}) => ({sprite}) + ), + functions: project.functions.map( + ({content: _, ...rest}) => rest + ), + } as any + } visitObject(object: Object_): string { const script = super.visitObject(object) const { diff --git a/deno.lock b/deno.lock index ce8b9b7..a8258d6 100644 --- a/deno.lock +++ b/deno.lock @@ -181,6 +181,16 @@ "https://deno.land/x/enz@0.1.10/src/util/mod.ts": "505f7d4da955a4f896e06375421f2a63cb52d967cb4ce481eed6c8434f87754e", "https://deno.land/x/enz@0.1.10/src/util/parseProject.ts": "43a9ce44107658a70466b919d7d711f794a5687fdf36534d817b6ae27304a9c1", "https://deno.land/x/enz@0.1.10/src/util/visit.ts": "26c80eacaaa776428f76caa66f2bd2bfe43be4828cb87e7b907cd0f6f14ade47", + "https://deno.land/x/enz@0.1.11/mod.ts": "d6b7ac161b614a7289843406ccae3f82b001ad72f4905bc75ec84a408832aac7", + "https://deno.land/x/enz@0.1.11/src/class/Object_.ts": "d79837d06d53193853d4efc78f835d67ea17cd7f17f080f4810dfca349cc828e", + "https://deno.land/x/enz@0.1.11/src/class/Project.ts": "60cb72180fc8764e9ea2d9568bc2926082cdee48216b57054955b756e967e0d5", + "https://deno.land/x/enz@0.1.11/src/class/Script.ts": "dbca1eefdc6e28df39050fb20d921a69d8455f6803686c4d30b8aa1496e639b7", + "https://deno.land/x/enz@0.1.11/src/class/mod.ts": "37dbf1c7db9a6b414943a1c7b2636cb5aa069f49665552a7bb02ef03f181ea04", + "https://deno.land/x/enz@0.1.11/src/mod.ts": "dddb534d9d13f61a3b8d4dac80e119796048e3c7570898b34a49c6d05ae77456", + "https://deno.land/x/enz@0.1.11/src/util/codegen.ts": "d7e4c9af340c457ce73c8571704da28782afb2c922edf56ed1addb5c198746ae", + "https://deno.land/x/enz@0.1.11/src/util/mod.ts": "505f7d4da955a4f896e06375421f2a63cb52d967cb4ce481eed6c8434f87754e", + "https://deno.land/x/enz@0.1.11/src/util/parseProject.ts": "43a9ce44107658a70466b919d7d711f794a5687fdf36534d817b6ae27304a9c1", + "https://deno.land/x/enz@0.1.11/src/util/visit.ts": "2862d603604af96ba36ad70ea395708c953ae6a97190dbb8037e3b6ea75593ee", "https://deno.land/x/enz@0.1.3/mod.ts": "d6b7ac161b614a7289843406ccae3f82b001ad72f4905bc75ec84a408832aac7", "https://deno.land/x/enz@0.1.3/src/class/Object_.ts": "d79837d06d53193853d4efc78f835d67ea17cd7f17f080f4810dfca349cc828e", "https://deno.land/x/enz@0.1.3/src/class/Project.ts": "6ba4d725439a8546311cf9e53968e72252f0d4646300f5d235b63862f07a278e",