Commit 67e89dfd authored by Mattia541993's avatar Mattia541993

Merge branch 'tmp-ios'

parents b63d35b8 c7fbb31b

Too many changes to show.

To preserve performance only 1000 of 1000+ files are displayed.

{
"name": "DoubleConversion",
"version": "1.1.6",
"license": {
"type": "MIT"
},
"homepage": "https://github.com/google/double-conversion",
"summary": "Efficient binary-decimal and decimal-binary conversion routines for IEEE doubles",
"authors": "Google",
"prepare_command": "mv src double-conversion",
"source": {
"git": "https://github.com/google/double-conversion.git",
"tag": "v1.1.6"
},
"module_name": "DoubleConversion",
"header_dir": "double-conversion",
"source_files": "double-conversion/*.{h,cc}",
"compiler_flags": "-Wno-unreachable-code",
"platforms": {
"ios": "9.0",
"tvos": "9.2"
}
}
{
"name": "FBLazyVector",
"version": "0.62.2",
"summary": "-",
"homepage": "http://facebook.github.io/react-native/",
"license": "MIT",
"authors": "Facebook, Inc. and its affiliates",
"platforms": {
"ios": "9.0",
"tvos": "9.2"
},
"source": {
"git": "https://github.com/facebook/react-native.git",
"tag": "v0.62.2"
},
"source_files": "**/*.{c,h,m,mm,cpp}",
"header_dir": "FBLazyVector"
}
{
"name": "FBReactNativeSpec",
"version": "0.62.2",
"summary": "-",
"homepage": "http://facebook.github.io/react-native/",
"license": "MIT",
"authors": "Facebook, Inc. and its affiliates",
"platforms": {
"ios": "9.0",
"tvos": "9.2"
},
"compiler_flags": "-DFOLLY_NO_CONFIG -DFOLLY_MOBILE=1 -DFOLLY_USE_LIBCPP=1 -Wno-comma -Wno-shorten-64-to-32 -Wno-nullability-completeness",
"source": {
"git": "https://github.com/facebook/react-native.git",
"tag": "v0.62.2"
},
"source_files": "**/*.{c,h,m,mm,cpp}",
"header_dir": "FBReactNativeSpec",
"pod_target_xcconfig": {
"USE_HEADERMAP": "YES",
"CLANG_CXX_LANGUAGE_STANDARD": "c++14",
"HEADER_SEARCH_PATHS": "\"$(PODS_TARGET_SRCROOT)/Libraries/FBReactNativeSpec\" \"$(PODS_ROOT)/Folly\""
},
"dependencies": {
"Folly": [
"2018.10.22.00"
],
"RCTRequired": [
"0.62.2"
],
"RCTTypeSafety": [
"0.62.2"
],
"React-Core": [
"0.62.2"
],
"React-jsi": [
"0.62.2"
],
"ReactCommon/turbomodule/core": [
"0.62.2"
]
}
}
{
"name": "Folly",
"version": "2018.10.22.00",
"license": {
"type": "Apache License, Version 2.0"
},
"homepage": "https://github.com/facebook/folly",
"summary": "An open-source C++ library developed and used at Facebook.",
"authors": "Facebook",
"source": {
"git": "https://github.com/facebook/folly.git",
"tag": "v2018.10.22.00"
},
"module_name": "folly",
"dependencies": {
"boost-for-react-native": [
],
"DoubleConversion": [
],
"glog": [
]
},
"compiler_flags": "-DFOLLY_NO_CONFIG -DFOLLY_MOBILE=1 -DFOLLY_USE_LIBCPP=1 -DFOLLY_HAVE_PTHREAD=1 -Wno-comma -Wno-shorten-64-to-32 -Wno-documentation",
"source_files": [
"folly/String.cpp",
"folly/Conv.cpp",
"folly/Demangle.cpp",
"folly/Format.cpp",
"folly/ScopeGuard.cpp",
"folly/Unicode.cpp",
"folly/dynamic.cpp",
"folly/json.cpp",
"folly/json_pointer.cpp",
"folly/container/detail/F14Table.cpp",
"folly/detail/Demangle.cpp",
"folly/hash/SpookyHashV2.cpp",
"folly/lang/Assume.cpp",
"folly/lang/ColdClass.cpp",
"folly/memory/detail/MallocImpl.cpp"
],
"preserve_paths": [
"folly/*.h",
"folly/container/*.h",
"folly/container/detail/*.h",
"folly/detail/*.h",
"folly/functional/*.h",
"folly/hash/*.h",
"folly/lang/*.h",
"folly/memory/*.h",
"folly/memory/detail/*.h",
"folly/portability/*.h"
],
"libraries": "stdc++",
"pod_target_xcconfig": {
"USE_HEADERMAP": "NO",
"CLANG_CXX_LANGUAGE_STANDARD": "c++14",
"HEADER_SEARCH_PATHS": "\"$(PODS_TARGET_SRCROOT)\" \"$(PODS_ROOT)/boost-for-react-native\" \"$(PODS_ROOT)/DoubleConversion\""
},
"default_subspecs": "Default",
"platforms": {
"ios": "9.0",
"tvos": "9.2"
},
"subspecs": [
{
"name": "Default"
},
{
"name": "Fabric",
"source_files": [
"folly/portability/SysUio.cpp",
"folly/FileUtil.cpp",
"folly/SharedMutex.cpp",
"folly/concurrency/CacheLocality.cpp",
"folly/detail/Futex.cpp",
"folly/lang/SafeAssert.cpp",
"folly/synchronization/ParkingLot.cpp",
"folly/portability/Malloc.cpp"
],
"preserve_paths": [
"folly/concurrency/CacheLocality.h",
"folly/synchronization/ParkingLot.h",
"folly/synchronization/SanitizeThread.h",
"folly/system/ThreadId.h"
]
}
]
}
{
"name": "RCTRequired",
"version": "0.62.2",
"summary": "-",
"homepage": "http://facebook.github.io/react-native/",
"license": "MIT",
"authors": "Facebook, Inc. and its affiliates",
"platforms": {
"ios": "9.0",
"tvos": "9.2"
},
"source": {
"git": "https://github.com/facebook/react-native.git",
"tag": "v0.62.2"
},
"source_files": "**/*.{c,h,m,mm,cpp}",
"header_dir": "RCTRequired"
}
{
"name": "RCTTypeSafety",
"version": "0.62.2",
"summary": "-",
"homepage": "http://facebook.github.io/react-native/",
"license": "MIT",
"authors": "Facebook, Inc. and its affiliates",
"platforms": {
"ios": "9.0",
"tvos": "9.2"
},
"compiler_flags": "-DFOLLY_NO_CONFIG -DFOLLY_MOBILE=1 -DFOLLY_USE_LIBCPP=1 -Wno-comma -Wno-shorten-64-to-32",
"source": {
"git": "https://github.com/facebook/react-native.git",
"tag": "v0.62.2"
},
"source_files": "**/*.{c,h,m,mm,cpp}",
"header_dir": "RCTTypeSafety",
"pod_target_xcconfig": {
"USE_HEADERMAP": "YES",
"CLANG_CXX_LANGUAGE_STANDARD": "c++14",
"HEADER_SEARCH_PATHS": "\"$(PODS_TARGET_SRCROOT)/Libraries/TypeSafety\" \"$(PODS_ROOT)/Folly\""
},
"dependencies": {
"FBLazyVector": [
"0.62.2"
],
"Folly": [
"2018.10.22.00"
],
"RCTRequired": [
"0.62.2"
],
"React-Core": [
"0.62.2"
]
}
}
{
"name": "React-Core",
"version": "0.62.2",
"summary": "The core of React Native.",
"homepage": "http://facebook.github.io/react-native/",
"license": "MIT",
"authors": "Facebook, Inc. and its affiliates",
"platforms": {
"ios": "9.0",
"tvos": "9.2"
},
"source": {
"git": "https://github.com/facebook/react-native.git",
"tag": "v0.62.2"
},
"compiler_flags": "-DFOLLY_NO_CONFIG -DFOLLY_MOBILE=1 -DFOLLY_USE_LIBCPP=1 -Wno-comma -Wno-shorten-64-to-32 -Wno-documentation",
"header_dir": "React",
"frameworks": "JavaScriptCore",
"libraries": "stdc++",
"pod_target_xcconfig": {
"HEADER_SEARCH_PATHS": "\"$(PODS_TARGET_SRCROOT)/ReactCommon\" \"$(PODS_ROOT)/boost-for-react-native\" \"$(PODS_ROOT)/DoubleConversion\" \"$(PODS_ROOT)/Folly\""
},
"user_target_xcconfig": {
"HEADER_SEARCH_PATHS": "\"$(PODS_ROOT)/Headers/Private/React-Core\""
},
"default_subspecs": "Default",
"dependencies": {
"Folly": [
"2018.10.22.00"
],
"React-cxxreact": [
"0.62.2"
],
"React-jsi": [
"0.62.2"
],
"React-jsiexecutor": [
"0.62.2"
],
"Yoga": [
],
"glog": [
]
},
"subspecs": [
{
"name": "Default",
"source_files": "React/**/*.{c,h,m,mm,S,cpp}",
"exclude_files": [
"React/CoreModules/**/*",
"React/DevSupport/**/*",
"React/Fabric/**/*",
"React/Inspector/**/*"
],
"ios": {
"exclude_files": "React/**/RCTTV*.*"
},
"private_header_files": "React/Cxx*/*.h",
"tvos": {
"exclude_files": [
"React/Modules/RCTClipboard*",
"React/Views/RCTDatePicker*",
"React/Views/RCTPicker*",
"React/Views/RCTRefreshControl*",
"React/Views/RCTSlider*",
"React/Views/RCTSwitch*",
"React/Cxx*/*.h"
]
}
},
{
"name": "DevSupport",
"source_files": [
"React/DevSupport/*.{h,mm,m}",
"React/Inspector/*.{h,mm,m}"
],
"dependencies": {
"React-Core/Default": [
"0.62.2"
],
"React-Core/RCTWebSocket": [
"0.62.2"
],
"React-jsinspector": [
"0.62.2"
]
}
},
{
"name": "RCTWebSocket",
"source_files": "Libraries/WebSocket/*.{h,m}",
"dependencies": {
"React-Core/Default": [
"0.62.2"
]
}
},
{
"name": "ARTHeaders",
"source_files": "Libraries/ART/**/*.h",
"dependencies": {
"React-Core/Default": [
]
}
},
{
"name": "CoreModulesHeaders",
"source_files": "React/CoreModules/**/*.h",
"dependencies": {
"React-Core/Default": [
]
}
},
{
"name": "RCTActionSheetHeaders",
"source_files": "Libraries/ActionSheetIOS/*.h",
"dependencies": {
"React-Core/Default": [
]
}
},
{
"name": "RCTAnimationHeaders",
"source_files": "Libraries/NativeAnimation/{Drivers/*,Nodes/*,*}.{h}",
"dependencies": {
"React-Core/Default": [
]
}
},
{
"name": "RCTBlobHeaders",
"source_files": "Libraries/Blob/{RCTBlobManager,RCTFileReaderModule}.h",
"dependencies": {
"React-Core/Default": [
]
}
},
{
"name": "RCTImageHeaders",
"source_files": "Libraries/Image/*.h",
"dependencies": {
"React-Core/Default": [
]
}
},
{
"name": "RCTLinkingHeaders",
"source_files": "Libraries/LinkingIOS/*.h",
"dependencies": {
"React-Core/Default": [
]
}
},
{
"name": "RCTNetworkHeaders",
"source_files": "Libraries/Network/*.h",
"dependencies": {
"React-Core/Default": [
]
}
},
{
"name": "RCTPushNotificationHeaders",
"source_files": "Libraries/PushNotificationIOS/*.h",
"dependencies": {
"React-Core/Default": [
]
}
},
{
"name": "RCTSettingsHeaders",
"source_files": "Libraries/Settings/*.h",
"dependencies": {
"React-Core/Default": [
]
}
},
{
"name": "RCTTextHeaders",
"source_files": "Libraries/Text/**/*.h",
"dependencies": {
"React-Core/Default": [
]
}
},
{
"name": "RCTVibrationHeaders",
"source_files": "Libraries/Vibration/*.h",
"dependencies": {
"React-Core/Default": [
]
}
}
]
}
{
"name": "React-CoreModules",
"version": "0.62.2",
"summary": "-",
"homepage": "http://facebook.github.io/react-native/",
"license": "MIT",
"authors": "Facebook, Inc. and its affiliates",
"platforms": {
"ios": "9.0",
"tvos": "9.2"
},
"compiler_flags": "-DFOLLY_NO_CONFIG -DFOLLY_MOBILE=1 -DFOLLY_USE_LIBCPP=1 -Wno-comma -Wno-shorten-64-to-32 -Wno-nullability-completeness",
"source": {
"git": "https://github.com/facebook/react-native.git",
"tag": "v0.62.2"
},
"source_files": "**/*.{c,m,mm,cpp}",
"header_dir": "CoreModules",
"pod_target_xcconfig": {
"USE_HEADERMAP": "YES",
"CLANG_CXX_LANGUAGE_STANDARD": "c++14",
"HEADER_SEARCH_PATHS": "\"$(PODS_TARGET_SRCROOT)/React/CoreModules\" \"$(PODS_ROOT)/Folly\""
},
"dependencies": {
"FBReactNativeSpec": [
"0.62.2"
],
"Folly": [
"2018.10.22.00"
],
"RCTTypeSafety": [
"0.62.2"
],
"React-Core/CoreModulesHeaders": [
"0.62.2"
],
"React-RCTImage": [
"0.62.2"
],
"ReactCommon/turbomodule/core": [
"0.62.2"
]
}
}
{
"name": "React-RCTActionSheet",
"version": "0.62.2",
"summary": "An API for displaying iOS action sheets and share sheets.",
"homepage": "http://facebook.github.io/react-native/",
"documentation_url": "https://facebook.github.io/react-native/docs/actionsheetios",
"license": "MIT",
"authors": "Facebook, Inc. and its affiliates",
"platforms": {
"ios": "9.0",
"tvos": "9.2"
},
"source": {
"git": "https://github.com/facebook/react-native.git",
"tag": "v0.62.2"
},
"source_files": "*.{m}",
"preserve_paths": [
"package.json",
"LICENSE",
"LICENSE-docs"
],
"header_dir": "RCTActionSheet",
"dependencies": {
"React-Core/RCTActionSheetHeaders": [
"0.62.2"
]
}
}
{
"name": "React-RCTAnimation",
"version": "0.62.2",
"summary": "A native driver for the Animated API.",
"homepage": "http://facebook.github.io/react-native/",
"license": "MIT",
"authors": "Facebook, Inc. and its affiliates",
"platforms": {
"ios": "9.0",
"tvos": "9.2"
},
"compiler_flags": "-DFOLLY_NO_CONFIG -DFOLLY_MOBILE=1 -DFOLLY_USE_LIBCPP=1 -Wno-comma -Wno-shorten-64-to-32 -Wno-nullability-completeness",
"source": {
"git": "https://github.com/facebook/react-native.git",
"tag": "v0.62.2"
},
"source_files": "{Drivers/*,Nodes/*,*}.{m,mm}",
"preserve_paths": [
"package.json",
"LICENSE",
"LICENSE-docs"
],
"header_dir": "RCTAnimation",
"pod_target_xcconfig": {
"USE_HEADERMAP": "YES",
"CLANG_CXX_LANGUAGE_STANDARD": "c++14",
"HEADER_SEARCH_PATHS": "\"$(PODS_ROOT)/Folly\""
},
"dependencies": {
"Folly": [
"2018.10.22.00"
],
"RCTTypeSafety": [
"0.62.2"
],
"ReactCommon/turbomodule/core": [
"0.62.2"
],
"FBReactNativeSpec": [
"0.62.2"
],
"React-Core/RCTAnimationHeaders": [
"0.62.2"
]
}
}
{
"name": "React-RCTBlob",
"version": "0.62.2",
"summary": "An API for displaying iOS action sheets and share sheets.",
"homepage": "http://facebook.github.io/react-native/",
"license": "MIT",
"authors": "Facebook, Inc. and its affiliates",
"platforms": {
"ios": "9.0",
"tvos": "9.2"
},
"compiler_flags": "-DFOLLY_NO_CONFIG -DFOLLY_MOBILE=1 -DFOLLY_USE_LIBCPP=1 -Wno-comma -Wno-shorten-64-to-32 -Wno-nullability-completeness",
"source": {
"git": "https://github.com/facebook/react-native.git",
"tag": "v0.62.2"
},
"source_files": "*.{m,mm}",
"preserve_paths": [
"package.json",
"LICENSE",
"LICENSE-docs"
],
"header_dir": "RCTBlob",
"pod_target_xcconfig": {
"USE_HEADERMAP": "YES",
"CLANG_CXX_LANGUAGE_STANDARD": "c++14",
"HEADER_SEARCH_PATHS": "\"$(PODS_ROOT)/Folly\""
},
"dependencies": {
"Folly": [
"2018.10.22.00"
],
"FBReactNativeSpec": [
"0.62.2"
],
"ReactCommon/turbomodule/core": [
"0.62.2"
],
"React-Core/RCTBlobHeaders": [
"0.62.2"
],
"React-Core/RCTWebSocket": [
"0.62.2"
],
"React-RCTNetwork": [
"0.62.2"
],
"React-jsi": [
"0.62.2"
]
}
}
{
"name": "React-RCTImage",
"version": "0.62.2",
"summary": "A React component for displaying different types of images.",
"homepage": "http://facebook.github.io/react-native/",
"documentation_url": "https://facebook.github.io/react-native/docs/image",
"license": "MIT",
"authors": "Facebook, Inc. and its affiliates",
"platforms": {
"ios": "9.0",
"tvos": "9.2"
},
"compiler_flags": "-DFOLLY_NO_CONFIG -DFOLLY_MOBILE=1 -DFOLLY_USE_LIBCPP=1 -Wno-comma -Wno-shorten-64-to-32 -Wno-nullability-completeness",
"source": {
"git": "https://github.com/facebook/react-native.git",
"tag": "v0.62.2"
},
"source_files": "*.{m,mm}",
"preserve_paths": [
"package.json",
"LICENSE",
"LICENSE-docs"
],
"header_dir": "RCTImage",
"pod_target_xcconfig": {
"USE_HEADERMAP": "YES",
"CLANG_CXX_LANGUAGE_STANDARD": "c++14",
"HEADER_SEARCH_PATHS": "\"$(PODS_ROOT)/Folly\""
},
"dependencies": {
"Folly": [
"2018.10.22.00"
],
"FBReactNativeSpec": [
"0.62.2"
],
"RCTTypeSafety": [
"0.62.2"
],
"ReactCommon/turbomodule/core": [
"0.62.2"
],
"React-Core/RCTImageHeaders": [
"0.62.2"
],
"React-RCTNetwork": [
"0.62.2"
]
}
}
{
"name": "React-RCTLinking",
"version": "0.62.2",
"summary": "A general interface to interact with both incoming and outgoing app links.",
"homepage": "http://facebook.github.io/react-native/",
"documentation_url": "https://facebook.github.io/react-native/docs/linking",
"license": "MIT",
"authors": "Facebook, Inc. and its affiliates",
"platforms": {
"ios": "9.0",
"tvos": "9.2"
},
"compiler_flags": "-DFOLLY_NO_CONFIG -DFOLLY_MOBILE=1 -DFOLLY_USE_LIBCPP=1 -Wno-comma -Wno-shorten-64-to-32 -Wno-nullability-completeness",
"source": {
"git": "https://github.com/facebook/react-native.git",
"tag": "v0.62.2"
},
"source_files": "*.{m,mm}",
"preserve_paths": [
"package.json",
"LICENSE",
"LICENSE-docs"
],
"header_dir": "RCTLinking",
"pod_target_xcconfig": {
"USE_HEADERMAP": "YES",
"CLANG_CXX_LANGUAGE_STANDARD": "c++14",
"HEADER_SEARCH_PATHS": "\"$(PODS_ROOT)/Folly\""
},
"dependencies": {
"FBReactNativeSpec": [
"0.62.2"
],
"React-Core/RCTLinkingHeaders": [
"0.62.2"
],
"ReactCommon/turbomodule/core": [
"0.62.2"
]
}
}
{
"name": "React-RCTNetwork",
"version": "0.62.2",
"summary": "The networking library of React Native.",
"homepage": "http://facebook.github.io/react-native/",
"license": "MIT",
"authors": "Facebook, Inc. and its affiliates",
"platforms": {
"ios": "9.0",
"tvos": "9.2"
},
"compiler_flags": "-DFOLLY_NO_CONFIG -DFOLLY_MOBILE=1 -DFOLLY_USE_LIBCPP=1 -Wno-comma -Wno-shorten-64-to-32 -Wno-nullability-completeness",
"source": {
"git": "https://github.com/facebook/react-native.git",
"tag": "v0.62.2"
},
"source_files": "*.{m,mm}",
"preserve_paths": [
"package.json",
"LICENSE",
"LICENSE-docs"
],
"header_dir": "RCTNetwork",
"pod_target_xcconfig": {
"USE_HEADERMAP": "YES",
"CLANG_CXX_LANGUAGE_STANDARD": "c++14",
"HEADER_SEARCH_PATHS": "\"$(PODS_ROOT)/Folly\""
},
"frameworks": "MobileCoreServices",
"dependencies": {
"Folly": [
"2018.10.22.00"
],
"FBReactNativeSpec": [
"0.62.2"
],
"RCTTypeSafety": [
"0.62.2"
],
"ReactCommon/turbomodule/core": [
"0.62.2"
],
"React-Core/RCTNetworkHeaders": [
"0.62.2"
]
}
}
{
"name": "React-RCTSettings",
"version": "0.62.2",
"summary": "A wrapper for NSUserDefaults, a persistent key-value store available only on iOS.",
"homepage": "http://facebook.github.io/react-native/",
"documentation_url": "https://facebook.github.io/react-native/docs/settings",
"license": "MIT",
"authors": "Facebook, Inc. and its affiliates",
"platforms": {
"ios": "9.0",
"tvos": "9.2"
},
"compiler_flags": "-DFOLLY_NO_CONFIG -DFOLLY_MOBILE=1 -DFOLLY_USE_LIBCPP=1 -Wno-comma -Wno-shorten-64-to-32 -Wno-nullability-completeness",
"source": {
"git": "https://github.com/facebook/react-native.git",
"tag": "v0.62.2"
},
"source_files": "*.{m,mm}",
"preserve_paths": [
"package.json",
"LICENSE",
"LICENSE-docs"
],
"header_dir": "RCTSettings",
"pod_target_xcconfig": {
"USE_HEADERMAP": "YES",
"CLANG_CXX_LANGUAGE_STANDARD": "c++14",
"HEADER_SEARCH_PATHS": "\"$(PODS_ROOT)/Folly\""
},
"dependencies": {
"Folly": [
"2018.10.22.00"
],
"FBReactNativeSpec": [
"0.62.2"
],
"RCTTypeSafety": [
"0.62.2"
],
"ReactCommon/turbomodule/core": [
"0.62.2"
],
"React-Core/RCTSettingsHeaders": [
"0.62.2"
]
}
}
{
"name": "React-RCTText",
"version": "0.62.2",
"summary": "A React component for displaying text.",
"homepage": "http://facebook.github.io/react-native/",
"documentation_url": "https://facebook.github.io/react-native/docs/text",
"license": "MIT",
"authors": "Facebook, Inc. and its affiliates",
"platforms": {
"ios": "9.0",
"tvos": "9.2"
},
"source": {
"git": "https://github.com/facebook/react-native.git",
"tag": "v0.62.2"
},
"source_files": "**/*.{h,m}",
"preserve_paths": [
"package.json",
"LICENSE",
"LICENSE-docs"
],
"header_dir": "RCTText",
"dependencies": {
"React-Core/RCTTextHeaders": [
"0.62.2"
]
}
}
{
"name": "React-RCTVibration",
"version": "0.62.2",
"summary": "An API for controlling the vibration hardware of the device.",
"homepage": "http://facebook.github.io/react-native/",
"documentation_url": "https://facebook.github.io/react-native/docs/vibration",
"license": "MIT",
"authors": "Facebook, Inc. and its affiliates",
"platforms": {
"ios": "9.0",
"tvos": "9.2"
},
"compiler_flags": "-DFOLLY_NO_CONFIG -DFOLLY_MOBILE=1 -DFOLLY_USE_LIBCPP=1 -Wno-comma -Wno-shorten-64-to-32 -Wno-nullability-completeness",
"source": {
"git": "https://github.com/facebook/react-native.git",
"tag": "v0.62.2"
},
"source_files": "*.{m,mm}",
"preserve_paths": [
"package.json",
"LICENSE",
"LICENSE-docs"
],
"header_dir": "RCTVibration",
"pod_target_xcconfig": {
"USE_HEADERMAP": "YES",
"CLANG_CXX_LANGUAGE_STANDARD": "c++14",
"HEADER_SEARCH_PATHS": "\"$(PODS_ROOT)/Folly\""
},
"frameworks": "AudioToolbox",
"dependencies": {
"Folly": [
"2018.10.22.00"
],
"FBReactNativeSpec": [
"0.62.2"
],
"ReactCommon/turbomodule/core": [
"0.62.2"
],
"React-Core/RCTVibrationHeaders": [
"0.62.2"
]
}
}
{
"name": "React-cxxreact",
"version": "0.62.2",
"summary": "-",
"homepage": "http://facebook.github.io/react-native/",
"license": "MIT",
"authors": "Facebook, Inc. and its affiliates",
"platforms": {
"ios": "9.0",
"tvos": "9.2"
},
"source": {
"git": "https://github.com/facebook/react-native.git",
"tag": "v0.62.2"
},
"source_files": "*.{cpp,h}",
"exclude_files": "SampleCxxModule.*",
"compiler_flags": "-DFOLLY_NO_CONFIG -DFOLLY_MOBILE=1 -DFOLLY_USE_LIBCPP=1 -Wno-comma -Wno-shorten-64-to-32 -Wno-documentation",
"pod_target_xcconfig": {
"HEADER_SEARCH_PATHS": "\"$(PODS_ROOT)/boost-for-react-native\" \"$(PODS_ROOT)/Folly\" \"$(PODS_ROOT)/DoubleConversion\""
},
"header_dir": "cxxreact",
"dependencies": {
"boost-for-react-native": [
"1.63.0"
],
"DoubleConversion": [
],
"Folly": [
"2018.10.22.00"
],
"glog": [
],
"React-jsinspector": [
"0.62.2"
]
}
}
{
"name": "React-jsi",
"version": "0.62.2",
"summary": "-",
"homepage": "http://facebook.github.io/react-native/",
"license": "MIT",
"authors": "Facebook, Inc. and its affiliates",
"platforms": {
"ios": "9.0",
"tvos": "9.2"
},
"source": {
"git": "https://github.com/facebook/react-native.git",
"tag": "v0.62.2"
},
"source_files": "**/*.{cpp,h}",
"exclude_files": "**/test/*",
"frameworks": "JavaScriptCore",
"compiler_flags": "-DFOLLY_NO_CONFIG -DFOLLY_MOBILE=1 -DFOLLY_USE_LIBCPP=1 -Wno-comma -Wno-shorten-64-to-32 -Wno-documentation",
"pod_target_xcconfig": {
"HEADER_SEARCH_PATHS": "\"$(PODS_ROOT)/boost-for-react-native\" \"$(PODS_ROOT)/Folly\" \"$(PODS_ROOT)/DoubleConversion\""
},
"header_dir": "jsi",
"default_subspecs": "Default",
"dependencies": {
"boost-for-react-native": [
"1.63.0"
],
"DoubleConversion": [
],
"Folly": [
"2018.10.22.00"
],
"glog": [
]
},
"subspecs": [
{
"name": "Default"
},
{
"name": "Fabric",
"pod_target_xcconfig": {
"OTHER_CFLAGS": "$(inherited) -DRN_FABRIC_ENABLED"
}
}
]
}
{
"name": "React-jsiexecutor",
"version": "0.62.2",
"summary": "-",
"homepage": "http://facebook.github.io/react-native/",
"license": "MIT",
"authors": "Facebook, Inc. and its affiliates",
"platforms": {
"ios": "9.0",
"tvos": "9.2"
},
"source": {
"git": "https://github.com/facebook/react-native.git",
"tag": "v0.62.2"
},
"source_files": "jsireact/*.{cpp,h}",
"compiler_flags": "-DFOLLY_NO_CONFIG -DFOLLY_MOBILE=1 -DFOLLY_USE_LIBCPP=1 -Wno-comma -Wno-shorten-64-to-32 -Wno-documentation",
"pod_target_xcconfig": {
"HEADER_SEARCH_PATHS": "\"$(PODS_ROOT)/boost-for-react-native\" \"$(PODS_ROOT)/Folly\" \"$(PODS_ROOT)/DoubleConversion\""
},
"header_dir": "jsireact",
"dependencies": {
"React-cxxreact": [
"0.62.2"
],
"React-jsi": [
"0.62.2"
],
"Folly": [
"2018.10.22.00"
],
"DoubleConversion": [
],
"glog": [
]
}
}
{
"name": "React-jsinspector",
"version": "0.62.2",
"summary": "-",
"homepage": "http://facebook.github.io/react-native/",
"license": "MIT",
"authors": "Facebook, Inc. and its affiliates",
"platforms": {
"ios": "9.0",
"tvos": "9.2"
},
"source": {
"git": "https://github.com/facebook/react-native.git",
"tag": "v0.62.2"
},
"source_files": "*.{cpp,h}",
"header_dir": "jsinspector"
}
{
"name": "React",
"version": "0.62.2",
"summary": "A framework for building native apps using React",
"description": "React Native apps are built using the React JS\nframework, and render directly to native UIKit\nelements using a fully asynchronous architecture.\nThere is no browser and no HTML. We have picked what\nwe think is the best set of features from these and\nother technologies to build what we hope to become\nthe best product development framework available,\nwith an emphasis on iteration speed, developer\ndelight, continuity of technology, and absolutely\nbeautiful and fast products with no compromises in\nquality or capability.",
"homepage": "http://facebook.github.io/react-native/",
"license": "MIT",
"authors": "Facebook, Inc. and its affiliates",
"platforms": {
"ios": "9.0",
"tvos": "9.2"
},
"source": {
"git": "https://github.com/facebook/react-native.git",
"tag": "v0.62.2"
},
"preserve_paths": [
"package.json",
"LICENSE",
"LICENSE-docs"
],
"cocoapods_version": ">= 1.2.0",
"dependencies": {
"React-Core": [
"0.62.2"
],
"React-Core/DevSupport": [
"0.62.2"
],
"React-Core/RCTWebSocket": [
"0.62.2"
],
"React-RCTActionSheet": [
"0.62.2"
],
"React-RCTAnimation": [
"0.62.2"
],
"React-RCTBlob": [
"0.62.2"
],
"React-RCTImage": [
"0.62.2"
],
"React-RCTLinking": [
"0.62.2"
],
"React-RCTNetwork": [
"0.62.2"
],
"React-RCTSettings": [
"0.62.2"
],
"React-RCTText": [
"0.62.2"
],
"React-RCTVibration": [
"0.62.2"
]
}
}
{
"name": "ReactCommon",
"module_name": "ReactCommon",
"version": "0.62.2",
"summary": "-",
"homepage": "http://facebook.github.io/react-native/",
"license": "MIT",
"authors": "Facebook, Inc. and its affiliates",
"platforms": {
"ios": "9.0",
"tvos": "9.2"
},
"source": {
"git": "https://github.com/facebook/react-native.git",
"tag": "v0.62.2"
},
"header_dir": "ReactCommon",
"compiler_flags": "-DFOLLY_NO_CONFIG -DFOLLY_MOBILE=1 -DFOLLY_USE_LIBCPP=1 -Wno-comma -Wno-shorten-64-to-32 -Wno-documentation",
"pod_target_xcconfig": {
"HEADER_SEARCH_PATHS": "\"$(PODS_ROOT)/boost-for-react-native\" \"$(PODS_ROOT)/Folly\" \"$(PODS_ROOT)/DoubleConversion\" \"$(PODS_ROOT)/Headers/Private/React-Core\"",
"USE_HEADERMAP": "YES",
"CLANG_CXX_LANGUAGE_STANDARD": "c++14"
},
"subspecs": [
{
"name": "callinvoker",
"source_files": "callinvoker/**/*.{cpp,h}",
"dependencies": {
"React-cxxreact": [
"0.62.2"
],
"DoubleConversion": [
],
"Folly": [
"2018.10.22.00"
],
"glog": [
]
}
},
{
"name": "turbomodule",
"dependencies": {
"ReactCommon/callinvoker": [
"0.62.2"
],
"React-Core": [
"0.62.2"
],
"React-cxxreact": [
"0.62.2"
],
"React-jsi": [
"0.62.2"
],
"Folly": [
"2018.10.22.00"
],
"DoubleConversion": [
],
"glog": [
]
},
"subspecs": [
{
"name": "core",
"source_files": [
"turbomodule/core/*.{cpp,h}",
"turbomodule/core/platform/ios/*.{mm,cpp,h}"
]
},
{
"name": "samples",
"source_files": [
"turbomodule/samples/*.{cpp,h}",
"turbomodule/samples/platform/ios/*.{mm,cpp,h}"
],
"dependencies": {
"ReactCommon/turbomodule/core": [
"0.62.2"
]
}
}
]
}
]
}
{
"name": "Yoga",
"version": "1.14.0",
"license": {
"type": "MIT"
},
"homepage": "https://yogalayout.com",
"documentation_url": "https://yogalayout.com/docs/",
"summary": "Yoga is a cross-platform layout engine which implements Flexbox.",
"description": "Yoga is a cross-platform layout engine enabling maximum collaboration within your team by implementing an API many designers are familiar with, and opening it up to developers across different platforms.",
"authors": "Facebook",
"source": {
"git": "https://github.com/facebook/react-native.git",
"tag": "v0.62.2"
},
"module_name": "yoga",
"header_dir": "yoga",
"requires_arc": false,
"pod_target_xcconfig": {
"DEFINES_MODULE": "YES"
},
"compiler_flags": [
"-fno-omit-frame-pointer",
"-fexceptions",
"-Wall",
"-Werror",
"-std=c++1y",
"-fPIC"
],
"platforms": {
"ios": "9.0",
"tvos": "9.2"
},
"source_files": "yoga/**/*.{cpp,h}",
"public_header_files": "yoga/{Yoga,YGEnums,YGMacros,YGValue}.h"
}
{
"name": "glog",
"version": "0.3.5",
"license": {
"type": "Google",
"file": "COPYING"
},
"homepage": "https://github.com/google/glog",
"summary": "Google logging module",
"authors": "Google",
"prepare_command": "#!/bin/bash\n# Copyright (c) Facebook, Inc. and its affiliates.\n#\n# This source code is licensed under the MIT license found in the\n# LICENSE file in the root directory of this source tree.\n\nset -e\n\nPLATFORM_NAME=\"${PLATFORM_NAME:-iphoneos}\"\nCURRENT_ARCH=\"${CURRENT_ARCH}\"\n\nif [ -z \"$CURRENT_ARCH\" ] || [ \"$CURRENT_ARCH\" == \"undefined_arch\" ]; then\n # Xcode 10 beta sets CURRENT_ARCH to \"undefined_arch\", this leads to incorrect linker arg.\n # it's better to rely on platform name as fallback because architecture differs between simulator and device\n\n if [[ \"$PLATFORM_NAME\" == *\"simulator\"* ]]; then\n CURRENT_ARCH=\"x86_64\"\n else\n CURRENT_ARCH=\"armv7\"\n fi\nfi\n\nexport CC=\"$(xcrun -find -sdk $PLATFORM_NAME cc) -arch $CURRENT_ARCH -isysroot $(xcrun -sdk $PLATFORM_NAME --show-sdk-path)\"\nexport CXX=\"$CC\"\n\n# Remove automake symlink if it exists\nif [ -h \"test-driver\" ]; then\n rm test-driver\nfi\n\n./configure --host arm-apple-darwin\n\n# Fix build for tvOS\ncat << EOF >> src/config.h\n\n/* Add in so we have Apple Target Conditionals */\n#ifdef __APPLE__\n#include <TargetConditionals.h>\n#include <Availability.h>\n#endif\n\n/* Special configuration for AppleTVOS */\n#if TARGET_OS_TV\n#undef HAVE_SYSCALL_H\n#undef HAVE_SYS_SYSCALL_H\n#undef OS_MACOSX\n#endif\n\n/* Special configuration for ucontext */\n#undef HAVE_UCONTEXT_H\n#undef PC_FROM_UCONTEXT\n#if defined(__x86_64__)\n#define PC_FROM_UCONTEXT uc_mcontext->__ss.__rip\n#elif defined(__i386__)\n#define PC_FROM_UCONTEXT uc_mcontext->__ss.__eip\n#endif\nEOF\n\n# Prepare exported header include\nEXPORTED_INCLUDE_DIR=\"exported/glog\"\nmkdir -p exported/glog\ncp -f src/glog/log_severity.h \"$EXPORTED_INCLUDE_DIR/\"\ncp -f src/glog/logging.h \"$EXPORTED_INCLUDE_DIR/\"\ncp -f src/glog/raw_logging.h \"$EXPORTED_INCLUDE_DIR/\"\ncp -f src/glog/stl_logging.h \"$EXPORTED_INCLUDE_DIR/\"\ncp -f src/glog/vlog_is_on.h \"$EXPORTED_INCLUDE_DIR/\"",
"source": {
"git": "https://github.com/google/glog.git",
"tag": "v0.3.5"
},
"module_name": "glog",
"header_dir": "glog",
"source_files": [
"src/glog/*.h",
"src/demangle.cc",
"src/logging.cc",
"src/raw_logging.cc",
"src/signalhandler.cc",
"src/symbolize.cc",
"src/utilities.cc",
"src/vlog_is_on.cc"
],
"preserve_paths": [
"src/*.h",
"src/base/*.h"
],
"exclude_files": "src/windows/**/*",
"libraries": "stdc++",
"compiler_flags": "-Wno-shorten-64-to-32",
"pod_target_xcconfig": {
"USE_HEADERMAP": "NO",
"HEADER_SEARCH_PATHS": "$(PODS_TARGET_SRCROOT)/src"
},
"platforms": {
"ios": "9.0",
"tvos": "9.2"
}
}
<?xml version="1.0" encoding="UTF-8"?>
<Workspace
version = "1.0">
<FileRef
location = "self:">
</FileRef>
</Workspace>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>IDEDidComputeMac32BitWarning</key>
<true/>
</dict>
</plist>
../acorn/bin/acorn
\ No newline at end of file
../atob/bin/atob.js
\ No newline at end of file
../color-support/bin.js
\ No newline at end of file
../envinfo/dist/cli.js
\ No newline at end of file
../escodegen/bin/escodegen.js
\ No newline at end of file
../escodegen/bin/esgenerate.js
\ No newline at end of file
../eslint/bin/eslint.js
\ No newline at end of file
../eslint-config-prettier/bin/cli.js
\ No newline at end of file
../esprima/bin/esparse.js
\ No newline at end of file
../esprima/bin/esvalidate.js
\ No newline at end of file
../image-size/bin/image-size.js
\ No newline at end of file
../import-local/fixtures/cli.js
\ No newline at end of file
../is-ci/bin.js
\ No newline at end of file
../jest/bin/jest.js
\ No newline at end of file
../jest-runtime/bin/jest-runtime.js
\ No newline at end of file
../jetifier/bin/jetify
\ No newline at end of file
../jetifier/bin/jetifier-standalone
\ No newline at end of file
../jetifier/bin/jetify
\ No newline at end of file
../js-yaml/bin/js-yaml.js
\ No newline at end of file
../jsesc/bin/jsesc
\ No newline at end of file
../json5/lib/cli.js
\ No newline at end of file
../logkitty/bin/logkitty.js
\ No newline at end of file
../loose-envify/cli.js
\ No newline at end of file
../metro/src/cli.js
\ No newline at end of file
../metro-inspector-proxy/src/cli.js
\ No newline at end of file
../metro-symbolicate/src/symbolicate.js
\ No newline at end of file
../mime/cli.js
\ No newline at end of file
../mkdirp/bin/cmd.js
\ No newline at end of file
../jest-changed-files/node_modules/which/bin/node-which
\ No newline at end of file
../@babel/parser/bin/babel-parser.js
\ No newline at end of file
../prettier/bin-prettier.js
\ No newline at end of file
../react-native/cli.js
\ No newline at end of file
../regjsparser/bin/parser
\ No newline at end of file
../@jest/core/node_modules/rimraf/bin.js
\ No newline at end of file
../sane/src/cli.js
\ No newline at end of file
../@babel/core/node_modules/semver/bin/semver
\ No newline at end of file
../sshpk/bin/sshpk-conv
\ No newline at end of file
../sshpk/bin/sshpk-sign
\ No newline at end of file
../sshpk/bin/sshpk-verify
\ No newline at end of file
../uglify-es/bin/uglifyjs
\ No newline at end of file
../uuid/bin/uuid
\ No newline at end of file
../@cnakazawa/watch/cli.js
\ No newline at end of file
This source diff could not be displayed because it is too large. You can view the blob instead.
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.
# @babel/code-frame
> Generate errors that contain a code frame that point to source locations.
See our website [@babel/code-frame](https://babeljs.io/docs/en/next/babel-code-frame.html) for more information.
## Install
Using npm:
```sh
npm install --save-dev @babel/code-frame
```
or using yarn:
```sh
yarn add @babel/code-frame --dev
```
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.codeFrameColumns = codeFrameColumns;
exports.default = _default;
var _highlight = _interopRequireWildcard(require("@babel/highlight"));
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
let deprecationWarningShown = false;
function getDefs(chalk) {
return {
gutter: chalk.grey,
marker: chalk.red.bold,
message: chalk.red.bold
};
}
const NEWLINE = /\r\n|[\n\r\u2028\u2029]/;
function getMarkerLines(loc, source, opts) {
const startLoc = Object.assign({
column: 0,
line: -1
}, loc.start);
const endLoc = Object.assign({}, startLoc, {}, loc.end);
const {
linesAbove = 2,
linesBelow = 3
} = opts || {};
const startLine = startLoc.line;
const startColumn = startLoc.column;
const endLine = endLoc.line;
const endColumn = endLoc.column;
let start = Math.max(startLine - (linesAbove + 1), 0);
let end = Math.min(source.length, endLine + linesBelow);
if (startLine === -1) {
start = 0;
}
if (endLine === -1) {
end = source.length;
}
const lineDiff = endLine - startLine;
const markerLines = {};
if (lineDiff) {
for (let i = 0; i <= lineDiff; i++) {
const lineNumber = i + startLine;
if (!startColumn) {
markerLines[lineNumber] = true;
} else if (i === 0) {
const sourceLength = source[lineNumber - 1].length;
markerLines[lineNumber] = [startColumn, sourceLength - startColumn + 1];
} else if (i === lineDiff) {
markerLines[lineNumber] = [0, endColumn];
} else {
const sourceLength = source[lineNumber - i].length;
markerLines[lineNumber] = [0, sourceLength];
}
}
} else {
if (startColumn === endColumn) {
if (startColumn) {
markerLines[startLine] = [startColumn, 0];
} else {
markerLines[startLine] = true;
}
} else {
markerLines[startLine] = [startColumn, endColumn - startColumn];
}
}
return {
start,
end,
markerLines
};
}
function codeFrameColumns(rawLines, loc, opts = {}) {
const highlighted = (opts.highlightCode || opts.forceColor) && (0, _highlight.shouldHighlight)(opts);
const chalk = (0, _highlight.getChalk)(opts);
const defs = getDefs(chalk);
const maybeHighlight = (chalkFn, string) => {
return highlighted ? chalkFn(string) : string;
};
const lines = rawLines.split(NEWLINE);
const {
start,
end,
markerLines
} = getMarkerLines(loc, lines, opts);
const hasColumns = loc.start && typeof loc.start.column === "number";
const numberMaxWidth = String(end).length;
const highlightedLines = highlighted ? (0, _highlight.default)(rawLines, opts) : rawLines;
let frame = highlightedLines.split(NEWLINE).slice(start, end).map((line, index) => {
const number = start + 1 + index;
const paddedNumber = ` ${number}`.slice(-numberMaxWidth);
const gutter = ` ${paddedNumber} | `;
const hasMarker = markerLines[number];
const lastMarkerLine = !markerLines[number + 1];
if (hasMarker) {
let markerLine = "";
if (Array.isArray(hasMarker)) {
const markerSpacing = line.slice(0, Math.max(hasMarker[0] - 1, 0)).replace(/[^\t]/g, " ");
const numberOfMarkers = hasMarker[1] || 1;
markerLine = ["\n ", maybeHighlight(defs.gutter, gutter.replace(/\d/g, " ")), markerSpacing, maybeHighlight(defs.marker, "^").repeat(numberOfMarkers)].join("");
if (lastMarkerLine && opts.message) {
markerLine += " " + maybeHighlight(defs.message, opts.message);
}
}
return [maybeHighlight(defs.marker, ">"), maybeHighlight(defs.gutter, gutter), line, markerLine].join("");
} else {
return ` ${maybeHighlight(defs.gutter, gutter)}${line}`;
}
}).join("\n");
if (opts.message && !hasColumns) {
frame = `${" ".repeat(numberMaxWidth + 1)}${opts.message}\n${frame}`;
}
if (highlighted) {
return chalk.reset(frame);
} else {
return frame;
}
}
function _default(rawLines, lineNumber, colNumber, opts = {}) {
if (!deprecationWarningShown) {
deprecationWarningShown = true;
const message = "Passing lineNumber and colNumber is deprecated to @babel/code-frame. Please use `codeFrameColumns`.";
if (process.emitWarning) {
process.emitWarning(message, "DeprecationWarning");
} else {
const deprecationError = new Error(message);
deprecationError.name = "DeprecationWarning";
console.warn(new Error(message));
}
}
colNumber = Math.max(colNumber, 0);
const location = {
start: {
column: colNumber,
line: lineNumber
}
};
return codeFrameColumns(rawLines, location, opts);
}
\ No newline at end of file
{
"name": "@babel/code-frame",
"version": "7.8.3",
"description": "Generate errors that contain a code frame that point to source locations.",
"author": "Sebastian McKenzie <sebmck@gmail.com>",
"homepage": "https://babeljs.io/",
"license": "MIT",
"publishConfig": {
"access": "public"
},
"repository": "https://github.com/babel/babel/tree/master/packages/babel-code-frame",
"main": "lib/index.js",
"dependencies": {
"@babel/highlight": "^7.8.3"
},
"devDependencies": {
"chalk": "^2.0.0",
"strip-ansi": "^4.0.0"
},
"gitHead": "a7620bd266ae1345975767bbc7abf09034437017"
}
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.
# @babel/core
> Babel compiler core.
See our website [@babel/core](https://babeljs.io/docs/en/next/babel-core.html) for more information or the [issues](https://github.com/babel/babel/issues?utf8=%E2%9C%93&q=is%3Aissue+label%3A%22pkg%3A%20core%22+is%3Aopen) associated with this package.
## Install
Using npm:
```sh
npm install --save-dev @babel/core
```
or using yarn:
```sh
yarn add @babel/core --dev
```
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.makeWeakCache = makeWeakCache;
exports.makeWeakCacheSync = makeWeakCacheSync;
exports.makeStrongCache = makeStrongCache;
exports.makeStrongCacheSync = makeStrongCacheSync;
exports.assertSimpleType = assertSimpleType;
function _gensync() {
const data = _interopRequireDefault(require("gensync"));
_gensync = function () {
return data;
};
return data;
}
var _async = require("../gensync-utils/async");
var _util = require("./util");
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
const synchronize = gen => {
return (0, _gensync().default)(gen).sync;
};
function* genTrue(data) {
return true;
}
function makeWeakCache(handler) {
return makeCachedFunction(WeakMap, handler);
}
function makeWeakCacheSync(handler) {
return synchronize(makeWeakCache(handler));
}
function makeStrongCache(handler) {
return makeCachedFunction(Map, handler);
}
function makeStrongCacheSync(handler) {
return synchronize(makeStrongCache(handler));
}
function makeCachedFunction(CallCache, handler) {
const callCacheSync = new CallCache();
const callCacheAsync = new CallCache();
const futureCache = new CallCache();
return function* cachedFunction(arg, data) {
const asyncContext = yield* (0, _async.isAsync)();
const callCache = asyncContext ? callCacheAsync : callCacheSync;
const cached = yield* getCachedValueOrWait(asyncContext, callCache, futureCache, arg, data);
if (cached.valid) return cached.value;
const cache = new CacheConfigurator(data);
const handlerResult = handler(arg, cache);
let finishLock;
let value;
if ((0, _util.isIterableIterator)(handlerResult)) {
const gen = handlerResult;
value = yield* (0, _async.onFirstPause)(gen, () => {
finishLock = setupAsyncLocks(cache, futureCache, arg);
});
} else {
value = handlerResult;
}
updateFunctionCache(callCache, cache, arg, value);
if (finishLock) {
futureCache.delete(arg);
finishLock.release(value);
}
return value;
};
}
function* getCachedValue(cache, arg, data) {
const cachedValue = cache.get(arg);
if (cachedValue) {
for (const {
value,
valid
} of cachedValue) {
if (yield* valid(data)) return {
valid: true,
value
};
}
}
return {
valid: false,
value: null
};
}
function* getCachedValueOrWait(asyncContext, callCache, futureCache, arg, data) {
const cached = yield* getCachedValue(callCache, arg, data);
if (cached.valid) {
return cached;
}
if (asyncContext) {
const cached = yield* getCachedValue(futureCache, arg, data);
if (cached.valid) {
const value = yield* (0, _async.waitFor)(cached.value.promise);
return {
valid: true,
value
};
}
}
return {
valid: false,
value: null
};
}
function setupAsyncLocks(config, futureCache, arg) {
const finishLock = new Lock();
updateFunctionCache(futureCache, config, arg, finishLock);
return finishLock;
}
function updateFunctionCache(cache, config, arg, value) {
if (!config.configured()) config.forever();
let cachedValue = cache.get(arg);
config.deactivate();
switch (config.mode()) {
case "forever":
cachedValue = [{
value,
valid: genTrue
}];
cache.set(arg, cachedValue);
break;
case "invalidate":
cachedValue = [{
value,
valid: config.validator()
}];
cache.set(arg, cachedValue);
break;
case "valid":
if (cachedValue) {
cachedValue.push({
value,
valid: config.validator()
});
} else {
cachedValue = [{
value,
valid: config.validator()
}];
cache.set(arg, cachedValue);
}
}
}
class CacheConfigurator {
constructor(data) {
this._active = true;
this._never = false;
this._forever = false;
this._invalidate = false;
this._configured = false;
this._pairs = [];
this._data = data;
}
simple() {
return makeSimpleConfigurator(this);
}
mode() {
if (this._never) return "never";
if (this._forever) return "forever";
if (this._invalidate) return "invalidate";
return "valid";
}
forever() {
if (!this._active) {
throw new Error("Cannot change caching after evaluation has completed.");
}
if (this._never) {
throw new Error("Caching has already been configured with .never()");
}
this._forever = true;
this._configured = true;
}
never() {
if (!this._active) {
throw new Error("Cannot change caching after evaluation has completed.");
}
if (this._forever) {
throw new Error("Caching has already been configured with .forever()");
}
this._never = true;
this._configured = true;
}
using(handler) {
if (!this._active) {
throw new Error("Cannot change caching after evaluation has completed.");
}
if (this._never || this._forever) {
throw new Error("Caching has already been configured with .never or .forever()");
}
this._configured = true;
const key = handler(this._data);
const fn = (0, _async.maybeAsync)(handler, `You appear to be using an async cache handler, but Babel has been called synchronously`);
if ((0, _async.isThenable)(key)) {
return key.then(key => {
this._pairs.push([key, fn]);
return key;
});
}
this._pairs.push([key, fn]);
return key;
}
invalidate(handler) {
this._invalidate = true;
return this.using(handler);
}
validator() {
const pairs = this._pairs;
return function* (data) {
for (const [key, fn] of pairs) {
if (key !== (yield* fn(data))) return false;
}
return true;
};
}
deactivate() {
this._active = false;
}
configured() {
return this._configured;
}
}
function makeSimpleConfigurator(cache) {
function cacheFn(val) {
if (typeof val === "boolean") {
if (val) cache.forever();else cache.never();
return;
}
return cache.using(() => assertSimpleType(val()));
}
cacheFn.forever = () => cache.forever();
cacheFn.never = () => cache.never();
cacheFn.using = cb => cache.using(() => assertSimpleType(cb()));
cacheFn.invalidate = cb => cache.invalidate(() => assertSimpleType(cb()));
return cacheFn;
}
function assertSimpleType(value) {
if ((0, _async.isThenable)(value)) {
throw new Error(`You appear to be using an async cache handler, ` + `which your current version of Babel does not support. ` + `We may add support for this in the future, ` + `but if you're on the most recent version of @babel/core and still ` + `seeing this error, then you'll need to synchronously handle your caching logic.`);
}
if (value != null && typeof value !== "string" && typeof value !== "boolean" && typeof value !== "number") {
throw new Error("Cache keys must be either string, boolean, number, null, or undefined.");
}
return value;
}
class Lock {
constructor() {
this.released = false;
this.promise = new Promise(resolve => {
this._resolve = resolve;
});
}
release(value) {
this.released = true;
this._resolve(value);
}
}
\ No newline at end of file
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.createCachedDescriptors = createCachedDescriptors;
exports.createUncachedDescriptors = createUncachedDescriptors;
exports.createDescriptor = createDescriptor;
var _files = require("./files");
var _item = require("./item");
var _caching = require("./caching");
function isEqualDescriptor(a, b) {
return a.name === b.name && a.value === b.value && a.options === b.options && a.dirname === b.dirname && a.alias === b.alias && a.ownPass === b.ownPass && (a.file && a.file.request) === (b.file && b.file.request) && (a.file && a.file.resolved) === (b.file && b.file.resolved);
}
function createCachedDescriptors(dirname, options, alias) {
const {
plugins,
presets,
passPerPreset
} = options;
return {
options,
plugins: plugins ? () => createCachedPluginDescriptors(plugins, dirname)(alias) : () => [],
presets: presets ? () => createCachedPresetDescriptors(presets, dirname)(alias)(!!passPerPreset) : () => []
};
}
function createUncachedDescriptors(dirname, options, alias) {
let plugins;
let presets;
return {
options,
plugins: () => {
if (!plugins) {
plugins = createPluginDescriptors(options.plugins || [], dirname, alias);
}
return plugins;
},
presets: () => {
if (!presets) {
presets = createPresetDescriptors(options.presets || [], dirname, alias, !!options.passPerPreset);
}
return presets;
}
};
}
const PRESET_DESCRIPTOR_CACHE = new WeakMap();
const createCachedPresetDescriptors = (0, _caching.makeWeakCacheSync)((items, cache) => {
const dirname = cache.using(dir => dir);
return (0, _caching.makeStrongCacheSync)(alias => (0, _caching.makeStrongCacheSync)(passPerPreset => createPresetDescriptors(items, dirname, alias, passPerPreset).map(desc => loadCachedDescriptor(PRESET_DESCRIPTOR_CACHE, desc))));
});
const PLUGIN_DESCRIPTOR_CACHE = new WeakMap();
const createCachedPluginDescriptors = (0, _caching.makeWeakCacheSync)((items, cache) => {
const dirname = cache.using(dir => dir);
return (0, _caching.makeStrongCacheSync)(alias => createPluginDescriptors(items, dirname, alias).map(desc => loadCachedDescriptor(PLUGIN_DESCRIPTOR_CACHE, desc)));
});
const DEFAULT_OPTIONS = {};
function loadCachedDescriptor(cache, desc) {
const {
value,
options = DEFAULT_OPTIONS
} = desc;
if (options === false) return desc;
let cacheByOptions = cache.get(value);
if (!cacheByOptions) {
cacheByOptions = new WeakMap();
cache.set(value, cacheByOptions);
}
let possibilities = cacheByOptions.get(options);
if (!possibilities) {
possibilities = [];
cacheByOptions.set(options, possibilities);
}
if (possibilities.indexOf(desc) === -1) {
const matches = possibilities.filter(possibility => isEqualDescriptor(possibility, desc));
if (matches.length > 0) {
return matches[0];
}
possibilities.push(desc);
}
return desc;
}
function createPresetDescriptors(items, dirname, alias, passPerPreset) {
return createDescriptors("preset", items, dirname, alias, passPerPreset);
}
function createPluginDescriptors(items, dirname, alias) {
return createDescriptors("plugin", items, dirname, alias);
}
function createDescriptors(type, items, dirname, alias, ownPass) {
const descriptors = items.map((item, index) => createDescriptor(item, dirname, {
type,
alias: `${alias}$${index}`,
ownPass: !!ownPass
}));
assertNoDuplicates(descriptors);
return descriptors;
}
function createDescriptor(pair, dirname, {
type,
alias,
ownPass
}) {
const desc = (0, _item.getItemDescriptor)(pair);
if (desc) {
return desc;
}
let name;
let options;
let value = pair;
if (Array.isArray(value)) {
if (value.length === 3) {
[value, options, name] = value;
} else {
[value, options] = value;
}
}
let file = undefined;
let filepath = null;
if (typeof value === "string") {
if (typeof type !== "string") {
throw new Error("To resolve a string-based item, the type of item must be given");
}
const resolver = type === "plugin" ? _files.loadPlugin : _files.loadPreset;
const request = value;
({
filepath,
value
} = resolver(value, dirname));
file = {
request,
resolved: filepath
};
}
if (!value) {
throw new Error(`Unexpected falsy value: ${String(value)}`);
}
if (typeof value === "object" && value.__esModule) {
if (value.default) {
value = value.default;
} else {
throw new Error("Must export a default export when using ES6 modules.");
}
}
if (typeof value !== "object" && typeof value !== "function") {
throw new Error(`Unsupported format: ${typeof value}. Expected an object or a function.`);
}
if (filepath !== null && typeof value === "object" && value) {
throw new Error(`Plugin/Preset files are not allowed to export objects, only functions. In ${filepath}`);
}
return {
name,
alias: filepath || alias,
value,
options,
dirname,
ownPass,
file
};
}
function assertNoDuplicates(items) {
const map = new Map();
for (const item of items) {
if (typeof item.value !== "function") continue;
let nameMap = map.get(item.value);
if (!nameMap) {
nameMap = new Set();
map.set(item.value, nameMap);
}
if (nameMap.has(item.name)) {
const conflicts = items.filter(i => i.value === item.value);
throw new Error([`Duplicate plugin/preset detected.`, `If you'd like to use two separate instances of a plugin,`, `they need separate names, e.g.`, ``, ` plugins: [`, ` ['some-plugin', {}],`, ` ['some-plugin', {}, 'some unique name'],`, ` ]`, ``, `Duplicates detected are:`, `${JSON.stringify(conflicts, null, 2)}`].join("\n"));
}
nameMap.add(item.name);
}
}
\ No newline at end of file
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = import_;
function import_(filepath) {
return import(filepath);
}
\ No newline at end of file
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.findConfigUpwards = findConfigUpwards;
exports.findPackageData = findPackageData;
exports.findRelativeConfig = findRelativeConfig;
exports.findRootConfig = findRootConfig;
exports.loadConfig = loadConfig;
exports.resolvePlugin = resolvePlugin;
exports.resolvePreset = resolvePreset;
exports.loadPlugin = loadPlugin;
exports.loadPreset = loadPreset;
exports.ROOT_CONFIG_FILENAMES = void 0;
function* findConfigUpwards(rootDir) {
return null;
}
function* findPackageData(filepath) {
return {
filepath,
directories: [],
pkg: null,
isPackage: false
};
}
function* findRelativeConfig(pkgData, envName, caller) {
return {
pkg: null,
config: null,
ignore: null
};
}
function* findRootConfig(dirname, envName, caller) {
return null;
}
function* loadConfig(name, dirname, envName, caller) {
throw new Error(`Cannot load ${name} relative to ${dirname} in a browser`);
}
const ROOT_CONFIG_FILENAMES = [];
exports.ROOT_CONFIG_FILENAMES = ROOT_CONFIG_FILENAMES;
function resolvePlugin(name, dirname) {
return null;
}
function resolvePreset(name, dirname) {
return null;
}
function loadPlugin(name, dirname) {
throw new Error(`Cannot load plugin ${name} relative to ${dirname} in a browser`);
}
function loadPreset(name, dirname) {
throw new Error(`Cannot load preset ${name} relative to ${dirname} in a browser`);
}
\ No newline at end of file
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "findPackageData", {
enumerable: true,
get: function () {
return _package.findPackageData;
}
});
Object.defineProperty(exports, "findConfigUpwards", {
enumerable: true,
get: function () {
return _configuration.findConfigUpwards;
}
});
Object.defineProperty(exports, "findRelativeConfig", {
enumerable: true,
get: function () {
return _configuration.findRelativeConfig;
}
});
Object.defineProperty(exports, "findRootConfig", {
enumerable: true,
get: function () {
return _configuration.findRootConfig;
}
});
Object.defineProperty(exports, "loadConfig", {
enumerable: true,
get: function () {
return _configuration.loadConfig;
}
});
Object.defineProperty(exports, "ROOT_CONFIG_FILENAMES", {
enumerable: true,
get: function () {
return _configuration.ROOT_CONFIG_FILENAMES;
}
});
Object.defineProperty(exports, "resolvePlugin", {
enumerable: true,
get: function () {
return _plugins.resolvePlugin;
}
});
Object.defineProperty(exports, "resolvePreset", {
enumerable: true,
get: function () {
return _plugins.resolvePreset;
}
});
Object.defineProperty(exports, "loadPlugin", {
enumerable: true,
get: function () {
return _plugins.loadPlugin;
}
});
Object.defineProperty(exports, "loadPreset", {
enumerable: true,
get: function () {
return _plugins.loadPreset;
}
});
var _package = require("./package");
var _configuration = require("./configuration");
var _plugins = require("./plugins");
({});
\ No newline at end of file
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = loadCjsOrMjsDefault;
var _async = require("../../gensync-utils/async");
function _path() {
const data = _interopRequireDefault(require("path"));
_path = function () {
return data;
};
return data;
}
function _url() {
const data = require("url");
_url = function () {
return data;
};
return data;
}
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
let import_;
try {
import_ = require("./import").default;
} catch (_unused) {}
function* loadCjsOrMjsDefault(filepath, asyncError) {
switch (guessJSModuleType(filepath)) {
case "cjs":
return loadCjsDefault(filepath);
case "unknown":
try {
return loadCjsDefault(filepath);
} catch (e) {
if (e.code !== "ERR_REQUIRE_ESM") throw e;
}
case "mjs":
if (yield* (0, _async.isAsync)()) {
return yield* (0, _async.waitFor)(loadMjsDefault(filepath));
}
throw new Error(asyncError);
}
}
function guessJSModuleType(filename) {
switch (_path().default.extname(filename)) {
case ".cjs":
return "cjs";
case ".mjs":
return "mjs";
default:
return "unknown";
}
}
function loadCjsDefault(filepath) {
const module = require(filepath);
return (module == null ? void 0 : module.__esModule) ? module.default || undefined : module;
}
function loadMjsDefault(_x) {
return _loadMjsDefault.apply(this, arguments);
}
function _loadMjsDefault() {
_loadMjsDefault = _asyncToGenerator(function* (filepath) {
if (!import_) {
throw new Error("Internal error: Native ECMAScript modules aren't supported" + " by this platform.\n");
}
const module = yield import_((0, _url().pathToFileURL)(filepath));
return module.default;
});
return _loadMjsDefault.apply(this, arguments);
}
\ No newline at end of file
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.findPackageData = findPackageData;
function _path() {
const data = _interopRequireDefault(require("path"));
_path = function () {
return data;
};
return data;
}
var _utils = require("./utils");
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
const PACKAGE_FILENAME = "package.json";
function* findPackageData(filepath) {
let pkg = null;
const directories = [];
let isPackage = true;
let dirname = _path().default.dirname(filepath);
while (!pkg && _path().default.basename(dirname) !== "node_modules") {
directories.push(dirname);
pkg = yield* readConfigPackage(_path().default.join(dirname, PACKAGE_FILENAME));
const nextLoc = _path().default.dirname(dirname);
if (dirname === nextLoc) {
isPackage = false;
break;
}
dirname = nextLoc;
}
return {
filepath,
directories,
pkg,
isPackage
};
}
const readConfigPackage = (0, _utils.makeStaticFileCache)((filepath, content) => {
let options;
try {
options = JSON.parse(content);
} catch (err) {
err.message = `${filepath}: Error while parsing JSON - ${err.message}`;
throw err;
}
if (typeof options !== "object") {
throw new Error(`${filepath}: Config returned typeof ${typeof options}`);
}
if (Array.isArray(options)) {
throw new Error(`${filepath}: Expected config object but found array`);
}
return {
filepath,
dirname: _path().default.dirname(filepath),
options
};
});
\ No newline at end of file
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.resolvePlugin = resolvePlugin;
exports.resolvePreset = resolvePreset;
exports.loadPlugin = loadPlugin;
exports.loadPreset = loadPreset;
function _debug() {
const data = _interopRequireDefault(require("debug"));
_debug = function () {
return data;
};
return data;
}
function _resolve() {
const data = _interopRequireDefault(require("resolve"));
_resolve = function () {
return data;
};
return data;
}
function _path() {
const data = _interopRequireDefault(require("path"));
_path = function () {
return data;
};
return data;
}
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
const debug = (0, _debug().default)("babel:config:loading:files:plugins");
const EXACT_RE = /^module:/;
const BABEL_PLUGIN_PREFIX_RE = /^(?!@|module:|[^/]+\/|babel-plugin-)/;
const BABEL_PRESET_PREFIX_RE = /^(?!@|module:|[^/]+\/|babel-preset-)/;
const BABEL_PLUGIN_ORG_RE = /^(@babel\/)(?!plugin-|[^/]+\/)/;
const BABEL_PRESET_ORG_RE = /^(@babel\/)(?!preset-|[^/]+\/)/;
const OTHER_PLUGIN_ORG_RE = /^(@(?!babel\/)[^/]+\/)(?![^/]*babel-plugin(?:-|\/|$)|[^/]+\/)/;
const OTHER_PRESET_ORG_RE = /^(@(?!babel\/)[^/]+\/)(?![^/]*babel-preset(?:-|\/|$)|[^/]+\/)/;
const OTHER_ORG_DEFAULT_RE = /^(@(?!babel$)[^/]+)$/;
function resolvePlugin(name, dirname) {
return resolveStandardizedName("plugin", name, dirname);
}
function resolvePreset(name, dirname) {
return resolveStandardizedName("preset", name, dirname);
}
function loadPlugin(name, dirname) {
const filepath = resolvePlugin(name, dirname);
if (!filepath) {
throw new Error(`Plugin ${name} not found relative to ${dirname}`);
}
const value = requireModule("plugin", filepath);
debug("Loaded plugin %o from %o.", name, dirname);
return {
filepath,
value
};
}
function loadPreset(name, dirname) {
const filepath = resolvePreset(name, dirname);
if (!filepath) {
throw new Error(`Preset ${name} not found relative to ${dirname}`);
}
const value = requireModule("preset", filepath);
debug("Loaded preset %o from %o.", name, dirname);
return {
filepath,
value
};
}
function standardizeName(type, name) {
if (_path().default.isAbsolute(name)) return name;
const isPreset = type === "preset";
return name.replace(isPreset ? BABEL_PRESET_PREFIX_RE : BABEL_PLUGIN_PREFIX_RE, `babel-${type}-`).replace(isPreset ? BABEL_PRESET_ORG_RE : BABEL_PLUGIN_ORG_RE, `$1${type}-`).replace(isPreset ? OTHER_PRESET_ORG_RE : OTHER_PLUGIN_ORG_RE, `$1babel-${type}-`).replace(OTHER_ORG_DEFAULT_RE, `$1/babel-${type}`).replace(EXACT_RE, "");
}
function resolveStandardizedName(type, name, dirname = process.cwd()) {
const standardizedName = standardizeName(type, name);
try {
return _resolve().default.sync(standardizedName, {
basedir: dirname
});
} catch (e) {
if (e.code !== "MODULE_NOT_FOUND") throw e;
if (standardizedName !== name) {
let resolvedOriginal = false;
try {
_resolve().default.sync(name, {
basedir: dirname
});
resolvedOriginal = true;
} catch (e2) {}
if (resolvedOriginal) {
e.message += `\n- If you want to resolve "${name}", use "module:${name}"`;
}
}
let resolvedBabel = false;
try {
_resolve().default.sync(standardizeName(type, "@babel/" + name), {
basedir: dirname
});
resolvedBabel = true;
} catch (e2) {}
if (resolvedBabel) {
e.message += `\n- Did you mean "@babel/${name}"?`;
}
let resolvedOppositeType = false;
const oppositeType = type === "preset" ? "plugin" : "preset";
try {
_resolve().default.sync(standardizeName(oppositeType, name), {
basedir: dirname
});
resolvedOppositeType = true;
} catch (e2) {}
if (resolvedOppositeType) {
e.message += `\n- Did you accidentally pass a ${oppositeType} as a ${type}?`;
}
throw e;
}
}
const LOADING_MODULES = new Set();
function requireModule(type, name) {
if (LOADING_MODULES.has(name)) {
throw new Error(`Reentrant ${type} detected trying to load "${name}". This module is not ignored ` + "and is trying to load itself while compiling itself, leading to a dependency cycle. " + 'We recommend adding it to your "ignore" list in your babelrc, or to a .babelignore.');
}
try {
LOADING_MODULES.add(name);
return require(name);
} finally {
LOADING_MODULES.delete(name);
}
}
\ No newline at end of file
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.makeStaticFileCache = makeStaticFileCache;
var _caching = require("../caching");
var fs = _interopRequireWildcard(require("../../gensync-utils/fs"));
function _fs2() {
const data = _interopRequireDefault(require("fs"));
_fs2 = function () {
return data;
};
return data;
}
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
function makeStaticFileCache(fn) {
return (0, _caching.makeStrongCache)(function* (filepath, cache) {
const cached = cache.invalidate(() => fileMtime(filepath));
if (cached === null) {
cache.forever();
return null;
}
return fn(filepath, (yield* fs.readFile(filepath, "utf8")));
});
}
function fileMtime(filepath) {
try {
return +_fs2().default.statSync(filepath).mtime;
} catch (e) {
if (e.code !== "ENOENT" && e.code !== "ENOTDIR") throw e;
}
return null;
}
\ No newline at end of file
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
function _gensync() {
const data = _interopRequireDefault(require("gensync"));
_gensync = function () {
return data;
};
return data;
}
var _async = require("../gensync-utils/async");
var _util = require("./util");
var context = _interopRequireWildcard(require("../index"));
var _plugin = _interopRequireDefault(require("./plugin"));
var _item = require("./item");
var _configChain = require("./config-chain");
function _traverse() {
const data = _interopRequireDefault(require("@babel/traverse"));
_traverse = function () {
return data;
};
return data;
}
var _caching = require("./caching");
var _options = require("./validation/options");
var _plugins = require("./validation/plugins");
var _configApi = _interopRequireDefault(require("./helpers/config-api"));
var _partial = _interopRequireDefault(require("./partial"));
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var _default = (0, _gensync().default)(function* loadFullConfig(inputOpts) {
const result = yield* (0, _partial.default)(inputOpts);
if (!result) {
return null;
}
const {
options,
context
} = result;
const optionDefaults = {};
const passes = [[]];
try {
const {
plugins,
presets
} = options;
if (!plugins || !presets) {
throw new Error("Assertion failure - plugins and presets exist");
}
const ignored = yield* function* recurseDescriptors(config, pass) {
const plugins = [];
for (let i = 0; i < config.plugins.length; i++) {
const descriptor = config.plugins[i];
if (descriptor.options !== false) {
try {
plugins.push((yield* loadPluginDescriptor(descriptor, context)));
} catch (e) {
if (i > 0 && e.code === "BABEL_UNKNOWN_PLUGIN_PROPERTY") {
(0, _options.checkNoUnwrappedItemOptionPairs)(config.plugins[i - 1], descriptor, "plugin", i, e);
}
throw e;
}
}
}
const presets = [];
for (let i = 0; i < config.presets.length; i++) {
const descriptor = config.presets[i];
if (descriptor.options !== false) {
try {
presets.push({
preset: yield* loadPresetDescriptor(descriptor, context),
pass: descriptor.ownPass ? [] : pass
});
} catch (e) {
if (i > 0 && e.code === "BABEL_UNKNOWN_OPTION") {
(0, _options.checkNoUnwrappedItemOptionPairs)(config.presets[i - 1], descriptor, "preset", i, e);
}
throw e;
}
}
}
if (presets.length > 0) {
passes.splice(1, 0, ...presets.map(o => o.pass).filter(p => p !== pass));
for (const {
preset,
pass
} of presets) {
if (!preset) return true;
const ignored = yield* recurseDescriptors({
plugins: preset.plugins,
presets: preset.presets
}, pass);
if (ignored) return true;
preset.options.forEach(opts => {
(0, _util.mergeOptions)(optionDefaults, opts);
});
}
}
if (plugins.length > 0) {
pass.unshift(...plugins);
}
}({
plugins: plugins.map(item => {
const desc = (0, _item.getItemDescriptor)(item);
if (!desc) {
throw new Error("Assertion failure - must be config item");
}
return desc;
}),
presets: presets.map(item => {
const desc = (0, _item.getItemDescriptor)(item);
if (!desc) {
throw new Error("Assertion failure - must be config item");
}
return desc;
})
}, passes[0]);
if (ignored) return null;
} catch (e) {
if (!/^\[BABEL\]/.test(e.message)) {
e.message = `[BABEL] ${context.filename || "unknown"}: ${e.message}`;
}
throw e;
}
const opts = optionDefaults;
(0, _util.mergeOptions)(opts, options);
opts.plugins = passes[0];
opts.presets = passes.slice(1).filter(plugins => plugins.length > 0).map(plugins => ({
plugins
}));
opts.passPerPreset = opts.presets.length > 0;
return {
options: opts,
passes: passes
};
});
exports.default = _default;
const loadDescriptor = (0, _caching.makeWeakCache)(function* ({
value,
options,
dirname,
alias
}, cache) {
if (options === false) throw new Error("Assertion failure");
options = options || {};
let item = value;
if (typeof value === "function") {
const api = Object.assign({}, context, {}, (0, _configApi.default)(cache));
try {
item = value(api, options, dirname);
} catch (e) {
if (alias) {
e.message += ` (While processing: ${JSON.stringify(alias)})`;
}
throw e;
}
}
if (!item || typeof item !== "object") {
throw new Error("Plugin/Preset did not return an object.");
}
if (typeof item.then === "function") {
yield* [];
throw new Error(`You appear to be using an async plugin, ` + `which your current version of Babel does not support. ` + `If you're using a published plugin, ` + `you may need to upgrade your @babel/core version.`);
}
return {
value: item,
options,
dirname,
alias
};
});
function* loadPluginDescriptor(descriptor, context) {
if (descriptor.value instanceof _plugin.default) {
if (descriptor.options) {
throw new Error("Passed options to an existing Plugin instance will not work.");
}
return descriptor.value;
}
return yield* instantiatePlugin((yield* loadDescriptor(descriptor, context)), context);
}
const instantiatePlugin = (0, _caching.makeWeakCache)(function* ({
value,
options,
dirname,
alias
}, cache) {
const pluginObj = (0, _plugins.validatePluginObject)(value);
const plugin = Object.assign({}, pluginObj);
if (plugin.visitor) {
plugin.visitor = _traverse().default.explode(Object.assign({}, plugin.visitor));
}
if (plugin.inherits) {
const inheritsDescriptor = {
name: undefined,
alias: `${alias}$inherits`,
value: plugin.inherits,
options,
dirname
};
const inherits = yield* (0, _async.forwardAsync)(loadPluginDescriptor, run => {
return cache.invalidate(data => run(inheritsDescriptor, data));
});
plugin.pre = chain(inherits.pre, plugin.pre);
plugin.post = chain(inherits.post, plugin.post);
plugin.manipulateOptions = chain(inherits.manipulateOptions, plugin.manipulateOptions);
plugin.visitor = _traverse().default.visitors.merge([inherits.visitor || {}, plugin.visitor || {}]);
}
return new _plugin.default(plugin, options, alias);
});
const validateIfOptionNeedsFilename = (options, descriptor) => {
if (options.test || options.include || options.exclude) {
const formattedPresetName = descriptor.name ? `"${descriptor.name}"` : "/* your preset */";
throw new Error([`Preset ${formattedPresetName} requires a filename to be set when babel is called directly,`, `\`\`\``, `babel.transform(code, { filename: 'file.ts', presets: [${formattedPresetName}] });`, `\`\`\``, `See https://babeljs.io/docs/en/options#filename for more information.`].join("\n"));
}
};
const validatePreset = (preset, context, descriptor) => {
if (!context.filename) {
const {
options
} = preset;
validateIfOptionNeedsFilename(options, descriptor);
if (options.overrides) {
options.overrides.forEach(overrideOptions => validateIfOptionNeedsFilename(overrideOptions, descriptor));
}
}
};
function* loadPresetDescriptor(descriptor, context) {
const preset = instantiatePreset((yield* loadDescriptor(descriptor, context)));
validatePreset(preset, context, descriptor);
return yield* (0, _configChain.buildPresetChain)(preset, context);
}
const instantiatePreset = (0, _caching.makeWeakCacheSync)(({
value,
dirname,
alias
}) => {
return {
options: (0, _options.validate)("preset", value),
alias,
dirname
};
});
function chain(a, b) {
const fns = [a, b].filter(Boolean);
if (fns.length <= 1) return fns[0];
return function (...args) {
for (const fn of fns) {
fn.apply(this, args);
}
};
}
\ No newline at end of file
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = makeAPI;
function _semver() {
const data = _interopRequireDefault(require("semver"));
_semver = function () {
return data;
};
return data;
}
var _ = require("../../");
var _caching = require("../caching");
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function makeAPI(cache) {
const env = value => cache.using(data => {
if (typeof value === "undefined") return data.envName;
if (typeof value === "function") {
return (0, _caching.assertSimpleType)(value(data.envName));
}
if (!Array.isArray(value)) value = [value];
return value.some(entry => {
if (typeof entry !== "string") {
throw new Error("Unexpected non-string value");
}
return entry === data.envName;
});
});
const caller = cb => cache.using(data => (0, _caching.assertSimpleType)(cb(data.caller)));
return {
version: _.version,
cache: cache.simple(),
env,
async: () => false,
caller,
assertVersion,
tokTypes: undefined
};
}
function assertVersion(range) {
if (typeof range === "number") {
if (!Number.isInteger(range)) {
throw new Error("Expected string or integer value.");
}
range = `^${range}.0.0-0`;
}
if (typeof range !== "string") {
throw new Error("Expected string or integer value.");
}
if (_semver().default.satisfies(_.version, range)) return;
const limit = Error.stackTraceLimit;
if (typeof limit === "number" && limit < 25) {
Error.stackTraceLimit = 25;
}
const err = new Error(`Requires Babel "${range}", but was loaded with "${_.version}". ` + `If you are sure you have a compatible version of @babel/core, ` + `it is likely that something in your build process is loading the ` + `wrong version. Inspect the stack trace of this error to look for ` + `the first entry that doesn't mention "@babel/core" or "babel-core" ` + `to see what is calling Babel.`);
if (typeof limit === "number") {
Error.stackTraceLimit = limit;
}
throw Object.assign(err, {
code: "BABEL_VERSION_UNSUPPORTED",
version: _.version,
range
});
}
\ No newline at end of file
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.getEnv = getEnv;
function getEnv(defaultValue = "development") {
return process.env.BABEL_ENV || process.env.NODE_ENV || defaultValue;
}
\ No newline at end of file
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "default", {
enumerable: true,
get: function () {
return _full.default;
}
});
exports.loadOptionsAsync = exports.loadOptionsSync = exports.loadOptions = exports.loadPartialConfigAsync = exports.loadPartialConfigSync = exports.loadPartialConfig = void 0;
function _gensync() {
const data = _interopRequireDefault(require("gensync"));
_gensync = function () {
return data;
};
return data;
}
var _full = _interopRequireDefault(require("./full"));
var _partial = require("./partial");
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
const loadOptionsRunner = (0, _gensync().default)(function* (opts) {
const config = yield* (0, _full.default)(opts);
return config ? config.options : null;
});
const maybeErrback = runner => (opts, callback) => {
if (callback === undefined && typeof opts === "function") {
callback = opts;
opts = undefined;
}
return callback ? runner.errback(opts, callback) : runner.sync(opts);
};
const loadPartialConfig = maybeErrback(_partial.loadPartialConfig);
exports.loadPartialConfig = loadPartialConfig;
const loadPartialConfigSync = _partial.loadPartialConfig.sync;
exports.loadPartialConfigSync = loadPartialConfigSync;
const loadPartialConfigAsync = _partial.loadPartialConfig.async;
exports.loadPartialConfigAsync = loadPartialConfigAsync;
const loadOptions = maybeErrback(loadOptionsRunner);
exports.loadOptions = loadOptions;
const loadOptionsSync = loadOptionsRunner.sync;
exports.loadOptionsSync = loadOptionsSync;
const loadOptionsAsync = loadOptionsRunner.async;
exports.loadOptionsAsync = loadOptionsAsync;
\ No newline at end of file
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.createItemFromDescriptor = createItemFromDescriptor;
exports.createConfigItem = createConfigItem;
exports.getItemDescriptor = getItemDescriptor;
function _path() {
const data = _interopRequireDefault(require("path"));
_path = function () {
return data;
};
return data;
}
var _configDescriptors = require("./config-descriptors");
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function createItemFromDescriptor(desc) {
return new ConfigItem(desc);
}
function createConfigItem(value, {
dirname = ".",
type
} = {}) {
const descriptor = (0, _configDescriptors.createDescriptor)(value, _path().default.resolve(dirname), {
type,
alias: "programmatic item"
});
return createItemFromDescriptor(descriptor);
}
function getItemDescriptor(item) {
if (item instanceof ConfigItem) {
return item._descriptor;
}
return undefined;
}
class ConfigItem {
constructor(descriptor) {
this._descriptor = descriptor;
Object.defineProperty(this, "_descriptor", {
enumerable: false
});
this.value = this._descriptor.value;
this.options = this._descriptor.options;
this.dirname = this._descriptor.dirname;
this.name = this._descriptor.name;
this.file = this._descriptor.file ? {
request: this._descriptor.file.request,
resolved: this._descriptor.file.resolved
} : undefined;
Object.freeze(this);
}
}
Object.freeze(ConfigItem.prototype);
\ No newline at end of file
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = loadPrivatePartialConfig;
exports.loadPartialConfig = void 0;
function _path() {
const data = _interopRequireDefault(require("path"));
_path = function () {
return data;
};
return data;
}
function _gensync() {
const data = _interopRequireDefault(require("gensync"));
_gensync = function () {
return data;
};
return data;
}
var _plugin = _interopRequireDefault(require("./plugin"));
var _util = require("./util");
var _item = require("./item");
var _configChain = require("./config-chain");
var _environment = require("./helpers/environment");
var _options = require("./validation/options");
var _files = require("./files");
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function* resolveRootMode(rootDir, rootMode) {
switch (rootMode) {
case "root":
return rootDir;
case "upward-optional":
{
const upwardRootDir = yield* (0, _files.findConfigUpwards)(rootDir);
return upwardRootDir === null ? rootDir : upwardRootDir;
}
case "upward":
{
const upwardRootDir = yield* (0, _files.findConfigUpwards)(rootDir);
if (upwardRootDir !== null) return upwardRootDir;
throw Object.assign(new Error(`Babel was run with rootMode:"upward" but a root could not ` + `be found when searching upward from "${rootDir}".\n` + `One of the following config files must be in the directory tree: ` + `"${_files.ROOT_CONFIG_FILENAMES.join(", ")}".`), {
code: "BABEL_ROOT_NOT_FOUND",
dirname: rootDir
});
}
default:
throw new Error(`Assertion failure - unknown rootMode value.`);
}
}
function* loadPrivatePartialConfig(inputOpts) {
if (inputOpts != null && (typeof inputOpts !== "object" || Array.isArray(inputOpts))) {
throw new Error("Babel options must be an object, null, or undefined");
}
const args = inputOpts ? (0, _options.validate)("arguments", inputOpts) : {};
const {
envName = (0, _environment.getEnv)(),
cwd = ".",
root: rootDir = ".",
rootMode = "root",
caller
} = args;
const absoluteCwd = _path().default.resolve(cwd);
const absoluteRootDir = yield* resolveRootMode(_path().default.resolve(absoluteCwd, rootDir), rootMode);
const context = {
filename: typeof args.filename === "string" ? _path().default.resolve(cwd, args.filename) : undefined,
cwd: absoluteCwd,
root: absoluteRootDir,
envName,
caller
};
const configChain = yield* (0, _configChain.buildRootChain)(args, context);
if (!configChain) return null;
const options = {};
configChain.options.forEach(opts => {
(0, _util.mergeOptions)(options, opts);
});
options.babelrc = false;
options.configFile = false;
options.passPerPreset = false;
options.envName = context.envName;
options.cwd = context.cwd;
options.root = context.root;
options.filename = typeof context.filename === "string" ? context.filename : undefined;
options.plugins = configChain.plugins.map(descriptor => (0, _item.createItemFromDescriptor)(descriptor));
options.presets = configChain.presets.map(descriptor => (0, _item.createItemFromDescriptor)(descriptor));
return {
options,
context,
ignore: configChain.ignore,
babelrc: configChain.babelrc,
config: configChain.config
};
}
const loadPartialConfig = (0, _gensync().default)(function* (inputOpts) {
const result = yield* loadPrivatePartialConfig(inputOpts);
if (!result) return null;
const {
options,
babelrc,
ignore,
config
} = result;
(options.plugins || []).forEach(item => {
if (item.value instanceof _plugin.default) {
throw new Error("Passing cached plugin instances is not supported in " + "babel.loadPartialConfig()");
}
});
return new PartialConfig(options, babelrc ? babelrc.filepath : undefined, ignore ? ignore.filepath : undefined, config ? config.filepath : undefined);
});
exports.loadPartialConfig = loadPartialConfig;
class PartialConfig {
constructor(options, babelrc, ignore, config) {
this.options = options;
this.babelignore = ignore;
this.babelrc = babelrc;
this.config = config;
Object.freeze(this);
}
hasFilesystemConfig() {
return this.babelrc !== undefined || this.config !== undefined;
}
}
Object.freeze(PartialConfig.prototype);
\ No newline at end of file
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = pathToPattern;
function _path() {
const data = _interopRequireDefault(require("path"));
_path = function () {
return data;
};
return data;
}
function _escapeRegExp() {
const data = _interopRequireDefault(require("lodash/escapeRegExp"));
_escapeRegExp = function () {
return data;
};
return data;
}
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
const sep = `\\${_path().default.sep}`;
const endSep = `(?:${sep}|$)`;
const substitution = `[^${sep}]+`;
const starPat = `(?:${substitution}${sep})`;
const starPatLast = `(?:${substitution}${endSep})`;
const starStarPat = `${starPat}*?`;
const starStarPatLast = `${starPat}*?${starPatLast}?`;
function pathToPattern(pattern, dirname) {
const parts = _path().default.resolve(dirname, pattern).split(_path().default.sep);
return new RegExp(["^", ...parts.map((part, i) => {
const last = i === parts.length - 1;
if (part === "**") return last ? starStarPatLast : starStarPat;
if (part === "*") return last ? starPatLast : starPat;
if (part.indexOf("*.") === 0) {
return substitution + (0, _escapeRegExp().default)(part.slice(1)) + (last ? endSep : sep);
}
return (0, _escapeRegExp().default)(part) + (last ? endSep : sep);
})].join(""));
}
\ No newline at end of file
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
class Plugin {
constructor(plugin, options, key) {
this.key = plugin.name || key;
this.manipulateOptions = plugin.manipulateOptions;
this.post = plugin.post;
this.pre = plugin.pre;
this.visitor = plugin.visitor || {};
this.parserOverride = plugin.parserOverride;
this.generatorOverride = plugin.generatorOverride;
this.options = options;
}
}
exports.default = Plugin;
\ No newline at end of file
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.mergeOptions = mergeOptions;
exports.isIterableIterator = isIterableIterator;
function mergeOptions(target, source) {
for (const k of Object.keys(source)) {
if (k === "parserOpts" && source.parserOpts) {
const parserOpts = source.parserOpts;
const targetObj = target.parserOpts = target.parserOpts || {};
mergeDefaultFields(targetObj, parserOpts);
} else if (k === "generatorOpts" && source.generatorOpts) {
const generatorOpts = source.generatorOpts;
const targetObj = target.generatorOpts = target.generatorOpts || {};
mergeDefaultFields(targetObj, generatorOpts);
} else {
const val = source[k];
if (val !== undefined) target[k] = val;
}
}
}
function mergeDefaultFields(target, source) {
for (const k of Object.keys(source)) {
const val = source[k];
if (val !== undefined) target[k] = val;
}
}
function isIterableIterator(value) {
return !!value && typeof value.next === "function" && typeof value[Symbol.iterator] === "function";
}
\ No newline at end of file
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.msg = msg;
exports.access = access;
exports.assertRootMode = assertRootMode;
exports.assertSourceMaps = assertSourceMaps;
exports.assertCompact = assertCompact;
exports.assertSourceType = assertSourceType;
exports.assertCallerMetadata = assertCallerMetadata;
exports.assertInputSourceMap = assertInputSourceMap;
exports.assertString = assertString;
exports.assertFunction = assertFunction;
exports.assertBoolean = assertBoolean;
exports.assertObject = assertObject;
exports.assertArray = assertArray;
exports.assertIgnoreList = assertIgnoreList;
exports.assertConfigApplicableTest = assertConfigApplicableTest;
exports.assertConfigFileSearch = assertConfigFileSearch;
exports.assertBabelrcSearch = assertBabelrcSearch;
exports.assertPluginList = assertPluginList;
function msg(loc) {
switch (loc.type) {
case "root":
return ``;
case "env":
return `${msg(loc.parent)}.env["${loc.name}"]`;
case "overrides":
return `${msg(loc.parent)}.overrides[${loc.index}]`;
case "option":
return `${msg(loc.parent)}.${loc.name}`;
case "access":
return `${msg(loc.parent)}[${JSON.stringify(loc.name)}]`;
default:
throw new Error(`Assertion failure: Unknown type ${loc.type}`);
}
}
function access(loc, name) {
return {
type: "access",
name,
parent: loc
};
}
function assertRootMode(loc, value) {
if (value !== undefined && value !== "root" && value !== "upward" && value !== "upward-optional") {
throw new Error(`${msg(loc)} must be a "root", "upward", "upward-optional" or undefined`);
}
return value;
}
function assertSourceMaps(loc, value) {
if (value !== undefined && typeof value !== "boolean" && value !== "inline" && value !== "both") {
throw new Error(`${msg(loc)} must be a boolean, "inline", "both", or undefined`);
}
return value;
}
function assertCompact(loc, value) {
if (value !== undefined && typeof value !== "boolean" && value !== "auto") {
throw new Error(`${msg(loc)} must be a boolean, "auto", or undefined`);
}
return value;
}
function assertSourceType(loc, value) {
if (value !== undefined && value !== "module" && value !== "script" && value !== "unambiguous") {
throw new Error(`${msg(loc)} must be "module", "script", "unambiguous", or undefined`);
}
return value;
}
function assertCallerMetadata(loc, value) {
const obj = assertObject(loc, value);
if (obj) {
if (typeof obj["name"] !== "string") {
throw new Error(`${msg(loc)} set but does not contain "name" property string`);
}
for (const prop of Object.keys(obj)) {
const propLoc = access(loc, prop);
const value = obj[prop];
if (value != null && typeof value !== "boolean" && typeof value !== "string" && typeof value !== "number") {
throw new Error(`${msg(propLoc)} must be null, undefined, a boolean, a string, or a number.`);
}
}
}
return value;
}
function assertInputSourceMap(loc, value) {
if (value !== undefined && typeof value !== "boolean" && (typeof value !== "object" || !value)) {
throw new Error(`${msg(loc)} must be a boolean, object, or undefined`);
}
return value;
}
function assertString(loc, value) {
if (value !== undefined && typeof value !== "string") {
throw new Error(`${msg(loc)} must be a string, or undefined`);
}
return value;
}
function assertFunction(loc, value) {
if (value !== undefined && typeof value !== "function") {
throw new Error(`${msg(loc)} must be a function, or undefined`);
}
return value;
}
function assertBoolean(loc, value) {
if (value !== undefined && typeof value !== "boolean") {
throw new Error(`${msg(loc)} must be a boolean, or undefined`);
}
return value;
}
function assertObject(loc, value) {
if (value !== undefined && (typeof value !== "object" || Array.isArray(value) || !value)) {
throw new Error(`${msg(loc)} must be an object, or undefined`);
}
return value;
}
function assertArray(loc, value) {
if (value != null && !Array.isArray(value)) {
throw new Error(`${msg(loc)} must be an array, or undefined`);
}
return value;
}
function assertIgnoreList(loc, value) {
const arr = assertArray(loc, value);
if (arr) {
arr.forEach((item, i) => assertIgnoreItem(access(loc, i), item));
}
return arr;
}
function assertIgnoreItem(loc, value) {
if (typeof value !== "string" && typeof value !== "function" && !(value instanceof RegExp)) {
throw new Error(`${msg(loc)} must be an array of string/Function/RegExp values, or undefined`);
}
return value;
}
function assertConfigApplicableTest(loc, value) {
if (value === undefined) return value;
if (Array.isArray(value)) {
value.forEach((item, i) => {
if (!checkValidTest(item)) {
throw new Error(`${msg(access(loc, i))} must be a string/Function/RegExp.`);
}
});
} else if (!checkValidTest(value)) {
throw new Error(`${msg(loc)} must be a string/Function/RegExp, or an array of those`);
}
return value;
}
function checkValidTest(value) {
return typeof value === "string" || typeof value === "function" || value instanceof RegExp;
}
function assertConfigFileSearch(loc, value) {
if (value !== undefined && typeof value !== "boolean" && typeof value !== "string") {
throw new Error(`${msg(loc)} must be a undefined, a boolean, a string, ` + `got ${JSON.stringify(value)}`);
}
return value;
}
function assertBabelrcSearch(loc, value) {
if (value === undefined || typeof value === "boolean") return value;
if (Array.isArray(value)) {
value.forEach((item, i) => {
if (!checkValidTest(item)) {
throw new Error(`${msg(access(loc, i))} must be a string/Function/RegExp.`);
}
});
} else if (!checkValidTest(value)) {
throw new Error(`${msg(loc)} must be a undefined, a boolean, a string/Function/RegExp ` + `or an array of those, got ${JSON.stringify(value)}`);
}
return value;
}
function assertPluginList(loc, value) {
const arr = assertArray(loc, value);
if (arr) {
arr.forEach((item, i) => assertPluginItem(access(loc, i), item));
}
return arr;
}
function assertPluginItem(loc, value) {
if (Array.isArray(value)) {
if (value.length === 0) {
throw new Error(`${msg(loc)} must include an object`);
}
if (value.length > 3) {
throw new Error(`${msg(loc)} may only be a two-tuple or three-tuple`);
}
assertPluginTarget(access(loc, 0), value[0]);
if (value.length > 1) {
const opts = value[1];
if (opts !== undefined && opts !== false && (typeof opts !== "object" || Array.isArray(opts) || opts === null)) {
throw new Error(`${msg(access(loc, 1))} must be an object, false, or undefined`);
}
}
if (value.length === 3) {
const name = value[2];
if (name !== undefined && typeof name !== "string") {
throw new Error(`${msg(access(loc, 2))} must be a string, or undefined`);
}
}
} else {
assertPluginTarget(loc, value);
}
return value;
}
function assertPluginTarget(loc, value) {
if ((typeof value !== "object" || !value) && typeof value !== "string" && typeof value !== "function") {
throw new Error(`${msg(loc)} must be a string, object, function`);
}
return value;
}
\ No newline at end of file
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment