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

31
node_modules/babel-preset-react-native/README.md generated vendored Normal file
View File

@@ -0,0 +1,31 @@
# babel-preset-react-native
Babel presets for React Native applications. React Native itself uses this Babel preset by default when transforming your app's source code.
If you wish to use a custom Babel configuration by writing a `.babelrc` file in your project's root directory, you must specify all the plugins necessary to transform your code. React Native does not apply its default Babel configuration in this case. So, to make your life easier, you can use this preset to get the default configuration and then specify more plugins that run before it.
## Usage
As mentioned above, you only need to use this preset if you are writing a custom `.babelrc` file.
### Installation
Install `babel-preset-react-native` in your app:
```sh
npm i babel-preset-react-native --save-dev
```
### Configuring Babel
Then, create a file called `.babelrc` in your project's root directory. The existence of this `.babelrc` file will tell React Native to use your custom Babel configuration instead of its own. Then load this preset:
```
{
"presets": ["react-native"]
}
```
You can further customize your Babel configuration by specifying plugins and other options. See [Babel's `.babelrc` documentation](https://babeljs.io/docs/usage/babelrc/) to learn more.
## Help and Support
If you get stuck configuring Babel, please ask a question on Stack Overflow or find a consultant for help. If you discover a bug, please open up an issue.

41
node_modules/babel-preset-react-native/configs/hmr.js generated vendored Normal file
View File

@@ -0,0 +1,41 @@
/**
* Copyright (c) 2015-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*/
'use strict';
var path = require('path');
var resolvePlugins = require('../lib/resolvePlugins');
var hmrTransform = 'react-transform-hmr/lib/index.js';
var transformPath = require.resolve(hmrTransform);
module.exports = function(options, filename) {
var transform = filename
? './' + path.relative(path.dirname(filename), transformPath) // packager can't handle absolute paths
: hmrTransform;
// Fix the module path to use '/' on Windows.
if (path.sep === '\\') {
transform = transform.replace(/\\/g, '/');
}
return {
plugins: resolvePlugins([
[
'react-transform',
{
transforms: [{
transform: transform,
imports: ['react'],
locals: ['module'],
}]
},
]
])
};
};

104
node_modules/babel-preset-react-native/configs/main.js generated vendored Normal file
View File

@@ -0,0 +1,104 @@
/**
* Copyright (c) 2015-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
*/
'use strict';
var resolvePlugins = require('../lib/resolvePlugins');
const getPreset = (src, options) => {
const plugins = [];
const isNull = src === null || src === undefined;
const hasClass = isNull || src.indexOf('class') !== -1;
const hasForOf =
isNull || (src.indexOf('for') !== -1 && src.indexOf('of') !== -1);
plugins.push(
'syntax-class-properties',
'syntax-trailing-function-commas',
'transform-class-properties',
'transform-es2015-block-scoping',
'transform-es2015-computed-properties',
'transform-es2015-destructuring',
'transform-es2015-function-name',
'transform-es2015-literals',
'transform-es2015-parameters',
'transform-es2015-shorthand-properties',
'transform-flow-strip-types',
'transform-react-jsx',
'transform-regenerator',
[
'transform-es2015-modules-commonjs',
{strict: false, allowTopLevelThis: true},
]
);
if (isNull || src.indexOf('async') !== -1 || src.indexOf('await') !== -1) {
plugins.push('syntax-async-functions');
}
if (hasClass) {
plugins.push('transform-es2015-classes');
}
if (isNull || src.indexOf('=>') !== -1) {
plugins.push('transform-es2015-arrow-functions');
}
if (isNull || src.indexOf('const') !== -1) {
plugins.push('check-es2015-constants');
}
if (isNull || hasClass || src.indexOf('...') !== -1) {
plugins.push('transform-es2015-spread');
plugins.push('transform-object-rest-spread');
}
if (isNull || src.indexOf('`') !== -1) {
plugins.push('transform-es2015-template-literals');
}
if (isNull || src.indexOf('Object.assign') !== -1) {
plugins.push('transform-object-assign');
}
if (hasForOf) {
plugins.push(['transform-es2015-for-of', {loose: true}]);
}
if (hasForOf || src.indexOf('Symbol') !== -1) {
plugins.push(require('../transforms/transform-symbol-member'));
}
if (
isNull ||
src.indexOf('React.createClass') !== -1 ||
src.indexOf('createReactClass') !== -1
) {
plugins.push('transform-react-display-name');
}
if (isNull || src.indexOf('import(')) {
plugins.push(require('../transforms/transform-dynamic-import'));
}
if (options && options.dev) {
plugins.push('transform-react-jsx-source');
}
return {
comments: false,
compact: true,
plugins: resolvePlugins(plugins),
};
};
const base = getPreset(null);
const devTools = getPreset(null, {dev: true});
module.exports = options => {
if (options.withDevTools == null) {
const env = process.env.BABEL_ENV || process.env.NODE_ENV;
if (!env || env === 'development') {
return devTools;
}
}
return base;
};
module.exports.getPreset = getPreset;

11
node_modules/babel-preset-react-native/index.js generated vendored Normal file
View File

@@ -0,0 +1,11 @@
/**
* Copyright (c) 2015-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*/
'use strict';
module.exports = require('./configs/main');

View File

@@ -0,0 +1,32 @@
/**
* Copyright (c) 2015-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*/
'use strict';
/**
* Manually resolve all default Babel plugins.
* `babel.transform` will attempt to resolve all base plugins relative to
* the file it's compiling. This makes sure that we're using the plugins
* installed in the react-native package.
*/
function resolvePlugins(plugins) {
return plugins.map(function(plugin) {
// Normalise plugin to an array.
if (!Array.isArray(plugin)) {
plugin = [plugin];
}
// Only resolve the plugin if it's a string reference.
if (typeof plugin[0] === 'string') {
plugin[0] = require('babel-plugin-' + plugin[0]);
plugin[0] = plugin[0].__esModule ? plugin[0].default : plugin[0];
}
return plugin;
});
}
module.exports = resolvePlugins;

175
node_modules/babel-preset-react-native/package.json generated vendored Normal file
View File

@@ -0,0 +1,175 @@
{
"_args": [
[
"babel-preset-react-native@^4.0.0",
"/home/bernhard/freifunk-app/node_modules/metro"
]
],
"_from": "babel-preset-react-native@>=4.0.0 <5.0.0",
"_id": "babel-preset-react-native@4.0.0",
"_inCache": true,
"_installable": true,
"_location": "/babel-preset-react-native",
"_nodeVersion": "8.5.0",
"_npmOperationalInternal": {
"host": "s3://npm-registry-packages",
"tmp": "tmp/babel-preset-react-native-4.0.0.tgz_1505391099961_0.9598081859294325"
},
"_npmUser": {
"email": "rafeca@gmail.com",
"name": "rafeca"
},
"_npmVersion": "5.3.0",
"_phantomChildren": {},
"_requested": {
"name": "babel-preset-react-native",
"raw": "babel-preset-react-native@^4.0.0",
"rawSpec": "^4.0.0",
"scope": null,
"spec": ">=4.0.0 <5.0.0",
"type": "range"
},
"_requiredBy": [
"#DEV:/",
"/metro"
],
"_resolved": "https://registry.npmjs.org/babel-preset-react-native/-/babel-preset-react-native-4.0.0.tgz",
"_shasum": "3df80dd33a453888cdd33bdb87224d17a5d73959",
"_shrinkwrap": null,
"_spec": "babel-preset-react-native@^4.0.0",
"_where": "/home/bernhard/freifunk-app/node_modules/metro",
"bugs": {
"url": "https://github.com/facebook/react-native/issues"
},
"dependencies": {
"babel-plugin-check-es2015-constants": "^6.5.0",
"babel-plugin-react-transform": "^3.0.0",
"babel-plugin-syntax-async-functions": "^6.5.0",
"babel-plugin-syntax-class-properties": "^6.5.0",
"babel-plugin-syntax-dynamic-import": "^6.18.0",
"babel-plugin-syntax-flow": "^6.5.0",
"babel-plugin-syntax-jsx": "^6.5.0",
"babel-plugin-syntax-trailing-function-commas": "^6.5.0",
"babel-plugin-transform-class-properties": "^6.5.0",
"babel-plugin-transform-es2015-arrow-functions": "^6.5.0",
"babel-plugin-transform-es2015-block-scoping": "^6.5.0",
"babel-plugin-transform-es2015-classes": "^6.5.0",
"babel-plugin-transform-es2015-computed-properties": "^6.5.0",
"babel-plugin-transform-es2015-destructuring": "^6.5.0",
"babel-plugin-transform-es2015-for-of": "^6.5.0",
"babel-plugin-transform-es2015-function-name": "^6.5.0",
"babel-plugin-transform-es2015-literals": "^6.5.0",
"babel-plugin-transform-es2015-modules-commonjs": "^6.5.0",
"babel-plugin-transform-es2015-parameters": "^6.5.0",
"babel-plugin-transform-es2015-shorthand-properties": "^6.5.0",
"babel-plugin-transform-es2015-spread": "^6.5.0",
"babel-plugin-transform-es2015-template-literals": "^6.5.0",
"babel-plugin-transform-flow-strip-types": "^6.5.0",
"babel-plugin-transform-object-assign": "^6.5.0",
"babel-plugin-transform-object-rest-spread": "^6.5.0",
"babel-plugin-transform-react-display-name": "^6.5.0",
"babel-plugin-transform-react-jsx": "^6.5.0",
"babel-plugin-transform-react-jsx-source": "^6.5.0",
"babel-plugin-transform-regenerator": "^6.5.0",
"babel-template": "^6.24.1",
"react-transform-hmr": "^1.0.4"
},
"description": "Babel preset for React Native applications",
"devDependencies": {},
"directories": {},
"dist": {
"integrity": "sha512-Wfbo6x244nUbBxjr7hQaNFdjj7FDYU+TVT7cFVPEdVPI68vhN52iLvamm+ErhNdHq6M4j1cMT6AJBYx7Wzdr0g==",
"shasum": "3df80dd33a453888cdd33bdb87224d17a5d73959",
"tarball": "https://registry.npmjs.org/babel-preset-react-native/-/babel-preset-react-native-4.0.0.tgz"
},
"homepage": "https://github.com/facebook/react-native/tree/master/babel-preset/README.md",
"keywords": [
"babel",
"preset",
"react-native"
],
"license": "BSD-3-Clause",
"main": "index.js",
"maintainers": [
{
"name": "ide",
"email": "ide+npm@jameside.com"
},
{
"name": "abi",
"email": "abimanyuraja@gmail.com"
},
{
"name": "brentvatne",
"email": "brentvatne@gmail.com"
},
{
"name": "ccheever",
"email": "ccheever@gmail.com"
},
{
"name": "davepack",
"email": "dave@expo.io"
},
{
"name": "davidaurelio",
"email": "dev@david-aurelio.com"
},
{
"name": "dikaiosune",
"email": "adam.n.perry@gmail.com"
},
{
"name": "expoadmin",
"email": "exponent.team@gmail.com"
},
{
"name": "fb",
"email": "opensource+npm@fb.com"
},
{
"name": "bestander",
"email": "bestander@gmail.com"
},
{
"name": "jeanlauliac",
"email": "jean@lauliac.com"
},
{
"name": "jesseruder",
"email": "jesse@sixfivezero.net"
},
{
"name": "mjesun",
"email": "mjesun@hotmail.com"
},
{
"name": "nikki93",
"email": "s.nikhilesh@gmail.com"
},
{
"name": "rafeca",
"email": "rafeca@gmail.com"
},
{
"name": "skevy",
"email": "adam@sk3vy.com"
},
{
"name": "terribleben",
"email": "ben@exp.host"
},
{
"name": "wilzh40",
"email": "wilzh40@gmail.com"
}
],
"name": "babel-preset-react-native",
"optionalDependencies": {},
"readme": "ERROR: No README data found!",
"repository": {
"type": "git",
"url": "https://github.com/facebook/react-native/tree/master/babel-preset"
},
"version": "4.0.0"
}

39
node_modules/babel-preset-react-native/plugins.js generated vendored Normal file
View File

@@ -0,0 +1,39 @@
/**
* Copyright (c) 2015-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*/
'use strict';
module.exports = {
'babel-plugin-react-transform': require('babel-plugin-react-transform'),
'babel-plugin-syntax-async-functions': require('babel-plugin-syntax-async-functions'),
'babel-plugin-syntax-class-properties': require('babel-plugin-syntax-class-properties'),
'babel-plugin-syntax-dynamic-import': require('babel-plugin-syntax-dynamic-import'),
'babel-plugin-syntax-trailing-function-commas': require('babel-plugin-syntax-trailing-function-commas'),
'babel-plugin-transform-class-properties': require('babel-plugin-transform-class-properties'),
'babel-plugin-transform-es2015-function-name': require('babel-plugin-transform-es2015-function-name'),
'babel-plugin-transform-es2015-arrow-functions': require('babel-plugin-transform-es2015-arrow-functions'),
'babel-plugin-transform-es2015-block-scoping': require('babel-plugin-transform-es2015-block-scoping'),
'babel-plugin-transform-es2015-classes': require('babel-plugin-transform-es2015-classes'),
'babel-plugin-transform-es2015-computed-properties': require('babel-plugin-transform-es2015-computed-properties'),
'babel-plugin-check-es2015-constants': require('babel-plugin-check-es2015-constants'),
'babel-plugin-transform-es2015-destructuring': require('babel-plugin-transform-es2015-destructuring'),
'babel-plugin-transform-es2015-modules-commonjs': require('babel-plugin-transform-es2015-modules-commonjs'),
'babel-plugin-transform-es2015-parameters': require('babel-plugin-transform-es2015-parameters'),
'babel-plugin-transform-es2015-shorthand-properties': require('babel-plugin-transform-es2015-shorthand-properties'),
'babel-plugin-transform-es2015-spread': require('babel-plugin-transform-es2015-spread'),
'babel-plugin-transform-es2015-template-literals': require('babel-plugin-transform-es2015-template-literals'),
'babel-plugin-transform-es2015-literals' : require('babel-plugin-transform-es2015-literals'),
'babel-plugin-transform-flow-strip-types': require('babel-plugin-transform-flow-strip-types'),
'babel-plugin-transform-object-assign': require('babel-plugin-transform-object-assign'),
'babel-plugin-transform-object-rest-spread': require('babel-plugin-transform-object-rest-spread'),
'babel-plugin-transform-react-display-name': require('babel-plugin-transform-react-display-name'),
'babel-plugin-transform-react-jsx-source': require('babel-plugin-transform-react-jsx-source'),
'babel-plugin-transform-react-jsx': require('babel-plugin-transform-react-jsx'),
'babel-plugin-transform-regenerator': require('babel-plugin-transform-regenerator'),
'babel-plugin-transform-es2015-for-of': require('babel-plugin-transform-es2015-for-of'),
};

View File

@@ -0,0 +1,32 @@
/**
* Copyright (c) 2016-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*/
'use strict';
const template = require('babel-template');
const buildImport = template('Promise.resolve().then(() => require(ARGS))');
const TYPE_IMPORT = 'Import';
const plugin = {
inherits: require('babel-plugin-syntax-dynamic-import'),
visitor: {
CallExpression(path) {
if (path.node.callee.type !== TYPE_IMPORT) {
return;
}
const newImport = buildImport({ARGS: path.node.arguments});
path.replaceWith(newImport);
},
},
};
module.exports = plugin;

View File

@@ -0,0 +1,64 @@
/**
* Copyright 2004-present Facebook. All Rights Reserved.
*/
'use strict';
/*eslint consistent-return: 0*/
/**
* Transforms function properties of the `Symbol` into
* the presence check, and fallback string "@@<name>".
*
* Example:
*
* Symbol.iterator;
*
* Transformed to:
*
* typeof Symbol.iterator === 'function' ? Symbol.iterator : '@@iterator';
*/
module.exports = function symbolMember(babel) {
const t = babel.types;
return {
visitor: {
MemberExpression(path) {
if (!isAppropriateMember(path)) {
return;
}
let node = path.node;
path.replaceWith(
t.conditionalExpression(
t.binaryExpression(
'===',
t.unaryExpression(
'typeof',
t.identifier('Symbol'),
true
),
t.stringLiteral('function')
),
node,
t.stringLiteral(`@@${node.property.name}`)
)
);
// We should stop to avoid infinite recursion, since Babel
// traverses replaced path, and again would hit our transform.
path.stop();
},
},
};
};
function isAppropriateMember(path) {
let node = path.node;
return path.parentPath.type !== 'AssignmentExpression' &&
node.object.type === 'Identifier' &&
node.object.name === 'Symbol' &&
node.property.type === 'Identifier';
}