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

4
node_modules/babel-plugin-react-transform/.babelrc generated vendored Normal file
View File

@@ -0,0 +1,4 @@
{
"presets": ["es2015"],
"plugins": []
}

20
node_modules/babel-plugin-react-transform/.eslintrc generated vendored Normal file
View File

@@ -0,0 +1,20 @@
{
"parser": "babel-eslint",
"plugins": [
"react"
],
"extends": "eslint:recommended",
"rules": {
"strict": 0,
"curly": [1, "multi-line"],
"camelcase": 0,
"comma-dangle": 1,
"no-use-before-define": [1, "nofunc"],
"no-underscore-dangle": 0,
"no-unused-vars": 0,
"semi": 1
},
env: {
"node": true
}
}

3
node_modules/babel-plugin-react-transform/.npmignore generated vendored Normal file
View File

@@ -0,0 +1,3 @@
src
*.log
DS_Store

View File

@@ -0,0 +1,9 @@
language: node_js
node_js:
- "5"
- "4.2"
- "iojs-2"
- "0.12"
- "0.10"
script:
- npm test

View File

@@ -0,0 +1,13 @@
# Contributor Code of Conduct
As contributors and maintainers of this project, we pledge to respect all people who contribute through reporting issues, posting feature requests, updating documentation, submitting pull requests or patches, and other activities.
We are committed to making participation in this project a harassment-free experience for everyone, regardless of level of experience, gender, gender identity and expression, sexual orientation, disability, personal appearance, body size, race, age, or religion.
Examples of unacceptable behavior by participants include the use of sexual language or imagery, derogatory comments or personal attacks, trolling, public or private harassment, insults, or other unprofessional conduct.
Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct. Project maintainers who do not follow the Code of Conduct may be removed from the project team.
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by opening an issue or contacting one or more of the project maintainers.
This Code of Conduct is adapted from the [Contributor Covenant](http://contributor-covenant.org), version 1.0.0, available at [http://contributor-covenant.org/version/1/0/0/](http://contributor-covenant.org/version/1/0/0/)

21
node_modules/babel-plugin-react-transform/LICENSE generated vendored Normal file
View File

@@ -0,0 +1,21 @@
The MIT License (MIT)
Copyright (c) 2016 Dan Abramov
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
node_modules/babel-plugin-react-transform/PATRONS.md generated vendored Normal file
View File

@@ -0,0 +1,19 @@
# Patrons
The work on React Transform, [React Hot Loader](https://github.com/gaearon/react-hot-loader), [Redux](https://github.com/rackt/redux), and related projects was [funded by the community](https://www.patreon.com/reactdx).
Meet some of the outstanding companies and individuals that made it possible:
* [Webflow](https://github.com/webflow)
* [Ximedes](https://www.ximedes.com/)
* [Herman J. Radtke III](http://hermanradtke.com)
* [Ken Wheeler](http://kenwheeler.github.io/)
* [Chung Yen Li](https://www.facebook.com/prototocal.lee)
* [Sunil Pai](https://twitter.com/threepointone)
* [Charlie Cheever](https://twitter.com/ccheever)
* [Eugene G](https://twitter.com/e1g)
* [Matt Apperson](https://twitter.com/mattapperson)
* [Jed Watson](https://twitter.com/jedwatson)
* [Sasha Aickin](https://twitter.com/xander76)
* [Stefan Tennigkeit](https://twitter.com/whobubble)
* [Sam Vincent](https://twitter.com/samvincent)
* Olegzandr Denman

240
node_modules/babel-plugin-react-transform/README.md generated vendored Normal file
View File

@@ -0,0 +1,240 @@
>## This Project Is Deprecated
>React Hot Loader 3 is [on the horizon](https://github.com/gaearon/react-hot-loader/pull/240), and you can try it today ([boilerplate branch](https://github.com/gaearon/react-hot-boilerplate/pull/61), [upgrade example](https://github.com/gaearon/redux-devtools/commit/64f58b7010a1b2a71ad16716eb37ac1031f93915)). It fixes some [long-standing issues](https://twitter.com/dan_abramov/status/722040946075045888) with both React Hot Loader and React Transform, and is intended as a replacement for both. The docs are not there yet, but they will be added before the final release. For now, [this commit](https://github.com/gaearon/redux-devtools/commit/64f58b7010a1b2a71ad16716eb37ac1031f93915) is a good reference.
# babel-plugin-react-transform
[![react-transform channel on discord](https://img.shields.io/badge/discord-react--transform%40reactiflux-61DAFB.svg?style=flat-square)](http://www.reactiflux.com)
:rocket: **Now with [Babel 6](https://github.com/babel/babel) support** (thank you [@thejameskyle](https://github.com/thejameskyle)!)
This plugin wraps React components with arbitrary transforms. In other words, **it allows you to instrument React components** in any way—limited only by your imagination.
## 🚧🚧🚧🚧🚧
This is **highly experimental tech**. If youre enthusiastic about hot reloading, by all means, give it a try, but dont bet your project on it. Either of the technologies it relies upon may change drastically or get deprecated any day. Youve been warned 😉 .
**This technology exists to prototype next-generation React developer experience**. Please dont use it blindly if you dont know the underlying technologies well. Otherwise you are likely to get disillusioned with JavaScript tooling.
**No effort went into making this user-friendly yet. The goal is to eventually kill this technology** in favor of less hacky technologies baked into React. These projects are not long term.
## Table of Contents
* [Ecosystem](#ecosystem)
* [Demo Project](#demo-project)
* [Installation](#installation)
* [Writing Transforms](#writing-transforms)
## Ecosystem
For a reference implementation, see [**react-transform-boilerplate**](https://github.com/gaearon/react-transform-boilerplate).
For a starter kit to help write your own transforms, see [**react-transform-noop**](https://github.com/pwmckenna/react-transform-noop).
#### Transforms
* [**react-transform-hmr**](https://github.com/gaearon/react-transform-hmr) - enables hot reloading using HMR API
* [**react-transform-catch-errors**](https://github.com/gaearon/react-transform-catch-errors) - catches errors inside `render()`
* [**react-transform-debug-inspector**](https://github.com/alexkuz/react-transform-debug-inspector) - renders an inline prop inspector
* [**react-transform-render-visualizer**](https://github.com/spredfast/react-transform-render-visualizer) - highlight components when updated
* [**react-transform-style**](https://github.com/pwmckenna/react-transform-style) - support `style` and `className` styling for all components
* [**react-transform-log-render**](https://github.com/rkit/react-transform-log-render) - log component renders with passed props and state
* [**react-transform-count-renders**](https://github.com/stipsan/react-transform-count-renders) - counts how many times your components render
Feeling inspired? Learn [how to write transforms](#writing-transforms) and send a PR!
## Demo Project
Check out **[react-transform-boilerplate](https://github.com/gaearon/react-transform-boilerplate)** for a demo showing a combination of transforms.
![](https://cloud.githubusercontent.com/assets/1539088/11611771/ae1a6bd8-9bac-11e5-9206-42447e0fe064.gif)
## Installation
This plugin is designed to be used with the Babel 6 ecosystem. These instructions assume you have a working project set up. If you do not have Babel set up in your project, [learn how to integrate](https://babeljs.io/docs/setup/) it with your toolkit before installing this plugin.
##### Using NPM
Install plugin and save in `devDependencies`:
```bash
npm install --save-dev babel-plugin-react-transform
```
Install some transforms:
```bash
npm install --save-dev react-transform-hmr
npm install --save-dev react-transform-catch-errors
```
##### Configuration
Add react-transform to the list of plugins in your babel configuration (usually `.babelrc`):
```js
{
"presets": ["react", "es2015"],
"env": {
// this plugin will be included only in development mode, e.g.
// if NODE_ENV (or BABEL_ENV) environment variable is not set
// or is equal to "development"
"development": {
"plugins": [
// must be an array with options object as second item
["react-transform", {
// must be an array of objects
"transforms": [{
// can be an NPM module name or a local path
"transform": "react-transform-hmr",
// see transform docs for "imports" and "locals" dependencies
"imports": ["react"],
"locals": ["module"]
}, {
// you can have many transforms, not just one
"transform": "react-transform-catch-errors",
"imports": ["react", "redbox-react"]
}, {
// can be an NPM module name or a local path
"transform": "./src/my-custom-transform"
}]
// by default we only look for `React.createClass` (and ES6 classes)
// but you can tell the plugin to look for different component factories:
// factoryMethods: ["React.createClass", "createClass"]
}]
]
}
}
}
```
As you can see, each transform, apart from the `transform` field where you write it name, also has `imports` and `locals` fields. You should consult the docs of each individual transform to learn which `imports` and `locals` it might need, and how it uses them. You probably already guessed that this is just a way to inject local variables (like `module`) or dependencies (like `react`) into the transforms that need them.
Note that when using `React.createClass()` and allowing `babel` to extract the `displayName` property you must ensure that [babel-plugin-react-display-name](https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-react-display-name) is included before `react-transform`. See [this github issue](https://github.com/gaearon/babel-plugin-react-transform/issues/19) for more details.
You may optionally specify an array of strings called `factoryMethods` if you want the plugin to look for components created with a factory method other than `React.createClass`. Note that you dont have to do anything special to look for ES6 components—`factoryMethods` is only relevant if you use factory methods akin to `React.createClass`.
## Writing Transforms
Its not hard to write a custom transform! First, make sure you call your NPM package `react-transform-*` so we have uniform naming across the transforms. The only thing you should export from your transform module is a function.
```js
export default function myTransform() {
// ¯\_(ツ)_/¯
}
```
This function should *return another function*:
```js
export default function myTransform() {
return function wrap(ReactClass) {
// ¯\_(ツ)_/¯
return ReactClass;
}
}
```
As you can see, youll receive `ReactClass` as a parameter. Its up to you to do something with it: monkeypatch its methods, create another component with the same prototype and a few different methods, wrap it into a higher-order component, etc. Be creative!
```js
export default function logAllUpdates() {
return function wrap(ReactClass) {
const displayName = // ¯\_(ツ)_/¯
const originalComponentDidUpdate = ReactClass.prototype.componentDidUpdate;
ReactClass.prototype.componentDidUpdate = function componentDidUpdate() {
console.info(`${displayName} updated:`, this.props, this.state);
if (originalComponentDidUpdate) {
originalComponentDidUpdate.apply(this, arguments);
}
}
return ReactClass;
}
}
```
Oh, how do I get `displayName`?
Actually, we give your transformation function a single argument called `options`. Yes, `options`:
```js
export default function logAllUpdates(options) {
```
It contains some useful data. For example, your `options` could look like this:
```js
{
// the file being processed
filename: '/Users/dan/p/my-projects/src/App.js',
// remember that "imports" .babelrc option?
imports: [React],
// remember that "locals" .babelrc option?
locals: [module],
// all components declared in the current file
components: {
$_MyComponent: {
// with their displayName when available
displayName: 'MyComponent'
},
$_SomeOtherComponent: {
displayName: 'SomeOtherComponent',
// and telling whether they are defined inside a function
isInFunction: true
}
}
}
```
Of course, you might not want to use *all* options, but isnt it nice to know that you have access to them in the top scope—which means before the component definitions actually run? (Hint: a hot reloading plugin might use this to decide whether a module is worthy of reloading, even if it contains an error and no React components have yet been wrapped because of it.)
So, to retrieve the `displayName` (or `isInFunction`, when available), use the `options` parameter *and* the second `uniqueId` parameter given to the inner function after `ReactClass`:
```js
export default function logAllUpdates(options) {
return function wrap(ReactClass, uniqueId) {
const displayName = options.components[uniqueId].displayName || '<Unknown>';
```
This is it!
Sure, its a slightly contrived example, as you can grab `ReactClass.displayName` just fine, but it illustrates a point: you have information about all of the components inside a file before that file executes, which is *very* handy for some transformations.
Here is the complete code for this example transformation function:
```js
export default function logAllUpdates(options) {
return function wrap(ReactClass, uniqueId) {
const displayName = options.components[uniqueId].displayName || '<Unknown>';
const originalComponentDidUpdate = ReactClass.prototype.componentDidUpdate;
ReactClass.prototype.componentDidUpdate = function componentDidUpdate() {
console.info(`${displayName} updated:`, this.props, this.state);
if (originalComponentDidUpdate) {
originalComponentDidUpdate.apply(this, arguments);
}
}
return ReactClass;
}
}
```
Now go ahead and write your own! Dont forget to tag it with `react-transform` [keyword on npm](https://www.npmjs.com/browse/keyword/react-transform).
## Patrons
The work on React Transform, [React Hot Loader](https://github.com/gaearon/react-hot-loader), [Redux](https://github.com/rackt/redux), and related projects was [funded by the community](https://www.patreon.com/reactdx). Meet some of the outstanding companies that made it possible:
* [Webflow](https://github.com/webflow)
* [Ximedes](https://www.ximedes.com/)
[See the full list of React Transform patrons.](PATRONS.md)
## License
MIT

345
node_modules/babel-plugin-react-transform/lib/index.js generated vendored Normal file
View File

@@ -0,0 +1,345 @@
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; };
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
exports.default = function (_ref) {
var t = _ref.types;
var template = _ref.template;
function matchesPatterns(path, patterns) {
return !!(0, _find2.default)(patterns, function (pattern) {
return t.isIdentifier(path.node, { name: pattern }) || path.matchesPattern(pattern);
});
}
function isReactLikeClass(node) {
return !!(0, _find2.default)(node.body.body, function (classMember) {
return t.isClassMethod(classMember) && t.isIdentifier(classMember.key, { name: 'render' });
});
}
function isReactLikeComponentObject(node) {
return t.isObjectExpression(node) && !!(0, _find2.default)(node.properties, function (objectMember) {
return (t.isObjectProperty(objectMember) || t.isObjectMethod(objectMember)) && (t.isIdentifier(objectMember.key, { name: 'render' }) || t.isStringLiteral(objectMember.key, { value: 'render' }));
});
}
// `foo({ displayName: 'NAME' });` => 'NAME'
function getDisplayName(node) {
var property = (0, _find2.default)(node.arguments[0].properties, function (node) {
return node.key.name === 'displayName';
});
return property && property.value.value;
}
function hasParentFunction(path) {
return !!path.findParent(function (parentPath) {
return parentPath.isFunction();
});
}
// wrapperFunction("componentId")(node)
function wrapComponent(node, componentId, wrapperFunctionId) {
return t.callExpression(t.callExpression(wrapperFunctionId, [t.stringLiteral(componentId)]), [node]);
}
// `{ name: foo }` => Node { type: "ObjectExpression", properties: [...] }
function toObjectExpression(object) {
var properties = Object.keys(object).map(function (key) {
return t.objectProperty(t.identifier(key), object[key]);
});
return t.objectExpression(properties);
}
var wrapperFunctionTemplate = template('\n function WRAPPER_FUNCTION_ID(ID_PARAM) {\n return function(COMPONENT_PARAM) {\n return EXPRESSION;\n };\n }\n ');
var VISITED_KEY = 'react-transform-' + Date.now();
var componentVisitor = {
Class: function Class(path) {
if (path.node[VISITED_KEY] || !matchesPatterns(path.get('superClass'), this.superClasses) || !isReactLikeClass(path.node)) {
return;
}
path.node[VISITED_KEY] = true;
var componentName = path.node.id && path.node.id.name || null;
var componentId = componentName || path.scope.generateUid('component');
var isInFunction = hasParentFunction(path);
this.components.push({
id: componentId,
name: componentName,
isInFunction: isInFunction
});
// Can't wrap ClassDeclarations
var isStatement = t.isStatement(path.node);
var expression = t.toExpression(path.node);
// wrapperFunction("componentId")(node)
var wrapped = wrapComponent(expression, componentId, this.wrapperFunctionId);
var constId = void 0;
if (isStatement) {
// wrapperFunction("componentId")(class Foo ...) => const Foo = wrapperFunction("componentId")(class Foo ...)
constId = t.identifier(componentName || componentId);
wrapped = t.variableDeclaration('const', [t.variableDeclarator(constId, wrapped)]);
}
if (t.isExportDefaultDeclaration(path.parent)) {
path.parentPath.insertBefore(wrapped);
path.parent.declaration = constId;
} else {
path.replaceWith(wrapped);
}
},
CallExpression: function CallExpression(path) {
if (path.node[VISITED_KEY] || !matchesPatterns(path.get('callee'), this.factoryMethods) || !isReactLikeComponentObject(path.node.arguments[0])) {
return;
}
path.node[VISITED_KEY] = true;
// `foo({ displayName: 'NAME' });` => 'NAME'
var componentName = getDisplayName(path.node);
var componentId = componentName || path.scope.generateUid('component');
var isInFunction = hasParentFunction(path);
this.components.push({
id: componentId,
name: componentName,
isInFunction: isInFunction
});
path.replaceWith(wrapComponent(path.node, componentId, this.wrapperFunctionId));
}
};
var ReactTransformBuilder = function () {
function ReactTransformBuilder(file, options) {
_classCallCheck(this, ReactTransformBuilder);
this.file = file;
this.program = file.path;
this.options = this.normalizeOptions(options);
// @todo: clean this shit up
this.configuredTransformsIds = [];
}
_createClass(ReactTransformBuilder, [{
key: 'normalizeOptions',
value: function normalizeOptions(options) {
return {
factoryMethods: options.factoryMethods || ['React.createClass'],
superClasses: options.superClasses || ['React.Component', 'React.PureComponent', 'Component', 'PureComponent'],
transforms: options.transforms.map(function (opts) {
return {
transform: opts.transform,
locals: opts.locals || [],
imports: opts.imports || []
};
})
};
}
}, {
key: 'build',
value: function build() {
var componentsDeclarationId = this.file.scope.generateUidIdentifier('components');
var wrapperFunctionId = this.file.scope.generateUidIdentifier('wrapComponent');
var components = this.collectAndWrapComponents(wrapperFunctionId);
if (!components.length) {
return;
}
var componentsDeclaration = this.initComponentsDeclaration(componentsDeclarationId, components);
var configuredTransforms = this.initTransformers(componentsDeclarationId);
var wrapperFunction = this.initWrapperFunction(wrapperFunctionId);
var body = this.program.node.body;
body.unshift(wrapperFunction);
configuredTransforms.reverse().forEach(function (node) {
return body.unshift(node);
});
body.unshift(componentsDeclaration);
}
/**
* const Foo = _wrapComponent('Foo')(class Foo extends React.Component {});
* ...
* const Bar = _wrapComponent('Bar')(React.createClass({
* displayName: 'Bar'
* }));
*/
}, {
key: 'collectAndWrapComponents',
value: function collectAndWrapComponents(wrapperFunctionId) {
var components = [];
this.file.path.traverse(componentVisitor, {
wrapperFunctionId: wrapperFunctionId,
components: components,
factoryMethods: this.options.factoryMethods,
superClasses: this.options.superClasses,
currentlyInFunction: false
});
return components;
}
/**
* const _components = {
* Foo: {
* displayName: "Foo"
* }
* };
*/
}, {
key: 'initComponentsDeclaration',
value: function initComponentsDeclaration(componentsDeclarationId, components) {
var uniqueId = 0;
var props = components.map(function (component) {
var componentId = component.id;
var componentProps = [];
if (component.name) {
componentProps.push(t.objectProperty(t.identifier('displayName'), t.stringLiteral(component.name)));
}
if (component.isInFunction) {
componentProps.push(t.objectProperty(t.identifier('isInFunction'), t.booleanLiteral(true)));
}
var objectKey = void 0;
if (t.isValidIdentifier(componentId)) {
objectKey = t.identifier(componentId);
} else {
objectKey = t.stringLiteral(componentId);
}
return t.objectProperty(objectKey, t.objectExpression(componentProps));
});
return t.variableDeclaration('const', [t.variableDeclarator(componentsDeclarationId, t.objectExpression(props))]);
}
/**
* import _transformLib from "transform-lib";
* ...
* const _transformLib2 = _transformLib({
* filename: "filename",
* components: _components,
* locals: [],
* imports: []
* });
*/
}, {
key: 'initTransformers',
value: function initTransformers(componentsDeclarationId) {
var _this = this;
return this.options.transforms.map(function (transform) {
var transformName = transform.transform;
var transformImportId = _this.file.addImport(transformName, 'default', transformName);
var transformLocals = transform.locals.map(function (local) {
return t.identifier(local);
});
var transformImports = transform.imports.map(function (importName) {
return _this.file.addImport(importName, 'default', importName);
});
var configuredTransformId = _this.file.scope.generateUidIdentifier(transformName);
var configuredTransform = t.variableDeclaration('const', [t.variableDeclarator(configuredTransformId, t.callExpression(transformImportId, [toObjectExpression({
filename: t.stringLiteral(_this.file.opts.filename),
components: componentsDeclarationId,
locals: t.arrayExpression(transformLocals),
imports: t.arrayExpression(transformImports)
})]))]);
_this.configuredTransformsIds.push(configuredTransformId);
return configuredTransform;
});
}
/**
* function _wrapComponent(id) {
* return function (Component) {
* return _transformLib2(Component, id);
* };
* }
*/
}, {
key: 'initWrapperFunction',
value: function initWrapperFunction(wrapperFunctionId) {
var idParam = t.identifier('id');
var componentParam = t.identifier('Component');
var expression = this.configuredTransformsIds.reverse().reduce(function (memo, transformId) {
return t.callExpression(transformId, [memo, idParam]);
}, componentParam);
return wrapperFunctionTemplate({
WRAPPER_FUNCTION_ID: wrapperFunctionId,
ID_PARAM: idParam,
COMPONENT_PARAM: componentParam,
EXPRESSION: expression
});
}
}], [{
key: 'validateOptions',
value: function validateOptions(options) {
return (typeof options === 'undefined' ? 'undefined' : _typeof(options)) === 'object' && Array.isArray(options.transforms);
}
}, {
key: 'assertValidOptions',
value: function assertValidOptions(options) {
if (!ReactTransformBuilder.validateOptions(options)) {
throw new Error('babel-plugin-react-transform requires that you specify options ' + 'in .babelrc or from the Babel Node API, and that it is an object ' + 'with a transforms property which is an array.');
}
}
}]);
return ReactTransformBuilder;
}();
return {
visitor: {
Program: function Program(path, _ref2) {
var file = _ref2.file;
var opts = _ref2.opts;
ReactTransformBuilder.assertValidOptions(opts);
var builder = new ReactTransformBuilder(file, opts);
builder.build();
}
}
};
};
var _find = require('lodash/find');
var _find2 = _interopRequireDefault(_find);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }

107
node_modules/babel-plugin-react-transform/package.json generated vendored Normal file
View File

@@ -0,0 +1,107 @@
{
"_args": [
[
"babel-plugin-react-transform@^3.0.0",
"/home/bernhard/freifunk-app/node_modules/metro"
]
],
"_from": "babel-plugin-react-transform@>=3.0.0 <4.0.0",
"_id": "babel-plugin-react-transform@3.0.0",
"_inCache": true,
"_installable": true,
"_location": "/babel-plugin-react-transform",
"_nodeVersion": "8.2.1",
"_npmOperationalInternal": {
"host": "s3://npm-registry-packages",
"tmp": "tmp/babel-plugin-react-transform-3.0.0.tgz_1505226983613_0.6134067801758647"
},
"_npmUser": {
"email": "dan.abramov@gmail.com",
"name": "gaearon"
},
"_npmVersion": "5.3.0",
"_phantomChildren": {},
"_requested": {
"name": "babel-plugin-react-transform",
"raw": "babel-plugin-react-transform@^3.0.0",
"rawSpec": "^3.0.0",
"scope": null,
"spec": ">=3.0.0 <4.0.0",
"type": "range"
},
"_requiredBy": [
"/babel-preset-react-native",
"/metro"
],
"_resolved": "https://registry.npmjs.org/babel-plugin-react-transform/-/babel-plugin-react-transform-3.0.0.tgz",
"_shasum": "402f25137b7bb66e9b54ead75557dfbc7ecaaa74",
"_shrinkwrap": null,
"_spec": "babel-plugin-react-transform@^3.0.0",
"_where": "/home/bernhard/freifunk-app/node_modules/metro",
"author": {
"email": "dan.abramov@me.com",
"name": "Dan Abramov"
},
"bugs": {
"url": "https://github.com/gaearon/babel-plugin-react-transform/issues"
},
"dependencies": {
"lodash": "^4.6.1"
},
"description": "Babel plugin to instrument React components with custom transforms",
"devDependencies": {
"babel-cli": "^6.2.0",
"babel-core": "^6.2.1",
"babel-eslint": "^4.1.6",
"babel-preset-es2015": "^6.1.18",
"babel-register": "^6.2.0",
"eslint": "^1.10.3",
"eslint-plugin-react": "^3.11.2",
"mocha": "^2.2.5",
"rimraf": "^2.4.3"
},
"directories": {},
"dist": {
"integrity": "sha512-4vJGddwPiHAOgshzZdGwYy4zRjjIr5SMY7gkOaCyIASjgpcsyLTlZNuB5rHOFoaTvGlhfo8/g4pobXPyHqm/3w==",
"shasum": "402f25137b7bb66e9b54ead75557dfbc7ecaaa74",
"tarball": "https://registry.npmjs.org/babel-plugin-react-transform/-/babel-plugin-react-transform-3.0.0.tgz"
},
"gitHead": "d7069df5c6f36a07857fd108067dc515b3a795ee",
"homepage": "https://github.com/gaearon/babel-plugin-react-transform#readme",
"keywords": [
"babel-plugin",
"components",
"dx",
"instrumentation",
"react",
"react-transform",
"reactjs"
],
"license": "MIT",
"main": "lib/index.js",
"maintainers": [
{
"name": "thejameskyle",
"email": "me@thejameskyle.com"
},
{
"name": "gaearon",
"email": "dan.abramov@gmail.com"
}
],
"name": "babel-plugin-react-transform",
"optionalDependencies": {},
"readme": "ERROR: No README data found!",
"repository": {
"type": "git",
"url": "git+https://github.com/gaearon/babel-plugin-react-transform.git"
},
"scripts": {
"build": "babel src -d lib",
"clean": "rimraf lib",
"prepublish": "npm run clean && npm run build",
"test": "mocha --compilers js:babel-register",
"test:watch": "npm run test -- --watch"
},
"version": "3.0.0"
}

View File

@@ -0,0 +1,6 @@
{
"globals": {
"React": false,
"factory": false
}
}

View File

@@ -0,0 +1,9 @@
{
"plugins": [
["../../../src", {
"transforms": [{
"transform": "transform-lib"
}]
}]
]
}

View File

@@ -0,0 +1,11 @@
factory({
render() {}
});
factory({
render: function() {}
});
factory({
'render': function() {}
});

View File

@@ -0,0 +1,11 @@
factory({
render() {}
});
factory({
render: function () {}
});
factory({
'render': function () {}
});

View File

@@ -0,0 +1,9 @@
{
"plugins": [
["../../../src", {
"transforms": [{
"transform": "transform-lib"
}]
}]
]
}

View File

@@ -0,0 +1,6 @@
foo(class Foo extends React.Component {
render() {}
});
foo(class extends React.Component {
render() {}
});

View File

@@ -0,0 +1,27 @@
import _transformLib from "transform-lib";
const _components = {
Foo: {
displayName: "Foo"
},
_component: {}
};
const _transformLib2 = _transformLib({
filename: "%FIXTURE_PATH%",
components: _components,
locals: [],
imports: []
});
function _wrapComponent(id) {
return function (Component) {
return _transformLib2(Component, id);
};
}
foo(_wrapComponent("Foo")(class Foo extends React.Component {
render() {}
}));
foo(_wrapComponent("_component")(class extends React.Component {
render() {}
}));

View File

@@ -0,0 +1,9 @@
{
"plugins": [
["../../../src", {
"transforms": [{
"transform": "transform-lib"
}]
}]
]
}

View File

@@ -0,0 +1,2 @@
foo(class Foo extends React.Component {});
foo(class extends React.Component {});

View File

@@ -0,0 +1,2 @@
foo(class Foo extends React.Component {});
foo(class extends React.Component {});

View File

@@ -0,0 +1,9 @@
{
"plugins": [
["../../../src", {
"transforms": [{
"transform": "transform-lib"
}]
}]
]
}

View File

@@ -0,0 +1,4 @@
import React, { Component } from 'react';
class Foo extends Component {
render() {}
}

View File

@@ -0,0 +1,25 @@
import _transformLib from 'transform-lib';
const _components = {
Foo: {
displayName: 'Foo'
}
};
const _transformLib2 = _transformLib({
filename: '%FIXTURE_PATH%',
components: _components,
locals: [],
imports: []
});
function _wrapComponent(id) {
return function (Component) {
return _transformLib2(Component, id);
};
}
import React, { Component } from 'react';
const Foo = _wrapComponent('Foo')(class Foo extends Component {
render() {}
});

View File

@@ -0,0 +1,9 @@
{
"plugins": [
["../../../src", {
"transforms": [{
"transform": "transform-lib"
}]
}]
]
}

View File

@@ -0,0 +1,4 @@
import React, { PureComponent } from 'react';
class Foo extends PureComponent {
render() {}
}

View File

@@ -0,0 +1,25 @@
import _transformLib from 'transform-lib';
const _components = {
Foo: {
displayName: 'Foo'
}
};
const _transformLib2 = _transformLib({
filename: '%FIXTURE_PATH%',
components: _components,
locals: [],
imports: []
});
function _wrapComponent(id) {
return function (Component) {
return _transformLib2(Component, id);
};
}
import React, { PureComponent } from 'react';
const Foo = _wrapComponent('Foo')(class Foo extends PureComponent {
render() {}
});

View File

@@ -0,0 +1,9 @@
{
"plugins": [
["../../../src", {
"transforms": [{
"transform": "transform-lib"
}]
}]
]
}

View File

@@ -0,0 +1,3 @@
class Foo extends React.Component {
render() {}
}

View File

@@ -0,0 +1,23 @@
import _transformLib from "transform-lib";
const _components = {
Foo: {
displayName: "Foo"
}
};
const _transformLib2 = _transformLib({
filename: "%FIXTURE_PATH%",
components: _components,
locals: [],
imports: []
});
function _wrapComponent(id) {
return function (Component) {
return _transformLib2(Component, id);
};
}
const Foo = _wrapComponent("Foo")(class Foo extends React.Component {
render() {}
});

View File

@@ -0,0 +1,9 @@
{
"plugins": [
["../../../src", {
"transforms": [{
"transform": "transform-lib"
}]
}]
]
}

View File

@@ -0,0 +1 @@
class Foo extends React.Component {}

View File

@@ -0,0 +1 @@
class Foo extends React.Component {}

View File

@@ -0,0 +1,9 @@
{
"plugins": [
["../../../src", {
"transforms": [{
"transform": "transform-lib"
}]
}]
]
}

View File

@@ -0,0 +1,3 @@
class Foo {
render() {}
}

View File

@@ -0,0 +1,3 @@
class Foo {
render() {}
}

View File

@@ -0,0 +1,9 @@
{
"plugins": [
["../../../src", {
"transforms": [{
"transform": "transform-lib"
}]
}]
]
}

View File

@@ -0,0 +1,5 @@
function factory() {
return class Foo extends React.Component {
render() {}
}
}

View File

@@ -0,0 +1,26 @@
import _transformLib from "transform-lib";
const _components = {
Foo: {
displayName: "Foo",
isInFunction: true
}
};
const _transformLib2 = _transformLib({
filename: "%FIXTURE_PATH%",
components: _components,
locals: [],
imports: []
});
function _wrapComponent(id) {
return function (Component) {
return _transformLib2(Component, id);
};
}
function factory() {
return _wrapComponent("Foo")(class Foo extends React.Component {
render() {}
});
}

View File

@@ -0,0 +1,9 @@
{
"plugins": [
["../../../src", {
"transforms": [{
"transform": "transform-lib"
}]
}]
]
}

View File

@@ -0,0 +1,3 @@
function factory() {
return class Foo extends React.Component {}
}

View File

@@ -0,0 +1,3 @@
function factory() {
return class Foo extends React.Component {};
}

View File

@@ -0,0 +1,9 @@
{
"plugins": [
["../../../src", {
"transforms": [{
"transform": "transform-lib"
}]
}]
]
}

View File

@@ -0,0 +1,3 @@
const Foo = class extends React.Component {
render() {}
}

View File

@@ -0,0 +1,21 @@
import _transformLib from "transform-lib";
const _components = {
_component: {}
};
const _transformLib2 = _transformLib({
filename: "%FIXTURE_PATH%",
components: _components,
locals: [],
imports: []
});
function _wrapComponent(id) {
return function (Component) {
return _transformLib2(Component, id);
};
}
const Foo = _wrapComponent("_component")(class extends React.Component {
render() {}
});

View File

@@ -0,0 +1,9 @@
{
"plugins": [
["../../../src", {
"transforms": [{
"transform": "transform-lib"
}]
}]
]
}

View File

@@ -0,0 +1 @@
const Foo = class extends React.Component {}

View File

@@ -0,0 +1 @@
const Foo = class extends React.Component {};

View File

@@ -0,0 +1,9 @@
{
"plugins": [
["../../../src", {
"transforms": [{
"transform": "transform-lib"
}]
}]
]
}

View File

@@ -0,0 +1,6 @@
export class Foo extends React.Component {}
export default React.createClass({});
export class Bar extends React.Component {}
export const bar = React.createClass({});
export class Baz { render() {} }
export class Boo { render() {} }

View File

@@ -0,0 +1,10 @@
export class Foo extends React.Component {}
export default React.createClass({});
export class Bar extends React.Component {}
export const bar = React.createClass({});
export class Baz {
render() {}
}
export class Boo {
render() {}
}

View File

@@ -0,0 +1,9 @@
{
"plugins": [
["../../../src", {
"transforms": [{
"transform": "transform-lib"
}]
}]
]
}

View File

@@ -0,0 +1,17 @@
import React from 'react';
const First = React.createNotClass({
displayName: 'First'
});
class Second extends React.NotComponent {}
const myCreateClass = spec => {
return React.createClass(spec);
};
const spec = {
render: function () {}
};
React.createClass(spec);

View File

@@ -0,0 +1,17 @@
import React from 'react';
const First = React.createNotClass({
displayName: 'First'
});
class Second extends React.NotComponent {}
const myCreateClass = spec => {
return React.createClass(spec);
};
const spec = {
render: function () {}
};
React.createClass(spec);

View File

@@ -0,0 +1,9 @@
{
"plugins": [
["../../../src", {
"transforms": [{
"transform": "transform-lib"
}]
}]
]
}

View File

@@ -0,0 +1,3 @@
const Foo = React.createClass({
displayName: Math.random()
});

View File

@@ -0,0 +1,3 @@
const Foo = React.createClass({
displayName: Math.random()
});

View File

@@ -0,0 +1,9 @@
{
"plugins": [
["../../../src", {
"transforms": [{
"transform": "transform-lib"
}]
}]
]
}

View File

@@ -0,0 +1,12 @@
const Foo = React.createClass({
displayName: 'Foo',
render: function () {}
});
React.createClass({
render: function () {}
});
const Bar = React.createClass({
render: function () {}
});

View File

@@ -0,0 +1,34 @@
import _transformLib from 'transform-lib';
const _components = {
Foo: {
displayName: 'Foo'
},
_component: {},
_component2: {}
};
const _transformLib2 = _transformLib({
filename: '%FIXTURE_PATH%',
components: _components,
locals: [],
imports: []
});
function _wrapComponent(id) {
return function (Component) {
return _transformLib2(Component, id);
};
}
const Foo = _wrapComponent('Foo')(React.createClass({
displayName: 'Foo',
render: function () {}
}));
_wrapComponent('_component')(React.createClass({
render: function () {}
}));
const Bar = _wrapComponent('_component2')(React.createClass({
render: function () {}
}));

View File

@@ -0,0 +1,9 @@
{
"plugins": [
["../../../src", {
"transforms": [{
"transform": "transform-lib"
}]
}]
]
}

View File

@@ -0,0 +1,4 @@
const MyComponent = React.createClass({
displayName: 'my-component',
render: function () {}
});

View File

@@ -0,0 +1,24 @@
import _transformLib from 'transform-lib';
const _components = {
'my-component': {
displayName: 'my-component'
}
};
const _transformLib2 = _transformLib({
filename: '%FIXTURE_PATH%',
components: _components,
locals: [],
imports: []
});
function _wrapComponent(id) {
return function (Component) {
return _transformLib2(Component, id);
};
}
const MyComponent = _wrapComponent('my-component')(React.createClass({
displayName: 'my-component',
render: function () {}
}));

View File

@@ -0,0 +1,9 @@
{
"plugins": [
["../../../src", {
"transforms": [{
"transform": "transform-lib"
}]
}]
]
}

View File

@@ -0,0 +1,3 @@
const MyComponent = React.createClass({
displayName: 'my-component'
});

View File

@@ -0,0 +1,3 @@
const MyComponent = React.createClass({
displayName: 'my-component'
});

View File

@@ -0,0 +1,9 @@
{
"plugins": [
["../../../src", {
"transforms": [{
"transform": "transform-lib"
}]
}]
]
}

View File

@@ -0,0 +1 @@
const Foo = React.createClass({});

View File

@@ -0,0 +1 @@
const Foo = React.createClass({});

View File

@@ -0,0 +1,9 @@
{
"plugins": [
["../../../src", {
"transforms": [{
"transform": "transform-lib"
}]
}]
]
}

View File

@@ -0,0 +1,6 @@
const Foo = React.createClass({
displayName: 'Foo'
});
React.createClass({
});

View File

@@ -0,0 +1,5 @@
const Foo = React.createClass({
displayName: 'Foo'
});
React.createClass({});

View File

@@ -0,0 +1,10 @@
{
"plugins": [
["../../../src", {
"factoryMethods": ["createClass", "factory"],
"transforms": [{
"transform": "transform-lib"
}]
}]
]
}

View File

@@ -0,0 +1,9 @@
const Foo = createClass({
displayName: 'Foo',
render: function () {}
});
const Bar = factory({
displayName: 'Bar',
render: function () {}
});

View File

@@ -0,0 +1,32 @@
import _transformLib from 'transform-lib';
const _components = {
Foo: {
displayName: 'Foo'
},
Bar: {
displayName: 'Bar'
}
};
const _transformLib2 = _transformLib({
filename: '%FIXTURE_PATH%',
components: _components,
locals: [],
imports: []
});
function _wrapComponent(id) {
return function (Component) {
return _transformLib2(Component, id);
};
}
const Foo = _wrapComponent('Foo')(createClass({
displayName: 'Foo',
render: function () {}
}));
const Bar = _wrapComponent('Bar')(factory({
displayName: 'Bar',
render: function () {}
}));

View File

@@ -0,0 +1,10 @@
{
"plugins": [
["../../../src", {
"factoryMethods": ["createClass", "factory"],
"transforms": [{
"transform": "transform-lib"
}]
}]
]
}

View File

@@ -0,0 +1,7 @@
const Foo = createClass({
displayName: 'Foo'
});
const Bar = factory({
displayName: 'Bar'
});

View File

@@ -0,0 +1,7 @@
const Foo = createClass({
displayName: 'Foo'
});
const Bar = factory({
displayName: 'Bar'
});

View File

@@ -0,0 +1,10 @@
{
"plugins": [
["../../../src", {
"superClasses": ["BooComponent", "CustomComponent"],
"transforms": [{
"transform": "transform-lib"
}]
}]
]
}

View File

@@ -0,0 +1,6 @@
class Foo extends BooComponent {
render() {}
}
class Bar extends CustomComponent {
render() {}
}

View File

@@ -0,0 +1,30 @@
import _transformLib from "transform-lib";
const _components = {
Foo: {
displayName: "Foo"
},
Bar: {
displayName: "Bar"
}
};
const _transformLib2 = _transformLib({
filename: "%FIXTURE_PATH%",
components: _components,
locals: [],
imports: []
});
function _wrapComponent(id) {
return function (Component) {
return _transformLib2(Component, id);
};
}
const Foo = _wrapComponent("Foo")(class Foo extends BooComponent {
render() {}
});
const Bar = _wrapComponent("Bar")(class Bar extends CustomComponent {
render() {}
});

View File

@@ -0,0 +1,10 @@
{
"plugins": [
["../../../src", {
"superClasses": ["BooComponent", "CustomComponent"],
"transforms": [{
"transform": "transform-lib"
}]
}]
]
}

View File

@@ -0,0 +1,2 @@
class Foo extends BooComponent {}
class Bar extends CustomComponent {}

View File

@@ -0,0 +1,2 @@
class Foo extends BooComponent {}
class Bar extends CustomComponent {}

View File

@@ -0,0 +1,11 @@
{
"plugins": [
["../../../src", {
"transforms": [{
"transform": "transform-one"
}, {
"transform": "transform-two"
}]
}]
]
}

View File

@@ -0,0 +1,3 @@
class Foo extends React.Component {
render() {}
}

View File

@@ -0,0 +1,31 @@
import _transformTwo from "transform-two";
import _transformOne from "transform-one";
const _components = {
Foo: {
displayName: "Foo"
}
};
const _transformOne2 = _transformOne({
filename: "%FIXTURE_PATH%",
components: _components,
locals: [],
imports: []
});
const _transformTwo2 = _transformTwo({
filename: "%FIXTURE_PATH%",
components: _components,
locals: [],
imports: []
});
function _wrapComponent(id) {
return function (Component) {
return _transformOne2(_transformTwo2(Component, id), id);
};
}
const Foo = _wrapComponent("Foo")(class Foo extends React.Component {
render() {}
});

View File

@@ -0,0 +1,11 @@
{
"plugins": [
["../../../src", {
"transforms": [{
"transform": "transform-one"
}, {
"transform": "transform-two"
}]
}]
]
}

View File

@@ -0,0 +1 @@
class Foo extends React.Component {}

View File

@@ -0,0 +1 @@
class Foo extends React.Component {}

View File

@@ -0,0 +1,11 @@
{
"plugins": [
["../../../src", {
"transforms": [{
"transform": "transform-lib",
"locals": [],
"imports": ["react", "react-dom"]
}]
}]
]
}

View File

@@ -0,0 +1,3 @@
class Foo extends React.Component {
render() {}
}

View File

@@ -0,0 +1,25 @@
import _reactDom from "react-dom";
import _react from "react";
import _transformLib from "transform-lib";
const _components = {
Foo: {
displayName: "Foo"
}
};
const _transformLib2 = _transformLib({
filename: "%FIXTURE_PATH%",
components: _components,
locals: [],
imports: [_react, _reactDom]
});
function _wrapComponent(id) {
return function (Component) {
return _transformLib2(Component, id);
};
}
const Foo = _wrapComponent("Foo")(class Foo extends React.Component {
render() {}
});

View File

@@ -0,0 +1,11 @@
{
"plugins": [
["../../../src", {
"transforms": [{
"transform": "transform-lib",
"locals": [],
"imports": ["react", "react-dom"]
}]
}]
]
}

View File

@@ -0,0 +1 @@
class Foo extends React.Component {}

View File

@@ -0,0 +1 @@
class Foo extends React.Component {}

View File

@@ -0,0 +1,11 @@
{
"plugins": [
["../../../src", {
"transforms": [{
"transform": "transform-lib",
"locals": ["module", "exports"],
"imports": []
}]
}]
]
}

View File

@@ -0,0 +1,3 @@
class Foo extends React.Component {
render() {}
}

View File

@@ -0,0 +1,23 @@
import _transformLib from "transform-lib";
const _components = {
Foo: {
displayName: "Foo"
}
};
const _transformLib2 = _transformLib({
filename: "%FIXTURE_PATH%",
components: _components,
locals: [module, exports],
imports: []
});
function _wrapComponent(id) {
return function (Component) {
return _transformLib2(Component, id);
};
}
const Foo = _wrapComponent("Foo")(class Foo extends React.Component {
render() {}
});

View File

@@ -0,0 +1,11 @@
{
"plugins": [
["../../../src", {
"transforms": [{
"transform": "transform-lib",
"locals": ["module", "exports"],
"imports": []
}]
}]
]
}

View File

@@ -0,0 +1 @@
class Foo extends React.Component {}

Some files were not shown because too many files have changed in this diff Show More