babel-preset-proposal-typescript
Advanced tools
Comparing version 3.0.0 to 4.0.0
export interface ProposalTypeScriptOptions { | ||
decoratorsBeforeExport?: boolean; | ||
decoratorsLegacy?: boolean; | ||
importDefer?: boolean | 'commonjs'; | ||
isTSX?: boolean; | ||
optionalChainingAssignVersion?: '2023-07'; | ||
pipelineOperator?: 'fsharp' | 'minimal' | 'smart'; | ||
@@ -6,0 +8,0 @@ recordTuplePolyfill?: boolean | string; |
import { declare } from '@babel/helper-plugin-utils'; | ||
import proposalAsyncDoExpressions from '@babel/plugin-proposal-async-do-expressions'; | ||
import proposalDestructuringPrivate from '@babel/plugin-proposal-destructuring-private'; | ||
import proposalDoExpressions from '@babel/plugin-proposal-do-expressions'; | ||
import proposalDuplicateNamedCapturingGroupsRegex from '@babel/plugin-proposal-duplicate-named-capturing-groups-regex'; | ||
import proposalFunctionBind from '@babel/plugin-proposal-function-bind'; | ||
import proposalFunctionSent from '@babel/plugin-proposal-function-sent'; | ||
import proposalJsonStrings from '@babel/plugin-proposal-json-strings'; | ||
import proposalImportDefer from '@babel/plugin-proposal-import-defer'; | ||
import proposalImportWasmSource from '@babel/plugin-proposal-import-wasm-source'; | ||
import proposalOptionalChainingAssign from '@babel/plugin-proposal-optional-chaining-assign'; | ||
import proposalPartialApplication from '@babel/plugin-proposal-partial-application'; | ||
import proposalPipelineOperator from '@babel/plugin-proposal-pipeline-operator'; | ||
import proposalRecordAndTuple from '@babel/plugin-proposal-record-and-tuple'; | ||
import proposalRegexpModifiers from '@babel/plugin-proposal-regexp-modifiers'; | ||
import proposalThrowExpression from '@babel/plugin-proposal-throw-expressions'; | ||
import syntaxDecorators from '@babel/plugin-syntax-decorators'; | ||
import syntaxTypeScript from '@babel/plugin-syntax-typescript'; | ||
import transformModulesCommonjs from '@babel/plugin-transform-modules-commonjs'; | ||
import { IS_RECORD_TUPLE_SUPPORTED } from './utils.js'; | ||
import syntaxV8intrinsic from './v8intrinsic.js'; | ||
export default declare((api, { decoratorsBeforeExport, decoratorsLegacy = true, isTSX, pipelineOperator = 'minimal', recordTuplePolyfill = IS_RECORD_TUPLE_SUPPORTED, recordTupleSyntaxType = 'hash', }) => { | ||
export default declare((api, { decoratorsBeforeExport, decoratorsLegacy = true, importDefer, isTSX, pipelineOperator = 'minimal', optionalChainingAssignVersion = '2023-07', recordTuplePolyfill = IS_RECORD_TUPLE_SUPPORTED, recordTupleSyntaxType = 'hash', }) => { | ||
api.assertVersion(7); | ||
@@ -34,8 +40,17 @@ return { | ||
proposalAsyncDoExpressions, | ||
proposalDestructuringPrivate, | ||
proposalDuplicateNamedCapturingGroupsRegex, | ||
proposalDoExpressions, | ||
proposalFunctionBind, | ||
proposalFunctionSent, | ||
proposalJsonStrings, | ||
...(importDefer ? [proposalImportDefer, transformModulesCommonjs] : []), | ||
proposalPartialApplication, | ||
proposalImportWasmSource, | ||
[ | ||
proposalOptionalChainingAssign, | ||
{ | ||
version: optionalChainingAssignVersion, | ||
}, | ||
], | ||
[ | ||
proposalPipelineOperator, | ||
@@ -56,2 +71,3 @@ { | ||
], | ||
proposalRegexpModifiers, | ||
proposalThrowExpression, | ||
@@ -58,0 +74,0 @@ ].filter(Boolean), |
@@ -1,2 +0,1 @@ | ||
export declare const NODE_VERSION: string; | ||
export declare const IS_RECORD_TUPLE_SUPPORTED: boolean; |
@@ -1,4 +0,3 @@ | ||
import compareVersions from 'compare-versions'; | ||
export const NODE_VERSION = process.versions.node; | ||
export const IS_RECORD_TUPLE_SUPPORTED = compareVersions.compare(NODE_VERSION, '14.6', '>='); | ||
const [major, minor] = process.versions.node.split('.'); | ||
export const IS_RECORD_TUPLE_SUPPORTED = +major > 14 || (+major === 14 && +minor >= 6); | ||
//# sourceMappingURL=utils.js.map |
{ | ||
"name": "babel-preset-proposal-typescript", | ||
"version": "3.0.0", | ||
"version": "4.0.0", | ||
"type": "module", | ||
"description": "Yet another Babel preset for TypeScript, only transforms proposals which TypeScript does not support now.", | ||
"repository": "git+https://github.com/rx-ts/babel-preset-proposal-typescript.git", | ||
"repository": "git+https://github.com/un-ts/babel-preset-proposal-typescript.git", | ||
"author": "JounQin <admin@1stg.me>", | ||
@@ -21,2 +21,3 @@ "license": "MIT", | ||
}, | ||
"fesm2015": "lib/index.es2015.mjs", | ||
"types": "lib", | ||
@@ -37,23 +38,27 @@ "files": [ | ||
"peerDependencies": { | ||
"@babel/core": "^7.15.0", | ||
"typescript": "^4.7.0" | ||
"@babel/core": "^7.23.0", | ||
"typescript": "^5.3.0" | ||
}, | ||
"dependencies": { | ||
"@babel/helper-plugin-utils": "^7.18.9", | ||
"@babel/plugin-proposal-async-do-expressions": "^7.18.6", | ||
"@babel/plugin-proposal-do-expressions": "^7.18.6", | ||
"@babel/plugin-proposal-function-bind": "^7.18.9", | ||
"@babel/plugin-proposal-function-sent": "^7.18.6", | ||
"@babel/plugin-proposal-json-strings": "^7.18.6", | ||
"@babel/plugin-proposal-optional-chaining": "^7.18.9", | ||
"@babel/plugin-proposal-partial-application": "^7.18.9", | ||
"@babel/plugin-proposal-pipeline-operator": "^7.18.9", | ||
"@babel/plugin-proposal-private-property-in-object": "^7.18.6", | ||
"@babel/plugin-proposal-record-and-tuple": "^7.18.6", | ||
"@babel/plugin-proposal-throw-expressions": "^7.18.6", | ||
"@babel/plugin-syntax-decorators": "^7.18.6", | ||
"@babel/plugin-syntax-typescript": "^7.18.6", | ||
"@bloomberg/record-tuple-polyfill": "^0.0.4", | ||
"compare-versions": "^4.1.3" | ||
"@babel/helper-plugin-utils": "^7.22.5", | ||
"@babel/plugin-proposal-async-do-expressions": "^7.23.3", | ||
"@babel/plugin-proposal-destructuring-private": "^7.23.3", | ||
"@babel/plugin-proposal-do-expressions": "^7.23.3", | ||
"@babel/plugin-proposal-duplicate-named-capturing-groups-regex": "^7.23.3", | ||
"@babel/plugin-proposal-function-bind": "^7.23.3", | ||
"@babel/plugin-proposal-function-sent": "^7.23.3", | ||
"@babel/plugin-proposal-import-defer": "^7.23.0", | ||
"@babel/plugin-proposal-import-wasm-source": "^7.23.0", | ||
"@babel/plugin-proposal-optional-chaining-assign": "^7.23.0", | ||
"@babel/plugin-proposal-partial-application": "^7.23.3", | ||
"@babel/plugin-proposal-pipeline-operator": "^7.23.3", | ||
"@babel/plugin-proposal-private-property-in-object": "^7.21.11", | ||
"@babel/plugin-proposal-record-and-tuple": "^7.23.3", | ||
"@babel/plugin-proposal-regexp-modifiers": "^7.23.3", | ||
"@babel/plugin-proposal-throw-expressions": "^7.23.3", | ||
"@babel/plugin-syntax-decorators": "^7.23.3", | ||
"@babel/plugin-syntax-typescript": "^7.23.3", | ||
"@babel/plugin-transform-modules-commonjs": "^7.23.3", | ||
"@bloomberg/record-tuple-polyfill": "^0.0.4" | ||
} | ||
} |
@@ -5,3 +5,2 @@ # babel-preset-proposal-typescript | ||
[![Codecov](https://img.shields.io/codecov/c/github/un-ts/babel-preset-proposal-typescript.svg)](https://codecov.io/gh/un-ts/babel-preset-proposal-typescript) | ||
[![Language grade: JavaScript](https://img.shields.io/lgtm/grade/javascript/g/un-ts/babel-preset-proposal-typescript.svg?logo=lgtm&logoWidth=18)](https://lgtm.com/projects/g/un-ts/babel-preset-proposal-typescript/context:javascript) | ||
[![npm](https://img.shields.io/npm/v/babel-preset-proposal-typescript.svg)](https://www.npmjs.com/package/babel-preset-proposal-typescript) | ||
@@ -30,2 +29,5 @@ [![GitHub Release](https://img.shields.io/github/release/un-ts/babel-preset-proposal-typescript)](https://github.com/un-ts/babel-preset-proposal-typescript/releases) | ||
- [Via webpack](#via-webpack) | ||
- [References](#references) | ||
- [Sponsors](#sponsors) | ||
- [Backers](#backers) | ||
- [Changelog](#changelog) | ||
@@ -37,11 +39,16 @@ - [License](#license) | ||
1. [async-do-expressions](https://www.npmjs.com/package/@babel/plugin-proposal-async-do-expressions) | ||
2. [do-expressions](https://www.npmjs.com/package/@babel/plugin-proposal-do-expressions) | ||
3. [function-bind](https://www.npmjs.com/package/@babel/plugin-proposal-function-bind) | ||
4. [function-sent](https://www.npmjs.com/package/@babel/plugin-proposal-function-sent) | ||
5. [json-strings](https://www.npmjs.com/package/@babel/plugin-proposal-json-strings) | ||
6. [partial-application](https://www.npmjs.com/package/@babel/plugin-proposal-partial-application) | ||
7. [pipeline-operator](https://www.npmjs.com/package/@babel/plugin-proposal-pipeline-operator) | ||
8. [record-and-tuple](https://www.npmjs.com/package/@babel/plugin-proposal-record-and-tuple) | ||
9. [throw-expressions](https://www.npmjs.com/package/@babel/plugin-proposal-throw-expressions) | ||
10. [v8intrinsic](./src/v8intrinsic.ts) - [Further Detail](https://babeljs.io/blog/2019/09/05/7.6.0#v8-intrinsic-runtime-functions-parsing-10148httpsgithubcombabelbabelpull10148) | ||
2. [destructuring-private](https://www.npmjs.com/package/@babel/plugin-proposal-destructuring-private) | ||
3. [do-expressions](https://www.npmjs.com/package/@babel/plugin-proposal-do-expressions) | ||
4. [duplicate-named-capturing-groups-regex](https://www.npmjs.com/package/@babel/plugin-proposal-duplicate-named-capturing-groups-regex) | ||
5. [function-bind](https://www.npmjs.com/package/@babel/plugin-proposal-function-bind) | ||
6. [function-sent](https://www.npmjs.com/package/@babel/plugin-proposal-function-sent) | ||
7. [import-defer](https://www.npmjs.com/package/@babel/plugin-proposal-import-defer) | ||
8. [import-wasm-source](https://www.npmjs.com/package/@babel/plugin-proposal-import-wasm-source) | ||
9. [optional-chaining-assign](https://www.npmjs.com/package/@babel/plugin-proposal-optional-chaining-assign) | ||
10. [partial-application](https://www.npmjs.com/package/@babel/plugin-proposal-partial-application) | ||
11. [pipeline-operator](https://www.npmjs.com/package/@babel/plugin-proposal-pipeline-operator) | ||
12. [record-and-tuple](https://www.npmjs.com/package/@babel/plugin-proposal-record-and-tuple) | ||
13. [regexp-modifiers](https://www.npmjs.com/package/@babel/plugin-proposal-regexp-modifiers) | ||
14. [throw-expressions](https://www.npmjs.com/package/@babel/plugin-proposal-throw-expressions) | ||
15. [v8intrinsic](./src/v8intrinsic.ts) - [Further Detail](https://babeljs.io/blog/2019/09/05/7.6.0#v8-intrinsic-runtime-functions-parsing-10148httpsgithubcombabelbabelpull10148) | ||
@@ -60,10 +67,12 @@ ## Install | ||
| option | description | defaults | | ||
| ------------------------ | -------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------- | | ||
| `decoratorsBeforeExport` | See [Babel Document](https://babeljs.io/docs/en/babel-plugin-proposal-decorators#decoratorsbeforeexport) | `undefined` | | ||
| `decoratorsLegacy` | whether to use legacy decorators semantic | `true` | | ||
| `isTSX` | whether to enable `jsx` plugin with `typescript` | `false`, but `true` for `/\.[jt]sx$/` | | ||
| `pipelineOperator` | implementation of pipeline operator, `minimal`, `smart` or `fsharp` | `minimal` | | ||
| `recordTuplePolyfill` | whether to enable import `record-tuple` plugin and polyfill, or specific the polyfill module name | `true` for Node>=14.6, it represents `@bloomberg/record-tuple-polyfill` | | ||
| `recordTupleSyntaxType` | record-tuple syntax, `hash` or `bar` | `hash` | | ||
| option | description | defaults | | ||
| ------------------------------- | ------------------------------------------------------------------------------------------------------------ | ----------------------------------------------------------------------- | | ||
| `decoratorsBeforeExport` | See [Babel Document](https://babeljs.io/docs/en/babel-plugin-proposal-decorators#decoratorsbeforeexport) | `undefined` | | ||
| `decoratorsLegacy` | Whether to use legacy decorators semantic | `true` | | ||
| `importDefer` | Whether to enabled `import-defer` plugin, if true `transform-modules-commonjs` will be enabled automatically | `false` | | ||
| `isTSX` | Whether to enable `jsx` plugin with `typescript` | `false`, but `true` for `/\.[jt]sx$/` | | ||
| `optionalChainingAssignVersion` | Version for `optional-chaining-assign` plugin, only `'2023-07'` allowed for now | `'2023-07'` | | ||
| `pipelineOperator` | Implementation of pipeline operator, `minimal`, `smart` or `fsharp` | `minimal` | | ||
| `recordTuplePolyfill` | Whether to enable import `record-tuple` plugin and polyfill, or specific the polyfill module name | `true` for Node>=14.6, it represents `@bloomberg/record-tuple-polyfill` | | ||
| `recordTupleSyntaxType` | `record-tuple` syntax, `hash` or `bar` | `hash` | | ||
@@ -128,2 +137,21 @@ ## Usage | ||
## References | ||
- [TC39 Proposals](https://github.com/tc39/proposals) | ||
- [Babel Proposals](https://github.com/babel/proposals) | ||
## Sponsors | ||
| 1stG | RxTS | UnTS | | ||
| ---------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------- | | ||
| [![1stG Open Collective backers and sponsors](https://opencollective.com/1stG/organizations.svg)](https://opencollective.com/1stG) | [![RxTS Open Collective backers and sponsors](https://opencollective.com/rxts/organizations.svg)](https://opencollective.com/rxts) | [![UnTS Open Collective backers and sponsors](https://opencollective.com/unts/organizations.svg)](https://opencollective.com/unts) | | ||
## Backers | ||
[![Backers](https://raw.githubusercontent.com/1stG/static/master/sponsors.svg)](https://github.com/sponsors/JounQin) | ||
| 1stG | RxTS | UnTS | | ||
| -------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------- | | ||
| [![1stG Open Collective backers and sponsors](https://opencollective.com/1stG/individuals.svg)](https://opencollective.com/1stG) | [![RxTS Open Collective backers and sponsors](https://opencollective.com/rxts/individuals.svg)](https://opencollective.com/rxts) | [![UnTS Open Collective backers and sponsors](https://opencollective.com/unts/individuals.svg)](https://opencollective.com/unts) | | ||
## Changelog | ||
@@ -130,0 +158,0 @@ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
337
163
0
28551
22
14
+ Added@babel/plugin-proposal-duplicate-named-capturing-groups-regex@^7.23.3
+ Added@babel/plugin-proposal-optional-chaining-assign@^7.23.0
+ Added@babel/core@7.24.4(transitive)
+ Added@babel/generator@7.24.4(transitive)
+ Added@babel/helper-create-class-features-plugin@7.24.4(transitive)
+ Added@babel/helper-create-regexp-features-plugin@7.22.15(transitive)
+ Added@babel/helper-import-to-platform-api@7.24.1(transitive)
+ Added@babel/helper-member-expression-to-functions@7.23.0(transitive)
+ Added@babel/helper-module-transforms@7.23.3(transitive)
+ Added@babel/helper-plugin-utils@7.24.0(transitive)
+ Added@babel/helper-simple-access@7.22.5(transitive)
+ Added@babel/helper-split-export-declaration@7.22.6(transitive)
+ Added@babel/helper-validator-identifier@7.22.20(transitive)
+ Added@babel/helper-wrap-function@7.22.20(transitive)
+ Added@babel/helpers@7.24.4(transitive)
+ Added@babel/highlight@7.24.2(transitive)
+ Added@babel/parser@7.24.4(transitive)
+ Added@babel/plugin-proposal-destructuring-private@7.24.1(transitive)
+ Added@babel/plugin-proposal-duplicate-named-capturing-groups-regex@7.24.1(transitive)
+ Added@babel/plugin-proposal-import-defer@7.24.1(transitive)
+ Added@babel/plugin-proposal-import-wasm-source@7.24.1(transitive)
+ Added@babel/plugin-proposal-optional-chaining-assign@7.24.1(transitive)
+ Added@babel/plugin-proposal-partial-application@7.24.1(transitive)
+ Added@babel/plugin-proposal-regexp-modifiers@7.24.1(transitive)
+ Added@babel/plugin-syntax-destructuring-private@7.24.1(transitive)
+ Added@babel/plugin-syntax-import-defer@7.24.1(transitive)
+ Added@babel/plugin-syntax-import-source@7.24.1(transitive)
+ Added@babel/plugin-syntax-optional-chaining-assign@7.24.1(transitive)
+ Added@babel/plugin-transform-destructuring@7.24.1(transitive)
+ Added@babel/plugin-transform-modules-commonjs@7.24.1(transitive)
+ Added@babel/plugin-transform-optional-chaining@7.24.1(transitive)
+ Added@babel/plugin-transform-parameters@7.24.1(transitive)
+ Added@babel/regjsgen@0.8.0(transitive)
+ Added@babel/traverse@7.24.1(transitive)
+ Added@babel/types@7.24.0(transitive)
+ Addedcaniuse-lite@1.0.30001612(transitive)
+ Addedelectron-to-chromium@1.4.748(transitive)
+ Addedjsesc@0.5.0(transitive)
+ Addedregenerate@1.4.2(transitive)
+ Addedregenerate-unicode-properties@10.1.1(transitive)
+ Addedregexpu-core@5.3.2(transitive)
+ Addedregjsparser@0.9.1(transitive)
+ Addedtypescript@5.4.5(transitive)
+ Addedunicode-canonical-property-names-ecmascript@2.0.0(transitive)
+ Addedunicode-match-property-ecmascript@2.0.0(transitive)
+ Addedunicode-match-property-value-ecmascript@2.1.0(transitive)
+ Addedunicode-property-aliases-ecmascript@2.1.0(transitive)
- Removedcompare-versions@^4.1.3
- Removed@babel/core@7.24.5(transitive)
- Removed@babel/generator@7.24.5(transitive)
- Removed@babel/helper-create-class-features-plugin@7.24.5(transitive)
- Removed@babel/helper-member-expression-to-functions@7.24.5(transitive)
- Removed@babel/helper-module-transforms@7.24.5(transitive)
- Removed@babel/helper-plugin-utils@7.24.5(transitive)
- Removed@babel/helper-simple-access@7.24.5(transitive)
- Removed@babel/helper-split-export-declaration@7.24.5(transitive)
- Removed@babel/helper-validator-identifier@7.24.5(transitive)
- Removed@babel/helper-wrap-function@7.24.5(transitive)
- Removed@babel/helpers@7.24.5(transitive)
- Removed@babel/highlight@7.24.5(transitive)
- Removed@babel/parser@7.24.5(transitive)
- Removed@babel/plugin-proposal-json-strings@7.18.6(transitive)
- Removed@babel/plugin-proposal-optional-chaining@7.21.0(transitive)
- Removed@babel/plugin-proposal-partial-application@7.24.5(transitive)
- Removed@babel/plugin-syntax-json-strings@7.8.3(transitive)
- Removed@babel/traverse@7.24.5(transitive)
- Removed@babel/types@7.24.5(transitive)
- Removedcaniuse-lite@1.0.30001614(transitive)
- Removedcompare-versions@4.1.4(transitive)
- Removedelectron-to-chromium@1.4.752(transitive)
- Removedtypescript@4.9.5(transitive)
Updated@babel/plugin-proposal-private-property-in-object@^7.21.11