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

Typescript conversion #53

Open
niokasgami opened this issue Feb 25, 2017 · 10 comments
Open

Typescript conversion #53

niokasgami opened this issue Feb 25, 2017 · 10 comments

Comments

@niokasgami
Copy link
Contributor

niokasgami commented Feb 25, 2017

First of all before peoples misunderstand I am not asking to convert MV to typescript
I am just asking if it's possible to allow me to make a d.ts or a definition files for MV corescript (and later to make a version in typescript who follow the corescript dev alongside.)

Obviously, the reason I say this is that sometime some game dev like me wish to have access to a more strict coding environnement for their game (and obviously are not using plugin because...I know how typescript doesn't like when you edit a class)

so for being simple I would like to make a conversion of the CoreScript (or a definition file ups to you) for the peoples who enjoy programming with typescript.

I will obviously not ask you guys to do it I can Happily do it myself and pull it as a new branch.

The Pros of this are the fact it's offers a stable strict environnment and good debugging
The cons are probably it's may be a little strict when it's come to plugin although it's perfect for Standalone dev
I hope you will like the idea :3

@inc0der
Copy link

inc0der commented Feb 25, 2017

I like the idea, I don't write in typescript, I never tried it yet but I know the definition files work awesome in VSCode and it would give me better IntelliSense for corescript. I'm pretty sure other editors can use definition files in the same manner.

@ghost
Copy link

ghost commented Feb 26, 2017

If you mean to write d.ts by hand, I agree with the idea.
because document is missing, strict d.ts would be lifeline of development.

but I wander who writes the d.ts.
The priority is relatively low.
IMO people who need it are few, because plugin developers are not frontend experts.

but if you make PR which contains d.ts, we'll consider about merging it.
Public interface should be stable, so maintenance cost would be acceptably low.

@niokasgami
Copy link
Contributor Author

Yep i will write it they are kinda easy to do and I already have some part who are ready such the interface for some of the json :3

@ghost
Copy link

ghost commented Feb 27, 2017

great!

@niokasgami
Copy link
Contributor Author

yes! I just struggle with making a proper Git pushing with Visual studio code lol. It's not like visual studio where it's have a more intuitive interface for make git push.

@niokasgami
Copy link
Contributor Author

niokasgami commented Mar 2, 2017

A little update! for show the structure of how MV_Typescript will be :

    /**
 * The namespace for the MV datas.
 * 
 * @namespace MV
 */
declare namespace MV {

    /**
     * The JSON interface for the actor
     * 
     * @export
     * @interface MV::IDataActor
     */
    export interface IDataActor {

        [index: number]: {
            /**
             * The id of the actor
             * 
             * @type {number}
             */
            id: number;

            /**
             * the battler name of the actor.
             * 
             * @type {string}
             */
            battlerName: string;

            /**
             * The character index used for the character graphic.
             * 
             * @type {number}
             */
            characterIndex: number;

            /**
             * the filename of the character graphic.
             * 
             * @type {string}
             */
            characterName: string;

            /**
             * The class id of the character.
             * 
             * @type {number}
             */
            classId: number;

            /**
             * The actor starting equipment.
             * 
             * @type {number[]}
             */
            equips: number[];

            /**
             * The character face index used for the actor face graphic.
             * 
             * @type {number}
             */
            faceIndex: number;

            /**
             * The filename for the character graphics.
             * 
             * @type {string}
             */
            faceName: string;

            /**
             * The actors traits. 
             * 
             * @type {any[]}
             */
            traits: any[]; /// TODO : Define the good traits interfaces?

            /**
             * The actor initial level on the game startup.
             * 
             * @type {number}
             */
            initialLevel: number;

            /**
             * The actor max level.
             * 
             * @type {number}
             */
            maxLevel: number;

            /**
             * The actor name in the game.
             * 
             * @type {string}
             */
            name: string;
            
            /**
             * The actor nickname in the game.
             * 
             * @type {string}
             */
            nickname: string;

            /**
             * The actor notes.
             * 
             * @type {string}
             */
            note: string;

            /**
             * The actor profile.
             * 
             * @type {string}
             */
            profile: string;
        }
    }
}

It's will be also on a external repository until well it's done...because let's be honest MV Library is Massive lol and I have to find a way to concatenate all the d.ts file in one after.

but in simple it's will be organized in a way it's will be intuitive to have information and intelisenses for the files.

@bsides
Copy link

bsides commented Mar 23, 2017

This is awesome but I believe you'll have a hard time with PIXI. There are some "official" d.ts files about it but not for 4 as far as I know. Or would you just ignore them?

@niokasgami
Copy link
Contributor Author

@bsides they actually have d.ts files for PIXI V4 actually! it's can be found in Typed repertories!

@bsides
Copy link

bsides commented Mar 24, 2017

Awesome! I'm looking forward to that PR, this is great news

@bungcip
Copy link
Contributor

bungcip commented Sep 30, 2017

Hi all, if anyone interested on corescript in typescript. I already converted it to typescript on https://bitbucket.org/bungcip/corescript-ts (using mercurial), feel free to check it.

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

4 participants