node_modules

This commit is contained in:
saeid
2019-07-15 13:07:31 +04:30
parent d3735c6d30
commit ce1a3ebf9c
35713 changed files with 3639219 additions and 1 deletions
+22
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.
+19
View File
@@ -0,0 +1,19 @@
# @babel/plugin-proposal-decorators
> Compile class and object decorators to ES5
See our website [@babel/plugin-proposal-decorators](https://babeljs.io/docs/en/next/babel-plugin-proposal-decorators.html) for more information.
## Install
Using npm:
```sh
npm install --save-dev @babel/plugin-proposal-decorators
```
or using yarn:
```sh
yarn add @babel/plugin-proposal-decorators --dev
```
+102
View File
@@ -0,0 +1,102 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
function _helperPluginUtils() {
const data = require("@babel/helper-plugin-utils");
_helperPluginUtils = function () {
return data;
};
return data;
}
function _pluginSyntaxDecorators() {
const data = _interopRequireDefault(require("@babel/plugin-syntax-decorators"));
_pluginSyntaxDecorators = function () {
return data;
};
return data;
}
function _helperCreateClassFeaturesPlugin() {
const data = require("@babel/helper-create-class-features-plugin");
_helperCreateClassFeaturesPlugin = function () {
return data;
};
return data;
}
var _transformerLegacy = _interopRequireDefault(require("./transformer-legacy"));
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var _default = (0, _helperPluginUtils().declare)((api, options) => {
api.assertVersion(7);
const {
legacy = false
} = options;
if (typeof legacy !== "boolean") {
throw new Error("'legacy' must be a boolean.");
}
const {
decoratorsBeforeExport
} = options;
if (decoratorsBeforeExport === undefined) {
if (!legacy) {
throw new Error("The 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 (typeof decoratorsBeforeExport !== "boolean") {
throw new Error("'decoratorsBeforeExport' must be a boolean.");
}
}
if (legacy) {
return {
name: "proposal-decorators",
inherits: _pluginSyntaxDecorators().default,
manipulateOptions({
generatorOpts
}) {
generatorOpts.decoratorsBeforeExport = decoratorsBeforeExport;
},
visitor: _transformerLegacy.default
};
}
return (0, _helperCreateClassFeaturesPlugin().createClassFeaturePlugin)({
name: "proposal-decorators",
feature: _helperCreateClassFeaturesPlugin().FEATURES.decorators,
manipulateOptions({
generatorOpts,
parserOpts
}) {
parserOpts.plugins.push(["decorators", {
decoratorsBeforeExport
}]);
generatorOpts.decoratorsBeforeExport = decoratorsBeforeExport;
}
});
});
exports.default = _default;
@@ -0,0 +1,171 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
function _core() {
const data = require("@babel/core");
_core = function () {
return data;
};
return data;
}
const buildClassDecorator = (0, _core().template)(`
DECORATOR(CLASS_REF = INNER) || CLASS_REF;
`);
const buildClassPrototype = (0, _core().template)(`
CLASS_REF.prototype;
`);
const buildGetDescriptor = (0, _core().template)(`
Object.getOwnPropertyDescriptor(TARGET, PROPERTY);
`);
const buildGetObjectInitializer = (0, _core().template)(`
(TEMP = Object.getOwnPropertyDescriptor(TARGET, PROPERTY), (TEMP = TEMP ? TEMP.value : undefined), {
enumerable: true,
configurable: true,
writable: true,
initializer: function(){
return TEMP;
}
})
`);
const WARNING_CALLS = new WeakSet();
function applyEnsureOrdering(path) {
const decorators = (path.isClass() ? [path].concat(path.get("body.body")) : path.get("properties")).reduce((acc, prop) => acc.concat(prop.node.decorators || []), []);
const identDecorators = decorators.filter(decorator => !_core().types.isIdentifier(decorator.expression));
if (identDecorators.length === 0) return;
return _core().types.sequenceExpression(identDecorators.map(decorator => {
const expression = decorator.expression;
const id = decorator.expression = path.scope.generateDeclaredUidIdentifier("dec");
return _core().types.assignmentExpression("=", id, expression);
}).concat([path.node]));
}
function applyClassDecorators(classPath) {
if (!hasClassDecorators(classPath.node)) return;
const decorators = classPath.node.decorators || [];
classPath.node.decorators = null;
const name = classPath.scope.generateDeclaredUidIdentifier("class");
return decorators.map(dec => dec.expression).reverse().reduce(function (acc, decorator) {
return buildClassDecorator({
CLASS_REF: _core().types.cloneNode(name),
DECORATOR: _core().types.cloneNode(decorator),
INNER: acc
}).expression;
}, classPath.node);
}
function hasClassDecorators(classNode) {
return !!(classNode.decorators && classNode.decorators.length);
}
function applyMethodDecorators(path, state) {
if (!hasMethodDecorators(path.node.body.body)) return;
return applyTargetDecorators(path, state, path.node.body.body);
}
function hasMethodDecorators(body) {
return body.some(node => node.decorators && node.decorators.length);
}
function applyObjectDecorators(path, state) {
if (!hasMethodDecorators(path.node.properties)) return;
return applyTargetDecorators(path, state, path.node.properties);
}
function applyTargetDecorators(path, state, decoratedProps) {
const name = path.scope.generateDeclaredUidIdentifier(path.isClass() ? "class" : "obj");
const exprs = decoratedProps.reduce(function (acc, node) {
const decorators = node.decorators || [];
node.decorators = null;
if (decorators.length === 0) return acc;
if (node.computed) {
throw path.buildCodeFrameError("Computed method/property decorators are not yet supported.");
}
const property = _core().types.isLiteral(node.key) ? node.key : _core().types.stringLiteral(node.key.name);
const target = path.isClass() && !node.static ? buildClassPrototype({
CLASS_REF: name
}).expression : name;
if (_core().types.isClassProperty(node, {
static: false
})) {
const descriptor = path.scope.generateDeclaredUidIdentifier("descriptor");
const initializer = node.value ? _core().types.functionExpression(null, [], _core().types.blockStatement([_core().types.returnStatement(node.value)])) : _core().types.nullLiteral();
node.value = _core().types.callExpression(state.addHelper("initializerWarningHelper"), [descriptor, _core().types.thisExpression()]);
WARNING_CALLS.add(node.value);
acc = acc.concat([_core().types.assignmentExpression("=", descriptor, _core().types.callExpression(state.addHelper("applyDecoratedDescriptor"), [_core().types.cloneNode(target), _core().types.cloneNode(property), _core().types.arrayExpression(decorators.map(dec => _core().types.cloneNode(dec.expression))), _core().types.objectExpression([_core().types.objectProperty(_core().types.identifier("configurable"), _core().types.booleanLiteral(true)), _core().types.objectProperty(_core().types.identifier("enumerable"), _core().types.booleanLiteral(true)), _core().types.objectProperty(_core().types.identifier("writable"), _core().types.booleanLiteral(true)), _core().types.objectProperty(_core().types.identifier("initializer"), initializer)])]))]);
} else {
acc = acc.concat(_core().types.callExpression(state.addHelper("applyDecoratedDescriptor"), [_core().types.cloneNode(target), _core().types.cloneNode(property), _core().types.arrayExpression(decorators.map(dec => _core().types.cloneNode(dec.expression))), _core().types.isObjectProperty(node) || _core().types.isClassProperty(node, {
static: true
}) ? buildGetObjectInitializer({
TEMP: path.scope.generateDeclaredUidIdentifier("init"),
TARGET: _core().types.cloneNode(target),
PROPERTY: _core().types.cloneNode(property)
}).expression : buildGetDescriptor({
TARGET: _core().types.cloneNode(target),
PROPERTY: _core().types.cloneNode(property)
}).expression, _core().types.cloneNode(target)]));
}
return acc;
}, []);
return _core().types.sequenceExpression([_core().types.assignmentExpression("=", _core().types.cloneNode(name), path.node), _core().types.sequenceExpression(exprs), _core().types.cloneNode(name)]);
}
function decoratedClassToExpression({
node,
scope
}) {
if (!hasClassDecorators(node) && !hasMethodDecorators(node.body.body)) {
return;
}
const ref = node.id ? _core().types.cloneNode(node.id) : scope.generateUidIdentifier("class");
return _core().types.variableDeclaration("let", [_core().types.variableDeclarator(ref, _core().types.toExpression(node))]);
}
var _default = {
ExportDefaultDeclaration(path) {
const decl = path.get("declaration");
if (!decl.isClassDeclaration()) return;
const replacement = decoratedClassToExpression(decl);
if (replacement) {
path.replaceWithMultiple([replacement, _core().types.exportNamedDeclaration(null, [_core().types.exportSpecifier(_core().types.cloneNode(replacement.declarations[0].id), _core().types.identifier("default"))])]);
}
},
ClassDeclaration(path) {
const replacement = decoratedClassToExpression(path);
if (replacement) {
path.replaceWith(replacement);
}
},
ClassExpression(path, state) {
const decoratedClass = applyEnsureOrdering(path) || applyClassDecorators(path, state) || applyMethodDecorators(path, state);
if (decoratedClass) path.replaceWith(decoratedClass);
},
ObjectExpression(path, state) {
const decoratedObject = applyEnsureOrdering(path) || applyObjectDecorators(path, state);
if (decoratedObject) path.replaceWith(decoratedObject);
},
AssignmentExpression(path, state) {
if (!WARNING_CALLS.has(path.node.right)) return;
path.replaceWith(_core().types.callExpression(state.addHelper("initializerDefineProperty"), [_core().types.cloneNode(path.get("left.object").node), _core().types.stringLiteral(path.get("left.property").node.name), _core().types.cloneNode(path.get("right.arguments")[0].node), _core().types.cloneNode(path.get("right.arguments")[1].node)]));
}
};
exports.default = _default;
+62
View File
@@ -0,0 +1,62 @@
{
"_from": "@babel/plugin-proposal-decorators@^7.1.0",
"_id": "@babel/plugin-proposal-decorators@7.4.0",
"_inBundle": false,
"_integrity": "sha512-d08TLmXeK/XbgCo7ZeZ+JaeZDtDai/2ctapTRsWWkkmy7G/cqz8DQN/HlWG7RR4YmfXxmExsbU3SuCjlM7AtUg==",
"_location": "/@babel/plugin-proposal-decorators",
"_phantomChildren": {},
"_requested": {
"type": "range",
"registry": true,
"raw": "@babel/plugin-proposal-decorators@^7.1.0",
"name": "@babel/plugin-proposal-decorators",
"escapedName": "@babel%2fplugin-proposal-decorators",
"scope": "@babel",
"rawSpec": "^7.1.0",
"saveSpec": null,
"fetchSpec": "^7.1.0"
},
"_requiredBy": [
"/@vue/babel-preset-app"
],
"_resolved": "https://registry.npmjs.org/@babel/plugin-proposal-decorators/-/plugin-proposal-decorators-7.4.0.tgz",
"_shasum": "8e1bfd83efa54a5f662033afcc2b8e701f4bb3a9",
"_spec": "@babel/plugin-proposal-decorators@^7.1.0",
"_where": "D:\\Atom\\Git\\Laravel_CSSd\\node_modules\\@vue\\babel-preset-app",
"author": {
"name": "Logan Smyth",
"email": "loganfsmyth@gmail.com"
},
"bundleDependencies": false,
"dependencies": {
"@babel/helper-create-class-features-plugin": "^7.4.0",
"@babel/helper-plugin-utils": "^7.0.0",
"@babel/plugin-syntax-decorators": "^7.2.0"
},
"deprecated": false,
"description": "Compile class and object decorators to ES5",
"devDependencies": {
"@babel/core": "^7.4.0",
"@babel/helper-plugin-test-runner": "^7.0.0"
},
"gitHead": "f1328fb913b5a93d54dfc6e3728b1f56c8f4a804",
"keywords": [
"babel",
"babel-plugin",
"decorators"
],
"license": "MIT",
"main": "lib/index.js",
"name": "@babel/plugin-proposal-decorators",
"peerDependencies": {
"@babel/core": "^7.0.0-0"
},
"publishConfig": {
"access": "public"
},
"repository": {
"type": "git",
"url": "https://github.com/babel/babel/tree/master/packages/babel-plugin-proposal-decorators"
},
"version": "7.4.0"
}