candybox2.github.io
candybox2.github.io copied to clipboard
How do/did you even compile this?
I've spent the last hour or two trying to compile it on Windows, so that I can play around with some features.
Here's what I learned:
- Requires TypeScript installed globally and on the PATH.
- Requires yuicompressor on the path. NPM global install with NPM's scripts on the PATH works.
- I got it working with [email protected].
- Requires 7zip's bin folder on the PATH.
- There's a bug (at least for Windows 10) in the syntax of the batch file.
- Expects Python 2.
- TypeScript 2 is too new: Enforces TS17009.
- TypeScript 1.4. is too old: Does not return 0 if there are no arguments (which the script uses to detect Typescript).
- The batch script doesn't stop if something goes wrong.
-
The code doesn't properly import all names used. For example, "main.ts" doesn't import
MainLoadingType
.
At the last step, I give up. I can't easily fix all of the import errors.
I managed to compile it under TypeScript 1.4.1 by removing the check for TypeScript. Huh? What version was used in the first place?
You need't to compile it.You can play it by opening index.html.
I plan to make some changes, so I need to compile it.
You don't need to compile this, it's JavaScript. You can alter the code from the console and make changes in the browser. However, if you want to change the elements that are called and host it on a local machine; unzip the "source files" and then just make changes to any of the files you want with a text editor. Then, save it all and then zip all the files again. I'm just a old n00b. If I used the wrong terms... nobody's probably read this comment anyway.
This repo is in TypeScript, not JavaScript. TypeScript is compiled to JS. The repo has to be compiled from TS to JS for it to run in the browser. The files candybox2_uncompressed.js
and candybox2.js
are the results of that compilation.
I already compiled it, but I had to use an old version of TypeScript and change how the compile scripts checked for TypeScript. As far as I can tell, the repo as-is shouldn't have been able to compile, yet it has been compiled.
Hi @Raijinili I was compiling it fine with docker and [email protected]. Try this:
docker run -ti alpine:3.10
apk add --no-cache python npm p7zip bash py-yuicompressor
npm install -g [email protected]
npm install -g yuicompressor
wget https://github.com/candybox2/candybox2.github.io/archive/master.tar.gz -O - | tar xzf -
cd candybox2.github.io-master
./compile.sh
Or ubuntu version:
docker run -ti ubuntu:18.04
apt-get update
apt-get -y install wget p7zip-full python yui-compressor nodejs npm
npm install -g [email protected]
npm install -g yuicompressor
wget https://github.com/candybox2/candybox2.github.io/archive/master.tar.gz -O - | tar xzf -
cd candybox2.github.io-master
./compile.sh
Cheers!
gotta bless docker sometimes.
I compiled it but it got errors when I ran it. It seemed it didn't require module before using it. Such as MainLoadingType