Skip to content

Support for TypeScript-based NativeScript projects #1117

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

Closed
tailsu opened this issue Oct 28, 2015 · 7 comments
Closed

Support for TypeScript-based NativeScript projects #1117

tailsu opened this issue Oct 28, 2015 · 7 comments
Assignees
Labels
Milestone

Comments

@tailsu
Copy link
Contributor

tailsu commented Oct 28, 2015

As a NativeScript used, I want to develop my project in TypeScript, but I don't want to muck around with TypeScript compilers, Grunt, Gulp or whatever.

How to Use

Execute:

$ tns install typescript

From now on, commands like tns prepare, tns build, etc. will compile all *.ts files under app/ and output the respective *.js files and the compiled files will be the ones that go into the built package.

@tailsu
Copy link
Contributor Author

tailsu commented Oct 28, 2015

Implemented in #1116

@vchimev
Copy link

vchimev commented Nov 11, 2015

The transpilation does not work when outside the project the prepare command is executed through the --path option. For example: tns prepare android/io --path <absolute/relative path>.

@rosen-vladimirov
Copy link
Contributor

@vchimev the issue is fixed in version 0.2.1 of nativescript-dev-typescript module. Can you test again :)

@vchimev
Copy link

vchimev commented Nov 16, 2015

It's fine, thanks.

@tailsu, @rosen-vladimirov - Is there any way to preserve my own .tsconfig as currently it is overwritten every time when tns install typescript is called?

@rosen-vladimirov
Copy link
Contributor

Hm, what's the use-case to call it more than once?

vchimev pushed a commit to NativeScript/nativescript-cli-tests that referenced this issue Nov 16, 2015
vchimev pushed a commit to NativeScript/nativescript-cli-tests that referenced this issue Nov 16, 2015
@vchimev
Copy link

vchimev commented Nov 17, 2015

I'm concerned about the scenario when I have already my .ts project along with .tsconfig file, than executing tns install typescript will overwrite my .tsconfig.

However, for the release of {N} CLI version 1.5 and nativescript-dev-typescript version 0.2.1 the scenario above will not be supported.

@vchimev
Copy link

vchimev commented Nov 17, 2015

How you could get started - install NativeScript CLI version 1.5 when it is released
npm install -g nativescript
  • clone NativeScript Hello World project template for TypeScript:
git clone [email protected]:NativeScript/template-hello-world-ts.git template-hello-world-ts
  • create a new app using the template:
tns create myApp --copy-from template-hello-world-ts
  • change the current working directory to your new app
cd myApp
  • install the TypeScript module
tns install typescript

Than executing any of the commands: tns prepare, tns build, tns run will compile all *.ts files under app/ directory and output the respective *.js files; the compiled files will be the ones that go into the built package.

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

No branches or pull requests

3 participants