Skip to content

CLI Rework#70

Merged
lolleko merged 11 commits intomasterfrom
cli-rework
Mar 17, 2018
Merged

CLI Rework#70
lolleko merged 11 commits intomasterfrom
cli-rework

Conversation

@lolleko
Copy link
Copy Markdown
Member

@lolleko lolleko commented Mar 14, 2018

Cleaned up parser

Closes #68, Closes #71

@lolleko lolleko requested a review from Perryvw March 14, 2018 14:54
@lolleko lolleko changed the title Split compiling and CLI parsing CLI Rework Mar 14, 2018
'ah': {
alias: 'addHeader',
describe: 'Specify if a header will be added to compiled files.',
default: false,
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should add the header by default

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Idk I think it looks cheap. Like those weird video converters youtube downloaders I used as a kid and that left their watermark everywhere.

Or is there an actual benefit in having a header that im not seeing?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No actual benefit, just some credit/advertising for us in case people see the code in other people's repositories. Also makes it clear the code is generated.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah that acutally makes sense.
But maybe reduce the it to a one liner?
I will jsut reeanble it and we can change that later if we want to....

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am fine with changing it to be only 1 or 2 lines. I got a nice comment from @zapp-brannigan-dota about maybe adding the version number. I would say the header should at least contain the following things: 'Generated by TypescriptToLua https://github.com/Perryvw/TypescriptToLua', the date, and the version of the transpiler that was used (should be possible right?).

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is the date important? With it I wouldn't add the header to any files that might end up version controlled.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Figured date would be useful for keeping track of when files changed but I guess it will also be in the file metadata/commits so maybe we can indeed leave it out.

} else {
alias.forEach((val) => optNameMap[val] = true);
}
}
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very unclear what the purpose of this loop is and why it sets values to true, add some explanation.

}
}

/** Find configFile, function form ts api seems to be broken? */
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

from* (typo)


NOTES:
- The tsc options might have no effect.
- Options in tsconfig.json are prioritized.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think Options in tsconfig.json are prioritized. should be in here or the wiki.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed it so that CLI is prioritized. This is the same behaviour now as in tsc and probably any cli tool out there. So I don't think its needed to mention that, but it wouldn't hurt either if this is mentioned somewhere in the docs.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's much better. It only needed mentioning because it was different from tsc.

@lolleko lolleko merged commit c9005c6 into master Mar 17, 2018
@Perryvw Perryvw deleted the cli-rework branch March 17, 2018 21:21
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

Successfully merging this pull request may close these issues.

3 participants