Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How do/did you even compile this? #12

Open
Raijinili opened this issue Aug 31, 2019 · 8 comments
Open

How do/did you even compile this? #12

Raijinili opened this issue Aug 31, 2019 · 8 comments

Comments

@Raijinili
Copy link
Contributor

Raijinili commented Aug 31, 2019

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.
  • 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.

@Raijinili
Copy link
Contributor Author

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?

@F-Unction
Copy link

You need't to compile it.You can play it by opening index.html.

@Raijinili
Copy link
Contributor Author

I plan to make some changes, so I need to compile it.

@justgotdarker
Copy link

justgotdarker commented Sep 19, 2019

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.

@Raijinili
Copy link
Contributor Author

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.

@kvaps
Copy link
Member

kvaps commented Sep 20, 2019

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!

@kvaps kvaps pinned this issue Aug 12, 2020
@Kreijstal
Copy link

gotta bless docker sometimes.

@CyanChanges
Copy link

I compiled it but it got errors when I ran it.
It seemed it didn't require module before using it.
Such as MainLoadingType

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants