Fixed #1 - Fixed the whatsnew-** script for loading release notes into builds
Added test to ensure that release notes are parsed properly Updated to latest dependencies to fix security vulnerability Updated GH Actions Workflow to run test before updating tag Updated README.md to reflect proper whatsnew documentation.
This commit is contained in:
127
node_modules/@jest/transform/build/ScriptTransformer.js
generated
vendored
127
node_modules/@jest/transform/build/ScriptTransformer.js
generated
vendored
@@ -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]
|
||||
]);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user