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

View File

@@ -0,0 +1,19 @@
# @babel/plugin-transform-react-jsx-source
> Add a __source prop to all JSX Elements
See our website [@babel/plugin-transform-react-jsx-source](https://babeljs.io/docs/en/next/babel-plugin-transform-react-jsx-source.html) for more information.
## Install
Using npm:
```sh
npm install --save-dev @babel/plugin-transform-react-jsx-source
```
or using yarn:
```sh
yarn add @babel/plugin-transform-react-jsx-source --dev
```

View File

@@ -0,0 +1,84 @@
"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 _core() {
const data = require("@babel/core");
_core = function () {
return data;
};
return data;
}
const TRACE_ID = "__source";
const FILE_NAME_VAR = "_jsxFileName";
var _default = (0, _helperPluginUtils().declare)(api => {
api.assertVersion(7);
function makeTrace(fileNameIdentifier, lineNumber) {
const fileLineLiteral = lineNumber != null ? _core().types.numericLiteral(lineNumber) : _core().types.nullLiteral();
const fileNameProperty = _core().types.objectProperty(_core().types.identifier("fileName"), fileNameIdentifier);
const lineNumberProperty = _core().types.objectProperty(_core().types.identifier("lineNumber"), fileLineLiteral);
return _core().types.objectExpression([fileNameProperty, lineNumberProperty]);
}
const visitor = {
JSXOpeningElement(path, state) {
const id = _core().types.jsxIdentifier(TRACE_ID);
const location = path.container.openingElement.loc;
if (!location) {
return;
}
const attributes = path.container.openingElement.attributes;
for (let i = 0; i < attributes.length; i++) {
const name = attributes[i].name;
if (name && name.name === TRACE_ID) {
return;
}
}
if (!state.fileNameIdentifier) {
const fileName = state.filename || "";
const fileNameIdentifier = path.scope.generateUidIdentifier(FILE_NAME_VAR);
path.hub.file.scope.push({
id: fileNameIdentifier,
init: _core().types.stringLiteral(fileName)
});
state.fileNameIdentifier = fileNameIdentifier;
}
const trace = makeTrace(state.fileNameIdentifier, location.start.line);
attributes.push(_core().types.jsxAttribute(id, _core().types.jsxExpressionContainer(trace)));
}
};
return {
visitor
};
});
exports.default = _default;

View File

@@ -0,0 +1,92 @@
{
"_args": [
[
"@babel/plugin-transform-react-jsx-source@^7.0.0-beta",
"/home/bernhard/freifunk-app/node_modules/metro"
]
],
"_from": "@babel/plugin-transform-react-jsx-source@>=7.0.0-beta <8.0.0",
"_id": "@babel/plugin-transform-react-jsx-source@7.0.0-beta.54",
"_inCache": true,
"_installable": true,
"_location": "/@babel/plugin-transform-react-jsx-source",
"_npmOperationalInternal": {
"host": "s3://npm-registry-packages",
"tmp": "tmp/plugin-transform-react-jsx-source_7.0.0-beta.54_1531764019135_0.6524243166274342"
},
"_npmUser": {
"email": "hi@henryzoo.com",
"name": "hzoo"
},
"_phantomChildren": {},
"_requested": {
"name": "@babel/plugin-transform-react-jsx-source",
"raw": "@babel/plugin-transform-react-jsx-source@^7.0.0-beta",
"rawSpec": "^7.0.0-beta",
"scope": "@babel",
"spec": ">=7.0.0-beta <8.0.0",
"type": "range"
},
"_requiredBy": [
"/metro"
],
"_resolved": "https://registry.npmjs.org/@babel/plugin-transform-react-jsx-source/-/plugin-transform-react-jsx-source-7.0.0-beta.54.tgz",
"_shasum": "1d6eee65ff772fb002b995e538c0c9615ed6a3f7",
"_shrinkwrap": null,
"_spec": "@babel/plugin-transform-react-jsx-source@^7.0.0-beta",
"_where": "/home/bernhard/freifunk-app/node_modules/metro",
"dependencies": {
"@babel/helper-plugin-utils": "7.0.0-beta.54",
"@babel/plugin-syntax-jsx": "7.0.0-beta.54"
},
"description": "Add a __source prop to all JSX Elements",
"devDependencies": {
"@babel/core": "7.0.0-beta.54",
"@babel/helper-plugin-test-runner": "7.0.0-beta.54"
},
"directories": {},
"dist": {
"fileCount": 5,
"shasum": "1d6eee65ff772fb002b995e538c0c9615ed6a3f7",
"tarball": "https://registry.npmjs.org/@babel/plugin-transform-react-jsx-source/-/plugin-transform-react-jsx-source-7.0.0-beta.54.tgz",
"unpackedSize": 3228
},
"keywords": [
"babel-plugin"
],
"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/plugin-transform-react-jsx-source",
"optionalDependencies": {},
"peerDependencies": {
"@babel/core": ">=7.0.0-beta.50 <7.0.0-rc.0"
},
"readme": "ERROR: No README data found!",
"repository": {
"type": "git",
"url": "https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-react-jsx-source"
},
"version": "7.0.0-beta.54"
}