initial commit taken from gitlab.lrz.de

This commit is contained in:
privatereese
2018-08-24 18:09:42 +02:00
parent ae54ed4c48
commit fc05486403
28494 changed files with 2159823 additions and 0 deletions

19
node_modules/@babel/helper-builder-react-jsx/README.md generated vendored Normal file
View File

@@ -0,0 +1,19 @@
# @babel/helper-builder-react-jsx
> Helper function to build react jsx
See our website [@babel/helper-builder-react-jsx](https://babeljs.io/docs/en/next/babel-helper-builder-react-jsx.html) for more information.
## Install
Using npm:
```sh
npm install --save-dev @babel/helper-builder-react-jsx
```
or using yarn:
```sh
yarn add @babel/helper-builder-react-jsx --dev
```

View File

@@ -0,0 +1,225 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = _default;
function _esutils() {
const data = _interopRequireDefault(require("esutils"));
_esutils = function () {
return data;
};
return data;
}
function t() {
const data = _interopRequireWildcard(require("@babel/types"));
t = function () {
return data;
};
return data;
}
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } }
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function _default(opts) {
const visitor = {};
visitor.JSXNamespacedName = function (path) {
if (opts.throwIfNamespace) {
throw path.buildCodeFrameError(`Namespace tags are not supported by default. React's JSX doesn't support namespace tags. \
You can turn on the 'throwIfNamespace' flag to bypass this warning.`);
}
};
visitor.JSXElement = {
exit(path, file) {
const callExpr = buildElementCall(path, file);
if (callExpr) {
path.replaceWith(t().inherits(callExpr, path.node));
}
}
};
visitor.JSXFragment = {
exit(path, file) {
if (opts.compat) {
throw path.buildCodeFrameError("Fragment tags are only supported in React 16 and up.");
}
const callExpr = buildFragmentCall(path, file);
if (callExpr) {
path.replaceWith(t().inherits(callExpr, path.node));
}
}
};
return visitor;
function convertJSXIdentifier(node, parent) {
if (t().isJSXIdentifier(node)) {
if (node.name === "this" && t().isReferenced(node, parent)) {
return t().thisExpression();
} else if (_esutils().default.keyword.isIdentifierNameES6(node.name)) {
node.type = "Identifier";
} else {
return t().stringLiteral(node.name);
}
} else if (t().isJSXMemberExpression(node)) {
return t().memberExpression(convertJSXIdentifier(node.object, node), convertJSXIdentifier(node.property, node));
} else if (t().isJSXNamespacedName(node)) {
return t().stringLiteral(`${node.namespace.name}:${node.name.name}`);
}
return node;
}
function convertAttributeValue(node) {
if (t().isJSXExpressionContainer(node)) {
return node.expression;
} else {
return node;
}
}
function convertAttribute(node) {
const value = convertAttributeValue(node.value || t().booleanLiteral(true));
if (t().isStringLiteral(value) && !t().isJSXExpressionContainer(node.value)) {
value.value = value.value.replace(/\n\s+/g, " ");
if (value.extra && value.extra.raw) {
delete value.extra.raw;
}
}
if (t().isJSXNamespacedName(node.name)) {
node.name = t().stringLiteral(node.name.namespace.name + ":" + node.name.name.name);
} else if (_esutils().default.keyword.isIdentifierNameES6(node.name.name)) {
node.name.type = "Identifier";
} else {
node.name = t().stringLiteral(node.name.name);
}
return t().inherits(t().objectProperty(node.name, value), node);
}
function buildElementCall(path, file) {
if (opts.filter && !opts.filter(path.node, file)) return;
const openingPath = path.get("openingElement");
openingPath.parent.children = t().react.buildChildren(openingPath.parent);
const tagExpr = convertJSXIdentifier(openingPath.node.name, openingPath.node);
const args = [];
let tagName;
if (t().isIdentifier(tagExpr)) {
tagName = tagExpr.name;
} else if (t().isLiteral(tagExpr)) {
tagName = tagExpr.value;
}
const state = {
tagExpr: tagExpr,
tagName: tagName,
args: args
};
if (opts.pre) {
opts.pre(state, file);
}
let attribs = openingPath.node.attributes;
if (attribs.length) {
attribs = buildOpeningElementAttributes(attribs, file);
} else {
attribs = t().nullLiteral();
}
args.push(attribs, ...path.node.children);
if (opts.post) {
opts.post(state, file);
}
return state.call || t().callExpression(state.callee, args);
}
function pushProps(_props, objs) {
if (!_props.length) return _props;
objs.push(t().objectExpression(_props));
return [];
}
function buildOpeningElementAttributes(attribs, file) {
let _props = [];
const objs = [];
const useBuiltIns = file.opts.useBuiltIns || false;
if (typeof useBuiltIns !== "boolean") {
throw new Error("transform-react-jsx currently only accepts a boolean option for " + "useBuiltIns (defaults to false)");
}
while (attribs.length) {
const prop = attribs.shift();
if (t().isJSXSpreadAttribute(prop)) {
_props = pushProps(_props, objs);
objs.push(prop.argument);
} else {
_props.push(convertAttribute(prop));
}
}
pushProps(_props, objs);
if (objs.length === 1) {
attribs = objs[0];
} else {
if (!t().isObjectExpression(objs[0])) {
objs.unshift(t().objectExpression([]));
}
const helper = useBuiltIns ? t().memberExpression(t().identifier("Object"), t().identifier("assign")) : file.addHelper("extends");
attribs = t().callExpression(helper, objs);
}
return attribs;
}
function buildFragmentCall(path, file) {
if (opts.filter && !opts.filter(path.node, file)) return;
const openingPath = path.get("openingElement");
openingPath.parent.children = t().react.buildChildren(openingPath.parent);
const args = [];
const tagName = null;
const tagExpr = file.get("jsxFragIdentifier")();
const state = {
tagExpr: tagExpr,
tagName: tagName,
args: args
};
if (opts.pre) {
opts.pre(state, file);
}
args.push(t().nullLiteral(), ...path.node.children);
if (opts.post) {
opts.post(state, file);
}
file.set("usedFragment", true);
return state.call || t().callExpression(state.callee, args);
}
}

