This commit is contained in:
2022-07-18 02:50:52 +00:00
parent befd344ab0
commit 06181b34d6
8569 changed files with 818704 additions and 352705 deletions
+1 -1
View File
@@ -2,7 +2,7 @@
> Allow parsing of decorators
See our website [@babel/plugin-syntax-decorators](https://babeljs.io/docs/en/next/babel-plugin-syntax-decorators.html) for more information.
See our website [@babel/plugin-syntax-decorators](https://babeljs.io/docs/en/babel-plugin-syntax-decorators) for more information.
## Install
+55 -23
View File
@@ -9,39 +9,71 @@ var _helperPluginUtils = require("@babel/helper-plugin-utils");
var _default = (0, _helperPluginUtils.declare)((api, options) => {
api.assertVersion(7);
const {
legacy = false
let {
version
} = options;
{
const {
legacy
} = options;
if (typeof legacy !== "boolean") {
throw new Error("'legacy' must be a boolean.");
}
if (legacy !== undefined) {
if (typeof legacy !== "boolean") {
throw new Error(".legacy must be a boolean.");
}
const {
decoratorsBeforeExport
} = options;
if (decoratorsBeforeExport === undefined) {
if (!legacy) {
throw new Error("The '@babel/plugin-syntax-decorators' plugin requires a" + " 'decoratorsBeforeExport' option, whose value must be a boolean." + " If you want to use the legacy decorators semantics, you can set" + " the 'legacy: true' option.");
}
} else {
if (legacy) {
throw new Error("'decoratorsBeforeExport' can't be used with legacy decorators.");
if (version !== undefined) {
throw new Error("You can either use the .legacy or the .version option, not both.");
}
}
if (typeof decoratorsBeforeExport !== "boolean") {
throw new Error("'decoratorsBeforeExport' must be a boolean.");
if (version === undefined) {
version = legacy ? "legacy" : "2018-09";
} else if (version !== "2021-12" && version !== "2018-09" && version !== "legacy") {
throw new Error("Unsupported decorators version: " + version);
}
var {
decoratorsBeforeExport
} = options;
if (decoratorsBeforeExport === undefined) {
if (version === "2021-12") {
decoratorsBeforeExport = false;
} else if (version === "2018-09") {
throw new Error("The decorators plugin, when .version is '2018-09' or not specified," + " requires a 'decoratorsBeforeExport' option, whose value must be a boolean.");
}
} else {
if (version === "legacy") {
throw new Error("'decoratorsBeforeExport' can't be used with legacy decorators.");
}
if (typeof decoratorsBeforeExport !== "boolean") {
throw new Error("'decoratorsBeforeExport' must be a boolean.");
}
}
}
return {
name: "syntax-decorators",
manipulateOptions(opts, parserOpts) {
parserOpts.plugins.push(legacy ? "decorators-legacy" : ["decorators", {
decoratorsBeforeExport
}]);
manipulateOptions({
generatorOpts
}, parserOpts) {
if (version === "legacy") {
parserOpts.plugins.push("decorators-legacy");
} else {
if (version === "2021-12") {
parserOpts.plugins.push(["decorators", {
decoratorsBeforeExport
}], "decoratorAutoAccessors");
generatorOpts.decoratorsBeforeExport = decoratorsBeforeExport;
} else if (version === "2018-09") {
parserOpts.plugins.push(["decorators", {
decoratorsBeforeExport
}]);
generatorOpts.decoratorsBeforeExport = decoratorsBeforeExport;
}
}
}
};
+24 -17
View File
@@ -1,50 +1,56 @@
{
"_args": [
[
"@babel/plugin-syntax-decorators@7.10.4",
"/mnt/Foxconn/Digitalent/Deverloper/liff-push_2series"
"@babel/plugin-syntax-decorators@7.18.6",
"/home/node/nuxt"
]
],
"_from": "@babel/plugin-syntax-decorators@7.10.4",
"_id": "@babel/plugin-syntax-decorators@7.10.4",
"_from": "@babel/plugin-syntax-decorators@7.18.6",
"_id": "@babel/plugin-syntax-decorators@7.18.6",
"_inBundle": false,
"_integrity": "sha512-2NaoC6fAk2VMdhY1eerkfHV+lVYC1u8b+jmRJISqANCJlTxYy19HGdIkkQtix2UtkcPuPu+IlDgrVseZnU03bw==",
"_integrity": "sha512-fqyLgjcxf/1yhyZ6A+yo1u9gJ7eleFQod2lkaUsF9DQ7sbbY3Ligym3L0+I2c0WmqNKDpoD9UTb1AKP3qRMOAQ==",
"_location": "/@babel/plugin-syntax-decorators",
"_phantomChildren": {},
"_requested": {
"type": "version",
"registry": true,
"raw": "@babel/plugin-syntax-decorators@7.10.4",
"raw": "@babel/plugin-syntax-decorators@7.18.6",
"name": "@babel/plugin-syntax-decorators",
"escapedName": "@babel%2fplugin-syntax-decorators",
"scope": "@babel",
"rawSpec": "7.10.4",
"rawSpec": "7.18.6",
"saveSpec": null,
"fetchSpec": "7.10.4"
"fetchSpec": "7.18.6"
},
"_requiredBy": [
"/@babel/plugin-proposal-decorators"
],
"_resolved": "https://registry.npmjs.org/@babel/plugin-syntax-decorators/-/plugin-syntax-decorators-7.10.4.tgz",
"_spec": "7.10.4",
"_where": "/mnt/Foxconn/Digitalent/Deverloper/liff-push_2series",
"_resolved": "https://registry.npmjs.org/@babel/plugin-syntax-decorators/-/plugin-syntax-decorators-7.18.6.tgz",
"_spec": "7.18.6",
"_where": "/home/node/nuxt",
"author": {
"name": "The Babel Team",
"url": "https://babel.dev/team"
},
"bugs": {
"url": "https://github.com/babel/babel/issues"
},
"dependencies": {
"@babel/helper-plugin-utils": "^7.10.4"
"@babel/helper-plugin-utils": "^7.18.6"
},
"description": "Allow parsing of decorators",
"devDependencies": {
"@babel/core": "^7.10.4"
"@babel/core": "^7.18.6"
},
"gitHead": "7fd40d86a0d03ff0e9c3ea16b29689945433d4df",
"homepage": "https://github.com/babel/babel#readme",
"engines": {
"node": ">=6.9.0"
},
"homepage": "https://babel.dev/docs/en/next/babel-plugin-syntax-decorators",
"keywords": [
"babel-plugin"
],
"license": "MIT",
"main": "lib/index.js",
"main": "./lib/index.js",
"name": "@babel/plugin-syntax-decorators",
"peerDependencies": {
"@babel/core": "^7.0.0-0"
@@ -57,5 +63,6 @@
"url": "git+https://github.com/babel/babel.git",
"directory": "packages/babel-plugin-syntax-decorators"
},
"version": "7.10.4"
"type": "commonjs",
"version": "7.18.6"
}