195 Commits

Author SHA1 Message Date
Nicolò Ribaudo
8ad6b75cde
Use function rather than var to compile private methods (#12990) 2021-03-11 02:08:31 +01:00
Nicolò Ribaudo
d04842a700
Avoid using CJS globals in internal source files (#12963)
* Lint against CJS globals in modules

* Use `import.meta.url` instead of `__filename` in `src` files

* Prepare fixtures runner for `import.meta.url`

* Use `import.meta.url` instead of `__filename` in `test/index` files

* Remove `__dirname` from remaining test files

dirname

* Avoid using `module` in `src` files

* Avoid using `require` in `src` files

* Avoid using `require` in `test` files

* Update `@types/node`

* Compile dynamic import in `@babel/node`

* Fix windows

* Use `@babel/plugin-proposal-dynamic-import` from npm
2021-03-05 19:55:36 +01:00
Nicolò Ribaudo
ea6a438315
Enable external-helpers by default in tests (#12911)
Co-authored-by: Huáng Jùnliàng <jlhwung@gmail.com>
Co-authored-by: Babel Bot <babel-bot@users.noreply.github.com>
2021-02-26 23:33:26 +01:00
Nicolò Ribaudo
c827193d9c v7.13.0 2021-02-22 23:35:18 +01:00
Nicolò Ribaudo
771841f764
Fix _isNativeReflectConstruct helper (#8461) 2021-02-22 22:49:44 +01:00
Huáng Jùnliàng
a93bbce867
Enable allowNamespaces in transform-typescript by default (#12765) 2021-02-21 17:46:06 +01:00
Nicolò Ribaudo
2f755ef052 v7.12.17 2021-02-18 15:58:43 +01:00
Huáng Jùnliàng
99130bcfdd
Register binding when transforming TSParameterProperty (#12796) 2021-02-17 00:42:01 +01:00
Babel Bot
dd5c9f958c v7.12.16 2021-02-11 22:36:24 +00:00
Huáng Jùnliàng
74ed698c2e
Support destructuring variable declarator within TS namespace (#12760)
* refactor: extract handleVariableDeclaration

* fix: support general variable declarator under namespace

* fix: support general declarator on export module id duplication check

* refactor: use for-in
2021-02-05 11:52:15 -05:00
Nicolò Ribaudo
d291edbdf1 v7.12.13 2021-02-03 01:59:31 +01:00
Nicolò Ribaudo
50462eb5e4
[babel 8] Enable allowDeclareFields option by default with TS (#12461) 2021-01-08 01:28:20 +01:00
Daniel Arthur Gallagher
e8b08523f4
docs: add package-specific documentation links (#12531)
[skip ci]
2021-01-06 14:11:53 +01:00
Huáng Jùnliàng
eea3065039
Update pathCache in NodePath#_replaceWith (#12391)
* add tests on regression 12386

* fix: update cache on _replaceWith

* fix: pathCache in replaceWithMultiple could be nullish

* Update packages/babel-traverse/src/path/replacement.js

Co-authored-by: Nicolò Ribaudo <nicolo.ribaudo@gmail.com>

* test: add replaceWith test to traverse

Co-authored-by: Brian Ng <bng412@gmail.com>
Co-authored-by: Nicolò Ribaudo <nicolo.ribaudo@gmail.com>
2020-11-24 15:07:20 -05:00
Álvaro Mondéjar
b649f8d192
Fix packages documentation README links. (#12289) 2020-10-30 21:19:21 +01:00
Nicolò Ribaudo
ed498a772b
Use workspace:* for devDependencies (again) (#12217)
Co-authored-by: Huáng Jùnliàng <jlhwung@gmail.com>
2020-10-19 18:32:06 +02:00
Nicolò Ribaudo
7f4b83833f v7.12.1 2020-10-16 00:36:30 +02:00
Huáng Jùnliàng
eec01fe078
chore: use workspace:* for dev deps (#12186) 2020-10-15 14:03:50 -04:00
Nicolò Ribaudo
726154c78e v7.12.0 2020-10-14 21:48:45 +02:00
Huáng Jùnliàng
d0d1fdb921
Add jsxPragmaFrag support to typescript transform (#11950) 2020-10-14 20:12:57 +02:00
An Phi
f6bd7493a8
fix transform-typescript logic to remove definite fields (#12149) 2020-10-08 12:35:43 -05:00
Иван Плесских
7ad9917793
[transform-typescript] Fix import elision for type exports (#12122) 2020-09-29 14:35:57 -05:00
Huáng Jùnliàng
3fad7eab9b
Use Yarn 2 (#11962)
* chore: use yarn 2

* chore: remove redundant yarn locks

* chore: remove publishEslintPkg

* chore: remove redundant make bootstrap

* Update .yarnrc.yml

Co-authored-by: Kristoffer K. <merceyz@users.noreply.github.com>

* chore: use workspace protocol for eslint packages in the root

Co-Authored-By: merceyz <merceyz@users.noreply.github.com>

* chore: pin caniuse-lite versions

Testcases in packages/babel-preset-env/test/fixtures/debug/browserslists-defaults-not-ie
depends on specific caniuse-lite versions. We pinned the version here
so we don't have to deal with fixture different in e2e-tests
where all deps will be updated and tested.

* chore: resolve yarn install warnings

* chore: update yarn cache path on circle/travis

* chore: add yarn deduplicate plugin

* chore: deduplicate lock files

* chore: move devDependencies to leaf packages

* chore: remove @yarnpkg/plugin-constraints

* chore: remove unused dedupe options

* test: fix unwanted self reference

* chore: remove output-file-sync dependency

* chore: update browserify to 16.5.2

Co-authored-by: Kristoffer K. <merceyz@users.noreply.github.com>
2020-08-25 14:37:30 -04:00
Huáng Jùnliàng
45fdb87747 v7.11.0 2020-07-30 17:12:07 -04:00
James C. Davis
aa82ab6358
Typescript: always strip declare from class fields (#11747)
* test: add failing test for decorated declare

* fix: always strip declare from class fields

* test: add decorated-declare-properties test
2020-07-30 14:06:45 -04:00
Huáng Jùnliàng
9e6663f125 Follow-up on initial TS4 catch param support (#11767)
* refactor: align with AST shape convention

* feat: print catch param type annotations

* test: add test case on transform
2020-07-29 16:51:48 -04:00
Huáng Jùnliàng
f7964a9ac5 v7.10.5 2020-07-14 14:10:36 -04:00
Huáng Jùnliàng
5dd64ecc4a
Disallow duplicated AST nodes (#11807) 2020-07-14 08:32:16 -05:00
Rafael Salguero Iturrios
f32d5debda
Typescript transform now removes generic arguments from optional calls (Fixes #11813) (#11816) 2020-07-09 17:32:05 -05:00
Bogdan Savluk
b1a8e72e16
Refactor generated builder names in @babel/types (#11582)
* ensure only builders starting with lowercase are used

* update generate builders to have function name starting flow lowercase

* fix bug in deprecated builders

* remove comment about not yet discussed change in next major version
2020-07-07 09:53:00 +02:00
Huáng Jùnliàng
7fd40d86a0 v7.10.4 2020-06-30 09:04:22 -04:00
Huáng Jùnliàng
2787ee2f96 v7.10.3 2020-06-19 16:42:41 -04:00
Sajad Torkamani
9d289c1457
Fix small typo (#11682) 2020-06-05 15:08:56 -04:00
Nicolò Ribaudo
88f57a7ea6 v7.10.1 2020-05-27 21:56:37 +00:00
Saulo Santiago
242d9e0b20
Use repository.directory field in package.json files (#11625)
Co-authored-by: Nicolas Stepien <567105+nstepien@users.noreply.github.com>
Co-authored-by: Nicolò Ribaudo <nicolo.ribaudo@gmail.com>
2020-05-27 16:32:25 +02:00
Nicolò Ribaudo
5da2440adf v7.10.0 2020-05-26 21:20:43 +00:00
Jason Quense
de8264c8a7
fix: don't elide jsx pragma import namespaces (#11523)
* fix: don't elide jsx pragma import namespaces

* use the correct pragma oops
2020-05-14 16:01:54 +02:00
Christoph Nakazawa
2bb2933dea
[helpers] Add a private function name within createSuper (#11514) 2020-05-04 23:30:53 +02:00
Nicolò Ribaudo
9c2846bcac v7.9.6 2020-04-29 20:33:47 +02:00
Kevin Lau
9b716518ed
Throw error on TypeScript declare const enum (#11410)
Throw error on `const enum` even if it has `declare`.

Resolves: #10785
2020-04-23 11:27:19 +02:00
Justin Ridgewell
070ec201bb
Speed up the createSuper helper (#11401) 2020-04-10 16:00:20 +02:00
Nicolò Ribaudo
67609a1232
Don't call createSuper in loose mode (it was unused) (#11358)
* Don't call `createSuper` in loose mode (it was unused)

* Update fixtures
2020-04-01 23:08:21 +02:00
Nicolò Ribaudo
d3cf5fb5f4 v7.9.4 2020-03-24 09:26:12 +01:00
Vlad Rindevich
2f549886e4
[preset-typescript] Fix private members type annotations (#11315) 2020-03-23 19:33:16 +01:00
Kai Cataldo
7ca814489a
fix: parse value imports named type as values (#11296)
* fix: parse value imports named type as values

* Address feedback

* Add plugin tests

* Add isContextual() check

* Remove importKind: value from extraneous nodes

* Ensure importKind is correct for more nodes

* Add additional test

* Address feedback

* Revert formatting

* Fix tests
2020-03-21 01:38:07 +01:00
Nicolò Ribaudo
8d5e422be2 v7.9.0 2020-03-20 16:32:55 +01:00
Nicolò Ribaudo
f6c7bf36ce
Allow extending untranspiled classes (#8656) 2020-03-16 23:59:15 +01:00
Nicolò Ribaudo
740260b236
Add import type and export type support to TypeScript (#11171)
* Add support for type only imports in TS (#11053)
* Implement "export type {}" (#11122)
* Add "exportKind: type" when needed with TS (#11157)
* Add `onlyRemoveTypeImports` option to `transform-typescript` (#11173)
* Add onlyRemoveTypeImports to preset-typescript (#11179)

Co-authored-by: Brian Ng <bng412@gmail.com>
Co-authored-by: Raja Sekar <rajasekarm.dev@gmail.com>
Co-authored-by: Nicolò Ribaudo <nicolo.ribaudo@gmail.com>
Co-authored-by: Kai Cataldo <kai@kaicataldo.com>
Co-authored-by: Huáng Jùnliàng <jlhwung@gmail.com>
Co-authored-by: Henry Zhu <smiley.we@gmail.com>
Co-authored-by: Siddhant N Trivedi <sidntrivedi012@gmail.com>
2020-03-16 22:58:51 +01:00
Nicolò Ribaudo
595f65f33b v7.8.7 2020-03-05 02:52:13 +01:00
James C. Davis
a5f63299eb
TypeScript: Preserve decorated definite class properties (#11129)
* test: update fixture with decorated definite class property

* fix: don't remove decorated definite class properties
2020-02-27 21:31:23 +01:00