babel-preset-proposal-typescript
Advanced tools
Comparing version 2.2.0 to 3.0.0
export interface ProposalTypeScriptOptions { | ||
classLoose?: boolean; | ||
decoratorsBeforeExport?: boolean; | ||
@@ -4,0 +3,0 @@ decoratorsLegacy?: boolean; |
@@ -1,22 +0,16 @@ | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
const tslib_1 = require("tslib"); | ||
const helper_plugin_utils_1 = require("@babel/helper-plugin-utils"); | ||
const plugin_proposal_async_do_expressions_1 = tslib_1.__importDefault(require("@babel/plugin-proposal-async-do-expressions")); | ||
const plugin_proposal_class_properties_1 = tslib_1.__importDefault(require("@babel/plugin-proposal-class-properties")); | ||
const plugin_proposal_class_static_block_1 = tslib_1.__importDefault(require("@babel/plugin-proposal-class-static-block")); | ||
const plugin_proposal_do_expressions_1 = tslib_1.__importDefault(require("@babel/plugin-proposal-do-expressions")); | ||
const plugin_proposal_function_bind_1 = tslib_1.__importDefault(require("@babel/plugin-proposal-function-bind")); | ||
const plugin_proposal_function_sent_1 = tslib_1.__importDefault(require("@babel/plugin-proposal-function-sent")); | ||
const plugin_proposal_json_strings_1 = tslib_1.__importDefault(require("@babel/plugin-proposal-json-strings")); | ||
const plugin_proposal_partial_application_1 = tslib_1.__importDefault(require("@babel/plugin-proposal-partial-application")); | ||
const plugin_proposal_pipeline_operator_1 = tslib_1.__importDefault(require("@babel/plugin-proposal-pipeline-operator")); | ||
const plugin_proposal_private_property_in_object_1 = tslib_1.__importDefault(require("@babel/plugin-proposal-private-property-in-object")); | ||
const plugin_proposal_record_and_tuple_1 = tslib_1.__importDefault(require("@babel/plugin-proposal-record-and-tuple")); | ||
const plugin_proposal_throw_expressions_1 = tslib_1.__importDefault(require("@babel/plugin-proposal-throw-expressions")); | ||
const plugin_syntax_decorators_1 = tslib_1.__importDefault(require("@babel/plugin-syntax-decorators")); | ||
const plugin_syntax_typescript_1 = tslib_1.__importDefault(require("@babel/plugin-syntax-typescript")); | ||
const v8intrinsic_1 = tslib_1.__importDefault(require("./v8intrinsic")); | ||
const utils_1 = require("./utils"); | ||
exports.default = helper_plugin_utils_1.declare((api, { classLoose, decoratorsBeforeExport, decoratorsLegacy = true, isTSX, pipelineOperator = 'minimal', recordTuplePolyfill = utils_1.IS_RECORD_TUPLE_SUPPORTED, recordTupleSyntaxType = 'hash', }) => { | ||
import { declare } from '@babel/helper-plugin-utils'; | ||
import proposalAsyncDoExpressions from '@babel/plugin-proposal-async-do-expressions'; | ||
import proposalDoExpressions from '@babel/plugin-proposal-do-expressions'; | ||
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 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 proposalThrowExpression from '@babel/plugin-proposal-throw-expressions'; | ||
import syntaxDecorators from '@babel/plugin-syntax-decorators'; | ||
import syntaxTypeScript from '@babel/plugin-syntax-typescript'; | ||
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', }) => { | ||
api.assertVersion(7); | ||
@@ -26,3 +20,3 @@ return { | ||
[ | ||
plugin_syntax_decorators_1.default, | ||
syntaxDecorators, | ||
{ | ||
@@ -34,3 +28,3 @@ decoratorsBeforeExport, | ||
[ | ||
plugin_syntax_typescript_1.default, | ||
syntaxTypeScript, | ||
{ | ||
@@ -40,35 +34,17 @@ isTSX, | ||
], | ||
v8intrinsic_1.default, | ||
plugin_proposal_async_do_expressions_1.default, | ||
syntaxV8intrinsic, | ||
proposalAsyncDoExpressions, | ||
proposalDoExpressions, | ||
proposalFunctionBind, | ||
proposalFunctionSent, | ||
proposalJsonStrings, | ||
proposalPartialApplication, | ||
[ | ||
plugin_proposal_class_static_block_1.default, | ||
proposalPipelineOperator, | ||
{ | ||
loose: classLoose, | ||
}, | ||
], | ||
[ | ||
plugin_proposal_class_properties_1.default, | ||
{ | ||
loose: classLoose, | ||
}, | ||
], | ||
plugin_proposal_do_expressions_1.default, | ||
plugin_proposal_function_bind_1.default, | ||
plugin_proposal_function_sent_1.default, | ||
plugin_proposal_json_strings_1.default, | ||
plugin_proposal_partial_application_1.default, | ||
[ | ||
plugin_proposal_pipeline_operator_1.default, | ||
{ | ||
proposal: pipelineOperator, | ||
}, | ||
], | ||
[ | ||
plugin_proposal_private_property_in_object_1.default, | ||
{ | ||
loose: classLoose, | ||
}, | ||
], | ||
recordTuplePolyfill && [ | ||
plugin_proposal_record_and_tuple_1.default, | ||
proposalRecordAndTuple, | ||
{ | ||
@@ -82,5 +58,4 @@ importPolyfill: !!recordTuplePolyfill, | ||
], | ||
plugin_proposal_throw_expressions_1.default, | ||
proposalThrowExpression, | ||
].filter(Boolean), | ||
// no need to override if it has been enabled | ||
overrides: isTSX | ||
@@ -93,3 +68,3 @@ ? undefined | ||
[ | ||
plugin_syntax_typescript_1.default, | ||
syntaxTypeScript, | ||
{ | ||
@@ -96,0 +71,0 @@ isTSX: true, |
@@ -1,7 +0,4 @@ | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.IS_RECORD_TUPLE_SUPPORTED = exports.NODE_VERSION = void 0; | ||
const compare_versions_1 = require("compare-versions"); | ||
exports.NODE_VERSION = process.versions.node; | ||
exports.IS_RECORD_TUPLE_SUPPORTED = compare_versions_1.compare(exports.NODE_VERSION, '14.6', '>='); | ||
import compareVersions from 'compare-versions'; | ||
export const NODE_VERSION = process.versions.node; | ||
export const IS_RECORD_TUPLE_SUPPORTED = compareVersions.compare(NODE_VERSION, '14.6', '>='); | ||
//# sourceMappingURL=utils.js.map |
@@ -1,5 +0,3 @@ | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
const helper_plugin_utils_1 = require("@babel/helper-plugin-utils"); | ||
exports.default = helper_plugin_utils_1.declare((api) => { | ||
import { declare } from '@babel/helper-plugin-utils'; | ||
export default declare((api) => { | ||
api.assertVersion(7); | ||
@@ -6,0 +4,0 @@ return { |
{ | ||
"name": "babel-preset-proposal-typescript", | ||
"version": "2.2.0", | ||
"version": "3.0.0", | ||
"type": "module", | ||
"description": "Yet another Babel preset for TypeScript, only transforms proposals which TypeScript does not support now.", | ||
@@ -11,5 +12,11 @@ "repository": "git+https://github.com/rx-ts/babel-preset-proposal-typescript.git", | ||
}, | ||
"main": "lib/cjs", | ||
"module": "lib/esm", | ||
"es2015": "lib/es2015", | ||
"main": "lib/index.cjs", | ||
"module": "lib/index.js", | ||
"exports": { | ||
"types": "./lib/index.d.ts", | ||
"es2015": "./lib/index.es2015.mjs", | ||
"fesm2015": "./lib/index.es2015.mjs", | ||
"import": "./lib/index.js", | ||
"require": "./lib/index.cjs" | ||
}, | ||
"types": "lib", | ||
@@ -30,25 +37,23 @@ "files": [ | ||
"peerDependencies": { | ||
"@babel/core": "^7.14.1", | ||
"typescript": "^4.3.0" | ||
"@babel/core": "^7.15.0", | ||
"typescript": "^4.7.0" | ||
}, | ||
"dependencies": { | ||
"@babel/helper-plugin-utils": "^7.13.0", | ||
"@babel/plugin-proposal-async-do-expressions": "^7.14.0", | ||
"@babel/plugin-proposal-class-properties": "^7.13.0", | ||
"@babel/plugin-proposal-class-static-block": "^7.14.3", | ||
"@babel/plugin-proposal-do-expressions": "^7.14.0", | ||
"@babel/plugin-proposal-function-bind": "^7.12.13", | ||
"@babel/plugin-proposal-function-sent": "^7.12.13", | ||
"@babel/plugin-proposal-json-strings": "^7.14.2", | ||
"@babel/plugin-proposal-optional-chaining": "^7.14.2", | ||
"@babel/plugin-proposal-partial-application": "^7.12.13", | ||
"@babel/plugin-proposal-pipeline-operator": "^7.12.13", | ||
"@babel/plugin-proposal-private-property-in-object": "^7.14.0", | ||
"@babel/plugin-proposal-record-and-tuple": "^7.13.0", | ||
"@babel/plugin-proposal-throw-expressions": "^7.12.13", | ||
"@babel/plugin-syntax-decorators": "^7.12.13", | ||
"@babel/plugin-syntax-typescript": "^7.12.13", | ||
"@bloomberg/record-tuple-polyfill": "^0.0.3", | ||
"compare-versions": "^3.6.0" | ||
"@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-preset-proposal-typescript | ||
[![GitHub Actions](https://github.com/rx-ts/babel-preset-proposal-typescript/workflows/CI/badge.svg)](https://github.com/rx-ts/babel-preset-proposal-typescript/actions/workflows/ci.yml) | ||
[![Codecov](https://img.shields.io/codecov/c/github/rx-ts/babel-preset-proposal-typescript.svg)](https://codecov.io/gh/rx-ts/babel-preset-proposal-typescript) | ||
[![Codacy Grade](https://img.shields.io/codacy/grade/bb554fe914d64b4b87cadb8a48b2a97b)](https://www.codacy.com/gh/rx-ts/babel-preset-proposal-typescript) | ||
[![GitHub Actions](https://github.com/un-ts/babel-preset-proposal-typescript/workflows/CI/badge.svg)](https://github.com/un-ts/babel-preset-proposal-typescript/actions/workflows/ci.yml) | ||
[![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) | ||
[![GitHub Release](https://img.shields.io/github/release/rx-ts/babel-preset-proposal-typescript)](https://github.com/rx-ts/babel-preset-proposal-typescript/releases) | ||
[![GitHub Release](https://img.shields.io/github/release/un-ts/babel-preset-proposal-typescript)](https://github.com/un-ts/babel-preset-proposal-typescript/releases) | ||
[![David Peer](https://img.shields.io/david/peer/rx-ts/babel-preset-proposal-typescript.svg)](https://david-dm.org/rx-ts/babel-preset-proposal-typescript?type=peer) | ||
[![David](https://img.shields.io/david/rx-ts/babel-preset-proposal-typescript.svg)](https://david-dm.org/rx-ts/babel-preset-proposal-typescript) | ||
[![David Dev](https://img.shields.io/david/dev/rx-ts/babel-preset-proposal-typescript.svg)](https://david-dm.org/rx-ts/babel-preset-proposal-typescript?type=dev) | ||
[![Conventional Commits](https://img.shields.io/badge/conventional%20commits-1.0.0-yellow.svg)](https://conventionalcommits.org) | ||
@@ -17,3 +13,3 @@ [![Renovate enabled](https://img.shields.io/badge/renovate-enabled-brightgreen.svg)](https://renovatebot.com) | ||
[![Code Style: Prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier) | ||
[![codechecks.io](https://raw.githubusercontent.com/codechecks/docs/master/images/badges/badge-default.svg?sanitize=true)](https://codechecks.io) | ||
[![changesets](https://img.shields.io/badge/maintained%20with-changesets-176de3.svg)](https://github.com/atlassian/changesets) | ||
@@ -40,14 +36,11 @@ Yet another Babel preset for TypeScript, only transforms proposals which TypeScript does not support now. | ||
1. [async-do-expressions](https://www.npmjs.com/package/@babel/plugin-proposal-async-do-expressions) | ||
2. [class-properties](https://www.npmjs.com/package/@babel/plugin-proposal-class-properties) | ||
3. [class-static-block](https://www.npmjs.com/package/@babel/plugin-proposal-class-static-block) | ||
4. [do-expressions](https://www.npmjs.com/package/@babel/plugin-proposal-do-expressions) | ||
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. [json-strings](https://www.npmjs.com/package/@babel/plugin-proposal-json-strings) | ||
8. [partial-application](https://www.npmjs.com/package/@babel/plugin-proposal-partial-application) | ||
9. [pipeline-operator](https://www.npmjs.com/package/@babel/plugin-proposal-pipeline-operator) | ||
10. [private-property-in-object](https://www.npmjs.com/package/@babel/plugin-proposal-private-property-in-object) | ||
11. [record-and-tuple](https://www.npmjs.com/package/@babel/plugin-proposal-record-and-tuple) | ||
12. [throw-expressions](https://www.npmjs.com/package/@babel/plugin-proposal-throw-expressions) | ||
13. [v8intrinsic](./src/v8intrinsic.ts) - [Further Detail](https://babeljs.io/blog/2019/09/05/7.6.0#v8-intrinsic-runtime-functions-parsing-10148-https-githubcom-babel-babel-pull-10148) | ||
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) | ||
@@ -68,3 +61,2 @@ ## Install | ||
| ------------------------ | -------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------- | | ||
| `classLoose` | whether to use loose mode for `class-static-block`, `class-properties` and `private-methods` | `undefined` | | ||
| `decoratorsBeforeExport` | See [Babel Document](https://babeljs.io/docs/en/babel-plugin-proposal-decorators#decoratorsbeforeexport) | `undefined` | | ||
@@ -94,3 +86,3 @@ | `decoratorsLegacy` | whether to use legacy decorators semantic | `true` | | ||
```sh | ||
babel input.ts --presets proposal-typescript >output.ts | ||
babel input.ts --presets proposal-typescript > output.ts | ||
``` | ||
@@ -97,0 +89,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
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
53270
18
Yes
300
135
1
+ Added@bloomberg/record-tuple-polyfill@0.0.4(transitive)
+ Addedcompare-versions@4.1.4(transitive)
- Removed@babel/plugin-proposal-class-properties@7.18.6(transitive)
- Removed@babel/plugin-proposal-class-static-block@7.21.0(transitive)
- Removed@babel/plugin-syntax-class-static-block@7.14.5(transitive)
- Removed@bloomberg/record-tuple-polyfill@0.0.3(transitive)
- Removedcompare-versions@3.6.0(transitive)
Updated@babel/plugin-proposal-private-property-in-object@^7.18.6
Updatedcompare-versions@^4.1.3