Skip to content
This repository has been archived by the owner on Mar 17, 2020. It is now read-only.

huan/pure-typescript

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

78 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

pure-typescript (DEPRECATED)

Huan(20200317): This modules is deprecated because it's not necessary anymore.

Pure Typescript Loader for running typescript death easy as javascript

Under Construction...

Please come back later if you are interesting Pupre-Typescript project.

Goal

  1. TypeScript be treated as First Class Language
  2. Support Pure TypeScript modules/library in node_moduels(done by #1
  3. Zero Configuration in Server(in progress)
  4. One Line Configuration in Browser(TBD #2)

Requirement

Those requirements are little bleeding edge because I believe pure typescript developers would love them.(I am)

  1. NodeJS v6 or above
  2. TypeScript v2 or above

Why Pure TypeScript?

I love typescript(because of angular 2), and I switched all my javascript code to typescript now, including my server components.

I also would like to write pure typescript npm modules, which I think there is no need to compile to javascript any more, because my environment is a full typescript stack, compile should only be ran at the final executation step.

There also many developers have the same idea as me.(see: The PAINs of Pure TypeScript Developer)

But there's no such a tool for us to run typescript smoothly for our need. for example:

  1. ts-node don't support load pure typescript library/module in node_modules directory
  2. tsconfig.json is a too complicated
  3. typings.json is too complicated
  4. index.d.ts is too complicated
  5. default file extension should be .ts, and should be the first dependencies file extention
  6. run typescript in browser needs a lot of configuration(too complicated)

I believe that run typescript should be put at first class, and be ran as easy as node in server, or javascript in browser, without any more complicated configures. this is the reason I decided to write this new tool pure-typescript to make pure-typescript developers more happy.

The PAINs of Pure Typescript Developer

Usage

Server

Just replace node by ts

$ npm install pure-typescript

$ ts main.ts

Browser

Just include pure-typescript in html head

<script src='//unpkg.com/pure-typescript'></script>
<script>
  var tsMain = PureTypeScript('main.ts')
</script>

Best Practice

  1. Add keywords: pure-typescript in package.json
  2. For Pure Typescript NPM Module, set main: index.ts in package.json

Reference

Version History

v0.0.3 (master)

  1. run purets like node: purets pure-typescript-file.ts
  2. support load pure typescript module in node_modules directory
  3. publish npm module: pure-typescript
  4. proxy right argv to ts program

Known Issues & Support

Github Issue - https://github.com/zixia/pure-typescript/issues

Todo List

[ ] Enable TypeScript in Browser by script src=//unpkg.com/pure-typescript, without any other configuration(like SystemJS?) [ ] Cache management for large project to speed up startup loading time

Reference

  1. Using the TypeScript Compiler API

Author

Zhuohuan LI zixia@zixia.net (http://linkedin.com/in/zixia)

profile for zixia at Stack Overflow, Q&A for professional and enthusiast programmers

Copyright & License

  • Code & Docs 2016© zixia
  • Code released under the ISC license
  • Docs released under Creative Commons

About

Pure Typescript Executor for Node & Browser with Zero Setting

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published