https://github.com/seleb/bitsy-merge
merge tool for bitsy gamedata
https://github.com/seleb/bitsy-merge
bitsy merge
Last synced: 8 months ago
JSON representation
merge tool for bitsy gamedata
- Host: GitHub
- URL: https://github.com/seleb/bitsy-merge
- Owner: seleb
- License: mit
- Created: 2019-05-11T02:45:58.000Z (about 7 years ago)
- Default Branch: main
- Last Pushed: 2024-09-24T17:25:10.000Z (over 1 year ago)
- Last Synced: 2024-11-04T00:51:59.635Z (over 1 year ago)
- Topics: bitsy, merge
- Language: JavaScript
- Homepage: https://seansleblanc.itch.io/bitsy-merge
- Size: 559 KB
- Stars: 3
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# @bitsy/merge
merge tool for bitsy gamedata
notes:
- contents which don't overlap will be added without being changed
- contents which overlap will have their ids prefixed before being added, and references to their id will automatically be updated
- contents which overlap but are identical will not be added (e.g. if you start from a shared file, only changes will be added on merge)
- the contents of dialog scripts are not checked or updated; if you're referencing things from dialog (especially via hacks) you'll have to make sure that the names still line up post-merge manually
- variables which overlap will throw an error (variable overlaps need to be resolved manually since dialog contents aren't updated)
- title, bitsy version, and room format from game to add is ignored
- make sure to choose a unique prefix: overlaps are not checked for prefixed conflict resolution
## How To
### Browser
1. include `./dist/index.iife.js` in HTML
```html
```
2. reference global
```js
const { merge } = window.bitsyMerge;
```
### Node
1. install
```sh
npm install @bitsy/merge --save
```
2. import
```js
const { merge } = require("@bitsy/merge");
```
```js
import { merge } from '@bitsy/merge';
```
### Use
```js
const baseGamedata = `Write your game's title here
# BITSY VERSION 6.0...`;
const addGamedata = `Write your game's title here
# BITSY VERSION 6.0...`;
const prefix = 'added_';
const mergedGamedata = merge(baseGamedata, addGamedata, prefix).gamedata;
```