From 995e120b34b4289d082dc69f6d261b7fa7482fce Mon Sep 17 00:00:00 2001 From: Eselvire <85529362+Eselvire@users.noreply.github.com> Date: Thu, 7 Dec 2023 11:33:47 +0000 Subject: [PATCH] add readme and dev steps --- .gitignore | 3 +++ README.md | 28 ++++++++++++++++++++++++++++ package.json | 3 ++- 3 files changed, 33 insertions(+), 1 deletion(-) create mode 100644 README.md diff --git a/.gitignore b/.gitignore index 468f82a..4a3bc7f 100644 --- a/.gitignore +++ b/.gitignore @@ -173,3 +173,6 @@ dist # Finder (MacOS) folder config .DS_Store +types.js +exporter.js + diff --git a/README.md b/README.md new file mode 100644 index 0000000..4662860 --- /dev/null +++ b/README.md @@ -0,0 +1,28 @@ +# Offlineland.io's exporter thingy + +`exporter.js` is a console snippet to export your account from [Manyland](https://manyland.com) (creations, collections, snaps, etc), and potentially import it back to [Offlineland.io](https://offlineland.io) + + + +## For developers: + +The actual work is done on the `exporter.ts` file. To set up a dev env: + +- install Bun ([Bun](https://bun.sh)): +- install dependencies: +```bash +bun install +``` +- run the compiler in watch mode: +```bash +bun run dev +``` + +When copy-pasting the built exporter.js, you'll need to be careful not to copy the first two lines: +```js +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +``` +Typescript really really wants to include them and has no option not to, but it doesn't work in browser. + +(If you manage to have tsc pick up the type for Zod.infer without using the `import/export type ...` syntax, you're a god please help me) diff --git a/package.json b/package.json index b3cf289..03e0123 100644 --- a/package.json +++ b/package.json @@ -3,7 +3,8 @@ "module": "exporter.js", "type": "module", "scripts": { - "build": "tsc ; sed -i '1,2d' exporter.js" + "build": "tsc ; sed -i '1,2d' exporter.js", + "dev": "tsc --watch" }, "devDependencies": { "bun-types": "latest"