90 Commits

Author SHA1 Message Date
Jake Bailey
4139807e75 Add build via esbuild
This configures the existing build tasks to use esbuild by default. If
using the plain files is desired, passing `--bundle=false` will build
using plain files and still produce a runnable system.

This is only a basic build; a more efficient build is provided later
when gulp is replaced by hereby.
2022-11-07 13:34:44 -08:00
Jake Bailey
36e29448e9 Get codebase building pre bundling
This isn't totally complete, but enough to get everything building and
tests running manually. The next commit will make the build work fully.
2022-11-07 13:34:44 -08:00
Jake Bailey
b6c0538826 Generated module conversion step - stripNamespaces
This step converts each file into an exported module by hoisting the namespace bodies into the global scope and transferring internal markers down onto declarations as needed.

The namespaces are reconstructed as "barrel"-style modules, which are identical to the old namespace objects in structure. These reconstructed namespaces are then imported in the newly module-ified files, making existing expressions like "ts." valid.
2022-11-07 13:32:03 -08:00
Jake Bailey
b56483feb8
Remove shims project (#50049) 2022-08-10 11:49:59 -07:00
Ron Buckton
cb1bc6169b
Move legacy decorators into separate transform (#48669) 2022-06-03 09:36:29 -07:00
Wesley Wigham
586b0d5011
moduleResolution: node12 support (#45884)
* Initial support for module: node12

* Add allowJs and declaration emit enabled tests

* Fix typos

* cts, mts, cjs, mjs, etc extension support

* Fix watch of files whose intepretation changes due to a package.json update

* Minor PR feedback

* Adjust error message

* Initial import/export/self-name support

* Accept new error codes

* TypesVersions support in export/import map conditions

* Fix import suggestion and autoimport default extensions under new resolution modes

* Add tests for import maps non-relative name lookup feature

* Fix isDeclarationFileName for .d.mts and .d.cts

* Preserve new extensions when generating module specifiers

* Fix spurious implict any suggestion caused by file ordering bug and optimize import name format detection by relying on parents being set

* Fix a bunch of incremental bugs that dont repro under fourslash for some reason

* Accept updated baseline

* Always include extensions on completions for cjs/mjs style imports

* String completion relative import suggestions respect the mode of the import when choosing if they provide extensions

* Style feedback

* Change diagnostic case
2021-09-24 14:25:59 -07:00
Kagami Sascha Rosylight
f4d0ea6539
Add target: ES2021 (#41239)
* Support `target: es2020`

* use CRLF

* update symbols

Co-authored-by: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com>
2021-03-10 13:31:25 -08:00
Ron Buckton
0847d85a4c Fix dependency order and observer registration 2020-10-26 12:27:34 -07:00
Ron Buckton
a197beef6d Migrate 'ts.performance' to use native performance hooks when available 2020-10-15 19:10:50 -04:00
Andrew Casey
5d60972ef4 Trace key operations
Produce output in Chrome's event tracing format so that it can be viewed
in Chrome/Edge.
2020-08-21 17:07:12 -07:00
Wesley Wigham
191f4f63ab
Explicitly add dependency on node to compiler tsconfig, remove es6+ string method usage (#39636) 2020-07-17 07:02:05 -07:00
Ron Buckton
eb3645f16b
Refactor node factory API, use node factory in parser (#35282)
* Refactor node factory API, use node factory in parser

* Move UnparsedSource nodes to factory

* Make most Node properties read-only

* Make pos/end/parent and JSDoc 'comment' read-only

* Update function/constructor-type factories

* Remove treeStateObserver

* Simplify Debug.deprecate

* Remove unused factory methods, simplify lazy factory methods

* Fix base factory used for source file updates

* Update test baseline due to merge from master

* Rename factory methods to be more consistent (#39058)
2020-06-16 16:55:03 -07:00
Wenlu Wang
70399e146e
add support for Lift Template Literal Restriction (#23801)
* add support for Lift Template Literal Restriction

* rename file and improve comment and tests

* fix NoSubstitutionTemplateLiteral support

* extract tagged template and add more test

* avoid useless parameter

* fix incorrect return node if cannot transform

* accept baseline

* correctly baseline

* accept baseline

* fix merge break

* fix merge break

* inline rescan template head or no subsititution template

* update scan error

* add comment and fix lint

* refactor and fix lint

* avoid blank

* fix merge conflict

* fix again

* fix again

* use multiple target

* fix space lint

Co-authored-by: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com>
2020-02-05 08:59:51 -08:00
Andrew Casey
566202f55d
Fix commas in JSON (#36497) 2020-01-29 10:50:03 -08:00
Kagami Sascha Rosylight
0f5ddd2ea0 Add es2020 transformation (#35518)
* Add es2020 transformation

* Add missing comma

Co-authored-by: Daniel Rosenwasser <DanielRosenwasser@users.noreply.github.com>
2019-12-23 16:45:17 -08:00
Wenlu Wang
4c7844be74 Implement export as namespace from (#34903)
* init export start as decl

* fix some broken

* fix more case

* fix more and more case

* make it work

* make lint happy and accept baseline

* add more tests

* fix system module

* add more case

* delete useless assert

* accept baseline

* make lint happy

* fix missing utils

* update api

* make lint happy

* add missing semi

* fix minor issue

* fix locally bound

* avoid useless check

* update public api

* add more case

* fix some case

* Use multi-module selection in test runner to cut down on duplication.

* Accepted baselines.

* remove superfluous tests.

* Remove baseline.

* Downlevel `export * as ns` in es2015.

* Accepted baselines.

* Update names of things.

Co-authored-by: Daniel Rosenwasser <DanielRosenwasser@users.noreply.github.com>
2019-12-20 16:00:20 -08:00
Wesley Wigham
c447ebc59c
Refactor: No more than 1 namespace declaration per file (#35373)
* Refactor: No more than 1 namespace declaration per file

* Simplify refs where possible
2019-11-27 13:44:31 -08:00
Ron Buckton
01b3d41124
Add external mapShim/debug modules (#33712)
* Add external mapShim/debug modules

* rename test file
2019-10-07 13:31:07 -07:00
Michael Crane
d34cf52576 Use 'noop' for NullLogger 2019-08-02 10:20:17 -07:00
Michael Crane
fa3e9c86db Add PerfLogger and NullLogger to simplify conditional logic 2019-08-01 12:46:33 -07:00
Ron Buckton
179381301e
Move class property transform (#31848)
* Revert "Revert "Move class property transformation into new transformer. (#30467)""

This reverts commit 53467ae4a4edb37c259b0b4e61972a90cd6c5587.

* Fix emit issues
2019-06-17 14:26:42 -07:00
Andrew Branch
53467ae4a4 Revert "Move class property transformation into new transformer. (#30467)"
This reverts commit 3139cf2f857483bc9b5b74d9c101379e27d2fa9f.
2019-06-06 17:40:02 -07:00
Joey Watts
3139cf2f85 Move class property transformation into new transformer. (#30467)
Signed-off-by: Joseph Watts <jwatts43@bloomberg.net>
2019-06-05 22:24:25 -07:00
Ron Buckton
3d2af9ff33
Relocate Debug namespace to reduce duplication (#31524) 2019-05-22 11:20:29 -07:00
Ryan Cavanaugh
885d4d63c8
Remove "generate types" code (#31075) 2019-04-23 13:51:47 -07:00
Kagami Sascha Rosylight
a8823f5169
Merge branch 'master' into es2019 2019-02-07 10:08:26 +09:00
Kagami Sascha Rosylight
6249b4c704 Remove ES2018 transforms for ES2018 target (#26315)
* rename esnext.ts as es2018.ts

* remove ES2018 transforms for ES2018 target

* change target from esnext to es2018

* rename tests
2019-02-06 15:35:52 -08:00
Kagami Sascha Rosylight
c89a80736e add ES2019 target 2018-12-27 19:46:21 +09:00
Ron Buckton
4982803a38 Merge branch 'master' into sourceMapGenerator 2018-10-08 18:01:37 -07:00
Andy
c57ff087d6
Add codefix to generate types for untyped module (#26588) 2018-09-18 11:47:29 -07:00
Ron Buckton
b006287cb1 Refactor and clean up sourcemap decoder 2018-09-04 17:50:06 -07:00
Ron Buckton
015babb6f7 Initial support for 'typesVersions' 2018-08-20 16:57:18 -07:00
Ryan Cavanaugh
8491f70379 Merge branch 'master' into esau-squash
# Conflicts:
#	tests/baselines/reference/api/typescript.d.ts
2018-06-14 11:25:00 -07:00
Wesley Wigham
2a1503610b
Stop generating sectional sourcemaps (#24917)
* Generate normal 1-part sourcemaps (at increased processing cost), since tools dislike sectional ones

* Add semicolon

* Accept sad baselines]

* Forward along sourcesContent if available

* Supress lint since the API actually calls for null here

* Fix concatenated sourcemap paths

* Accept bad baselines :(

* Add overloads

* Accept api update

* Fix lint
2018-06-13 18:52:23 -07:00
Ryan Cavanaugh
066b191982 Collapse core/compiler/parser into parser 2018-06-11 17:07:58 -07:00
Ryan Cavanaugh
ab10b86205 Almost working? 2018-06-10 19:28:38 -07:00
Ryan Cavanaugh
336c37662d Projzilla phase 1 2018-06-09 16:48:08 -07:00
Ryan Cavanaugh
cf87bd446d Merge branch 'master' into tsbuild 2018-06-05 14:55:51 -07:00
Wesley Wigham
d9b93903c0
Use more nodelike paths for import types when possible (#24610)
* Use more nodelike paths for import types when possible

* move functionality from services into compiler, fix with propert file/directory conflict handling

* mark suspect cast
2018-06-05 12:54:36 -07:00
Ryan Cavanaugh
7e0825a3e7 Clean, etc 2018-05-21 17:47:58 -07:00
Ryan Cavanaugh
d98a9a0150 WIP 2018-05-14 18:27:52 -07:00
Ryan Cavanaugh
5b3254957c Explicitly list compiler source files in their current emitted order 2018-04-11 15:38:26 -07:00
Wesley Wigham
19ec83fcdf
Refactor declaration emitter into declaration transformer (#21930)
* Refactor declaration emitter into declaration transformer

* Slight cleanup from code review feedback

* Incorporate fix for new test

* Swaths of PR feedback

* Merge public methods

* Per-file output

* Preserve input import ordering more often

* Unify jsdoc comment start detection under more lenient rule

* Move to per-file transformations to reduce the memory that msut be retained

* Fix typo
2018-03-15 22:23:10 -07:00
Sheetal Nandi
dc62bb9abc Change builder to BuilderProgram so it is similar to operating on program 2017-12-07 18:58:15 -08:00
Sheetal Nandi
68d360585a PR feedback 2017-09-26 16:21:15 -07:00
Sheetal Nandi
14febe2113 Rename watchedProgram.ts to watch.ts 2017-09-26 10:46:32 -07:00
Sheetal Nandi
fdb104b242 Merge branch 'master' into watchImprovements 2017-09-11 13:49:36 -07:00
Wesley Wigham
053b915061 Rebase SymbolWalker change onto master
From PR #9847.
2017-08-22 11:33:32 -07:00
Sheetal Nandi
0d5e6c9de5 Use cache for module resolution even in watch mode 2017-08-07 11:31:12 -07:00
Sheetal Nandi
031a63762f Switch back to have tsc.ts the only file thats different in tsc.js generation now that api has tests 2017-08-07 11:31:12 -07:00