Socket
Socket
Sign inDemoInstall

babel-preset-proposal-typescript

Package Overview
Dependencies
109
Maintainers
2
Versions
31
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 3.0.0 to 4.0.0

2

lib/index.d.ts
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

lib/utils.d.ts

@@ -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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc