This commit is contained in:
David Kale
2020-09-08 13:25:36 -04:00
parent e4246d2b5b
commit 91fcbb0108
4227 changed files with 416837 additions and 457884 deletions

23
node_modules/@jest/transform/LICENSE generated vendored
View File

@@ -1,23 +0,0 @@
MIT License
For Jest software
Copyright (c) 2014-present, Facebook, Inc.
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.

View File

@@ -11,6 +11,7 @@ export default class ScriptTransformer {
private _cache;
private _config;
private _transformCache;
private _transformConfigCache;
constructor(config: Config.ProjectConfig);
private _getCacheKey;
private _getFileCachePath;
@@ -27,6 +28,8 @@ export default class ScriptTransformer {
private _transformAndBuildScript;
transform(filename: Config.Path, options: Options, fileSource?: string): TransformResult;
transformJson(filename: Config.Path, options: Options, fileSource: string): string;
requireAndTranspileModule<ModuleType = unknown>(moduleName: string, callback?: (module: ModuleType) => void): ModuleType;
requireAndTranspileModule<ModuleType = unknown>(moduleName: string, callback?: (module: ModuleType) => Promise<void>): Promise<ModuleType>;
/**
* @deprecated use `this.shouldTransform` instead
*/

View File

@@ -1 +1 @@
{"version":3,"file":"ScriptTransformer.d.ts","sourceRoot":"","sources":["../src/ScriptTransformer.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAKH,OAAO,EAAC,MAAM,EAAC,MAAM,aAAa,CAAC;AAYnC,OAAO,EACL,OAAO,EAGP,eAAe,EAChB,MAAM,SAAS,CAAC;AAyBjB,MAAM,CAAC,OAAO,OAAO,iBAAiB;IACpC,MAAM,CAAC,oBAAoB,EAAE,oBAAoB,CAAC;IAClD,OAAO,CAAC,MAAM,CAAe;IAC7B,OAAO,CAAC,OAAO,CAAuB;IACtC,OAAO,CAAC,eAAe,CAAgC;gBAE3C,MAAM,EAAE,MAAM,CAAC,aAAa;IAoBxC,OAAO,CAAC,YAAY;IAgCpB,OAAO,CAAC,iBAAiB;IAyBzB,OAAO,CAAC,iBAAiB;IAezB,OAAO,CAAC,eAAe;IA2BvB,OAAO,CAAC,eAAe;IAmCvB,OAAO,CAAC,YAAY;IAUpB,kBAAkB,CAAC,QAAQ,EAAE,MAAM,CAAC,IAAI,GAAG,IAAI;IAI/C,eAAe,CAAC,QAAQ,EAAE,MAAM,CAAC,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,OAAO;;;;;IAwF3E,OAAO,CAAC,wBAAwB;IA+DhC,SAAS,CACP,QAAQ,EAAE,MAAM,CAAC,IAAI,EACrB,OAAO,EAAE,OAAO,EAChB,UAAU,CAAC,EAAE,MAAM,GAClB,eAAe;IA2BlB,aAAa,CACX,QAAQ,EAAE,MAAM,CAAC,IAAI,EACrB,OAAO,EAAE,OAAO,EAChB,UAAU,EAAE,MAAM,GACjB,MAAM;IAkBT;;OAEG;IAEH,OAAO,CAAC,gBAAgB;IAIxB,eAAe,CAAC,QAAQ,EAAE,MAAM,CAAC,IAAI,GAAG,OAAO;CAQhD"}
{"version":3,"file":"ScriptTransformer.d.ts","sourceRoot":"","sources":["../src/ScriptTransformer.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAKH,OAAO,EAAC,MAAM,EAAC,MAAM,aAAa,CAAC;A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,OAAO,CAAC,gBAAgB;IAIxB,eAAe,CAAC,QAAQ,EAAE,MAAM,CAAC,IAAI,GAAG,OAAO;CAQhD"}

View File

@@ -135,6 +135,16 @@ function _realpathNative() {
return data;
}
function _pirates() {
const data = require('pirates');
_pirates = function _pirates() {
return data;
};
return data;
}
var _shouldInstrument = _interopRequireDefault(require('./shouldInstrument'));
var _enhanceUnexpectedTokenMessage = _interopRequireDefault(
@@ -159,6 +169,38 @@ function _defineProperty(obj, key, value) {
return 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);
});
};
}
// Use `require` to avoid TS rootDir
const _require = require('../package.json'),
VERSION = _require.version; // This data structure is used to avoid recalculating some data every time that
@@ -169,6 +211,21 @@ const projectCaches = new WeakMap(); // To reset the cache for specific changese
const CACHE_VERSION = '1';
function waitForPromiseWithCleanup(_x, _x2) {
return _waitForPromiseWithCleanup.apply(this, arguments);
}
function _waitForPromiseWithCleanup() {
_waitForPromiseWithCleanup = _asyncToGenerator(function*(promise, cleanup) {
try {
yield promise;
} finally {
cleanup();
}
});
return _waitForPromiseWithCleanup.apply(this, arguments);
}
class ScriptTransformer {
constructor(config) {
_defineProperty(this, '_cache', void 0);
@@ -177,8 +234,11 @@ class ScriptTransformer {
_defineProperty(this, '_transformCache', void 0);
_defineProperty(this, '_transformConfigCache', void 0);
this._config = config;
this._transformCache = new Map();
this._transformConfigCache = new Map();
let projectCache = projectCaches.get(config);
if (!projectCache) {
@@ -258,7 +318,11 @@ class ScriptTransformer {
for (let i = 0; i < transformRegExp.length; i++) {
if (transformRegExp[i][0].test(filename)) {
return transformRegExp[i][1];
const transformPath = transformRegExp[i][1];
this._transformConfigCache.set(transformPath, transformRegExp[i][2]);
return transformPath;
}
}
@@ -283,8 +347,10 @@ class ScriptTransformer {
transform = require(transformPath);
const transformerConfig = this._transformConfigCache.get(transformPath);
if (typeof transform.createTransformer === 'function') {
transform = transform.createTransformer();
transform = transform.createTransformer(transformerConfig);
}
if (typeof transform.process !== 'function') {
@@ -543,6 +609,56 @@ class ScriptTransformer {
return fileSource;
}
requireAndTranspileModule(moduleName, callback) {
// Load the transformer to avoid a cycle where we need to load a
// transformer in order to transform it in the require hooks
this.preloadTransformer(moduleName);
let transforming = false;
const revertHook = (0, _pirates().addHook)(
(code, filename) => {
try {
transforming = true;
return this.transformSource(filename, code, false).code || code;
} finally {
transforming = false;
}
},
{
exts: [_path().default.extname(moduleName)],
ignoreNodeModules: false,
matcher: filename => {
if (transforming) {
// Don't transform any dependency required by the transformer itself
return false;
}
return this.shouldTransform(filename);
}
}
);
const module = require(moduleName);
if (!callback) {
revertHook();
return module;
}
try {
const cbResult = callback(module);
if ((0, _jestUtil().isPromise)(cbResult)) {
return waitForPromiseWithCleanup(cbResult, revertHook).then(
() => module
);
}
} finally {
revertHook();
}
return module;
}
/**
* @deprecated use `this.shouldTransform` instead
*/
@@ -700,7 +816,7 @@ const calcIgnorePatternRegExp = config => {
!config.transformIgnorePatterns ||
config.transformIgnorePatterns.length === 0
) {
return;
return undefined;
}
return new RegExp(config.transformIgnorePatterns.join('|'));
@@ -708,7 +824,7 @@ const calcIgnorePatternRegExp = config => {
const calcTransformRegExp = config => {
if (!config.transform.length) {
return;
return undefined;
}
const transformRegexp = [];
@@ -716,7 +832,8 @@ const calcTransformRegExp = config => {
for (let i = 0; i < config.transform.length; i++) {
transformRegexp.push([
new RegExp(config.transform[i][0]),
config.transform[i][1]
config.transform[i][1],
config.transform[i][2]
]);
}

View File

@@ -1,2 +1,8 @@
/**
* Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
export default function enhanceUnexpectedTokenMessage(e: Error): Error;
//# sourceMappingURL=enhanceUnexpectedTokenMessage.d.ts.map

View File

@@ -1 +1 @@
{"version":3,"file":"enhanceUnexpectedTokenMessage.d.ts","sourceRoot":"","sources":["../src/enhanceUnexpectedTokenMessage.ts"],"names":[],"mappings":"AAMA,MAAM,CAAC,OAAO,UAAU,6BAA6B,CAAC,CAAC,EAAE,KAAK,SA2B7D"}
{"version":3,"file":"enhanceUnexpectedTokenMessage.d.ts","sourceRoot":"","sources":["../src/enhanceUnexpectedTokenMessage.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAMH,MAAM,CAAC,OAAO,UAAU,6BAA6B,CAAC,CAAC,EAAE,KAAK,SA2B7D"}

View File

@@ -19,7 +19,12 @@ function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : {default: obj};
}
// Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
/**
* Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
const DOT = ' \u2022 ';
function enhanceUnexpectedTokenMessage(e) {

View File

@@ -1,33 +1,27 @@
{
"_args": [
[
"slash@2.0.0",
"/Users/pjquirk/Source/GitHub/actions/labeler"
]
],
"_development": true,
"_from": "slash@2.0.0",
"_from": "slash@^2.0.0",
"_id": "slash@2.0.0",
"_inBundle": false,
"_integrity": "sha512-ZYKh3Wh2z1PpEXWr0MpSBZ0V6mZHAQfYevttO11c51CaWjGTaadiKZ+wVt1PbMlDV5qhMFslpZCemhwOK7C89A==",
"_location": "/@jest/transform/slash",
"_phantomChildren": {},
"_requested": {
"type": "version",
"type": "range",
"registry": true,
"raw": "slash@2.0.0",
"raw": "slash@^2.0.0",
"name": "slash",
"escapedName": "slash",
"rawSpec": "2.0.0",
"rawSpec": "^2.0.0",
"saveSpec": null,
"fetchSpec": "2.0.0"
"fetchSpec": "^2.0.0"
},
"_requiredBy": [
"/@jest/transform"
],
"_resolved": "https://registry.npmjs.org/slash/-/slash-2.0.0.tgz",
"_spec": "2.0.0",
"_where": "/Users/pjquirk/Source/GitHub/actions/labeler",
"_shasum": "de552851a1759df3a8f206535442f5ec4ddeab44",
"_spec": "slash@^2.0.0",
"_where": "/Users/dakale/dev/GitHub/actions/labeler/node_modules/@jest/transform",
"author": {
"name": "Sindre Sorhus",
"email": "sindresorhus@gmail.com",
@@ -36,6 +30,8 @@
"bugs": {
"url": "https://github.com/sindresorhus/slash/issues"
},
"bundleDependencies": false,
"deprecated": false,
"description": "Convert Windows backslash paths to slash paths",
"devDependencies": {
"ava": "*",

View File

@@ -1,27 +1,20 @@
{
"_args": [
[
"@jest/transform@24.8.0",
"/Users/pjquirk/Source/GitHub/actions/labeler"
]
],
"_development": true,
"_from": "@jest/transform@24.8.0",
"_id": "@jest/transform@24.8.0",
"_from": "@jest/transform@^24.9.0",
"_id": "@jest/transform@24.9.0",
"_inBundle": false,
"_integrity": "sha512-xBMfFUP7TortCs0O+Xtez2W7Zu1PLH9bvJgtraN1CDST6LBM/eTOZ9SfwS/lvV8yOfcDpFmwf9bq5cYbXvqsvA==",
"_integrity": "sha512-TcQUmyNRxV94S0QpMOnZl0++6RMiqpbH/ZMccFB/amku6Uwvyb1cjYX7xkp5nGNkbX4QPH/FcB6q1HBTHynLmQ==",
"_location": "/@jest/transform",
"_phantomChildren": {},
"_requested": {
"type": "version",
"type": "range",
"registry": true,
"raw": "@jest/transform@24.8.0",
"raw": "@jest/transform@^24.9.0",
"name": "@jest/transform",
"escapedName": "@jest%2ftransform",
"scope": "@jest",
"rawSpec": "24.8.0",
"rawSpec": "^24.9.0",
"saveSpec": null,
"fetchSpec": "24.8.0"
"fetchSpec": "^24.9.0"
},
"_requiredBy": [
"/@jest/core",
@@ -30,29 +23,33 @@
"/babel-jest",
"/jest-runtime"
],
"_resolved": "https://registry.npmjs.org/@jest/transform/-/transform-24.8.0.tgz",
"_spec": "24.8.0",
"_where": "/Users/pjquirk/Source/GitHub/actions/labeler",
"_resolved": "https://registry.npmjs.org/@jest/transform/-/transform-24.9.0.tgz",
"_shasum": "4ae2768b296553fadab09e9ec119543c90b16c56",
"_spec": "@jest/transform@^24.9.0",
"_where": "/Users/dakale/dev/GitHub/actions/labeler/node_modules/@jest/core",
"bugs": {
"url": "https://github.com/facebook/jest/issues"
},
"bundleDependencies": false,
"dependencies": {
"@babel/core": "^7.1.0",
"@jest/types": "^24.8.0",
"@jest/types": "^24.9.0",
"babel-plugin-istanbul": "^5.1.0",
"chalk": "^2.0.1",
"convert-source-map": "^1.4.0",
"fast-json-stable-stringify": "^2.0.0",
"graceful-fs": "^4.1.15",
"jest-haste-map": "^24.8.0",
"jest-regex-util": "^24.3.0",
"jest-util": "^24.8.0",
"jest-haste-map": "^24.9.0",
"jest-regex-util": "^24.9.0",
"jest-util": "^24.9.0",
"micromatch": "^3.1.10",
"pirates": "^4.0.1",
"realpath-native": "^1.1.0",
"slash": "^2.0.0",
"source-map": "^0.6.1",
"write-file-atomic": "2.4.1"
},
"deprecated": false,
"devDependencies": {
"@types/babel__core": "^7.1.0",
"@types/convert-source-map": "^1.5.1",
@@ -64,7 +61,7 @@
"engines": {
"node": ">= 6"
},
"gitHead": "845728f24b3ef41e450595c384e9b5c9fdf248a4",
"gitHead": "9ad0f4bc6b8bdd94989804226c28c9960d9da7d1",
"homepage": "https://github.com/facebook/jest#readme",
"license": "MIT",
"main": "build/index.js",
@@ -77,5 +74,5 @@
"url": "git+https://github.com/facebook/jest.git",
"directory": "packages/jest-transform"
},
"version": "24.8.0"
"version": "24.9.0"
}

View File

@@ -1,13 +0,0 @@
{
"extends": "../../tsconfig.json",
"compilerOptions": {
"rootDir": "src",
"outDir": "build"
},
"references": [
{"path": "../jest-haste-map"},
{"path": "../jest-regex-util"},
{"path": "../jest-types"},
{"path": "../jest-util"}
]
}

File diff suppressed because it is too large Load Diff