View File

@@ -0,0 +1,83 @@
{
"_args": [
[
"@babel/helper-builder-react-jsx@7.0.0-beta.54",
"/home/bernhard/freifunk-app/node_modules/@babel/plugin-transform-react-jsx"
]
],
"_from": "@babel/helper-builder-react-jsx@7.0.0-beta.54",
"_id": "@babel/helper-builder-react-jsx@7.0.0-beta.54",
"_inCache": true,
"_installable": true,
"_location": "/@babel/helper-builder-react-jsx",
"_npmOperationalInternal": {
"host": "s3://npm-registry-packages",
"tmp": "tmp/helper-builder-react-jsx_7.0.0-beta.54_1531763991678_0.26372264606217244"
},
"_npmUser": {
"email": "hi@henryzoo.com",
"name": "hzoo"
},
"_phantomChildren": {},
"_requested": {
"name": "@babel/helper-builder-react-jsx",
"raw": "@babel/helper-builder-react-jsx@7.0.0-beta.54",
"rawSpec": "7.0.0-beta.54",
"scope": "@babel",
"spec": "7.0.0-beta.54",
"type": "version"
},
"_requiredBy": [
"/@babel/plugin-transform-react-jsx"
],
"_resolved": "https://registry.npmjs.org/@babel/helper-builder-react-jsx/-/helper-builder-react-jsx-7.0.0-beta.54.tgz",
"_shasum": "cad582ab1cb831f4dc34e9bcb4c4fa2f1fb6c986",
"_shrinkwrap": null,
"_spec": "@babel/helper-builder-react-jsx@7.0.0-beta.54",
"_where": "/home/bernhard/freifunk-app/node_modules/@babel/plugin-transform-react-jsx",
"dependencies": {
"@babel/types": "7.0.0-beta.54",
"esutils": "^2.0.0"
},
"description": "Helper function to build react jsx",
"devDependencies": {},
"directories": {},
"dist": {
"fileCount": 5,
"shasum": "cad582ab1cb831f4dc34e9bcb4c4fa2f1fb6c986",
"tarball": "https://registry.npmjs.org/@babel/helper-builder-react-jsx/-/helper-builder-react-jsx-7.0.0-beta.54.tgz",
"unpackedSize": 7105
},
"license": "MIT",
"main": "lib/index.js",
"maintainers": [
{
"name": "danez",
"email": "daniel@tschinder.de"
},
{
"name": "existentialism",
"email": "bng412@gmail.com"
},
{
"name": "hzoo",
"email": "hi@henryzoo.com"
},
{
"name": "loganfsmyth",
"email": "loganfsmyth@gmail.com"
},
{
"name": "xtuc",
"email": "contact@xtuc.fr"
}
],
"name": "@babel/helper-builder-react-jsx",
"optionalDependencies": {},
"readme": "ERROR: No README data found!",
"repository": {
"type": "git",
"url": "https://github.com/babel/babel/tree/master/packages/babel-helper-builder-react-jsx"
},
"version": "7.0.0-beta.54"
}