@bitsy/merge

2.2.1 • Public • Published

@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
<script src="vendor/@bitsy/merge/dist/index.iife.js"></script>
  1. reference global
const { merge } = window.bitsyMerge;

Node

  1. install
npm install @bitsy/merge --save
  1. import
const { merge } = require("@bitsy/merge");
import { merge } from '@bitsy/merge';

Use

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;

Readme

Keywords

Package Sidebar

Install

npm i @bitsy/merge

Weekly Downloads

3

Version

2.2.1

License

MIT

Unpacked Size

84.1 kB

Total Files

7

Last publish

Collaborators

  • ragzouken
  • seansleblanc