Skip to content

How do/did you even compile this? #12

Open

Description

@Raijinili

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 yuicompressor@2.4.8.
  • 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.

Activity

  1. Raijinili commented on Aug 31, 2019

    @Raijinili
    ContributorAuthor

    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?

  2. F-Unction commented on Sep 12, 2019

    @F-Unction

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

  3. Raijinili commented on Sep 12, 2019

    @Raijinili
    ContributorAuthor

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

  4. justgotdarker commented on Sep 19, 2019

    @justgotdarker

    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.

  5. Raijinili commented on Sep 20, 2019

    @Raijinili
    ContributorAuthor

    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.

  6. kvaps commented on Sep 20, 2019

    @kvaps
    Member

    Hi @Raijinili I was compiling it fine with docker and typescript@1.5.3. Try this:

    docker run -ti alpine:3.10
    apk add --no-cache python npm p7zip bash py-yuicompressor
    
    npm install -g typescript@1.5.3
    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 typescript@1.5.3
    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!

  7. pinned this issue on Aug 12, 2020
  8. Kreijstal commented on May 10, 2021

    @Kreijstal

    gotta bless docker sometimes.

  9. cyans-nya commented on Jan 19, 2023

    @cyans-nya

    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions