This commit is contained in:
Iliyan Angelov
2025-09-14 23:24:25 +03:00
commit c67067a2a4
71311 changed files with 6800714 additions and 0 deletions

View File

@@ -0,0 +1,22 @@
MIT License
Copyright (c) 2014-present Sebastian McKenzie and other contributors
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

View File

@@ -0,0 +1,19 @@
# @babel/plugin-syntax-flow
> Allow parsing of the flow syntax
See our website [@babel/plugin-syntax-flow](https://babeljs.io/docs/babel-plugin-syntax-flow) for more information.
## Install
Using npm:
```sh
npm install --save-dev @babel/plugin-syntax-flow
```
or using yarn:
```sh
yarn add @babel/plugin-syntax-flow --dev
```

View File

@@ -0,0 +1,40 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var _helperPluginUtils = require("@babel/helper-plugin-utils");
var _default = exports.default = (0, _helperPluginUtils.declare)((api, options) => {
api.assertVersion(7);
const {
all,
enums
} = options;
if (typeof all !== "boolean" && all !== undefined) {
throw new Error(".all must be a boolean, or undefined");
}
{
if (enums === false) {
console.warn("The .enums option has been removed and it's now always enabled.");
}
}
return {
name: "syntax-flow",
manipulateOptions(opts, parserOpts) {
{
if (parserOpts.plugins.some(p => (Array.isArray(p) ? p[0] : p) === "typescript")) {
return;
}
}
{
parserOpts.plugins.push(["flow", {
all,
enums
}]);
}
}
};
});
//# sourceMappingURL=index.js.map

View File

@@ -0,0 +1 @@
{"version":3,"names":["_helperPluginUtils","require","_default","exports","default","declare","api","options","assertVersion","all","enums","undefined","Error","console","warn","name","manipulateOptions","opts","parserOpts","plugins","some","p","Array","isArray","push"],"sources":["../src/index.ts"],"sourcesContent":["import { declare } from \"@babel/helper-plugin-utils\";\n\nexport interface Options {\n all?: boolean;\n}\n\nexport default declare((api, options: Options) => {\n api.assertVersion(REQUIRED_VERSION(7));\n\n // When enabled and plugins includes flow, all files should be parsed as if\n // the @flow pragma was provided.\n // @ts-expect-error Babel 7\n const { all, enums } = options;\n\n if (typeof all !== \"boolean\" && all !== undefined) {\n throw new Error(\".all must be a boolean, or undefined\");\n }\n\n if (process.env.BABEL_8_BREAKING) {\n if (enums !== undefined) {\n throw new Error(\n \"The .enums option has been removed and it's now always enabled. Please remove it from your config.\",\n );\n }\n } else {\n if (enums === false) {\n console.warn(\n \"The .enums option has been removed and it's now always enabled.\",\n );\n }\n }\n\n return {\n name: \"syntax-flow\",\n\n manipulateOptions(opts, parserOpts) {\n if (!process.env.BABEL_8_BREAKING) {\n // If the file has already enabled TS, assume that this is not a\n // valid Flowtype file.\n if (\n parserOpts.plugins.some(\n p => (Array.isArray(p) ? p[0] : p) === \"typescript\",\n )\n ) {\n return;\n }\n }\n\n if (process.env.BABEL_8_BREAKING) {\n parserOpts.plugins.push([\"flow\", { all }]);\n } else {\n // @ts-expect-error Babel 7\n parserOpts.plugins.push([\"flow\", { all, enums }]);\n }\n },\n };\n});\n"],"mappings":";;;;;;AAAA,IAAAA,kBAAA,GAAAC,OAAA;AAAqD,IAAAC,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAMtC,IAAAC,0BAAO,EAAC,CAACC,GAAG,EAAEC,OAAgB,KAAK;EAChDD,GAAG,CAACE,aAAa,CAAkB,CAAE,CAAC;EAKtC,MAAM;IAAEC,GAAG;IAAEC;EAAM,CAAC,GAAGH,OAAO;EAE9B,IAAI,OAAOE,GAAG,KAAK,SAAS,IAAIA,GAAG,KAAKE,SAAS,EAAE;IACjD,MAAM,IAAIC,KAAK,CAAC,sCAAsC,CAAC;EACzD;EAQO;IACL,IAAIF,KAAK,KAAK,KAAK,EAAE;MACnBG,OAAO,CAACC,IAAI,CACV,iEACF,CAAC;IACH;EACF;EAEA,OAAO;IACLC,IAAI,EAAE,aAAa;IAEnBC,iBAAiBA,CAACC,IAAI,EAAEC,UAAU,EAAE;MACC;QAGjC,IACEA,UAAU,CAACC,OAAO,CAACC,IAAI,CACrBC,CAAC,IAAI,CAACC,KAAK,CAACC,OAAO,CAACF,CAAC,CAAC,GAAGA,CAAC,CAAC,CAAC,CAAC,GAAGA,CAAC,MAAM,YACzC,CAAC,EACD;UACA;QACF;MACF;MAIO;QAELH,UAAU,CAACC,OAAO,CAACK,IAAI,CAAC,CAAC,MAAM,EAAE;UAAEf,GAAG;UAAEC;QAAM,CAAC,CAAC,CAAC;MACnD;IACF;EACF,CAAC;AACH,CAAC,CAAC","ignoreList":[]}

View File

@@ -0,0 +1,33 @@
{
"name": "@babel/plugin-syntax-flow",
"version": "7.27.1",
"description": "Allow parsing of the flow syntax",
"repository": {
"type": "git",
"url": "https://github.com/babel/babel.git",
"directory": "packages/babel-plugin-syntax-flow"
},
"homepage": "https://babel.dev/docs/en/next/babel-plugin-syntax-flow",
"license": "MIT",
"publishConfig": {
"access": "public"
},
"main": "./lib/index.js",
"keywords": [
"babel-plugin"
],
"dependencies": {
"@babel/helper-plugin-utils": "^7.27.1"
},
"peerDependencies": {
"@babel/core": "^7.0.0-0"
},
"devDependencies": {
"@babel/core": "^7.27.1"
},
"engines": {
"node": ">=6.9.0"
},
"author": "The Babel Team (https://babel.dev/team)",
"type": "commonjs"
}