Skip to content

Commit

Permalink
add readme and dev steps
Browse files Browse the repository at this point in the history
  • Loading branch information
Eselvire committed Dec 7, 2023
1 parent 78b05d7 commit 995e120
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 1 deletion.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -173,3 +173,6 @@ dist

# Finder (MacOS) folder config
.DS_Store
types.js
exporter.js

28 changes: 28 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -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)
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit 995e120

Please sign in to comment.