diff --git a/.gitignore b/.gitignore index d13f150fe..8e521c468 100644 --- a/.gitignore +++ b/.gitignore @@ -12,6 +12,7 @@ res/.tmp .vscode/settings.json app/*.log +package-lock.json app/package-lock.json app/settings app/redist @@ -25,4 +26,5 @@ app/assets/js/*.map art/export_appElements -tests/_doNotShare \ No newline at end of file +tests/_doNotShare +node_modules diff --git a/.haxerc b/.haxerc new file mode 100644 index 000000000..f8137ff81 --- /dev/null +++ b/.haxerc @@ -0,0 +1,4 @@ +{ + "version": "4.2.0", + "resolveLibs": "scoped" +} \ No newline at end of file diff --git a/README.md b/README.md index 975bd1a0f..0a2fb4298 100644 --- a/README.md +++ b/README.md @@ -17,8 +17,8 @@ Visit [LDtk.io](https://ldtk.io) to get latest version. ## Requirements - - **[Haxe compiler](https://haxe.org)**: you need an up-to-date and working Haxe install to build LDtk. - - **[NPM](https://www.npmjs.com/)**: this package manager is used for various install and packaging scripts + - **[Haxe compiler](https://haxe.org)**: you need an up-to-date and working Haxe install to build LDtk. (Installed manually or using Lix with npm) + - **[NPM](https://www.npmjs.com/)**: this package manager is used for various install and packaging scripts. ### Installing Haxe libs @@ -68,7 +68,7 @@ If you want to try a future version of LDtk, you can checkout branches named `de **IMPORTANT**: - these *dev* branches might be unstables, or even broken. Therefore, it's not recommended to use, unless you plan to add or fix something on LDtk. - - because *dev* branches might change quickly, you will need to update haxelibs often. + - because *dev* branches might change quickly, you will need to update haxelibs often, or run `lix download` for new branches. - you will need to switch the *LDtk haxe API* to the **same** branch as LDtk repo. (adapt the branch name below accordingly): ``` @@ -91,4 +91,4 @@ npm run start - Electron: https://www.electronjs.org/ - JQuery: https://jquery.com - MarkedJS: https://github.com/markedjs/marked - - SVG icons from https://material.io + - SVG icons from https://material.io \ No newline at end of file diff --git a/haxe_libraries/ase.hxml b/haxe_libraries/ase.hxml new file mode 100644 index 000000000..c1894d428 --- /dev/null +++ b/haxe_libraries/ase.hxml @@ -0,0 +1,3 @@ +# @install: lix --silent download "haxelib:/ase#1.1.1" into ase/1.1.1/haxelib +-cp ${HAXE_LIBCACHE}/ase/1.1.1/haxelib/src +-D ase=1.1.1 \ No newline at end of file diff --git a/haxe_libraries/castle.hxml b/haxe_libraries/castle.hxml new file mode 100644 index 000000000..e1248f881 --- /dev/null +++ b/haxe_libraries/castle.hxml @@ -0,0 +1,3 @@ +# @install: lix --silent download "gh://github.com/ncannasse/castle#53d6daf5fade1505a6abf7b407e2332f4f77e2cf" into castle/1.6.1/github/53d6daf5fade1505a6abf7b407e2332f4f77e2cf +-cp ${HAXE_LIBCACHE}/castle/1.6.1/github/53d6daf5fade1505a6abf7b407e2332f4f77e2cf/ +-D castle=1.6.1 \ No newline at end of file diff --git a/haxe_libraries/deepnightLibs.hxml b/haxe_libraries/deepnightLibs.hxml new file mode 100644 index 000000000..bbe98d707 --- /dev/null +++ b/haxe_libraries/deepnightLibs.hxml @@ -0,0 +1,3 @@ +# @install: lix --silent download "gh://github.com/deepnight/deepnightLibs#ebab3786f1f58f0c11f7cdc25f22f798e6b9a9b3" into deepnightLibs/1.0.59/github/ebab3786f1f58f0c11f7cdc25f22f798e6b9a9b3 +-cp ${HAXE_LIBCACHE}/deepnightLibs/1.0.59/github/ebab3786f1f58f0c11f7cdc25f22f798e6b9a9b3/src/ +-D deepnightLibs=1.0.59 \ No newline at end of file diff --git a/haxe_libraries/electron.hxml b/haxe_libraries/electron.hxml new file mode 100644 index 000000000..596cb81a1 --- /dev/null +++ b/haxe_libraries/electron.hxml @@ -0,0 +1,4 @@ +# @install: lix --silent download "gh://github.com/tong/hxelectron#628364b950f14a87e4c6668fd22fa04824c473b5" into electron/12.0.9/github/628364b950f14a87e4c6668fd22fa04824c473b5 +-lib hxnodejs +-cp ${HAXE_LIBCACHE}/electron/12.0.9/github/628364b950f14a87e4c6668fd22fa04824c473b5/src +-D electron=12.0.9 \ No newline at end of file diff --git a/haxe_libraries/format.hxml b/haxe_libraries/format.hxml new file mode 100644 index 000000000..fa815b761 --- /dev/null +++ b/haxe_libraries/format.hxml @@ -0,0 +1,3 @@ +# @install: lix --silent download "haxelib:/format#3.5.0" into format/3.5.0/haxelib +-cp ${HAXE_LIBCACHE}/format/3.5.0/haxelib/ +-D format=3.5.0 \ No newline at end of file diff --git a/haxe_libraries/heaps-aseprite.hxml b/haxe_libraries/heaps-aseprite.hxml new file mode 100644 index 000000000..1b0741b82 --- /dev/null +++ b/haxe_libraries/heaps-aseprite.hxml @@ -0,0 +1,6 @@ +# @install: lix --silent download "gh://github.com/deepnight/heaps-aseprite#738f0480976903343b8f6f8aa354a20099588f51" into heaps-aseprite/0.0.4/github/738f0480976903343b8f6f8aa354a20099588f51 +-lib ase +-cp ${HAXE_LIBCACHE}/heaps-aseprite/0.0.4/github/738f0480976903343b8f6f8aa354a20099588f51/ +-D heaps-aseprite=0.0.4 +# Adds .aseprite file handling to hxd.res.Config +--macro aseprite.Macros.init() diff --git a/haxe_libraries/heaps.hxml b/haxe_libraries/heaps.hxml new file mode 100644 index 000000000..b205ec1cb --- /dev/null +++ b/haxe_libraries/heaps.hxml @@ -0,0 +1,4 @@ +# @install: lix --silent download "gh://github.com/deepnight/heaps#7c578975b47bc71dd5212edba40298a6cf0aeab8" into heaps/1.9.1/github/7c578975b47bc71dd5212edba40298a6cf0aeab8 +-lib format +-cp ${HAXE_LIBCACHE}/heaps/1.9.1/github/7c578975b47bc71dd5212edba40298a6cf0aeab8/ +-D heaps=1.9.1 \ No newline at end of file diff --git a/haxe_libraries/hxnodejs.hxml b/haxe_libraries/hxnodejs.hxml new file mode 100644 index 000000000..fe2e0c175 --- /dev/null +++ b/haxe_libraries/hxnodejs.hxml @@ -0,0 +1,7 @@ +# @install: lix --silent download "gh://github.com/HaxeFoundation/hxnodejs#d2d871c5b4d4589fa4ccb6e2031f982e172f8860" into hxnodejs/12.1.0/github/d2d871c5b4d4589fa4ccb6e2031f982e172f8860 +-cp ${HAXE_LIBCACHE}/hxnodejs/12.1.0/github/d2d871c5b4d4589fa4ccb6e2031f982e172f8860/src +-D hxnodejs=12.1.0 +--macro allowPackage('sys') +# should behave like other target defines and not be defined in macro context +--macro define('nodejs') +--macro _internal.SuppressDeprecated.run() diff --git a/haxe_libraries/ldtk-haxe-api.hxml b/haxe_libraries/ldtk-haxe-api.hxml new file mode 100644 index 000000000..38f8f1172 --- /dev/null +++ b/haxe_libraries/ldtk-haxe-api.hxml @@ -0,0 +1,3 @@ +# @install: lix --silent download "gh://github.com/deepnight/ldtk-haxe-api#1ea2a42f71371d4c983bc922aa2b81b4209e8ced" into ldtk-haxe-api/0.9.3-rc.1/github/1ea2a42f71371d4c983bc922aa2b81b4209e8ced +-cp ${HAXE_LIBCACHE}/ldtk-haxe-api/0.9.3-rc.1/github/1ea2a42f71371d4c983bc922aa2b81b4209e8ced/src/ +-D ldtk-haxe-api=0.9.3-rc.1 \ No newline at end of file diff --git a/package.json b/package.json new file mode 100644 index 000000000..937ec38fb --- /dev/null +++ b/package.json @@ -0,0 +1,34 @@ +{ + "name": "ldtk", + "productName": "LDtk", + "author": "Sebastien Benard", + "description": "2D level editor", + "scripts": { + "start": "cd app && npm run start", + "compile": "haxe main.hxml && haxe renderer.hxml", + "doc": "haxe doc.hxml", + "pack-prepare": "cd app && npm run pack-prepare", + "pack-test": "cd app && npm run pack-test", + "pack-win": "cd app && npm run pack-win", + "pack-macos": "cd app && npm run pack-macos", + "pack-linux-x86": "cd app && npm run pack-linux-x86", + "pack-linux-arm64": "cd app && npm run pack-linux-arm64", + "publish-github": "cd app && npm run publish-github", + "publish-itchio": "cd app && publish-itchio", + "quicktype": "cd app && npm run quicktype", + "qt-cs": "cd app && npm run qt-cs", + "qt-js": "cd app && npm run qt-js", + "qt-py": "cd app && npm run qt-py", + "qt-rs": "cd app && npm run qt-rs", + "qt-go": "cd app && npm run qt-go", + "qt-cpp": "cd app && npm run qt-cpp", + "postinstall": "lix download && cd app && npm i" + }, + "repository": { + "type": "git", + "url": "https://github.com/deepnight/ldtk.git" + }, + "devDependencies": { + "lix": "^15.9.1" + } +}