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:
41
node_modules/resolve/lib/sync.js
generated
vendored
41
node_modules/resolve/lib/sync.js
generated
vendored
@@ -1,4 +1,4 @@
|
||||
var core = require('./core');
|
||||
var isCore = require('./is-core');
|
||||
var fs = require('fs');
|
||||
var path = require('path');
|
||||
var caller = require('./caller.js');
|
||||
@@ -38,7 +38,15 @@ var maybeUnwrapSymlink = function maybeUnwrapSymlink(x, opts) {
|
||||
return x;
|
||||
};
|
||||
|
||||
module.exports = function (x, options) {
|
||||
var getPackageCandidates = function getPackageCandidates(x, start, opts) {
|
||||
var dirs = nodeModulesPaths(start, opts, x);
|
||||
for (var i = 0; i < dirs.length; i++) {
|
||||
dirs[i] = path.join(dirs[i], x);
|
||||
}
|
||||
return dirs;
|
||||
};
|
||||
|
||||
module.exports = function resolveSync(x, options) {
|
||||
if (typeof x !== 'string') {
|
||||
throw new TypeError('Path must be a string.');
|
||||
}
|
||||
@@ -47,6 +55,7 @@ module.exports = function (x, options) {
|
||||
var isFile = opts.isFile || defaultIsFile;
|
||||
var readFileSync = opts.readFileSync || fs.readFileSync;
|
||||
var isDirectory = opts.isDirectory || defaultIsDir;
|
||||
var packageIterator = opts.packageIterator;
|
||||
|
||||
var extensions = opts.extensions || ['.js'];
|
||||
var basedir = opts.basedir || path.dirname(caller());
|
||||
@@ -62,15 +71,13 @@ module.exports = function (x, options) {
|
||||
if (x === '..' || x.slice(-1) === '/') res += '/';
|
||||
var m = loadAsFileSync(res) || loadAsDirectorySync(res);
|
||||
if (m) return maybeUnwrapSymlink(m, opts);
|
||||
} else if (core[x]) {
|
||||
} else if (isCore(x)) {
|
||||
return x;
|
||||
} else {
|
||||
var n = loadNodeModulesSync(x, absoluteStart);
|
||||
if (n) return maybeUnwrapSymlink(n, opts);
|
||||
}
|
||||
|
||||
if (core[x]) return x;
|
||||
|
||||
var err = new Error("Cannot find module '" + x + "' from '" + parent + "'");
|
||||
err.code = 'MODULE_NOT_FOUND';
|
||||
throw err;
|
||||
@@ -105,7 +112,7 @@ module.exports = function (x, options) {
|
||||
}
|
||||
if ((/[/\\]node_modules[/\\]*$/).test(dir)) return;
|
||||
|
||||
var pkgfile = path.join(dir, 'package.json');
|
||||
var pkgfile = path.join(maybeUnwrapSymlink(dir, opts), 'package.json');
|
||||
|
||||
if (!isFile(pkgfile)) {
|
||||
return loadpkg(path.dirname(dir));
|
||||
@@ -118,25 +125,27 @@ module.exports = function (x, options) {
|
||||
} catch (jsonErr) {}
|
||||
|
||||
if (pkg && opts.packageFilter) {
|
||||
pkg = opts.packageFilter(pkg, dir);
|
||||
// v2 will pass pkgfile
|
||||
pkg = opts.packageFilter(pkg, /*pkgfile,*/ dir); // eslint-disable-line spaced-comment
|
||||
}
|
||||
|
||||
return { pkg: pkg, dir: dir };
|
||||
}
|
||||
|
||||
function loadAsDirectorySync(x) {
|
||||
var pkgfile = path.join(x, '/package.json');
|
||||
var pkgfile = path.join(maybeUnwrapSymlink(x, opts), '/package.json');
|
||||
if (isFile(pkgfile)) {
|
||||
try {
|
||||
var body = readFileSync(pkgfile, 'UTF8');
|
||||
var pkg = JSON.parse(body);
|
||||
} catch (e) {}
|
||||
|
||||
if (opts.packageFilter) {
|
||||
pkg = opts.packageFilter(pkg, x);
|
||||
if (pkg && opts.packageFilter) {
|
||||
// v2 will pass pkgfile
|
||||
pkg = opts.packageFilter(pkg, /*pkgfile,*/ x); // eslint-disable-line spaced-comment
|
||||
}
|
||||
|
||||
if (pkg.main) {
|
||||
if (pkg && pkg.main) {
|
||||
if (typeof pkg.main !== 'string') {
|
||||
var mainError = new TypeError('package “' + pkg.name + '” `main` must be a string');
|
||||
mainError.code = 'INVALID_PACKAGE_MAIN';
|
||||
@@ -158,13 +167,15 @@ module.exports = function (x, options) {
|
||||
}
|
||||
|
||||
function loadNodeModulesSync(x, start) {
|
||||
var dirs = nodeModulesPaths(start, opts, x);
|
||||
var thunk = function () { return getPackageCandidates(x, start, opts); };
|
||||
var dirs = packageIterator ? packageIterator(x, start, thunk, opts) : thunk();
|
||||
|
||||
for (var i = 0; i < dirs.length; i++) {
|
||||
var dir = dirs[i];
|
||||
if (isDirectory(dir)) {
|
||||
var m = loadAsFileSync(path.join(dir, '/', x));
|
||||
if (isDirectory(path.dirname(dir))) {
|
||||
var m = loadAsFileSync(dir);
|
||||
if (m) return m;
|
||||
var n = loadAsDirectorySync(path.join(dir, '/', x));
|
||||
var n = loadAsDirectorySync(dir);
|
||||
if (n) return n;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user