@html-validate/commitlint-config 3.2.0 → 3.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/commitlint.js +877 -539
- package/package.json +1 -1
package/dist/commitlint.js
CHANGED
|
@@ -14101,173 +14101,6 @@ var require_lodash9 = __commonJS({
|
|
|
14101
14101
|
}
|
|
14102
14102
|
});
|
|
14103
14103
|
|
|
14104
|
-
// node_modules/cosmiconfig/dist/types.js
|
|
14105
|
-
var require_types2 = __commonJS({
|
|
14106
|
-
"node_modules/cosmiconfig/dist/types.js"(exports) {
|
|
14107
|
-
"use strict";
|
|
14108
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14109
|
-
}
|
|
14110
|
-
});
|
|
14111
|
-
|
|
14112
|
-
// node_modules/path-type/index.js
|
|
14113
|
-
var require_path_type = __commonJS({
|
|
14114
|
-
"node_modules/path-type/index.js"(exports) {
|
|
14115
|
-
"use strict";
|
|
14116
|
-
var { promisify } = __require("util");
|
|
14117
|
-
var fs7 = __require("fs");
|
|
14118
|
-
async function isType(fsStatType, statsMethodName, filePath) {
|
|
14119
|
-
if (typeof filePath !== "string") {
|
|
14120
|
-
throw new TypeError(`Expected a string, got ${typeof filePath}`);
|
|
14121
|
-
}
|
|
14122
|
-
try {
|
|
14123
|
-
const stats = await promisify(fs7[fsStatType])(filePath);
|
|
14124
|
-
return stats[statsMethodName]();
|
|
14125
|
-
} catch (error) {
|
|
14126
|
-
if (error.code === "ENOENT") {
|
|
14127
|
-
return false;
|
|
14128
|
-
}
|
|
14129
|
-
throw error;
|
|
14130
|
-
}
|
|
14131
|
-
}
|
|
14132
|
-
function isTypeSync(fsStatType, statsMethodName, filePath) {
|
|
14133
|
-
if (typeof filePath !== "string") {
|
|
14134
|
-
throw new TypeError(`Expected a string, got ${typeof filePath}`);
|
|
14135
|
-
}
|
|
14136
|
-
try {
|
|
14137
|
-
return fs7[fsStatType](filePath)[statsMethodName]();
|
|
14138
|
-
} catch (error) {
|
|
14139
|
-
if (error.code === "ENOENT") {
|
|
14140
|
-
return false;
|
|
14141
|
-
}
|
|
14142
|
-
throw error;
|
|
14143
|
-
}
|
|
14144
|
-
}
|
|
14145
|
-
exports.isFile = isType.bind(null, "stat", "isFile");
|
|
14146
|
-
exports.isDirectory = isType.bind(null, "stat", "isDirectory");
|
|
14147
|
-
exports.isSymlink = isType.bind(null, "lstat", "isSymbolicLink");
|
|
14148
|
-
exports.isFileSync = isTypeSync.bind(null, "statSync", "isFile");
|
|
14149
|
-
exports.isDirectorySync = isTypeSync.bind(null, "statSync", "isDirectory");
|
|
14150
|
-
exports.isSymlinkSync = isTypeSync.bind(null, "lstatSync", "isSymbolicLink");
|
|
14151
|
-
}
|
|
14152
|
-
});
|
|
14153
|
-
|
|
14154
|
-
// node_modules/cosmiconfig/dist/util.js
|
|
14155
|
-
var require_util2 = __commonJS({
|
|
14156
|
-
"node_modules/cosmiconfig/dist/util.js"(exports) {
|
|
14157
|
-
"use strict";
|
|
14158
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14159
|
-
exports.removeUndefinedValuesFromObject = exports.getPropertyByPath = exports.emplace = void 0;
|
|
14160
|
-
function emplace(map, key, fn) {
|
|
14161
|
-
const cached = map.get(key);
|
|
14162
|
-
if (cached !== void 0) {
|
|
14163
|
-
return cached;
|
|
14164
|
-
}
|
|
14165
|
-
const result = fn();
|
|
14166
|
-
map.set(key, result);
|
|
14167
|
-
return result;
|
|
14168
|
-
}
|
|
14169
|
-
exports.emplace = emplace;
|
|
14170
|
-
function getPropertyByPath(source, path16) {
|
|
14171
|
-
if (typeof path16 === "string" && Object.prototype.hasOwnProperty.call(source, path16)) {
|
|
14172
|
-
return source[path16];
|
|
14173
|
-
}
|
|
14174
|
-
const parsedPath = typeof path16 === "string" ? path16.split(".") : path16;
|
|
14175
|
-
return parsedPath.reduce((previous, key) => {
|
|
14176
|
-
if (previous === void 0) {
|
|
14177
|
-
return previous;
|
|
14178
|
-
}
|
|
14179
|
-
return previous[key];
|
|
14180
|
-
}, source);
|
|
14181
|
-
}
|
|
14182
|
-
exports.getPropertyByPath = getPropertyByPath;
|
|
14183
|
-
function removeUndefinedValuesFromObject(options) {
|
|
14184
|
-
if (!options) {
|
|
14185
|
-
return void 0;
|
|
14186
|
-
}
|
|
14187
|
-
return Object.fromEntries(Object.entries(options).filter(([, value2]) => value2 !== void 0));
|
|
14188
|
-
}
|
|
14189
|
-
exports.removeUndefinedValuesFromObject = removeUndefinedValuesFromObject;
|
|
14190
|
-
}
|
|
14191
|
-
});
|
|
14192
|
-
|
|
14193
|
-
// node_modules/cosmiconfig/dist/ExplorerBase.js
|
|
14194
|
-
var require_ExplorerBase = __commonJS({
|
|
14195
|
-
"node_modules/cosmiconfig/dist/ExplorerBase.js"(exports) {
|
|
14196
|
-
"use strict";
|
|
14197
|
-
var __importDefault = exports && exports.__importDefault || function(mod) {
|
|
14198
|
-
return mod && mod.__esModule ? mod : { "default": mod };
|
|
14199
|
-
};
|
|
14200
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14201
|
-
exports.getExtensionDescription = exports.ExplorerBase = void 0;
|
|
14202
|
-
var path_1 = __importDefault(__require("path"));
|
|
14203
|
-
var util_js_1 = require_util2();
|
|
14204
|
-
var ExplorerBase = class {
|
|
14205
|
-
#loadingMetaConfig = false;
|
|
14206
|
-
config;
|
|
14207
|
-
loadCache;
|
|
14208
|
-
searchCache;
|
|
14209
|
-
constructor(options) {
|
|
14210
|
-
this.config = options;
|
|
14211
|
-
if (options.cache) {
|
|
14212
|
-
this.loadCache = /* @__PURE__ */ new Map();
|
|
14213
|
-
this.searchCache = /* @__PURE__ */ new Map();
|
|
14214
|
-
}
|
|
14215
|
-
this.#validateConfig();
|
|
14216
|
-
}
|
|
14217
|
-
set loadingMetaConfig(value2) {
|
|
14218
|
-
this.#loadingMetaConfig = value2;
|
|
14219
|
-
}
|
|
14220
|
-
#validateConfig() {
|
|
14221
|
-
const config = this.config;
|
|
14222
|
-
for (const place of config.searchPlaces) {
|
|
14223
|
-
const extension = path_1.default.extname(place);
|
|
14224
|
-
const loader = this.config.loaders[extension || "noExt"] ?? this.config.loaders["default"];
|
|
14225
|
-
if (loader === void 0) {
|
|
14226
|
-
throw new Error(`Missing loader for ${getExtensionDescription(place)}.`);
|
|
14227
|
-
}
|
|
14228
|
-
if (typeof loader !== "function") {
|
|
14229
|
-
throw new Error(`Loader for ${getExtensionDescription(place)} is not a function: Received ${typeof loader}.`);
|
|
14230
|
-
}
|
|
14231
|
-
}
|
|
14232
|
-
}
|
|
14233
|
-
clearLoadCache() {
|
|
14234
|
-
if (this.loadCache) {
|
|
14235
|
-
this.loadCache.clear();
|
|
14236
|
-
}
|
|
14237
|
-
}
|
|
14238
|
-
clearSearchCache() {
|
|
14239
|
-
if (this.searchCache) {
|
|
14240
|
-
this.searchCache.clear();
|
|
14241
|
-
}
|
|
14242
|
-
}
|
|
14243
|
-
clearCaches() {
|
|
14244
|
-
this.clearLoadCache();
|
|
14245
|
-
this.clearSearchCache();
|
|
14246
|
-
}
|
|
14247
|
-
toCosmiconfigResult(filepath, config) {
|
|
14248
|
-
if (config === null) {
|
|
14249
|
-
return null;
|
|
14250
|
-
}
|
|
14251
|
-
if (config === void 0) {
|
|
14252
|
-
return { filepath, config: void 0, isEmpty: true };
|
|
14253
|
-
}
|
|
14254
|
-
if (this.config.applyPackagePropertyPathToConfiguration || this.#loadingMetaConfig) {
|
|
14255
|
-
config = (0, util_js_1.getPropertyByPath)(config, this.config.packageProp);
|
|
14256
|
-
}
|
|
14257
|
-
if (config === void 0) {
|
|
14258
|
-
return { filepath, config: void 0, isEmpty: true };
|
|
14259
|
-
}
|
|
14260
|
-
return { config, filepath };
|
|
14261
|
-
}
|
|
14262
|
-
};
|
|
14263
|
-
exports.ExplorerBase = ExplorerBase;
|
|
14264
|
-
function getExtensionDescription(extension) {
|
|
14265
|
-
return extension ? `extension "${extension}"` : "files without extensions";
|
|
14266
|
-
}
|
|
14267
|
-
exports.getExtensionDescription = getExtensionDescription;
|
|
14268
|
-
}
|
|
14269
|
-
});
|
|
14270
|
-
|
|
14271
14104
|
// node_modules/import-fresh/node_modules/resolve-from/index.js
|
|
14272
14105
|
var require_resolve_from2 = __commonJS({
|
|
14273
14106
|
"node_modules/import-fresh/node_modules/resolve-from/index.js"(exports, module) {
|
|
@@ -62226,7 +62059,7 @@ ${lanes.join("\n")}
|
|
|
62226
62059
|
if (resolutionMode === 99 && (3 <= moduleResolution && moduleResolution <= 99)) {
|
|
62227
62060
|
features |= 32;
|
|
62228
62061
|
}
|
|
62229
|
-
const
|
|
62062
|
+
const conditions2 = features & 8 ? getConditions(options, resolutionMode) : [];
|
|
62230
62063
|
const diagnostics = [];
|
|
62231
62064
|
const moduleResolutionState = {
|
|
62232
62065
|
compilerOptions: options,
|
|
@@ -62236,7 +62069,7 @@ ${lanes.join("\n")}
|
|
|
62236
62069
|
affectingLocations,
|
|
62237
62070
|
packageJsonInfoCache: cache2,
|
|
62238
62071
|
features,
|
|
62239
|
-
conditions,
|
|
62072
|
+
conditions: conditions2,
|
|
62240
62073
|
requestContainingDirectory: containingDirectory,
|
|
62241
62074
|
reportDiagnostic: (diag2) => void diagnostics.push(diag2),
|
|
62242
62075
|
isConfigLookup: false,
|
|
@@ -62403,14 +62236,14 @@ ${lanes.join("\n")}
|
|
|
62403
62236
|
return [];
|
|
62404
62237
|
}
|
|
62405
62238
|
}
|
|
62406
|
-
const
|
|
62239
|
+
const conditions2 = resolutionMode === 99 ? ["import"] : ["require"];
|
|
62407
62240
|
if (!options.noDtsResolution) {
|
|
62408
|
-
|
|
62241
|
+
conditions2.push("types");
|
|
62409
62242
|
}
|
|
62410
62243
|
if (moduleResolution !== 100) {
|
|
62411
|
-
|
|
62244
|
+
conditions2.push("node");
|
|
62412
62245
|
}
|
|
62413
|
-
return concatenate(
|
|
62246
|
+
return concatenate(conditions2, options.customConditions);
|
|
62414
62247
|
}
|
|
62415
62248
|
function resolvePackageNameToPackageJson(packageName, containingDirectory, options, host, cache2) {
|
|
62416
62249
|
const moduleResolutionState = getTemporaryModuleResolutionState(cache2 == null ? void 0 : cache2.getPackageJsonInfoCache(), host, options);
|
|
@@ -63025,7 +62858,7 @@ ${lanes.join("\n")}
|
|
|
63025
62858
|
resolutionMode
|
|
63026
62859
|
);
|
|
63027
62860
|
}
|
|
63028
|
-
function nodeNextModuleNameResolverWorker(features, moduleName2, containingFile, compilerOptions, host, cache2, redirectedReference, resolutionMode,
|
|
62861
|
+
function nodeNextModuleNameResolverWorker(features, moduleName2, containingFile, compilerOptions, host, cache2, redirectedReference, resolutionMode, conditions2) {
|
|
63029
62862
|
const containingDirectory = getDirectoryPath(containingFile);
|
|
63030
62863
|
const esmMode = resolutionMode === 99 ? 32 : 0;
|
|
63031
62864
|
let extensions = compilerOptions.noDtsResolution ? 3 : 1 | 2 | 4;
|
|
@@ -63043,7 +62876,7 @@ ${lanes.join("\n")}
|
|
|
63043
62876
|
/*isConfigLookup*/
|
|
63044
62877
|
false,
|
|
63045
62878
|
redirectedReference,
|
|
63046
|
-
|
|
62879
|
+
conditions2
|
|
63047
62880
|
);
|
|
63048
62881
|
}
|
|
63049
62882
|
function tryResolveJSModuleWorker(moduleName2, initialDir, host) {
|
|
@@ -63064,7 +62897,7 @@ ${lanes.join("\n")}
|
|
|
63064
62897
|
void 0
|
|
63065
62898
|
);
|
|
63066
62899
|
}
|
|
63067
|
-
function bundlerModuleNameResolver(moduleName2, containingFile, compilerOptions, host, cache2, redirectedReference,
|
|
62900
|
+
function bundlerModuleNameResolver(moduleName2, containingFile, compilerOptions, host, cache2, redirectedReference, conditions2) {
|
|
63068
62901
|
const containingDirectory = getDirectoryPath(containingFile);
|
|
63069
62902
|
let extensions = compilerOptions.noDtsResolution ? 3 : 1 | 2 | 4;
|
|
63070
62903
|
if (getResolveJsonModule(compilerOptions)) {
|
|
@@ -63081,10 +62914,10 @@ ${lanes.join("\n")}
|
|
|
63081
62914
|
/*isConfigLookup*/
|
|
63082
62915
|
false,
|
|
63083
62916
|
redirectedReference,
|
|
63084
|
-
|
|
62917
|
+
conditions2
|
|
63085
62918
|
);
|
|
63086
62919
|
}
|
|
63087
|
-
function nodeModuleNameResolver(moduleName2, containingFile, compilerOptions, host, cache2, redirectedReference,
|
|
62920
|
+
function nodeModuleNameResolver(moduleName2, containingFile, compilerOptions, host, cache2, redirectedReference, conditions2, isConfigLookup) {
|
|
63088
62921
|
let extensions;
|
|
63089
62922
|
if (isConfigLookup) {
|
|
63090
62923
|
extensions = 8;
|
|
@@ -63095,7 +62928,7 @@ ${lanes.join("\n")}
|
|
|
63095
62928
|
} else {
|
|
63096
62929
|
extensions = getResolveJsonModule(compilerOptions) ? 1 | 2 | 4 | 8 : 1 | 2 | 4;
|
|
63097
62930
|
}
|
|
63098
|
-
return nodeModuleNameResolverWorker(
|
|
62931
|
+
return nodeModuleNameResolverWorker(conditions2 ? 30 : 0, moduleName2, getDirectoryPath(containingFile), compilerOptions, host, cache2, extensions, !!isConfigLookup, redirectedReference, conditions2);
|
|
63099
62932
|
}
|
|
63100
62933
|
function nodeNextJsonConfigResolver(moduleName2, containingFile, host) {
|
|
63101
62934
|
return nodeModuleNameResolverWorker(
|
|
@@ -63118,13 +62951,13 @@ ${lanes.join("\n")}
|
|
|
63118
62951
|
void 0
|
|
63119
62952
|
);
|
|
63120
62953
|
}
|
|
63121
|
-
function nodeModuleNameResolverWorker(features, moduleName2, containingDirectory, compilerOptions, host, cache2, extensions, isConfigLookup, redirectedReference,
|
|
62954
|
+
function nodeModuleNameResolverWorker(features, moduleName2, containingDirectory, compilerOptions, host, cache2, extensions, isConfigLookup, redirectedReference, conditions2) {
|
|
63122
62955
|
var _a2, _b2, _c2, _d;
|
|
63123
62956
|
const traceEnabled = isTraceEnabled(compilerOptions, host);
|
|
63124
62957
|
const failedLookupLocations = [];
|
|
63125
62958
|
const affectingLocations = [];
|
|
63126
62959
|
const moduleResolution = getEmitModuleResolutionKind(compilerOptions);
|
|
63127
|
-
|
|
62960
|
+
conditions2 ?? (conditions2 = getConditions(
|
|
63128
62961
|
compilerOptions,
|
|
63129
62962
|
moduleResolution === 100 || moduleResolution === 2 ? void 0 : features & 32 ? 99 : 1
|
|
63130
62963
|
/* CommonJS */
|
|
@@ -63138,7 +62971,7 @@ ${lanes.join("\n")}
|
|
|
63138
62971
|
affectingLocations,
|
|
63139
62972
|
packageJsonInfoCache: cache2,
|
|
63140
62973
|
features,
|
|
63141
|
-
conditions:
|
|
62974
|
+
conditions: conditions2 ?? emptyArray,
|
|
63142
62975
|
requestContainingDirectory: containingDirectory,
|
|
63143
62976
|
reportDiagnostic: (diag2) => void diagnostics.push(diag2),
|
|
63144
62977
|
isConfigLookup,
|
|
@@ -63156,7 +62989,7 @@ ${lanes.join("\n")}
|
|
|
63156
62989
|
result = tryResolve(extensions, state);
|
|
63157
62990
|
}
|
|
63158
62991
|
let legacyResult;
|
|
63159
|
-
if (((_a2 = result == null ? void 0 : result.value) == null ? void 0 : _a2.isExternalLibraryImport) && !isConfigLookup && extensions & (1 | 4) && features & 8 && !isExternalModuleNameRelative(moduleName2) && !extensionIsOk(1 | 4, result.value.resolved.extension) && (
|
|
62992
|
+
if (((_a2 = result == null ? void 0 : result.value) == null ? void 0 : _a2.isExternalLibraryImport) && !isConfigLookup && extensions & (1 | 4) && features & 8 && !isExternalModuleNameRelative(moduleName2) && !extensionIsOk(1 | 4, result.value.resolved.extension) && (conditions2 == null ? void 0 : conditions2.includes("import"))) {
|
|
63160
62993
|
traceIfEnabled(state, Diagnostics.Resolution_of_non_relative_name_failed_trying_with_modern_Node_resolution_features_disabled_to_see_if_npm_library_needs_configuration_update);
|
|
63161
62994
|
const diagnosticState = {
|
|
63162
62995
|
...state,
|
|
@@ -63516,8 +63349,8 @@ ${lanes.join("\n")}
|
|
|
63516
63349
|
)],
|
|
63517
63350
|
arrayIsEqualTo
|
|
63518
63351
|
);
|
|
63519
|
-
for (const
|
|
63520
|
-
const loadPackageJsonExportsState = { ...loadPackageJsonMainState, failedLookupLocations: [], conditions, host };
|
|
63352
|
+
for (const conditions2 of conditionSets) {
|
|
63353
|
+
const loadPackageJsonExportsState = { ...loadPackageJsonMainState, failedLookupLocations: [], conditions: conditions2, host };
|
|
63521
63354
|
const exportResolutions = loadEntrypointsFromExportMap(
|
|
63522
63355
|
packageJsonInfo,
|
|
63523
63356
|
packageJsonInfo.contents.packageJsonContent.exports,
|
|
@@ -64228,8 +64061,8 @@ ${lanes.join("\n")}
|
|
|
64228
64061
|
}
|
|
64229
64062
|
}
|
|
64230
64063
|
}
|
|
64231
|
-
function isApplicableVersionedTypesKey(
|
|
64232
|
-
if (!
|
|
64064
|
+
function isApplicableVersionedTypesKey(conditions2, key) {
|
|
64065
|
+
if (!conditions2.includes("types"))
|
|
64233
64066
|
return false;
|
|
64234
64067
|
if (!startsWith(key, "types@"))
|
|
64235
64068
|
return false;
|
|
@@ -68524,7 +68357,7 @@ ${lanes.join("\n")}
|
|
|
68524
68357
|
return ending !== 0 || value2 === processEnding(relativeToBaseUrl, [ending], compilerOptions, host);
|
|
68525
68358
|
}
|
|
68526
68359
|
}
|
|
68527
|
-
function tryGetModuleNameFromExports(options, targetFilePath, packageDirectory, packageName, exports2,
|
|
68360
|
+
function tryGetModuleNameFromExports(options, targetFilePath, packageDirectory, packageName, exports2, conditions2, mode = 0) {
|
|
68528
68361
|
if (typeof exports2 === "string") {
|
|
68529
68362
|
const pathOrPattern = getNormalizedAbsolutePath(
|
|
68530
68363
|
combinePaths(packageDirectory, exports2),
|
|
@@ -68568,7 +68401,7 @@ ${lanes.join("\n")}
|
|
|
68568
68401
|
break;
|
|
68569
68402
|
}
|
|
68570
68403
|
} else if (Array.isArray(exports2)) {
|
|
68571
|
-
return forEach(exports2, (e) => tryGetModuleNameFromExports(options, targetFilePath, packageDirectory, packageName, e,
|
|
68404
|
+
return forEach(exports2, (e) => tryGetModuleNameFromExports(options, targetFilePath, packageDirectory, packageName, e, conditions2));
|
|
68572
68405
|
} else if (typeof exports2 === "object" && exports2 !== null) {
|
|
68573
68406
|
if (allKeysStartWithDot(exports2)) {
|
|
68574
68407
|
return forEach(getOwnKeys(exports2), (k) => {
|
|
@@ -68578,13 +68411,13 @@ ${lanes.join("\n")}
|
|
|
68578
68411
|
void 0
|
|
68579
68412
|
);
|
|
68580
68413
|
const mode2 = endsWith(k, "/") ? 1 : k.includes("*") ? 2 : 0;
|
|
68581
|
-
return tryGetModuleNameFromExports(options, targetFilePath, packageDirectory, subPackageName, exports2[k],
|
|
68414
|
+
return tryGetModuleNameFromExports(options, targetFilePath, packageDirectory, subPackageName, exports2[k], conditions2, mode2);
|
|
68582
68415
|
});
|
|
68583
68416
|
} else {
|
|
68584
68417
|
for (const key of getOwnKeys(exports2)) {
|
|
68585
|
-
if (key === "default" ||
|
|
68418
|
+
if (key === "default" || conditions2.includes(key) || isApplicableVersionedTypesKey(conditions2, key)) {
|
|
68586
68419
|
const subTarget = exports2[key];
|
|
68587
|
-
const result = tryGetModuleNameFromExports(options, targetFilePath, packageDirectory, packageName, subTarget,
|
|
68420
|
+
const result = tryGetModuleNameFromExports(options, targetFilePath, packageDirectory, packageName, subTarget, conditions2, mode);
|
|
68588
68421
|
if (result) {
|
|
68589
68422
|
return result;
|
|
68590
68423
|
}
|
|
@@ -68672,8 +68505,8 @@ ${lanes.join("\n")}
|
|
|
68672
68505
|
if (getResolvePackageJsonExports(options)) {
|
|
68673
68506
|
const nodeModulesDirectoryName2 = packageRootPath.substring(parts.topLevelPackageNameIndex + 1);
|
|
68674
68507
|
const packageName2 = getPackageNameFromTypesPackageName(nodeModulesDirectoryName2);
|
|
68675
|
-
const
|
|
68676
|
-
const fromExports = packageJsonContent.exports ? tryGetModuleNameFromExports(options, path16, packageRootPath, packageName2, packageJsonContent.exports,
|
|
68508
|
+
const conditions2 = getConditions(options, importMode);
|
|
68509
|
+
const fromExports = packageJsonContent.exports ? tryGetModuleNameFromExports(options, path16, packageRootPath, packageName2, packageJsonContent.exports, conditions2) : void 0;
|
|
68677
68510
|
if (fromExports) {
|
|
68678
68511
|
const withJsExtension = !hasTSFileExtension(fromExports.moduleFileToTry) ? fromExports : { moduleFileToTry: removeFileExtension(fromExports.moduleFileToTry) + tryGetJSExtensionForFile(fromExports.moduleFileToTry, options) };
|
|
68679
68512
|
return { ...withJsExtension, verbatimFromExports: true };
|
|
@@ -190448,7 +190281,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
190448
190281
|
}
|
|
190449
190282
|
const keys = getOwnKeys(exports2);
|
|
190450
190283
|
const fragmentSubpath = components.join("/") + (components.length && hasTrailingDirectorySeparator(fragment) ? "/" : "");
|
|
190451
|
-
const
|
|
190284
|
+
const conditions2 = getConditions(compilerOptions, mode);
|
|
190452
190285
|
addCompletionEntriesFromPathsOrExports(
|
|
190453
190286
|
result,
|
|
190454
190287
|
fragmentSubpath,
|
|
@@ -190456,7 +190289,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
190456
190289
|
extensionOptions,
|
|
190457
190290
|
host,
|
|
190458
190291
|
keys,
|
|
190459
|
-
(key) => singleElementArray(getPatternFromFirstMatchingCondition(exports2[key],
|
|
190292
|
+
(key) => singleElementArray(getPatternFromFirstMatchingCondition(exports2[key], conditions2)),
|
|
190460
190293
|
comparePatternKeys
|
|
190461
190294
|
);
|
|
190462
190295
|
return;
|
|
@@ -190470,15 +190303,15 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
190470
190303
|
}
|
|
190471
190304
|
return arrayFrom(result.values());
|
|
190472
190305
|
}
|
|
190473
|
-
function getPatternFromFirstMatchingCondition(target,
|
|
190306
|
+
function getPatternFromFirstMatchingCondition(target, conditions2) {
|
|
190474
190307
|
if (typeof target === "string") {
|
|
190475
190308
|
return target;
|
|
190476
190309
|
}
|
|
190477
190310
|
if (target && typeof target === "object" && !isArray(target)) {
|
|
190478
190311
|
for (const condition in target) {
|
|
190479
|
-
if (condition === "default" ||
|
|
190312
|
+
if (condition === "default" || conditions2.includes(condition) || isApplicableVersionedTypesKey(conditions2, condition)) {
|
|
190480
190313
|
const pattern = target[condition];
|
|
190481
|
-
return getPatternFromFirstMatchingCondition(pattern,
|
|
190314
|
+
return getPatternFromFirstMatchingCondition(pattern, conditions2);
|
|
190482
190315
|
}
|
|
190483
190316
|
}
|
|
190484
190317
|
}
|
|
@@ -220139,7 +219972,14 @@ var require_loaders = __commonJS({
|
|
|
220139
219972
|
const { href } = (0, url_1.pathToFileURL)(filepath);
|
|
220140
219973
|
return (await import(href)).default;
|
|
220141
219974
|
} catch (error) {
|
|
220142
|
-
|
|
219975
|
+
try {
|
|
219976
|
+
return (0, exports.loadJsSync)(filepath, "");
|
|
219977
|
+
} catch (requireError) {
|
|
219978
|
+
if (requireError.code === "ERR_REQUIRE_ESM" || requireError instanceof SyntaxError && requireError.toString().includes("Cannot use import statement outside a module")) {
|
|
219979
|
+
throw error;
|
|
219980
|
+
}
|
|
219981
|
+
throw requireError;
|
|
219982
|
+
}
|
|
220143
219983
|
}
|
|
220144
219984
|
};
|
|
220145
219985
|
exports.loadJs = loadJs;
|
|
@@ -220205,23 +220045,25 @@ ${error.message}`;
|
|
|
220205
220045
|
typescript = (await Promise.resolve().then(() => __toESM(require_typescript()))).default;
|
|
220206
220046
|
}
|
|
220207
220047
|
const compiledFilepath = `${filepath.slice(0, -2)}mjs`;
|
|
220048
|
+
let transpiledContent;
|
|
220208
220049
|
try {
|
|
220209
|
-
|
|
220210
|
-
|
|
220211
|
-
|
|
220212
|
-
|
|
220213
|
-
|
|
220214
|
-
|
|
220215
|
-
|
|
220216
|
-
|
|
220217
|
-
|
|
220218
|
-
|
|
220219
|
-
|
|
220220
|
-
|
|
220221
|
-
|
|
220222
|
-
error.message = `TypeScript Error in ${filepath}:
|
|
220050
|
+
try {
|
|
220051
|
+
const config = resolveTsConfig(path_1.default.dirname(filepath)) ?? {};
|
|
220052
|
+
config.compilerOptions = {
|
|
220053
|
+
...config.compilerOptions,
|
|
220054
|
+
module: typescript.ModuleKind.ES2022,
|
|
220055
|
+
moduleResolution: typescript.ModuleResolutionKind.Bundler,
|
|
220056
|
+
target: typescript.ScriptTarget.ES2022,
|
|
220057
|
+
noEmit: false
|
|
220058
|
+
};
|
|
220059
|
+
transpiledContent = typescript.transpileModule(content, config).outputText;
|
|
220060
|
+
await (0, promises_1.writeFile)(compiledFilepath, transpiledContent);
|
|
220061
|
+
} catch (error) {
|
|
220062
|
+
error.message = `TypeScript Error in ${filepath}:
|
|
220223
220063
|
${error.message}`;
|
|
220224
|
-
|
|
220064
|
+
throw error;
|
|
220065
|
+
}
|
|
220066
|
+
return await (0, exports.loadJs)(compiledFilepath, transpiledContent);
|
|
220225
220067
|
} finally {
|
|
220226
220068
|
if ((0, fs_1.existsSync)(compiledFilepath)) {
|
|
220227
220069
|
await (0, promises_1.rm)(compiledFilepath);
|
|
@@ -220245,6 +220087,424 @@ ${error.message}`;
|
|
|
220245
220087
|
}
|
|
220246
220088
|
});
|
|
220247
220089
|
|
|
220090
|
+
// node_modules/cosmiconfig/dist/defaults.js
|
|
220091
|
+
var require_defaults2 = __commonJS({
|
|
220092
|
+
"node_modules/cosmiconfig/dist/defaults.js"(exports) {
|
|
220093
|
+
"use strict";
|
|
220094
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
220095
|
+
exports.defaultLoadersSync = exports.defaultLoaders = exports.metaSearchPlaces = exports.globalConfigSearchPlacesSync = exports.globalConfigSearchPlaces = exports.getDefaultSearchPlacesSync = exports.getDefaultSearchPlaces = void 0;
|
|
220096
|
+
var loaders_1 = require_loaders();
|
|
220097
|
+
function getDefaultSearchPlaces(moduleName2) {
|
|
220098
|
+
return [
|
|
220099
|
+
"package.json",
|
|
220100
|
+
`.${moduleName2}rc`,
|
|
220101
|
+
`.${moduleName2}rc.json`,
|
|
220102
|
+
`.${moduleName2}rc.yaml`,
|
|
220103
|
+
`.${moduleName2}rc.yml`,
|
|
220104
|
+
`.${moduleName2}rc.js`,
|
|
220105
|
+
`.${moduleName2}rc.ts`,
|
|
220106
|
+
`.${moduleName2}rc.cjs`,
|
|
220107
|
+
`.${moduleName2}rc.mjs`,
|
|
220108
|
+
`.config/${moduleName2}rc`,
|
|
220109
|
+
`.config/${moduleName2}rc.json`,
|
|
220110
|
+
`.config/${moduleName2}rc.yaml`,
|
|
220111
|
+
`.config/${moduleName2}rc.yml`,
|
|
220112
|
+
`.config/${moduleName2}rc.js`,
|
|
220113
|
+
`.config/${moduleName2}rc.ts`,
|
|
220114
|
+
`.config/${moduleName2}rc.cjs`,
|
|
220115
|
+
`.config/${moduleName2}rc.mjs`,
|
|
220116
|
+
`${moduleName2}.config.js`,
|
|
220117
|
+
`${moduleName2}.config.ts`,
|
|
220118
|
+
`${moduleName2}.config.cjs`,
|
|
220119
|
+
`${moduleName2}.config.mjs`
|
|
220120
|
+
];
|
|
220121
|
+
}
|
|
220122
|
+
exports.getDefaultSearchPlaces = getDefaultSearchPlaces;
|
|
220123
|
+
function getDefaultSearchPlacesSync(moduleName2) {
|
|
220124
|
+
return [
|
|
220125
|
+
"package.json",
|
|
220126
|
+
`.${moduleName2}rc`,
|
|
220127
|
+
`.${moduleName2}rc.json`,
|
|
220128
|
+
`.${moduleName2}rc.yaml`,
|
|
220129
|
+
`.${moduleName2}rc.yml`,
|
|
220130
|
+
`.${moduleName2}rc.js`,
|
|
220131
|
+
`.${moduleName2}rc.ts`,
|
|
220132
|
+
`.${moduleName2}rc.cjs`,
|
|
220133
|
+
`.config/${moduleName2}rc`,
|
|
220134
|
+
`.config/${moduleName2}rc.json`,
|
|
220135
|
+
`.config/${moduleName2}rc.yaml`,
|
|
220136
|
+
`.config/${moduleName2}rc.yml`,
|
|
220137
|
+
`.config/${moduleName2}rc.js`,
|
|
220138
|
+
`.config/${moduleName2}rc.ts`,
|
|
220139
|
+
`.config/${moduleName2}rc.cjs`,
|
|
220140
|
+
`${moduleName2}.config.js`,
|
|
220141
|
+
`${moduleName2}.config.ts`,
|
|
220142
|
+
`${moduleName2}.config.cjs`
|
|
220143
|
+
];
|
|
220144
|
+
}
|
|
220145
|
+
exports.getDefaultSearchPlacesSync = getDefaultSearchPlacesSync;
|
|
220146
|
+
exports.globalConfigSearchPlaces = [
|
|
220147
|
+
"config",
|
|
220148
|
+
"config.json",
|
|
220149
|
+
"config.yaml",
|
|
220150
|
+
"config.yml",
|
|
220151
|
+
"config.js",
|
|
220152
|
+
"config.ts",
|
|
220153
|
+
"config.cjs",
|
|
220154
|
+
"config.mjs"
|
|
220155
|
+
];
|
|
220156
|
+
exports.globalConfigSearchPlacesSync = [
|
|
220157
|
+
"config",
|
|
220158
|
+
"config.json",
|
|
220159
|
+
"config.yaml",
|
|
220160
|
+
"config.yml",
|
|
220161
|
+
"config.js",
|
|
220162
|
+
"config.ts",
|
|
220163
|
+
"config.cjs"
|
|
220164
|
+
];
|
|
220165
|
+
exports.metaSearchPlaces = [
|
|
220166
|
+
"package.json",
|
|
220167
|
+
"package.yaml",
|
|
220168
|
+
".config/config.json",
|
|
220169
|
+
".config/config.yaml",
|
|
220170
|
+
".config/config.yml",
|
|
220171
|
+
".config/config.js",
|
|
220172
|
+
".config/config.ts",
|
|
220173
|
+
".config/config.cjs",
|
|
220174
|
+
".config/config.mjs"
|
|
220175
|
+
];
|
|
220176
|
+
exports.defaultLoaders = Object.freeze({
|
|
220177
|
+
".mjs": loaders_1.loadJs,
|
|
220178
|
+
".cjs": loaders_1.loadJs,
|
|
220179
|
+
".js": loaders_1.loadJs,
|
|
220180
|
+
".ts": loaders_1.loadTs,
|
|
220181
|
+
".json": loaders_1.loadJson,
|
|
220182
|
+
".yaml": loaders_1.loadYaml,
|
|
220183
|
+
".yml": loaders_1.loadYaml,
|
|
220184
|
+
noExt: loaders_1.loadYaml
|
|
220185
|
+
});
|
|
220186
|
+
exports.defaultLoadersSync = Object.freeze({
|
|
220187
|
+
".cjs": loaders_1.loadJsSync,
|
|
220188
|
+
".js": loaders_1.loadJsSync,
|
|
220189
|
+
".ts": loaders_1.loadTsSync,
|
|
220190
|
+
".json": loaders_1.loadJson,
|
|
220191
|
+
".yaml": loaders_1.loadYaml,
|
|
220192
|
+
".yml": loaders_1.loadYaml,
|
|
220193
|
+
noExt: loaders_1.loadYaml
|
|
220194
|
+
});
|
|
220195
|
+
}
|
|
220196
|
+
});
|
|
220197
|
+
|
|
220198
|
+
// node_modules/env-paths/index.js
|
|
220199
|
+
var require_env_paths = __commonJS({
|
|
220200
|
+
"node_modules/env-paths/index.js"(exports, module) {
|
|
220201
|
+
"use strict";
|
|
220202
|
+
var path16 = __require("path");
|
|
220203
|
+
var os4 = __require("os");
|
|
220204
|
+
var homedir = os4.homedir();
|
|
220205
|
+
var tmpdir = os4.tmpdir();
|
|
220206
|
+
var { env: env3 } = process;
|
|
220207
|
+
var macos = (name) => {
|
|
220208
|
+
const library = path16.join(homedir, "Library");
|
|
220209
|
+
return {
|
|
220210
|
+
data: path16.join(library, "Application Support", name),
|
|
220211
|
+
config: path16.join(library, "Preferences", name),
|
|
220212
|
+
cache: path16.join(library, "Caches", name),
|
|
220213
|
+
log: path16.join(library, "Logs", name),
|
|
220214
|
+
temp: path16.join(tmpdir, name)
|
|
220215
|
+
};
|
|
220216
|
+
};
|
|
220217
|
+
var windows = (name) => {
|
|
220218
|
+
const appData = env3.APPDATA || path16.join(homedir, "AppData", "Roaming");
|
|
220219
|
+
const localAppData = env3.LOCALAPPDATA || path16.join(homedir, "AppData", "Local");
|
|
220220
|
+
return {
|
|
220221
|
+
// Data/config/cache/log are invented by me as Windows isn't opinionated about this
|
|
220222
|
+
data: path16.join(localAppData, name, "Data"),
|
|
220223
|
+
config: path16.join(appData, name, "Config"),
|
|
220224
|
+
cache: path16.join(localAppData, name, "Cache"),
|
|
220225
|
+
log: path16.join(localAppData, name, "Log"),
|
|
220226
|
+
temp: path16.join(tmpdir, name)
|
|
220227
|
+
};
|
|
220228
|
+
};
|
|
220229
|
+
var linux = (name) => {
|
|
220230
|
+
const username = path16.basename(homedir);
|
|
220231
|
+
return {
|
|
220232
|
+
data: path16.join(env3.XDG_DATA_HOME || path16.join(homedir, ".local", "share"), name),
|
|
220233
|
+
config: path16.join(env3.XDG_CONFIG_HOME || path16.join(homedir, ".config"), name),
|
|
220234
|
+
cache: path16.join(env3.XDG_CACHE_HOME || path16.join(homedir, ".cache"), name),
|
|
220235
|
+
// https://wiki.debian.org/XDGBaseDirectorySpecification#state
|
|
220236
|
+
log: path16.join(env3.XDG_STATE_HOME || path16.join(homedir, ".local", "state"), name),
|
|
220237
|
+
temp: path16.join(tmpdir, username, name)
|
|
220238
|
+
};
|
|
220239
|
+
};
|
|
220240
|
+
var envPaths = (name, options) => {
|
|
220241
|
+
if (typeof name !== "string") {
|
|
220242
|
+
throw new TypeError(`Expected string, got ${typeof name}`);
|
|
220243
|
+
}
|
|
220244
|
+
options = Object.assign({ suffix: "nodejs" }, options);
|
|
220245
|
+
if (options.suffix) {
|
|
220246
|
+
name += `-${options.suffix}`;
|
|
220247
|
+
}
|
|
220248
|
+
if (process.platform === "darwin") {
|
|
220249
|
+
return macos(name);
|
|
220250
|
+
}
|
|
220251
|
+
if (process.platform === "win32") {
|
|
220252
|
+
return windows(name);
|
|
220253
|
+
}
|
|
220254
|
+
return linux(name);
|
|
220255
|
+
};
|
|
220256
|
+
module.exports = envPaths;
|
|
220257
|
+
module.exports.default = envPaths;
|
|
220258
|
+
}
|
|
220259
|
+
});
|
|
220260
|
+
|
|
220261
|
+
// node_modules/cosmiconfig/dist/util.js
|
|
220262
|
+
var require_util2 = __commonJS({
|
|
220263
|
+
"node_modules/cosmiconfig/dist/util.js"(exports) {
|
|
220264
|
+
"use strict";
|
|
220265
|
+
var __createBinding = exports && exports.__createBinding || (Object.create ? function(o, m, k, k2) {
|
|
220266
|
+
if (k2 === void 0)
|
|
220267
|
+
k2 = k;
|
|
220268
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
220269
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
220270
|
+
desc = { enumerable: true, get: function() {
|
|
220271
|
+
return m[k];
|
|
220272
|
+
} };
|
|
220273
|
+
}
|
|
220274
|
+
Object.defineProperty(o, k2, desc);
|
|
220275
|
+
} : function(o, m, k, k2) {
|
|
220276
|
+
if (k2 === void 0)
|
|
220277
|
+
k2 = k;
|
|
220278
|
+
o[k2] = m[k];
|
|
220279
|
+
});
|
|
220280
|
+
var __setModuleDefault = exports && exports.__setModuleDefault || (Object.create ? function(o, v) {
|
|
220281
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
220282
|
+
} : function(o, v) {
|
|
220283
|
+
o["default"] = v;
|
|
220284
|
+
});
|
|
220285
|
+
var __importStar = exports && exports.__importStar || function(mod) {
|
|
220286
|
+
if (mod && mod.__esModule)
|
|
220287
|
+
return mod;
|
|
220288
|
+
var result = {};
|
|
220289
|
+
if (mod != null) {
|
|
220290
|
+
for (var k in mod)
|
|
220291
|
+
if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k))
|
|
220292
|
+
__createBinding(result, mod, k);
|
|
220293
|
+
}
|
|
220294
|
+
__setModuleDefault(result, mod);
|
|
220295
|
+
return result;
|
|
220296
|
+
};
|
|
220297
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
220298
|
+
exports.isDirectorySync = exports.isDirectory = exports.removeUndefinedValuesFromObject = exports.getPropertyByPath = exports.emplace = void 0;
|
|
220299
|
+
var fs_1 = __importStar(__require("fs"));
|
|
220300
|
+
function emplace(map, key, fn) {
|
|
220301
|
+
const cached = map.get(key);
|
|
220302
|
+
if (cached !== void 0) {
|
|
220303
|
+
return cached;
|
|
220304
|
+
}
|
|
220305
|
+
const result = fn();
|
|
220306
|
+
map.set(key, result);
|
|
220307
|
+
return result;
|
|
220308
|
+
}
|
|
220309
|
+
exports.emplace = emplace;
|
|
220310
|
+
function getPropertyByPath(source, path16) {
|
|
220311
|
+
if (typeof path16 === "string" && Object.prototype.hasOwnProperty.call(source, path16)) {
|
|
220312
|
+
return source[path16];
|
|
220313
|
+
}
|
|
220314
|
+
const parsedPath = typeof path16 === "string" ? path16.split(".") : path16;
|
|
220315
|
+
return parsedPath.reduce((previous, key) => {
|
|
220316
|
+
if (previous === void 0) {
|
|
220317
|
+
return previous;
|
|
220318
|
+
}
|
|
220319
|
+
return previous[key];
|
|
220320
|
+
}, source);
|
|
220321
|
+
}
|
|
220322
|
+
exports.getPropertyByPath = getPropertyByPath;
|
|
220323
|
+
function removeUndefinedValuesFromObject(options) {
|
|
220324
|
+
return Object.fromEntries(Object.entries(options).filter(([, value2]) => value2 !== void 0));
|
|
220325
|
+
}
|
|
220326
|
+
exports.removeUndefinedValuesFromObject = removeUndefinedValuesFromObject;
|
|
220327
|
+
async function isDirectory(path16) {
|
|
220328
|
+
try {
|
|
220329
|
+
const stat = await fs_1.promises.stat(path16);
|
|
220330
|
+
return stat.isDirectory();
|
|
220331
|
+
} catch (e) {
|
|
220332
|
+
if (e.code === "ENOENT") {
|
|
220333
|
+
return false;
|
|
220334
|
+
}
|
|
220335
|
+
throw e;
|
|
220336
|
+
}
|
|
220337
|
+
}
|
|
220338
|
+
exports.isDirectory = isDirectory;
|
|
220339
|
+
function isDirectorySync(path16) {
|
|
220340
|
+
try {
|
|
220341
|
+
const stat = fs_1.default.statSync(path16);
|
|
220342
|
+
return stat.isDirectory();
|
|
220343
|
+
} catch (e) {
|
|
220344
|
+
if (e.code === "ENOENT") {
|
|
220345
|
+
return false;
|
|
220346
|
+
}
|
|
220347
|
+
throw e;
|
|
220348
|
+
}
|
|
220349
|
+
}
|
|
220350
|
+
exports.isDirectorySync = isDirectorySync;
|
|
220351
|
+
}
|
|
220352
|
+
});
|
|
220353
|
+
|
|
220354
|
+
// node_modules/cosmiconfig/dist/ExplorerBase.js
|
|
220355
|
+
var require_ExplorerBase = __commonJS({
|
|
220356
|
+
"node_modules/cosmiconfig/dist/ExplorerBase.js"(exports) {
|
|
220357
|
+
"use strict";
|
|
220358
|
+
var __importDefault = exports && exports.__importDefault || function(mod) {
|
|
220359
|
+
return mod && mod.__esModule ? mod : { "default": mod };
|
|
220360
|
+
};
|
|
220361
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
220362
|
+
exports.getExtensionDescription = exports.ExplorerBase = void 0;
|
|
220363
|
+
var env_paths_1 = __importDefault(require_env_paths());
|
|
220364
|
+
var os_1 = __importDefault(__require("os"));
|
|
220365
|
+
var path_1 = __importDefault(__require("path"));
|
|
220366
|
+
var util_js_1 = require_util2();
|
|
220367
|
+
var ExplorerBase = class {
|
|
220368
|
+
#loadingMetaConfig = false;
|
|
220369
|
+
config;
|
|
220370
|
+
loadCache;
|
|
220371
|
+
searchCache;
|
|
220372
|
+
constructor(options) {
|
|
220373
|
+
this.config = options;
|
|
220374
|
+
if (options.cache) {
|
|
220375
|
+
this.loadCache = /* @__PURE__ */ new Map();
|
|
220376
|
+
this.searchCache = /* @__PURE__ */ new Map();
|
|
220377
|
+
}
|
|
220378
|
+
this.#validateConfig();
|
|
220379
|
+
}
|
|
220380
|
+
set loadingMetaConfig(value2) {
|
|
220381
|
+
this.#loadingMetaConfig = value2;
|
|
220382
|
+
}
|
|
220383
|
+
#validateConfig() {
|
|
220384
|
+
const config = this.config;
|
|
220385
|
+
for (const place of config.searchPlaces) {
|
|
220386
|
+
const extension = path_1.default.extname(place);
|
|
220387
|
+
const loader = this.config.loaders[extension || "noExt"] ?? this.config.loaders["default"];
|
|
220388
|
+
if (loader === void 0) {
|
|
220389
|
+
throw new Error(`Missing loader for ${getExtensionDescription(place)}.`);
|
|
220390
|
+
}
|
|
220391
|
+
if (typeof loader !== "function") {
|
|
220392
|
+
throw new Error(`Loader for ${getExtensionDescription(place)} is not a function: Received ${typeof loader}.`);
|
|
220393
|
+
}
|
|
220394
|
+
}
|
|
220395
|
+
}
|
|
220396
|
+
clearLoadCache() {
|
|
220397
|
+
if (this.loadCache) {
|
|
220398
|
+
this.loadCache.clear();
|
|
220399
|
+
}
|
|
220400
|
+
}
|
|
220401
|
+
clearSearchCache() {
|
|
220402
|
+
if (this.searchCache) {
|
|
220403
|
+
this.searchCache.clear();
|
|
220404
|
+
}
|
|
220405
|
+
}
|
|
220406
|
+
clearCaches() {
|
|
220407
|
+
this.clearLoadCache();
|
|
220408
|
+
this.clearSearchCache();
|
|
220409
|
+
}
|
|
220410
|
+
toCosmiconfigResult(filepath, config) {
|
|
220411
|
+
if (config === null) {
|
|
220412
|
+
return null;
|
|
220413
|
+
}
|
|
220414
|
+
if (config === void 0) {
|
|
220415
|
+
return { filepath, config: void 0, isEmpty: true };
|
|
220416
|
+
}
|
|
220417
|
+
if (this.config.applyPackagePropertyPathToConfiguration || this.#loadingMetaConfig) {
|
|
220418
|
+
const packageProp = this.config.packageProp ?? this.config.moduleName;
|
|
220419
|
+
config = (0, util_js_1.getPropertyByPath)(config, packageProp);
|
|
220420
|
+
}
|
|
220421
|
+
if (config === void 0) {
|
|
220422
|
+
return { filepath, config: void 0, isEmpty: true };
|
|
220423
|
+
}
|
|
220424
|
+
return { config, filepath };
|
|
220425
|
+
}
|
|
220426
|
+
validateImports(containingFilePath, imports, importStack) {
|
|
220427
|
+
const fileDirectory = path_1.default.dirname(containingFilePath);
|
|
220428
|
+
for (const importPath of imports) {
|
|
220429
|
+
if (typeof importPath !== "string") {
|
|
220430
|
+
throw new Error(`${containingFilePath}: Key $import must contain a string or a list of strings`);
|
|
220431
|
+
}
|
|
220432
|
+
const fullPath = path_1.default.resolve(fileDirectory, importPath);
|
|
220433
|
+
if (fullPath === containingFilePath) {
|
|
220434
|
+
throw new Error(`Self-import detected in ${containingFilePath}`);
|
|
220435
|
+
}
|
|
220436
|
+
const idx = importStack.indexOf(fullPath);
|
|
220437
|
+
if (idx !== -1) {
|
|
220438
|
+
throw new Error(`Circular import detected:
|
|
220439
|
+
${[...importStack, fullPath].map((path16, i) => `${i + 1}. ${path16}`).join("\n")} (same as ${idx + 1}.)`);
|
|
220440
|
+
}
|
|
220441
|
+
}
|
|
220442
|
+
}
|
|
220443
|
+
getSearchPlacesForDir(dir, globalConfigPlaces) {
|
|
220444
|
+
return (dir.isGlobalConfig ? globalConfigPlaces : this.config.searchPlaces).map((place) => path_1.default.join(dir.path, place));
|
|
220445
|
+
}
|
|
220446
|
+
getGlobalConfigDir() {
|
|
220447
|
+
return (0, env_paths_1.default)(this.config.moduleName, { suffix: "" }).config;
|
|
220448
|
+
}
|
|
220449
|
+
*getGlobalDirs(startDir) {
|
|
220450
|
+
const stopDir = path_1.default.resolve(this.config.stopDir ?? os_1.default.homedir());
|
|
220451
|
+
yield { path: startDir, isGlobalConfig: false };
|
|
220452
|
+
let currentDir = startDir;
|
|
220453
|
+
while (currentDir !== stopDir) {
|
|
220454
|
+
const parentDir = path_1.default.dirname(currentDir);
|
|
220455
|
+
if (parentDir === currentDir) {
|
|
220456
|
+
break;
|
|
220457
|
+
}
|
|
220458
|
+
yield { path: parentDir, isGlobalConfig: false };
|
|
220459
|
+
currentDir = parentDir;
|
|
220460
|
+
}
|
|
220461
|
+
yield { path: this.getGlobalConfigDir(), isGlobalConfig: true };
|
|
220462
|
+
}
|
|
220463
|
+
};
|
|
220464
|
+
exports.ExplorerBase = ExplorerBase;
|
|
220465
|
+
function getExtensionDescription(extension) {
|
|
220466
|
+
return extension ? `extension "${extension}"` : "files without extensions";
|
|
220467
|
+
}
|
|
220468
|
+
exports.getExtensionDescription = getExtensionDescription;
|
|
220469
|
+
}
|
|
220470
|
+
});
|
|
220471
|
+
|
|
220472
|
+
// node_modules/cosmiconfig/dist/merge.js
|
|
220473
|
+
var require_merge2 = __commonJS({
|
|
220474
|
+
"node_modules/cosmiconfig/dist/merge.js"(exports) {
|
|
220475
|
+
"use strict";
|
|
220476
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
220477
|
+
exports.mergeAll = exports.hasOwn = void 0;
|
|
220478
|
+
exports.hasOwn = Function.prototype.call.bind(Object.prototype.hasOwnProperty);
|
|
220479
|
+
var objToString = Function.prototype.call.bind(Object.prototype.toString);
|
|
220480
|
+
function isPlainObject2(obj) {
|
|
220481
|
+
return objToString(obj) === "[object Object]";
|
|
220482
|
+
}
|
|
220483
|
+
function merge2(target, source, options) {
|
|
220484
|
+
for (const key of Object.keys(source)) {
|
|
220485
|
+
const newValue = source[key];
|
|
220486
|
+
if ((0, exports.hasOwn)(target, key)) {
|
|
220487
|
+
if (Array.isArray(target[key]) && Array.isArray(newValue)) {
|
|
220488
|
+
if (options.mergeArrays) {
|
|
220489
|
+
target[key].push(...newValue);
|
|
220490
|
+
continue;
|
|
220491
|
+
}
|
|
220492
|
+
} else if (isPlainObject2(target[key]) && isPlainObject2(newValue)) {
|
|
220493
|
+
target[key] = merge2(target[key], newValue, options);
|
|
220494
|
+
continue;
|
|
220495
|
+
}
|
|
220496
|
+
}
|
|
220497
|
+
target[key] = newValue;
|
|
220498
|
+
}
|
|
220499
|
+
return target;
|
|
220500
|
+
}
|
|
220501
|
+
function mergeAll(objects, options) {
|
|
220502
|
+
return objects.reduce((target, source) => merge2(target, source, options), {});
|
|
220503
|
+
}
|
|
220504
|
+
exports.mergeAll = mergeAll;
|
|
220505
|
+
}
|
|
220506
|
+
});
|
|
220507
|
+
|
|
220248
220508
|
// node_modules/cosmiconfig/dist/Explorer.js
|
|
220249
220509
|
var require_Explorer = __commonJS({
|
|
220250
220510
|
"node_modules/cosmiconfig/dist/Explorer.js"(exports) {
|
|
@@ -220256,9 +220516,9 @@ var require_Explorer = __commonJS({
|
|
|
220256
220516
|
exports.Explorer = void 0;
|
|
220257
220517
|
var promises_1 = __importDefault(__require("fs/promises"));
|
|
220258
220518
|
var path_1 = __importDefault(__require("path"));
|
|
220259
|
-
var
|
|
220519
|
+
var defaults_1 = require_defaults2();
|
|
220260
220520
|
var ExplorerBase_js_1 = require_ExplorerBase();
|
|
220261
|
-
var
|
|
220521
|
+
var merge_1 = require_merge2();
|
|
220262
220522
|
var util_js_1 = require_util2();
|
|
220263
220523
|
var Explorer = class extends ExplorerBase_js_1.ExplorerBase {
|
|
220264
220524
|
async load(filepath) {
|
|
@@ -220280,30 +220540,34 @@ var require_Explorer = __commonJS({
|
|
|
220280
220540
|
return config;
|
|
220281
220541
|
}
|
|
220282
220542
|
}
|
|
220283
|
-
const stopDir = path_1.default.resolve(this.config.stopDir);
|
|
220284
220543
|
from = path_1.default.resolve(from);
|
|
220544
|
+
const dirs = this.#getDirs(from);
|
|
220545
|
+
const firstDirIter = await dirs.next();
|
|
220546
|
+
if (firstDirIter.done) {
|
|
220547
|
+
throw new Error(`Could not find any folders to iterate through (start from ${from})`);
|
|
220548
|
+
}
|
|
220549
|
+
let currentDir = firstDirIter.value;
|
|
220285
220550
|
const search = async () => {
|
|
220286
|
-
if (await (0,
|
|
220287
|
-
for (const
|
|
220288
|
-
const filepath = path_1.default.join(from, place);
|
|
220551
|
+
if (await (0, util_js_1.isDirectory)(currentDir.path)) {
|
|
220552
|
+
for (const filepath of this.getSearchPlacesForDir(currentDir, defaults_1.globalConfigSearchPlaces)) {
|
|
220289
220553
|
try {
|
|
220290
220554
|
const result = await this.#readConfiguration(filepath);
|
|
220291
220555
|
if (result !== null && !(result.isEmpty && this.config.ignoreEmptySearchPlaces)) {
|
|
220292
220556
|
return await this.config.transform(result);
|
|
220293
220557
|
}
|
|
220294
220558
|
} catch (error) {
|
|
220295
|
-
if (error.code === "ENOENT" || error.code === "EISDIR" || error.code === "ENOTDIR") {
|
|
220559
|
+
if (error.code === "ENOENT" || error.code === "EISDIR" || error.code === "ENOTDIR" || error.code === "EACCES") {
|
|
220296
220560
|
continue;
|
|
220297
220561
|
}
|
|
220298
220562
|
throw error;
|
|
220299
220563
|
}
|
|
220300
220564
|
}
|
|
220301
220565
|
}
|
|
220302
|
-
const
|
|
220303
|
-
if (
|
|
220304
|
-
|
|
220566
|
+
const nextDirIter = await dirs.next();
|
|
220567
|
+
if (!nextDirIter.done) {
|
|
220568
|
+
currentDir = nextDirIter.value;
|
|
220305
220569
|
if (this.searchCache) {
|
|
220306
|
-
return await (0, util_js_1.emplace)(this.searchCache,
|
|
220570
|
+
return await (0, util_js_1.emplace)(this.searchCache, currentDir.path, search);
|
|
220307
220571
|
}
|
|
220308
220572
|
return await search();
|
|
220309
220573
|
}
|
|
@@ -220314,28 +220578,85 @@ var require_Explorer = __commonJS({
|
|
|
220314
220578
|
}
|
|
220315
220579
|
return await search();
|
|
220316
220580
|
}
|
|
220317
|
-
async #readConfiguration(filepath) {
|
|
220581
|
+
async #readConfiguration(filepath, importStack = []) {
|
|
220318
220582
|
const contents = await promises_1.default.readFile(filepath, { encoding: "utf-8" });
|
|
220319
|
-
return this.toCosmiconfigResult(filepath, await this.#
|
|
220583
|
+
return this.toCosmiconfigResult(filepath, await this.#loadConfigFileWithImports(filepath, contents, importStack));
|
|
220584
|
+
}
|
|
220585
|
+
async #loadConfigFileWithImports(filepath, contents, importStack) {
|
|
220586
|
+
const loadedContent = await this.#loadConfiguration(filepath, contents);
|
|
220587
|
+
if (!loadedContent || !(0, merge_1.hasOwn)(loadedContent, "$import")) {
|
|
220588
|
+
return loadedContent;
|
|
220589
|
+
}
|
|
220590
|
+
const fileDirectory = path_1.default.dirname(filepath);
|
|
220591
|
+
const { $import: imports, ...ownContent } = loadedContent;
|
|
220592
|
+
const importPaths = Array.isArray(imports) ? imports : [imports];
|
|
220593
|
+
const newImportStack = [...importStack, filepath];
|
|
220594
|
+
this.validateImports(filepath, importPaths, newImportStack);
|
|
220595
|
+
const importedConfigs = await Promise.all(importPaths.map(async (importPath) => {
|
|
220596
|
+
const fullPath = path_1.default.resolve(fileDirectory, importPath);
|
|
220597
|
+
const result = await this.#readConfiguration(fullPath, newImportStack);
|
|
220598
|
+
return result?.config;
|
|
220599
|
+
}));
|
|
220600
|
+
return (0, merge_1.mergeAll)([...importedConfigs, ownContent], {
|
|
220601
|
+
mergeArrays: this.config.mergeImportArrays
|
|
220602
|
+
});
|
|
220320
220603
|
}
|
|
220321
220604
|
async #loadConfiguration(filepath, contents) {
|
|
220322
220605
|
if (contents.trim() === "") {
|
|
220323
220606
|
return;
|
|
220324
220607
|
}
|
|
220325
|
-
if (path_1.default.basename(filepath) === "package.json") {
|
|
220326
|
-
return (0, util_js_1.getPropertyByPath)((0, loaders_js_1.loadJson)(filepath, contents), this.config.packageProp) ?? null;
|
|
220327
|
-
}
|
|
220328
220608
|
const extension = path_1.default.extname(filepath);
|
|
220609
|
+
const loader = this.config.loaders[extension || "noExt"] ?? this.config.loaders["default"];
|
|
220610
|
+
if (!loader) {
|
|
220611
|
+
throw new Error(`No loader specified for ${(0, ExplorerBase_js_1.getExtensionDescription)(extension)}`);
|
|
220612
|
+
}
|
|
220329
220613
|
try {
|
|
220330
|
-
const
|
|
220331
|
-
if (
|
|
220332
|
-
return
|
|
220614
|
+
const loadedContents = await loader(filepath, contents);
|
|
220615
|
+
if (path_1.default.basename(filepath, extension) !== "package") {
|
|
220616
|
+
return loadedContents;
|
|
220333
220617
|
}
|
|
220618
|
+
return (0, util_js_1.getPropertyByPath)(loadedContents, this.config.packageProp ?? this.config.moduleName) ?? null;
|
|
220334
220619
|
} catch (error) {
|
|
220335
220620
|
error.filepath = filepath;
|
|
220336
220621
|
throw error;
|
|
220337
220622
|
}
|
|
220338
|
-
|
|
220623
|
+
}
|
|
220624
|
+
async #fileExists(path16) {
|
|
220625
|
+
try {
|
|
220626
|
+
await promises_1.default.stat(path16);
|
|
220627
|
+
return true;
|
|
220628
|
+
} catch (e) {
|
|
220629
|
+
return false;
|
|
220630
|
+
}
|
|
220631
|
+
}
|
|
220632
|
+
async *#getDirs(startDir) {
|
|
220633
|
+
switch (this.config.searchStrategy) {
|
|
220634
|
+
case "none": {
|
|
220635
|
+
yield { path: startDir, isGlobalConfig: false };
|
|
220636
|
+
return;
|
|
220637
|
+
}
|
|
220638
|
+
case "project": {
|
|
220639
|
+
let currentDir = startDir;
|
|
220640
|
+
while (true) {
|
|
220641
|
+
yield { path: currentDir, isGlobalConfig: false };
|
|
220642
|
+
for (const ext of ["json", "yaml"]) {
|
|
220643
|
+
const packageFile = path_1.default.join(currentDir, `package.${ext}`);
|
|
220644
|
+
if (await this.#fileExists(packageFile)) {
|
|
220645
|
+
break;
|
|
220646
|
+
}
|
|
220647
|
+
}
|
|
220648
|
+
const parentDir = path_1.default.dirname(currentDir);
|
|
220649
|
+
if (parentDir === currentDir) {
|
|
220650
|
+
break;
|
|
220651
|
+
}
|
|
220652
|
+
currentDir = parentDir;
|
|
220653
|
+
}
|
|
220654
|
+
return;
|
|
220655
|
+
}
|
|
220656
|
+
case "global": {
|
|
220657
|
+
yield* this.getGlobalDirs(startDir);
|
|
220658
|
+
}
|
|
220659
|
+
}
|
|
220339
220660
|
}
|
|
220340
220661
|
};
|
|
220341
220662
|
exports.Explorer = Explorer;
|
|
@@ -220353,9 +220674,9 @@ var require_ExplorerSync = __commonJS({
|
|
|
220353
220674
|
exports.ExplorerSync = void 0;
|
|
220354
220675
|
var fs_1 = __importDefault(__require("fs"));
|
|
220355
220676
|
var path_1 = __importDefault(__require("path"));
|
|
220356
|
-
var
|
|
220677
|
+
var defaults_1 = require_defaults2();
|
|
220357
220678
|
var ExplorerBase_js_1 = require_ExplorerBase();
|
|
220358
|
-
var
|
|
220679
|
+
var merge_1 = require_merge2();
|
|
220359
220680
|
var util_js_1 = require_util2();
|
|
220360
220681
|
var ExplorerSync = class extends ExplorerBase_js_1.ExplorerBase {
|
|
220361
220682
|
load(filepath) {
|
|
@@ -220377,30 +220698,34 @@ var require_ExplorerSync = __commonJS({
|
|
|
220377
220698
|
return config;
|
|
220378
220699
|
}
|
|
220379
220700
|
}
|
|
220380
|
-
const stopDir = path_1.default.resolve(this.config.stopDir);
|
|
220381
220701
|
from = path_1.default.resolve(from);
|
|
220702
|
+
const dirs = this.#getDirs(from);
|
|
220703
|
+
const firstDirIter = dirs.next();
|
|
220704
|
+
if (firstDirIter.done) {
|
|
220705
|
+
throw new Error(`Could not find any folders to iterate through (start from ${from})`);
|
|
220706
|
+
}
|
|
220707
|
+
let currentDir = firstDirIter.value;
|
|
220382
220708
|
const search = () => {
|
|
220383
|
-
if ((0,
|
|
220384
|
-
for (const
|
|
220385
|
-
const filepath = path_1.default.join(from, place);
|
|
220709
|
+
if ((0, util_js_1.isDirectorySync)(currentDir.path)) {
|
|
220710
|
+
for (const filepath of this.getSearchPlacesForDir(currentDir, defaults_1.globalConfigSearchPlacesSync)) {
|
|
220386
220711
|
try {
|
|
220387
220712
|
const result = this.#readConfiguration(filepath);
|
|
220388
220713
|
if (result !== null && !(result.isEmpty && this.config.ignoreEmptySearchPlaces)) {
|
|
220389
220714
|
return this.config.transform(result);
|
|
220390
220715
|
}
|
|
220391
220716
|
} catch (error) {
|
|
220392
|
-
if (error.code === "ENOENT" || error.code === "EISDIR" || error.code === "ENOTDIR") {
|
|
220717
|
+
if (error.code === "ENOENT" || error.code === "EISDIR" || error.code === "ENOTDIR" || error.code === "EACCES") {
|
|
220393
220718
|
continue;
|
|
220394
220719
|
}
|
|
220395
220720
|
throw error;
|
|
220396
220721
|
}
|
|
220397
220722
|
}
|
|
220398
220723
|
}
|
|
220399
|
-
const
|
|
220400
|
-
if (
|
|
220401
|
-
|
|
220724
|
+
const nextDirIter = dirs.next();
|
|
220725
|
+
if (!nextDirIter.done) {
|
|
220726
|
+
currentDir = nextDirIter.value;
|
|
220402
220727
|
if (this.searchCache) {
|
|
220403
|
-
return (0, util_js_1.emplace)(this.searchCache,
|
|
220728
|
+
return (0, util_js_1.emplace)(this.searchCache, currentDir.path, search);
|
|
220404
220729
|
}
|
|
220405
220730
|
return search();
|
|
220406
220731
|
}
|
|
@@ -220411,28 +220736,85 @@ var require_ExplorerSync = __commonJS({
|
|
|
220411
220736
|
}
|
|
220412
220737
|
return search();
|
|
220413
220738
|
}
|
|
220414
|
-
#readConfiguration(filepath) {
|
|
220739
|
+
#readConfiguration(filepath, importStack = []) {
|
|
220415
220740
|
const contents = fs_1.default.readFileSync(filepath, "utf8");
|
|
220416
|
-
return this.toCosmiconfigResult(filepath, this.#
|
|
220741
|
+
return this.toCosmiconfigResult(filepath, this.#loadConfigFileWithImports(filepath, contents, importStack));
|
|
220742
|
+
}
|
|
220743
|
+
#loadConfigFileWithImports(filepath, contents, importStack) {
|
|
220744
|
+
const loadedContent = this.#loadConfiguration(filepath, contents);
|
|
220745
|
+
if (!loadedContent || !(0, merge_1.hasOwn)(loadedContent, "$import")) {
|
|
220746
|
+
return loadedContent;
|
|
220747
|
+
}
|
|
220748
|
+
const fileDirectory = path_1.default.dirname(filepath);
|
|
220749
|
+
const { $import: imports, ...ownContent } = loadedContent;
|
|
220750
|
+
const importPaths = Array.isArray(imports) ? imports : [imports];
|
|
220751
|
+
const newImportStack = [...importStack, filepath];
|
|
220752
|
+
this.validateImports(filepath, importPaths, newImportStack);
|
|
220753
|
+
const importedConfigs = importPaths.map((importPath) => {
|
|
220754
|
+
const fullPath = path_1.default.resolve(fileDirectory, importPath);
|
|
220755
|
+
const result = this.#readConfiguration(fullPath, newImportStack);
|
|
220756
|
+
return result?.config;
|
|
220757
|
+
});
|
|
220758
|
+
return (0, merge_1.mergeAll)([...importedConfigs, ownContent], {
|
|
220759
|
+
mergeArrays: this.config.mergeImportArrays
|
|
220760
|
+
});
|
|
220417
220761
|
}
|
|
220418
220762
|
#loadConfiguration(filepath, contents) {
|
|
220419
220763
|
if (contents.trim() === "") {
|
|
220420
220764
|
return;
|
|
220421
220765
|
}
|
|
220422
|
-
if (path_1.default.basename(filepath) === "package.json") {
|
|
220423
|
-
return (0, util_js_1.getPropertyByPath)((0, loaders_js_1.loadJson)(filepath, contents), this.config.packageProp) ?? null;
|
|
220424
|
-
}
|
|
220425
220766
|
const extension = path_1.default.extname(filepath);
|
|
220767
|
+
const loader = this.config.loaders[extension || "noExt"] ?? this.config.loaders["default"];
|
|
220768
|
+
if (!loader) {
|
|
220769
|
+
throw new Error(`No loader specified for ${(0, ExplorerBase_js_1.getExtensionDescription)(extension)}`);
|
|
220770
|
+
}
|
|
220426
220771
|
try {
|
|
220427
|
-
const
|
|
220428
|
-
if (
|
|
220429
|
-
return
|
|
220772
|
+
const loadedContents = loader(filepath, contents);
|
|
220773
|
+
if (path_1.default.basename(filepath, extension) !== "package") {
|
|
220774
|
+
return loadedContents;
|
|
220430
220775
|
}
|
|
220776
|
+
return (0, util_js_1.getPropertyByPath)(loadedContents, this.config.packageProp ?? this.config.moduleName) ?? null;
|
|
220431
220777
|
} catch (error) {
|
|
220432
220778
|
error.filepath = filepath;
|
|
220433
220779
|
throw error;
|
|
220434
220780
|
}
|
|
220435
|
-
|
|
220781
|
+
}
|
|
220782
|
+
#fileExists(path16) {
|
|
220783
|
+
try {
|
|
220784
|
+
fs_1.default.statSync(path16);
|
|
220785
|
+
return true;
|
|
220786
|
+
} catch (e) {
|
|
220787
|
+
return false;
|
|
220788
|
+
}
|
|
220789
|
+
}
|
|
220790
|
+
*#getDirs(startDir) {
|
|
220791
|
+
switch (this.config.searchStrategy) {
|
|
220792
|
+
case "none": {
|
|
220793
|
+
yield { path: startDir, isGlobalConfig: false };
|
|
220794
|
+
return;
|
|
220795
|
+
}
|
|
220796
|
+
case "project": {
|
|
220797
|
+
let currentDir = startDir;
|
|
220798
|
+
while (true) {
|
|
220799
|
+
yield { path: currentDir, isGlobalConfig: false };
|
|
220800
|
+
for (const ext of ["json", "yaml"]) {
|
|
220801
|
+
const packageFile = path_1.default.join(currentDir, `package.${ext}`);
|
|
220802
|
+
if (this.#fileExists(packageFile)) {
|
|
220803
|
+
break;
|
|
220804
|
+
}
|
|
220805
|
+
}
|
|
220806
|
+
const parentDir = path_1.default.dirname(currentDir);
|
|
220807
|
+
if (parentDir === currentDir) {
|
|
220808
|
+
break;
|
|
220809
|
+
}
|
|
220810
|
+
currentDir = parentDir;
|
|
220811
|
+
}
|
|
220812
|
+
return;
|
|
220813
|
+
}
|
|
220814
|
+
case "global": {
|
|
220815
|
+
yield* this.getGlobalDirs(startDir);
|
|
220816
|
+
}
|
|
220817
|
+
}
|
|
220436
220818
|
}
|
|
220437
220819
|
/**
|
|
220438
220820
|
* @deprecated Use {@link ExplorerSync.prototype.load}.
|
|
@@ -220457,179 +220839,140 @@ var require_ExplorerSync = __commonJS({
|
|
|
220457
220839
|
var require_dist = __commonJS({
|
|
220458
220840
|
"node_modules/cosmiconfig/dist/index.js"(exports) {
|
|
220459
220841
|
"use strict";
|
|
220460
|
-
var __createBinding = exports && exports.__createBinding || (Object.create ? function(o, m, k, k2) {
|
|
220461
|
-
if (k2 === void 0)
|
|
220462
|
-
k2 = k;
|
|
220463
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
220464
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
220465
|
-
desc = { enumerable: true, get: function() {
|
|
220466
|
-
return m[k];
|
|
220467
|
-
} };
|
|
220468
|
-
}
|
|
220469
|
-
Object.defineProperty(o, k2, desc);
|
|
220470
|
-
} : function(o, m, k, k2) {
|
|
220471
|
-
if (k2 === void 0)
|
|
220472
|
-
k2 = k;
|
|
220473
|
-
o[k2] = m[k];
|
|
220474
|
-
});
|
|
220475
|
-
var __exportStar = exports && exports.__exportStar || function(m, exports2) {
|
|
220476
|
-
for (var p in m)
|
|
220477
|
-
if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports2, p))
|
|
220478
|
-
__createBinding(exports2, m, p);
|
|
220479
|
-
};
|
|
220480
|
-
var __importDefault = exports && exports.__importDefault || function(mod) {
|
|
220481
|
-
return mod && mod.__esModule ? mod : { "default": mod };
|
|
220482
|
-
};
|
|
220483
220842
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
220484
|
-
exports.
|
|
220485
|
-
|
|
220486
|
-
|
|
220843
|
+
exports.defaultLoadersSync = exports.defaultLoaders = exports.globalConfigSearchPlacesSync = exports.globalConfigSearchPlaces = exports.getDefaultSearchPlacesSync = exports.getDefaultSearchPlaces = exports.cosmiconfigSync = exports.cosmiconfig = void 0;
|
|
220844
|
+
var defaults_1 = require_defaults2();
|
|
220845
|
+
Object.defineProperty(exports, "defaultLoaders", { enumerable: true, get: function() {
|
|
220846
|
+
return defaults_1.defaultLoaders;
|
|
220847
|
+
} });
|
|
220848
|
+
Object.defineProperty(exports, "defaultLoadersSync", { enumerable: true, get: function() {
|
|
220849
|
+
return defaults_1.defaultLoadersSync;
|
|
220850
|
+
} });
|
|
220851
|
+
Object.defineProperty(exports, "getDefaultSearchPlaces", { enumerable: true, get: function() {
|
|
220852
|
+
return defaults_1.getDefaultSearchPlaces;
|
|
220853
|
+
} });
|
|
220854
|
+
Object.defineProperty(exports, "getDefaultSearchPlacesSync", { enumerable: true, get: function() {
|
|
220855
|
+
return defaults_1.getDefaultSearchPlacesSync;
|
|
220856
|
+
} });
|
|
220857
|
+
Object.defineProperty(exports, "globalConfigSearchPlaces", { enumerable: true, get: function() {
|
|
220858
|
+
return defaults_1.globalConfigSearchPlaces;
|
|
220859
|
+
} });
|
|
220860
|
+
Object.defineProperty(exports, "globalConfigSearchPlacesSync", { enumerable: true, get: function() {
|
|
220861
|
+
return defaults_1.globalConfigSearchPlacesSync;
|
|
220862
|
+
} });
|
|
220487
220863
|
var Explorer_js_1 = require_Explorer();
|
|
220488
220864
|
var ExplorerSync_js_1 = require_ExplorerSync();
|
|
220489
|
-
var loaders_js_1 = require_loaders();
|
|
220490
220865
|
var util_1 = require_util2();
|
|
220491
|
-
exports.metaSearchPlaces = [
|
|
220492
|
-
"package.json",
|
|
220493
|
-
".config.json",
|
|
220494
|
-
".config.yaml",
|
|
220495
|
-
".config.yml",
|
|
220496
|
-
".config.js",
|
|
220497
|
-
".config.ts",
|
|
220498
|
-
".config.cjs",
|
|
220499
|
-
".config.mjs"
|
|
220500
|
-
];
|
|
220501
|
-
exports.defaultLoaders = Object.freeze({
|
|
220502
|
-
".mjs": loaders_js_1.loadJs,
|
|
220503
|
-
".cjs": loaders_js_1.loadJs,
|
|
220504
|
-
".js": loaders_js_1.loadJs,
|
|
220505
|
-
".ts": loaders_js_1.loadTs,
|
|
220506
|
-
".json": loaders_js_1.loadJson,
|
|
220507
|
-
".yaml": loaders_js_1.loadYaml,
|
|
220508
|
-
".yml": loaders_js_1.loadYaml,
|
|
220509
|
-
noExt: loaders_js_1.loadYaml
|
|
220510
|
-
});
|
|
220511
|
-
exports.defaultLoadersSync = Object.freeze({
|
|
220512
|
-
".cjs": loaders_js_1.loadJsSync,
|
|
220513
|
-
".js": loaders_js_1.loadJsSync,
|
|
220514
|
-
".ts": loaders_js_1.loadTsSync,
|
|
220515
|
-
".json": loaders_js_1.loadJson,
|
|
220516
|
-
".yaml": loaders_js_1.loadYaml,
|
|
220517
|
-
".yml": loaders_js_1.loadYaml,
|
|
220518
|
-
noExt: loaders_js_1.loadYaml
|
|
220519
|
-
});
|
|
220520
220866
|
var identity2 = function identity3(x) {
|
|
220521
220867
|
return x;
|
|
220522
220868
|
};
|
|
220523
|
-
function
|
|
220869
|
+
function getUserDefinedOptionsFromMetaConfig() {
|
|
220524
220870
|
const metaExplorer = new ExplorerSync_js_1.ExplorerSync({
|
|
220525
|
-
|
|
220871
|
+
moduleName: "cosmiconfig",
|
|
220526
220872
|
stopDir: process.cwd(),
|
|
220527
|
-
searchPlaces:
|
|
220873
|
+
searchPlaces: defaults_1.metaSearchPlaces,
|
|
220528
220874
|
ignoreEmptySearchPlaces: false,
|
|
220529
220875
|
applyPackagePropertyPathToConfiguration: true,
|
|
220530
|
-
loaders:
|
|
220876
|
+
loaders: defaults_1.defaultLoaders,
|
|
220531
220877
|
transform: identity2,
|
|
220532
220878
|
cache: true,
|
|
220533
|
-
metaConfigFilePath: null
|
|
220879
|
+
metaConfigFilePath: null,
|
|
220880
|
+
mergeImportArrays: true,
|
|
220881
|
+
mergeSearchPlaces: true,
|
|
220882
|
+
searchStrategy: "none"
|
|
220534
220883
|
});
|
|
220535
220884
|
const metaConfig = metaExplorer.search();
|
|
220536
220885
|
if (!metaConfig) {
|
|
220537
|
-
return
|
|
220886
|
+
return null;
|
|
220538
220887
|
}
|
|
220539
220888
|
if (metaConfig.config?.loaders) {
|
|
220540
220889
|
throw new Error("Can not specify loaders in meta config file");
|
|
220541
220890
|
}
|
|
220542
|
-
|
|
220543
|
-
|
|
220544
|
-
overrideOptions.searchPlaces = overrideOptions.searchPlaces.map((path16) => path16.replace("{name}", moduleName2));
|
|
220891
|
+
if (metaConfig.config?.searchStrategy) {
|
|
220892
|
+
throw new Error("Can not specify searchStrategy in meta config file");
|
|
220545
220893
|
}
|
|
220546
|
-
overrideOptions
|
|
220547
|
-
|
|
220548
|
-
|
|
220549
|
-
function normalizeOptions(moduleName2, options) {
|
|
220550
|
-
const defaults = {
|
|
220551
|
-
packageProp: moduleName2,
|
|
220552
|
-
searchPlaces: [
|
|
220553
|
-
"package.json",
|
|
220554
|
-
`.${moduleName2}rc`,
|
|
220555
|
-
`.${moduleName2}rc.json`,
|
|
220556
|
-
`.${moduleName2}rc.yaml`,
|
|
220557
|
-
`.${moduleName2}rc.yml`,
|
|
220558
|
-
`.${moduleName2}rc.js`,
|
|
220559
|
-
`.${moduleName2}rc.ts`,
|
|
220560
|
-
`.${moduleName2}rc.cjs`,
|
|
220561
|
-
`.${moduleName2}rc.mjs`,
|
|
220562
|
-
`.config/${moduleName2}rc`,
|
|
220563
|
-
`.config/${moduleName2}rc.json`,
|
|
220564
|
-
`.config/${moduleName2}rc.yaml`,
|
|
220565
|
-
`.config/${moduleName2}rc.yml`,
|
|
220566
|
-
`.config/${moduleName2}rc.js`,
|
|
220567
|
-
`.config/${moduleName2}rc.ts`,
|
|
220568
|
-
`.config/${moduleName2}rc.cjs`,
|
|
220569
|
-
`.config/${moduleName2}rc.mjs`,
|
|
220570
|
-
`${moduleName2}.config.js`,
|
|
220571
|
-
`${moduleName2}.config.ts`,
|
|
220572
|
-
`${moduleName2}.config.cjs`,
|
|
220573
|
-
`${moduleName2}.config.mjs`
|
|
220574
|
-
],
|
|
220575
|
-
ignoreEmptySearchPlaces: true,
|
|
220576
|
-
stopDir: os_1.default.homedir(),
|
|
220577
|
-
cache: true,
|
|
220578
|
-
transform: identity2,
|
|
220579
|
-
loaders: exports.defaultLoaders,
|
|
220580
|
-
metaConfigFilePath: null
|
|
220894
|
+
const overrideOptions = {
|
|
220895
|
+
mergeSearchPlaces: true,
|
|
220896
|
+
...metaConfig.config ?? {}
|
|
220581
220897
|
};
|
|
220898
|
+
return {
|
|
220899
|
+
config: (0, util_1.removeUndefinedValuesFromObject)(overrideOptions),
|
|
220900
|
+
filepath: metaConfig.filepath
|
|
220901
|
+
};
|
|
220902
|
+
}
|
|
220903
|
+
function getResolvedSearchPlaces(moduleName2, toolDefinedSearchPlaces, userConfiguredOptions) {
|
|
220904
|
+
const userConfiguredSearchPlaces = userConfiguredOptions.searchPlaces?.map((path16) => path16.replace("{name}", moduleName2));
|
|
220905
|
+
if (userConfiguredOptions.mergeSearchPlaces) {
|
|
220906
|
+
return [...userConfiguredSearchPlaces ?? [], ...toolDefinedSearchPlaces];
|
|
220907
|
+
}
|
|
220908
|
+
return userConfiguredSearchPlaces ?? /* istanbul ignore next */
|
|
220909
|
+
toolDefinedSearchPlaces;
|
|
220910
|
+
}
|
|
220911
|
+
function mergeOptionsBase(moduleName2, defaults, options) {
|
|
220912
|
+
const userDefinedConfig = getUserDefinedOptionsFromMetaConfig();
|
|
220913
|
+
if (!userDefinedConfig) {
|
|
220914
|
+
return {
|
|
220915
|
+
...defaults,
|
|
220916
|
+
...(0, util_1.removeUndefinedValuesFromObject)(options),
|
|
220917
|
+
loaders: {
|
|
220918
|
+
...defaults.loaders,
|
|
220919
|
+
...options.loaders
|
|
220920
|
+
}
|
|
220921
|
+
};
|
|
220922
|
+
}
|
|
220923
|
+
const userConfiguredOptions = userDefinedConfig.config;
|
|
220924
|
+
const toolDefinedSearchPlaces = options.searchPlaces ?? defaults.searchPlaces;
|
|
220582
220925
|
return {
|
|
220583
220926
|
...defaults,
|
|
220584
220927
|
...(0, util_1.removeUndefinedValuesFromObject)(options),
|
|
220928
|
+
metaConfigFilePath: userDefinedConfig.filepath,
|
|
220929
|
+
...userConfiguredOptions,
|
|
220930
|
+
searchPlaces: getResolvedSearchPlaces(moduleName2, toolDefinedSearchPlaces, userConfiguredOptions),
|
|
220585
220931
|
loaders: {
|
|
220586
220932
|
...defaults.loaders,
|
|
220587
220933
|
...options.loaders
|
|
220588
220934
|
}
|
|
220589
220935
|
};
|
|
220590
220936
|
}
|
|
220591
|
-
function
|
|
220937
|
+
function validateOptions(options) {
|
|
220938
|
+
if (options.searchStrategy != null && options.searchStrategy !== "global" && options.stopDir) {
|
|
220939
|
+
throw new Error('Can not supply `stopDir` option with `searchStrategy` other than "global"');
|
|
220940
|
+
}
|
|
220941
|
+
}
|
|
220942
|
+
function mergeOptions(moduleName2, options) {
|
|
220943
|
+
validateOptions(options);
|
|
220592
220944
|
const defaults = {
|
|
220593
|
-
|
|
220594
|
-
searchPlaces:
|
|
220595
|
-
"package.json",
|
|
220596
|
-
`.${moduleName2}rc`,
|
|
220597
|
-
`.${moduleName2}rc.json`,
|
|
220598
|
-
`.${moduleName2}rc.yaml`,
|
|
220599
|
-
`.${moduleName2}rc.yml`,
|
|
220600
|
-
`.${moduleName2}rc.js`,
|
|
220601
|
-
`.${moduleName2}rc.ts`,
|
|
220602
|
-
`.${moduleName2}rc.cjs`,
|
|
220603
|
-
`.config/${moduleName2}rc`,
|
|
220604
|
-
`.config/${moduleName2}rc.json`,
|
|
220605
|
-
`.config/${moduleName2}rc.yaml`,
|
|
220606
|
-
`.config/${moduleName2}rc.yml`,
|
|
220607
|
-
`.config/${moduleName2}rc.js`,
|
|
220608
|
-
`.config/${moduleName2}rc.ts`,
|
|
220609
|
-
`.config/${moduleName2}rc.cjs`,
|
|
220610
|
-
`${moduleName2}.config.js`,
|
|
220611
|
-
`${moduleName2}.config.ts`,
|
|
220612
|
-
`${moduleName2}.config.cjs`
|
|
220613
|
-
],
|
|
220945
|
+
moduleName: moduleName2,
|
|
220946
|
+
searchPlaces: (0, defaults_1.getDefaultSearchPlaces)(moduleName2),
|
|
220614
220947
|
ignoreEmptySearchPlaces: true,
|
|
220615
|
-
stopDir: os_1.default.homedir(),
|
|
220616
220948
|
cache: true,
|
|
220617
220949
|
transform: identity2,
|
|
220618
|
-
loaders:
|
|
220619
|
-
metaConfigFilePath: null
|
|
220950
|
+
loaders: defaults_1.defaultLoaders,
|
|
220951
|
+
metaConfigFilePath: null,
|
|
220952
|
+
mergeImportArrays: true,
|
|
220953
|
+
mergeSearchPlaces: true,
|
|
220954
|
+
searchStrategy: options.stopDir ? "global" : "none"
|
|
220620
220955
|
};
|
|
220621
|
-
return
|
|
220622
|
-
|
|
220623
|
-
|
|
220624
|
-
|
|
220625
|
-
|
|
220626
|
-
|
|
220627
|
-
|
|
220956
|
+
return mergeOptionsBase(moduleName2, defaults, options);
|
|
220957
|
+
}
|
|
220958
|
+
function mergeOptionsSync(moduleName2, options) {
|
|
220959
|
+
validateOptions(options);
|
|
220960
|
+
const defaults = {
|
|
220961
|
+
moduleName: moduleName2,
|
|
220962
|
+
searchPlaces: (0, defaults_1.getDefaultSearchPlacesSync)(moduleName2),
|
|
220963
|
+
ignoreEmptySearchPlaces: true,
|
|
220964
|
+
cache: true,
|
|
220965
|
+
transform: identity2,
|
|
220966
|
+
loaders: defaults_1.defaultLoadersSync,
|
|
220967
|
+
metaConfigFilePath: null,
|
|
220968
|
+
mergeImportArrays: true,
|
|
220969
|
+
mergeSearchPlaces: true,
|
|
220970
|
+
searchStrategy: options.stopDir ? "global" : "none"
|
|
220628
220971
|
};
|
|
220972
|
+
return mergeOptionsBase(moduleName2, defaults, options);
|
|
220629
220973
|
}
|
|
220630
220974
|
function cosmiconfig2(moduleName2, options = {}) {
|
|
220631
|
-
const
|
|
220632
|
-
const normalizedOptions = normalizeOptions(moduleName2, internalOptions);
|
|
220975
|
+
const normalizedOptions = mergeOptions(moduleName2, options);
|
|
220633
220976
|
const explorer = new Explorer_js_1.Explorer(normalizedOptions);
|
|
220634
220977
|
return {
|
|
220635
220978
|
search: explorer.search.bind(explorer),
|
|
@@ -220641,8 +220984,7 @@ var require_dist = __commonJS({
|
|
|
220641
220984
|
}
|
|
220642
220985
|
exports.cosmiconfig = cosmiconfig2;
|
|
220643
220986
|
function cosmiconfigSync(moduleName2, options = {}) {
|
|
220644
|
-
const
|
|
220645
|
-
const normalizedOptions = normalizeOptionsSync(moduleName2, internalOptions);
|
|
220987
|
+
const normalizedOptions = mergeOptionsSync(moduleName2, options);
|
|
220646
220988
|
const explorerSync = new ExplorerSync_js_1.ExplorerSync(normalizedOptions);
|
|
220647
220989
|
return {
|
|
220648
220990
|
search: explorerSync.search.bind(explorerSync),
|
|
@@ -224485,7 +224827,7 @@ Default "index" lookups for the main are deprecated for ES modules.`, "Deprecati
|
|
|
224485
224827
|
function invalidPackageTarget2(subpath, target, packageJsonUrl, internal, base) {
|
|
224486
224828
|
return target = "object" == typeof target && null !== target ? JSON.stringify(target, null, "") : `${target}`, new ERR_INVALID_PACKAGE_TARGET2((0, external_node_url_namespaceObject.fileURLToPath)(new external_node_url_namespaceObject.URL(".", packageJsonUrl)), subpath, target, internal, base && (0, external_node_url_namespaceObject.fileURLToPath)(base));
|
|
224487
224829
|
}
|
|
224488
|
-
function resolvePackageTargetString2(target, subpath, match2, packageJsonUrl, base, pattern, internal, isPathMap,
|
|
224830
|
+
function resolvePackageTargetString2(target, subpath, match2, packageJsonUrl, base, pattern, internal, isPathMap, conditions2) {
|
|
224489
224831
|
if ("" !== subpath && !pattern && "/" !== target[target.length - 1])
|
|
224490
224832
|
throw invalidPackageTarget2(match2, target, packageJsonUrl, internal, base);
|
|
224491
224833
|
if (!target.startsWith("./")) {
|
|
@@ -224496,7 +224838,7 @@ Default "index" lookups for the main are deprecated for ES modules.`, "Deprecati
|
|
|
224496
224838
|
} catch {
|
|
224497
224839
|
}
|
|
224498
224840
|
if (!isURL) {
|
|
224499
|
-
return packageResolve2(pattern ? RegExpPrototypeSymbolReplace2.call(patternRegEx2, target, () => subpath) : target + subpath, packageJsonUrl,
|
|
224841
|
+
return packageResolve2(pattern ? RegExpPrototypeSymbolReplace2.call(patternRegEx2, target, () => subpath) : target + subpath, packageJsonUrl, conditions2);
|
|
224500
224842
|
}
|
|
224501
224843
|
}
|
|
224502
224844
|
throw invalidPackageTarget2(match2, target, packageJsonUrl, internal, base);
|
|
@@ -224532,9 +224874,9 @@ Default "index" lookups for the main are deprecated for ES modules.`, "Deprecati
|
|
|
224532
224874
|
const keyNumber = Number(key);
|
|
224533
224875
|
return `${keyNumber}` === key && (keyNumber >= 0 && keyNumber < 4294967295);
|
|
224534
224876
|
}
|
|
224535
|
-
function resolvePackageTarget2(packageJsonUrl, target, subpath, packageSubpath, base, pattern, internal, isPathMap,
|
|
224877
|
+
function resolvePackageTarget2(packageJsonUrl, target, subpath, packageSubpath, base, pattern, internal, isPathMap, conditions2) {
|
|
224536
224878
|
if ("string" == typeof target)
|
|
224537
|
-
return resolvePackageTargetString2(target, subpath, packageSubpath, packageJsonUrl, base, pattern, internal, isPathMap,
|
|
224879
|
+
return resolvePackageTargetString2(target, subpath, packageSubpath, packageJsonUrl, base, pattern, internal, isPathMap, conditions2);
|
|
224538
224880
|
if (Array.isArray(target)) {
|
|
224539
224881
|
const targetList = target;
|
|
224540
224882
|
if (0 === targetList.length)
|
|
@@ -224544,7 +224886,7 @@ Default "index" lookups for the main are deprecated for ES modules.`, "Deprecati
|
|
|
224544
224886
|
const targetItem = targetList[i2];
|
|
224545
224887
|
let resolveResult;
|
|
224546
224888
|
try {
|
|
224547
|
-
resolveResult = resolvePackageTarget2(packageJsonUrl, targetItem, subpath, packageSubpath, base, pattern, internal, isPathMap,
|
|
224889
|
+
resolveResult = resolvePackageTarget2(packageJsonUrl, targetItem, subpath, packageSubpath, base, pattern, internal, isPathMap, conditions2);
|
|
224548
224890
|
} catch (error) {
|
|
224549
224891
|
if (lastException = error, "ERR_INVALID_PACKAGE_TARGET" === error.code)
|
|
224550
224892
|
continue;
|
|
@@ -224569,8 +224911,8 @@ Default "index" lookups for the main are deprecated for ES modules.`, "Deprecati
|
|
|
224569
224911
|
}
|
|
224570
224912
|
for (i2 = -1; ++i2 < keys.length; ) {
|
|
224571
224913
|
const key = keys[i2];
|
|
224572
|
-
if ("default" === key ||
|
|
224573
|
-
const resolveResult = resolvePackageTarget2(packageJsonUrl, target[key], subpath, packageSubpath, base, pattern, internal, isPathMap,
|
|
224914
|
+
if ("default" === key || conditions2 && conditions2.has(key)) {
|
|
224915
|
+
const resolveResult = resolvePackageTarget2(packageJsonUrl, target[key], subpath, packageSubpath, base, pattern, internal, isPathMap, conditions2);
|
|
224574
224916
|
if (void 0 === resolveResult)
|
|
224575
224917
|
continue;
|
|
224576
224918
|
return resolveResult;
|
|
@@ -224586,7 +224928,7 @@ Default "index" lookups for the main are deprecated for ES modules.`, "Deprecati
|
|
|
224586
224928
|
const pjsonPath = (0, external_node_url_namespaceObject.fileURLToPath)(pjsonUrl);
|
|
224587
224929
|
emittedPackageWarnings2.has(pjsonPath + "|" + match2) || (emittedPackageWarnings2.add(pjsonPath + "|" + match2), external_node_process_namespaceObject.emitWarning(`Use of deprecated trailing slash pattern mapping "${match2}" in the "exports" field module resolution of the package at ${pjsonPath}${base ? ` imported from ${(0, external_node_url_namespaceObject.fileURLToPath)(base)}` : ""}. Mapping specifiers ending in "/" is no longer supported.`, "DeprecationWarning", "DEP0155"));
|
|
224588
224930
|
}
|
|
224589
|
-
function packageExportsResolve2(packageJsonUrl, packageSubpath, packageConfig, base,
|
|
224931
|
+
function packageExportsResolve2(packageJsonUrl, packageSubpath, packageConfig, base, conditions2) {
|
|
224590
224932
|
let exports2 = packageConfig.exports;
|
|
224591
224933
|
if (function(exports3, packageJsonUrl2, base2) {
|
|
224592
224934
|
if ("string" == typeof exports3 || Array.isArray(exports3))
|
|
@@ -224604,7 +224946,7 @@ Default "index" lookups for the main are deprecated for ES modules.`, "Deprecati
|
|
|
224604
224946
|
}
|
|
224605
224947
|
return isConditionalSugar;
|
|
224606
224948
|
}(exports2, packageJsonUrl, base) && (exports2 = { ".": exports2 }), own3.call(exports2, packageSubpath) && !packageSubpath.includes("*") && !packageSubpath.endsWith("/")) {
|
|
224607
|
-
const resolveResult = resolvePackageTarget2(packageJsonUrl, exports2[packageSubpath], "", packageSubpath, base, false, false, false,
|
|
224949
|
+
const resolveResult = resolvePackageTarget2(packageJsonUrl, exports2[packageSubpath], "", packageSubpath, base, false, false, false, conditions2);
|
|
224608
224950
|
if (null == resolveResult)
|
|
224609
224951
|
throw exportsNotFound2(packageSubpath, packageJsonUrl, base);
|
|
224610
224952
|
return resolveResult;
|
|
@@ -224621,7 +224963,7 @@ Default "index" lookups for the main are deprecated for ES modules.`, "Deprecati
|
|
|
224621
224963
|
}
|
|
224622
224964
|
}
|
|
224623
224965
|
if (bestMatch) {
|
|
224624
|
-
const resolveResult = resolvePackageTarget2(packageJsonUrl, exports2[bestMatch], bestMatchSubpath, bestMatch, base, true, false, packageSubpath.endsWith("/"),
|
|
224966
|
+
const resolveResult = resolvePackageTarget2(packageJsonUrl, exports2[bestMatch], bestMatchSubpath, bestMatch, base, true, false, packageSubpath.endsWith("/"), conditions2);
|
|
224625
224967
|
if (null == resolveResult)
|
|
224626
224968
|
throw exportsNotFound2(packageSubpath, packageJsonUrl, base);
|
|
224627
224969
|
return resolveResult;
|
|
@@ -224632,7 +224974,7 @@ Default "index" lookups for the main are deprecated for ES modules.`, "Deprecati
|
|
|
224632
224974
|
const aPatternIndex = a.indexOf("*"), bPatternIndex = b.indexOf("*"), baseLengthA = -1 === aPatternIndex ? a.length : aPatternIndex + 1, baseLengthB = -1 === bPatternIndex ? b.length : bPatternIndex + 1;
|
|
224633
224975
|
return baseLengthA > baseLengthB ? -1 : baseLengthB > baseLengthA || -1 === aPatternIndex ? 1 : -1 === bPatternIndex || a.length > b.length ? -1 : b.length > a.length ? 1 : 0;
|
|
224634
224976
|
}
|
|
224635
|
-
function packageImportsResolve2(name, base,
|
|
224977
|
+
function packageImportsResolve2(name, base, conditions2) {
|
|
224636
224978
|
if ("#" === name || name.startsWith("#/") || name.endsWith("/")) {
|
|
224637
224979
|
throw new ERR_INVALID_MODULE_SPECIFIER2(name, "is not a valid internal imports specifier name", (0, external_node_url_namespaceObject.fileURLToPath)(base));
|
|
224638
224980
|
}
|
|
@@ -224643,7 +224985,7 @@ Default "index" lookups for the main are deprecated for ES modules.`, "Deprecati
|
|
|
224643
224985
|
const imports = packageConfig.imports;
|
|
224644
224986
|
if (imports)
|
|
224645
224987
|
if (own3.call(imports, name) && !name.includes("*")) {
|
|
224646
|
-
const resolveResult = resolvePackageTarget2(packageJsonUrl, imports[name], "", name, base, false, true, false,
|
|
224988
|
+
const resolveResult = resolvePackageTarget2(packageJsonUrl, imports[name], "", name, base, false, true, false, conditions2);
|
|
224647
224989
|
if (null != resolveResult)
|
|
224648
224990
|
return resolveResult;
|
|
224649
224991
|
} else {
|
|
@@ -224658,7 +225000,7 @@ Default "index" lookups for the main are deprecated for ES modules.`, "Deprecati
|
|
|
224658
225000
|
}
|
|
224659
225001
|
}
|
|
224660
225002
|
if (bestMatch) {
|
|
224661
|
-
const resolveResult = resolvePackageTarget2(packageJsonUrl, imports[bestMatch], bestMatchSubpath, bestMatch, base, true, true, false,
|
|
225003
|
+
const resolveResult = resolvePackageTarget2(packageJsonUrl, imports[bestMatch], bestMatchSubpath, bestMatch, base, true, true, false, conditions2);
|
|
224662
225004
|
if (null != resolveResult)
|
|
224663
225005
|
return resolveResult;
|
|
224664
225006
|
}
|
|
@@ -224668,7 +225010,7 @@ Default "index" lookups for the main are deprecated for ES modules.`, "Deprecati
|
|
|
224668
225010
|
return new ERR_PACKAGE_IMPORT_NOT_DEFINED2(specifier, packageJsonUrl2 && (0, external_node_url_namespaceObject.fileURLToPath)(new external_node_url_namespaceObject.URL(".", packageJsonUrl2)), (0, external_node_url_namespaceObject.fileURLToPath)(base2));
|
|
224669
225011
|
}(name, packageJsonUrl, base);
|
|
224670
225012
|
}
|
|
224671
|
-
function packageResolve2(specifier, base,
|
|
225013
|
+
function packageResolve2(specifier, base, conditions2) {
|
|
224672
225014
|
if (external_node_module_namespaceObject.builtinModules.includes(specifier))
|
|
224673
225015
|
return new external_node_url_namespaceObject.URL("node:" + specifier);
|
|
224674
225016
|
const { packageName, packageSubpath, isScoped } = function(specifier2, base2) {
|
|
@@ -224682,7 +225024,7 @@ Default "index" lookups for the main are deprecated for ES modules.`, "Deprecati
|
|
|
224682
225024
|
if (packageConfig.exists) {
|
|
224683
225025
|
const packageJsonUrl2 = (0, external_node_url_namespaceObject.pathToFileURL)(packageConfig.pjsonPath);
|
|
224684
225026
|
if (packageConfig.name === packageName && void 0 !== packageConfig.exports && null !== packageConfig.exports)
|
|
224685
|
-
return packageExportsResolve2(packageJsonUrl2, packageSubpath, packageConfig, base,
|
|
225027
|
+
return packageExportsResolve2(packageJsonUrl2, packageSubpath, packageConfig, base, conditions2);
|
|
224686
225028
|
}
|
|
224687
225029
|
let lastPath, packageJsonUrl = new external_node_url_namespaceObject.URL("./node_modules/" + packageName + "/package.json", base), packageJsonPath = (0, external_node_url_namespaceObject.fileURLToPath)(packageJsonUrl);
|
|
224688
225030
|
do {
|
|
@@ -224691,11 +225033,11 @@ Default "index" lookups for the main are deprecated for ES modules.`, "Deprecati
|
|
|
224691
225033
|
continue;
|
|
224692
225034
|
}
|
|
224693
225035
|
const packageConfig2 = getPackageConfig(packageJsonPath, specifier, base);
|
|
224694
|
-
return void 0 !== packageConfig2.exports && null !== packageConfig2.exports ? packageExportsResolve2(packageJsonUrl, packageSubpath, packageConfig2, base,
|
|
225036
|
+
return void 0 !== packageConfig2.exports && null !== packageConfig2.exports ? packageExportsResolve2(packageJsonUrl, packageSubpath, packageConfig2, base, conditions2) : "." === packageSubpath ? legacyMainResolve2(packageJsonUrl, packageConfig2, base) : new external_node_url_namespaceObject.URL(packageSubpath, packageJsonUrl);
|
|
224695
225037
|
} while (packageJsonPath.length !== lastPath.length);
|
|
224696
225038
|
throw new ERR_MODULE_NOT_FOUND2(packageName, (0, external_node_url_namespaceObject.fileURLToPath)(base));
|
|
224697
225039
|
}
|
|
224698
|
-
function moduleResolve2(specifier, base,
|
|
225040
|
+
function moduleResolve2(specifier, base, conditions2, preserveSymlinks) {
|
|
224699
225041
|
const protocol = base.protocol, isRemote = "http:" === protocol || "https:" === protocol;
|
|
224700
225042
|
let resolved;
|
|
224701
225043
|
if (function(specifier2) {
|
|
@@ -224714,10 +225056,10 @@ Default "index" lookups for the main are deprecated for ES modules.`, "Deprecati
|
|
|
224714
225056
|
try {
|
|
224715
225057
|
resolved = new external_node_url_namespaceObject.URL(specifier);
|
|
224716
225058
|
} catch {
|
|
224717
|
-
isRemote || (resolved = packageResolve2(specifier, base,
|
|
225059
|
+
isRemote || (resolved = packageResolve2(specifier, base, conditions2));
|
|
224718
225060
|
}
|
|
224719
225061
|
else
|
|
224720
|
-
resolved = packageImportsResolve2(specifier, base,
|
|
225062
|
+
resolved = packageImportsResolve2(specifier, base, conditions2);
|
|
224721
225063
|
return external_node_assert_namespaceObject(void 0 !== resolved, "expected to be defined"), "file:" !== resolved.protocol ? resolved : function(resolved2, base2, preserveSymlinks2) {
|
|
224722
225064
|
if (null !== encodedSepRegEx2.exec(resolved2.pathname))
|
|
224723
225065
|
throw new ERR_INVALID_MODULE_SPECIFIER2(resolved2.pathname, 'must not include encoded "/" or "\\" characters', (0, external_node_url_namespaceObject.fileURLToPath)(base2));
|
|
@@ -224739,9 +225081,9 @@ Default "index" lookups for the main are deprecated for ES modules.`, "Deprecati
|
|
|
224739
225081
|
return "string" != typeof id || id.startsWith("file://") ? normalizeSlash((0, external_node_url_namespaceObject.fileURLToPath)(id)) : normalizeSlash(id);
|
|
224740
225082
|
}
|
|
224741
225083
|
const DEFAULT_CONDITIONS_SET = /* @__PURE__ */ new Set(["node", "import"]), DEFAULT_URL = (0, external_node_url_namespaceObject.pathToFileURL)(process.cwd()), DEFAULT_EXTENSIONS = [".mjs", ".cjs", ".js", ".json"], NOT_FOUND_ERRORS = /* @__PURE__ */ new Set(["ERR_MODULE_NOT_FOUND", "ERR_UNSUPPORTED_DIR_IMPORT", "MODULE_NOT_FOUND", "ERR_PACKAGE_PATH_NOT_EXPORTED"]);
|
|
224742
|
-
function _tryModuleResolve(id, url,
|
|
225084
|
+
function _tryModuleResolve(id, url, conditions2) {
|
|
224743
225085
|
try {
|
|
224744
|
-
return moduleResolve2(id, url,
|
|
225086
|
+
return moduleResolve2(id, url, conditions2);
|
|
224745
225087
|
} catch (error) {
|
|
224746
225088
|
if (!NOT_FOUND_ERRORS.has(error.code))
|
|
224747
225089
|
throw error;
|
|
@@ -224847,9 +225189,9 @@ Default "index" lookups for the main are deprecated for ES modules.`, "Deprecati
|
|
|
224847
225189
|
return _path;
|
|
224848
225190
|
}(id, alias)), opts.esmResolve) {
|
|
224849
225191
|
const conditionSets = [["node", "require"], ["node", "import"]];
|
|
224850
|
-
for (const
|
|
225192
|
+
for (const conditions2 of conditionSets) {
|
|
224851
225193
|
try {
|
|
224852
|
-
resolved = resolvePathSync(id, { url: _url, conditions, extensions: opts.extensions });
|
|
225194
|
+
resolved = resolvePathSync(id, { url: _url, conditions: conditions2, extensions: opts.extensions });
|
|
224853
225195
|
} catch (error) {
|
|
224854
225196
|
err = error;
|
|
224855
225197
|
}
|
|
@@ -230183,14 +230525,14 @@ Add ${syntaxPluginInfo} to the 'plugins' section of your Babel config to enable
|
|
|
230183
230525
|
if (protocol && "file:" !== protocol && "data:" !== protocol && (!experimentalNetworkImports2 || "https:" !== protocol && "http:" !== protocol))
|
|
230184
230526
|
throw new ERR_UNSUPPORTED_ESM_URL_SCHEME(parsed2, ["file", "data"].concat(experimentalNetworkImports2 ? ["https", "http"] : []));
|
|
230185
230527
|
}(parsed, experimentalNetworkImports);
|
|
230186
|
-
const
|
|
230187
|
-
if (void 0 !==
|
|
230188
|
-
if (!Array.isArray(
|
|
230189
|
-
throw new ERR_INVALID_ARG_VALUE("conditions",
|
|
230190
|
-
return new Set(
|
|
230528
|
+
const conditions2 = function(conditions3) {
|
|
230529
|
+
if (void 0 !== conditions3 && conditions3 !== DEFAULT_CONDITIONS) {
|
|
230530
|
+
if (!Array.isArray(conditions3))
|
|
230531
|
+
throw new ERR_INVALID_ARG_VALUE("conditions", conditions3, "expected an array");
|
|
230532
|
+
return new Set(conditions3);
|
|
230191
230533
|
}
|
|
230192
230534
|
return DEFAULT_CONDITIONS_SET;
|
|
230193
|
-
}(context.conditions), url = moduleResolve2(specifier2, new (_url()).URL(parentURL),
|
|
230535
|
+
}(context.conditions), url = moduleResolve2(specifier2, new (_url()).URL(parentURL), conditions2, false);
|
|
230194
230536
|
return function(url2) {
|
|
230195
230537
|
const protocol = url2.protocol;
|
|
230196
230538
|
if ("file:" !== protocol && "data:" !== protocol && "node:" !== protocol)
|
|
@@ -230421,7 +230763,7 @@ Default "index" lookups for the main are deprecated for ES modules.`, "Deprecati
|
|
|
230421
230763
|
function invalidPackageTarget2(subpath, target, packageJsonUrl, internal, base) {
|
|
230422
230764
|
return target = "object" == typeof target && null !== target ? JSON.stringify(target, null, "") : `${target}`, new ERR_INVALID_PACKAGE_TARGET2((0, _url().fileURLToPath)(new (_url()).URL(".", packageJsonUrl)), subpath, target, internal, base && (0, _url().fileURLToPath)(base));
|
|
230423
230765
|
}
|
|
230424
|
-
function resolvePackageTargetString2(target, subpath, match2, packageJsonUrl, base, pattern, internal, isPathMap,
|
|
230766
|
+
function resolvePackageTargetString2(target, subpath, match2, packageJsonUrl, base, pattern, internal, isPathMap, conditions2) {
|
|
230425
230767
|
if ("" !== subpath && !pattern && "/" !== target[target.length - 1])
|
|
230426
230768
|
throw invalidPackageTarget2(match2, target, packageJsonUrl, internal, base);
|
|
230427
230769
|
if (!target.startsWith("./")) {
|
|
@@ -230432,7 +230774,7 @@ Default "index" lookups for the main are deprecated for ES modules.`, "Deprecati
|
|
|
230432
230774
|
} catch (_unused3) {
|
|
230433
230775
|
}
|
|
230434
230776
|
if (!isURL) {
|
|
230435
|
-
return packageResolve2(pattern ? RegExpPrototypeSymbolReplace2.call(patternRegEx2, target, () => subpath) : target + subpath, packageJsonUrl,
|
|
230777
|
+
return packageResolve2(pattern ? RegExpPrototypeSymbolReplace2.call(patternRegEx2, target, () => subpath) : target + subpath, packageJsonUrl, conditions2);
|
|
230436
230778
|
}
|
|
230437
230779
|
}
|
|
230438
230780
|
throw invalidPackageTarget2(match2, target, packageJsonUrl, internal, base);
|
|
@@ -230468,9 +230810,9 @@ Default "index" lookups for the main are deprecated for ES modules.`, "Deprecati
|
|
|
230468
230810
|
const keyNumber = Number(key);
|
|
230469
230811
|
return `${keyNumber}` === key && (keyNumber >= 0 && keyNumber < 4294967295);
|
|
230470
230812
|
}
|
|
230471
|
-
function resolvePackageTarget2(packageJsonUrl, target, subpath, packageSubpath, base, pattern, internal, isPathMap,
|
|
230813
|
+
function resolvePackageTarget2(packageJsonUrl, target, subpath, packageSubpath, base, pattern, internal, isPathMap, conditions2) {
|
|
230472
230814
|
if ("string" == typeof target)
|
|
230473
|
-
return resolvePackageTargetString2(target, subpath, packageSubpath, packageJsonUrl, base, pattern, internal, isPathMap,
|
|
230815
|
+
return resolvePackageTargetString2(target, subpath, packageSubpath, packageJsonUrl, base, pattern, internal, isPathMap, conditions2);
|
|
230474
230816
|
if (Array.isArray(target)) {
|
|
230475
230817
|
const targetList = target;
|
|
230476
230818
|
if (0 === targetList.length)
|
|
@@ -230480,7 +230822,7 @@ Default "index" lookups for the main are deprecated for ES modules.`, "Deprecati
|
|
|
230480
230822
|
const targetItem = targetList[i];
|
|
230481
230823
|
let resolveResult;
|
|
230482
230824
|
try {
|
|
230483
|
-
resolveResult = resolvePackageTarget2(packageJsonUrl, targetItem, subpath, packageSubpath, base, pattern, internal, isPathMap,
|
|
230825
|
+
resolveResult = resolvePackageTarget2(packageJsonUrl, targetItem, subpath, packageSubpath, base, pattern, internal, isPathMap, conditions2);
|
|
230484
230826
|
} catch (error) {
|
|
230485
230827
|
if (lastException = error, "ERR_INVALID_PACKAGE_TARGET" === error.code)
|
|
230486
230828
|
continue;
|
|
@@ -230505,8 +230847,8 @@ Default "index" lookups for the main are deprecated for ES modules.`, "Deprecati
|
|
|
230505
230847
|
}
|
|
230506
230848
|
for (i = -1; ++i < keys.length; ) {
|
|
230507
230849
|
const key = keys[i];
|
|
230508
|
-
if ("default" === key ||
|
|
230509
|
-
const resolveResult = resolvePackageTarget2(packageJsonUrl, target[key], subpath, packageSubpath, base, pattern, internal, isPathMap,
|
|
230850
|
+
if ("default" === key || conditions2 && conditions2.has(key)) {
|
|
230851
|
+
const resolveResult = resolvePackageTarget2(packageJsonUrl, target[key], subpath, packageSubpath, base, pattern, internal, isPathMap, conditions2);
|
|
230510
230852
|
if (void 0 === resolveResult)
|
|
230511
230853
|
continue;
|
|
230512
230854
|
return resolveResult;
|
|
@@ -230522,7 +230864,7 @@ Default "index" lookups for the main are deprecated for ES modules.`, "Deprecati
|
|
|
230522
230864
|
const pjsonPath = (0, _url().fileURLToPath)(pjsonUrl);
|
|
230523
230865
|
emittedPackageWarnings2.has(pjsonPath + "|" + match2) || (emittedPackageWarnings2.add(pjsonPath + "|" + match2), _process().emitWarning(`Use of deprecated trailing slash pattern mapping "${match2}" in the "exports" field module resolution of the package at ${pjsonPath}${base ? ` imported from ${(0, _url().fileURLToPath)(base)}` : ""}. Mapping specifiers ending in "/" is no longer supported.`, "DeprecationWarning", "DEP0155"));
|
|
230524
230866
|
}
|
|
230525
|
-
function packageExportsResolve2(packageJsonUrl, packageSubpath, packageConfig, base,
|
|
230867
|
+
function packageExportsResolve2(packageJsonUrl, packageSubpath, packageConfig, base, conditions2) {
|
|
230526
230868
|
let exports3 = packageConfig.exports;
|
|
230527
230869
|
if (function(exports4, packageJsonUrl2, base2) {
|
|
230528
230870
|
if ("string" == typeof exports4 || Array.isArray(exports4))
|
|
@@ -230540,7 +230882,7 @@ Default "index" lookups for the main are deprecated for ES modules.`, "Deprecati
|
|
|
230540
230882
|
}
|
|
230541
230883
|
return isConditionalSugar;
|
|
230542
230884
|
}(exports3, packageJsonUrl, base) && (exports3 = { ".": exports3 }), own3.call(exports3, packageSubpath) && !packageSubpath.includes("*") && !packageSubpath.endsWith("/")) {
|
|
230543
|
-
const resolveResult = resolvePackageTarget2(packageJsonUrl, exports3[packageSubpath], "", packageSubpath, base, false, false, false,
|
|
230885
|
+
const resolveResult = resolvePackageTarget2(packageJsonUrl, exports3[packageSubpath], "", packageSubpath, base, false, false, false, conditions2);
|
|
230544
230886
|
if (null == resolveResult)
|
|
230545
230887
|
throw exportsNotFound2(packageSubpath, packageJsonUrl, base);
|
|
230546
230888
|
return resolveResult;
|
|
@@ -230557,7 +230899,7 @@ Default "index" lookups for the main are deprecated for ES modules.`, "Deprecati
|
|
|
230557
230899
|
}
|
|
230558
230900
|
}
|
|
230559
230901
|
if (bestMatch) {
|
|
230560
|
-
const resolveResult = resolvePackageTarget2(packageJsonUrl, exports3[bestMatch], bestMatchSubpath, bestMatch, base, true, false, packageSubpath.endsWith("/"),
|
|
230902
|
+
const resolveResult = resolvePackageTarget2(packageJsonUrl, exports3[bestMatch], bestMatchSubpath, bestMatch, base, true, false, packageSubpath.endsWith("/"), conditions2);
|
|
230561
230903
|
if (null == resolveResult)
|
|
230562
230904
|
throw exportsNotFound2(packageSubpath, packageJsonUrl, base);
|
|
230563
230905
|
return resolveResult;
|
|
@@ -230568,7 +230910,7 @@ Default "index" lookups for the main are deprecated for ES modules.`, "Deprecati
|
|
|
230568
230910
|
const aPatternIndex = a.indexOf("*"), bPatternIndex = b.indexOf("*"), baseLengthA = -1 === aPatternIndex ? a.length : aPatternIndex + 1, baseLengthB = -1 === bPatternIndex ? b.length : bPatternIndex + 1;
|
|
230569
230911
|
return baseLengthA > baseLengthB ? -1 : baseLengthB > baseLengthA || -1 === aPatternIndex ? 1 : -1 === bPatternIndex || a.length > b.length ? -1 : b.length > a.length ? 1 : 0;
|
|
230570
230912
|
}
|
|
230571
|
-
function packageImportsResolve2(name, base,
|
|
230913
|
+
function packageImportsResolve2(name, base, conditions2) {
|
|
230572
230914
|
if ("#" === name || name.startsWith("#/") || name.endsWith("/")) {
|
|
230573
230915
|
throw new ERR_INVALID_MODULE_SPECIFIER2(name, "is not a valid internal imports specifier name", (0, _url().fileURLToPath)(base));
|
|
230574
230916
|
}
|
|
@@ -230579,7 +230921,7 @@ Default "index" lookups for the main are deprecated for ES modules.`, "Deprecati
|
|
|
230579
230921
|
const imports = packageConfig.imports;
|
|
230580
230922
|
if (imports)
|
|
230581
230923
|
if (own3.call(imports, name) && !name.includes("*")) {
|
|
230582
|
-
const resolveResult = resolvePackageTarget2(packageJsonUrl, imports[name], "", name, base, false, true, false,
|
|
230924
|
+
const resolveResult = resolvePackageTarget2(packageJsonUrl, imports[name], "", name, base, false, true, false, conditions2);
|
|
230583
230925
|
if (null != resolveResult)
|
|
230584
230926
|
return resolveResult;
|
|
230585
230927
|
} else {
|
|
@@ -230594,7 +230936,7 @@ Default "index" lookups for the main are deprecated for ES modules.`, "Deprecati
|
|
|
230594
230936
|
}
|
|
230595
230937
|
}
|
|
230596
230938
|
if (bestMatch) {
|
|
230597
|
-
const resolveResult = resolvePackageTarget2(packageJsonUrl, imports[bestMatch], bestMatchSubpath, bestMatch, base, true, true, false,
|
|
230939
|
+
const resolveResult = resolvePackageTarget2(packageJsonUrl, imports[bestMatch], bestMatchSubpath, bestMatch, base, true, true, false, conditions2);
|
|
230598
230940
|
if (null != resolveResult)
|
|
230599
230941
|
return resolveResult;
|
|
230600
230942
|
}
|
|
@@ -230604,7 +230946,7 @@ Default "index" lookups for the main are deprecated for ES modules.`, "Deprecati
|
|
|
230604
230946
|
return new ERR_PACKAGE_IMPORT_NOT_DEFINED2(specifier, packageJsonUrl2 && (0, _url().fileURLToPath)(new (_url()).URL(".", packageJsonUrl2)), (0, _url().fileURLToPath)(base2));
|
|
230605
230947
|
}(name, packageJsonUrl, base);
|
|
230606
230948
|
}
|
|
230607
|
-
function packageResolve2(specifier, base,
|
|
230949
|
+
function packageResolve2(specifier, base, conditions2) {
|
|
230608
230950
|
if (_module().builtinModules.includes(specifier))
|
|
230609
230951
|
return new (_url()).URL("node:" + specifier);
|
|
230610
230952
|
const { packageName, packageSubpath, isScoped } = function(specifier2, base2) {
|
|
@@ -230618,7 +230960,7 @@ Default "index" lookups for the main are deprecated for ES modules.`, "Deprecati
|
|
|
230618
230960
|
if (packageConfig.exists) {
|
|
230619
230961
|
const packageJsonUrl2 = (0, _url().pathToFileURL)(packageConfig.pjsonPath);
|
|
230620
230962
|
if (packageConfig.name === packageName && void 0 !== packageConfig.exports && null !== packageConfig.exports)
|
|
230621
|
-
return packageExportsResolve2(packageJsonUrl2, packageSubpath, packageConfig, base,
|
|
230963
|
+
return packageExportsResolve2(packageJsonUrl2, packageSubpath, packageConfig, base, conditions2);
|
|
230622
230964
|
}
|
|
230623
230965
|
let lastPath, packageJsonUrl = new (_url()).URL("./node_modules/" + packageName + "/package.json", base), packageJsonPath = (0, _url().fileURLToPath)(packageJsonUrl);
|
|
230624
230966
|
do {
|
|
@@ -230627,7 +230969,7 @@ Default "index" lookups for the main are deprecated for ES modules.`, "Deprecati
|
|
|
230627
230969
|
continue;
|
|
230628
230970
|
}
|
|
230629
230971
|
const packageConfig2 = getPackageConfig(packageJsonPath, specifier, base);
|
|
230630
|
-
return void 0 !== packageConfig2.exports && null !== packageConfig2.exports ? packageExportsResolve2(packageJsonUrl, packageSubpath, packageConfig2, base,
|
|
230972
|
+
return void 0 !== packageConfig2.exports && null !== packageConfig2.exports ? packageExportsResolve2(packageJsonUrl, packageSubpath, packageConfig2, base, conditions2) : "." === packageSubpath ? legacyMainResolve2(packageJsonUrl, packageConfig2, base) : new (_url()).URL(packageSubpath, packageJsonUrl);
|
|
230631
230973
|
} while (packageJsonPath.length !== lastPath.length);
|
|
230632
230974
|
throw new ERR_MODULE_NOT_FOUND2(packageName, (0, _url().fileURLToPath)(base));
|
|
230633
230975
|
}
|
|
@@ -230642,7 +230984,7 @@ Default "index" lookups for the main are deprecated for ES modules.`, "Deprecati
|
|
|
230642
230984
|
return false;
|
|
230643
230985
|
}(specifier));
|
|
230644
230986
|
}
|
|
230645
|
-
function moduleResolve2(specifier, base,
|
|
230987
|
+
function moduleResolve2(specifier, base, conditions2, preserveSymlinks) {
|
|
230646
230988
|
const protocol = base.protocol, isRemote = "http:" === protocol || "https:" === protocol;
|
|
230647
230989
|
let resolved;
|
|
230648
230990
|
if (shouldBeTreatedAsRelativeOrAbsolutePath2(specifier))
|
|
@@ -230651,10 +230993,10 @@ Default "index" lookups for the main are deprecated for ES modules.`, "Deprecati
|
|
|
230651
230993
|
try {
|
|
230652
230994
|
resolved = new (_url()).URL(specifier);
|
|
230653
230995
|
} catch (_unused4) {
|
|
230654
|
-
isRemote || (resolved = packageResolve2(specifier, base,
|
|
230996
|
+
isRemote || (resolved = packageResolve2(specifier, base, conditions2));
|
|
230655
230997
|
}
|
|
230656
230998
|
else
|
|
230657
|
-
resolved = packageImportsResolve2(specifier, base,
|
|
230999
|
+
resolved = packageImportsResolve2(specifier, base, conditions2);
|
|
230658
231000
|
return _assert()(void 0 !== resolved, "expected to be defined"), "file:" !== resolved.protocol ? resolved : function(resolved2, base2, preserveSymlinks2) {
|
|
230659
231001
|
if (null !== encodedSepRegEx2.exec(resolved2.pathname))
|
|
230660
231002
|
throw new ERR_INVALID_MODULE_SPECIFIER2(resolved2.pathname, 'must not include encoded "/" or "\\" characters', (0, _url().fileURLToPath)(base2));
|
|
@@ -256421,7 +256763,10 @@ async function lint(message2, rawRulesConfig, rawOpts) {
|
|
|
256421
256763
|
const missing = Object.keys(rulesConfig).filter((name) => typeof allRules.get(name) !== "function");
|
|
256422
256764
|
if (missing.length > 0) {
|
|
256423
256765
|
const names = [...allRules.keys()];
|
|
256424
|
-
throw new RangeError(
|
|
256766
|
+
throw new RangeError([
|
|
256767
|
+
`Found rules without implementation: ${missing.join(", ")}.`,
|
|
256768
|
+
`Supported rules are: ${names.join(", ")}.`
|
|
256769
|
+
].join("\n"));
|
|
256425
256770
|
}
|
|
256426
256771
|
const invalid = Object.entries(rulesConfig).map(([name, config]) => {
|
|
256427
256772
|
if (!Array.isArray(config)) {
|
|
@@ -256469,8 +256814,8 @@ async function lint(message2, rawRulesConfig, rawOpts) {
|
|
|
256469
256814
|
};
|
|
256470
256815
|
});
|
|
256471
256816
|
const results = (await Promise.all(pendingResults)).filter((result) => result !== null);
|
|
256472
|
-
const errors = results.filter((result) => result.level ===
|
|
256473
|
-
const warnings = results.filter((result) => result.level ===
|
|
256817
|
+
const errors = results.filter((result) => result.level === RuleConfigSeverity.Error && !result.valid);
|
|
256818
|
+
const warnings = results.filter((result) => result.level === RuleConfigSeverity.Warning && !result.valid);
|
|
256474
256819
|
const valid = errors.length === 0;
|
|
256475
256820
|
return {
|
|
256476
256821
|
valid,
|
|
@@ -257411,7 +257756,7 @@ function invalidPackageTarget(subpath, target, packageJsonUrl, internal, base) {
|
|
|
257411
257756
|
base && fileURLToPath5(base)
|
|
257412
257757
|
);
|
|
257413
257758
|
}
|
|
257414
|
-
function resolvePackageTargetString(target, subpath, match2, packageJsonUrl, base, pattern, internal, isPathMap,
|
|
257759
|
+
function resolvePackageTargetString(target, subpath, match2, packageJsonUrl, base, pattern, internal, isPathMap, conditions2) {
|
|
257415
257760
|
if (subpath !== "" && !pattern && target[target.length - 1] !== "/")
|
|
257416
257761
|
throw invalidPackageTarget(match2, target, packageJsonUrl, internal, base);
|
|
257417
257762
|
if (!target.startsWith("./")) {
|
|
@@ -257428,7 +257773,7 @@ function resolvePackageTargetString(target, subpath, match2, packageJsonUrl, bas
|
|
|
257428
257773
|
target,
|
|
257429
257774
|
() => subpath
|
|
257430
257775
|
) : target + subpath;
|
|
257431
|
-
return packageResolve(exportTarget, packageJsonUrl,
|
|
257776
|
+
return packageResolve(exportTarget, packageJsonUrl, conditions2);
|
|
257432
257777
|
}
|
|
257433
257778
|
}
|
|
257434
257779
|
throw invalidPackageTarget(match2, target, packageJsonUrl, internal, base);
|
|
@@ -257503,7 +257848,7 @@ function isArrayIndex(key) {
|
|
|
257503
257848
|
return false;
|
|
257504
257849
|
return keyNumber >= 0 && keyNumber < 4294967295;
|
|
257505
257850
|
}
|
|
257506
|
-
function resolvePackageTarget(packageJsonUrl, target, subpath, packageSubpath, base, pattern, internal, isPathMap,
|
|
257851
|
+
function resolvePackageTarget(packageJsonUrl, target, subpath, packageSubpath, base, pattern, internal, isPathMap, conditions2) {
|
|
257507
257852
|
if (typeof target === "string") {
|
|
257508
257853
|
return resolvePackageTargetString(
|
|
257509
257854
|
target,
|
|
@@ -257514,7 +257859,7 @@ function resolvePackageTarget(packageJsonUrl, target, subpath, packageSubpath, b
|
|
|
257514
257859
|
pattern,
|
|
257515
257860
|
internal,
|
|
257516
257861
|
isPathMap,
|
|
257517
|
-
|
|
257862
|
+
conditions2
|
|
257518
257863
|
);
|
|
257519
257864
|
}
|
|
257520
257865
|
if (Array.isArray(target)) {
|
|
@@ -257536,7 +257881,7 @@ function resolvePackageTarget(packageJsonUrl, target, subpath, packageSubpath, b
|
|
|
257536
257881
|
pattern,
|
|
257537
257882
|
internal,
|
|
257538
257883
|
isPathMap,
|
|
257539
|
-
|
|
257884
|
+
conditions2
|
|
257540
257885
|
);
|
|
257541
257886
|
} catch (error) {
|
|
257542
257887
|
const exception = (
|
|
@@ -257577,7 +257922,7 @@ function resolvePackageTarget(packageJsonUrl, target, subpath, packageSubpath, b
|
|
|
257577
257922
|
i = -1;
|
|
257578
257923
|
while (++i < keys.length) {
|
|
257579
257924
|
const key = keys[i];
|
|
257580
|
-
if (key === "default" ||
|
|
257925
|
+
if (key === "default" || conditions2 && conditions2.has(key)) {
|
|
257581
257926
|
const conditionalTarget = (
|
|
257582
257927
|
/** @type {unknown} */
|
|
257583
257928
|
target[key]
|
|
@@ -257591,7 +257936,7 @@ function resolvePackageTarget(packageJsonUrl, target, subpath, packageSubpath, b
|
|
|
257591
257936
|
pattern,
|
|
257592
257937
|
internal,
|
|
257593
257938
|
isPathMap,
|
|
257594
|
-
|
|
257939
|
+
conditions2
|
|
257595
257940
|
);
|
|
257596
257941
|
if (resolveResult === void 0)
|
|
257597
257942
|
continue;
|
|
@@ -257649,7 +257994,7 @@ function emitTrailingSlashPatternDeprecation(match2, pjsonUrl, base) {
|
|
|
257649
257994
|
"DEP0155"
|
|
257650
257995
|
);
|
|
257651
257996
|
}
|
|
257652
|
-
function packageExportsResolve(packageJsonUrl, packageSubpath, packageConfig, base,
|
|
257997
|
+
function packageExportsResolve(packageJsonUrl, packageSubpath, packageConfig, base, conditions2) {
|
|
257653
257998
|
let exports = packageConfig.exports;
|
|
257654
257999
|
if (isConditionalExportsMainSugar(exports, packageJsonUrl, base)) {
|
|
257655
258000
|
exports = { ".": exports };
|
|
@@ -257665,7 +258010,7 @@ function packageExportsResolve(packageJsonUrl, packageSubpath, packageConfig, ba
|
|
|
257665
258010
|
false,
|
|
257666
258011
|
false,
|
|
257667
258012
|
false,
|
|
257668
|
-
|
|
258013
|
+
conditions2
|
|
257669
258014
|
);
|
|
257670
258015
|
if (resolveResult === null || resolveResult === void 0) {
|
|
257671
258016
|
throw exportsNotFound(packageSubpath, packageJsonUrl, base);
|
|
@@ -257711,7 +258056,7 @@ function packageExportsResolve(packageJsonUrl, packageSubpath, packageConfig, ba
|
|
|
257711
258056
|
true,
|
|
257712
258057
|
false,
|
|
257713
258058
|
packageSubpath.endsWith("/"),
|
|
257714
|
-
|
|
258059
|
+
conditions2
|
|
257715
258060
|
);
|
|
257716
258061
|
if (resolveResult === null || resolveResult === void 0) {
|
|
257717
258062
|
throw exportsNotFound(packageSubpath, packageJsonUrl, base);
|
|
@@ -257739,7 +258084,7 @@ function patternKeyCompare(a, b) {
|
|
|
257739
258084
|
return 1;
|
|
257740
258085
|
return 0;
|
|
257741
258086
|
}
|
|
257742
|
-
function packageImportsResolve(name, base,
|
|
258087
|
+
function packageImportsResolve(name, base, conditions2) {
|
|
257743
258088
|
if (name === "#" || name.startsWith("#/") || name.endsWith("/")) {
|
|
257744
258089
|
const reason = "is not a valid internal imports specifier name";
|
|
257745
258090
|
throw new ERR_INVALID_MODULE_SPECIFIER(name, reason, fileURLToPath5(base));
|
|
@@ -257760,7 +258105,7 @@ function packageImportsResolve(name, base, conditions) {
|
|
|
257760
258105
|
false,
|
|
257761
258106
|
true,
|
|
257762
258107
|
false,
|
|
257763
|
-
|
|
258108
|
+
conditions2
|
|
257764
258109
|
);
|
|
257765
258110
|
if (resolveResult !== null && resolveResult !== void 0) {
|
|
257766
258111
|
return resolveResult;
|
|
@@ -257795,7 +258140,7 @@ function packageImportsResolve(name, base, conditions) {
|
|
|
257795
258140
|
true,
|
|
257796
258141
|
true,
|
|
257797
258142
|
false,
|
|
257798
|
-
|
|
258143
|
+
conditions2
|
|
257799
258144
|
);
|
|
257800
258145
|
if (resolveResult !== null && resolveResult !== void 0) {
|
|
257801
258146
|
return resolveResult;
|
|
@@ -257832,7 +258177,7 @@ function parsePackageName(specifier, base) {
|
|
|
257832
258177
|
const packageSubpath = "." + (separatorIndex === -1 ? "" : specifier.slice(separatorIndex));
|
|
257833
258178
|
return { packageName, packageSubpath, isScoped };
|
|
257834
258179
|
}
|
|
257835
|
-
function packageResolve(specifier, base,
|
|
258180
|
+
function packageResolve(specifier, base, conditions2) {
|
|
257836
258181
|
if (builtinModules.includes(specifier)) {
|
|
257837
258182
|
return new URL3("node:" + specifier);
|
|
257838
258183
|
}
|
|
@@ -257849,7 +258194,7 @@ function packageResolve(specifier, base, conditions) {
|
|
|
257849
258194
|
packageSubpath,
|
|
257850
258195
|
packageConfig,
|
|
257851
258196
|
base,
|
|
257852
|
-
|
|
258197
|
+
conditions2
|
|
257853
258198
|
);
|
|
257854
258199
|
}
|
|
257855
258200
|
}
|
|
@@ -257880,7 +258225,7 @@ function packageResolve(specifier, base, conditions) {
|
|
|
257880
258225
|
packageSubpath,
|
|
257881
258226
|
packageConfig2,
|
|
257882
258227
|
base,
|
|
257883
|
-
|
|
258228
|
+
conditions2
|
|
257884
258229
|
);
|
|
257885
258230
|
}
|
|
257886
258231
|
if (packageSubpath === ".") {
|
|
@@ -257907,20 +258252,20 @@ function shouldBeTreatedAsRelativeOrAbsolutePath(specifier) {
|
|
|
257907
258252
|
return true;
|
|
257908
258253
|
return isRelativeSpecifier(specifier);
|
|
257909
258254
|
}
|
|
257910
|
-
function moduleResolve(specifier, base,
|
|
258255
|
+
function moduleResolve(specifier, base, conditions2, preserveSymlinks) {
|
|
257911
258256
|
const protocol = base.protocol;
|
|
257912
258257
|
const isRemote = protocol === "http:" || protocol === "https:";
|
|
257913
258258
|
let resolved;
|
|
257914
258259
|
if (shouldBeTreatedAsRelativeOrAbsolutePath(specifier)) {
|
|
257915
258260
|
resolved = new URL3(specifier, base);
|
|
257916
258261
|
} else if (!isRemote && specifier[0] === "#") {
|
|
257917
|
-
resolved = packageImportsResolve(specifier, base,
|
|
258262
|
+
resolved = packageImportsResolve(specifier, base, conditions2);
|
|
257918
258263
|
} else {
|
|
257919
258264
|
try {
|
|
257920
258265
|
resolved = new URL3(specifier);
|
|
257921
258266
|
} catch {
|
|
257922
258267
|
if (!isRemote) {
|
|
257923
|
-
resolved = packageResolve(specifier, base,
|
|
258268
|
+
resolved = packageResolve(specifier, base, conditions2);
|
|
257924
258269
|
}
|
|
257925
258270
|
}
|
|
257926
258271
|
}
|
|
@@ -257958,6 +258303,7 @@ var pathSuffixes = [
|
|
|
257958
258303
|
`${path6.sep}index.json`
|
|
257959
258304
|
];
|
|
257960
258305
|
var specifierSuffixes = ["", ".js", ".json", "/index.js", "/index.json"];
|
|
258306
|
+
var conditions = /* @__PURE__ */ new Set(["import", "node"]);
|
|
257961
258307
|
var resolveFrom = (lookup, parent) => {
|
|
257962
258308
|
if (path6.isAbsolute(lookup)) {
|
|
257963
258309
|
for (const suffix of pathSuffixes) {
|
|
@@ -257971,7 +258317,7 @@ var resolveFrom = (lookup, parent) => {
|
|
|
257971
258317
|
const base = pathToFileURL2(parent ? fs3.statSync(parent).isDirectory() ? path6.join(parent, "noop.js") : parent : import.meta.url);
|
|
257972
258318
|
for (const suffix of specifierSuffixes) {
|
|
257973
258319
|
try {
|
|
257974
|
-
return fileURLToPath6(moduleResolve(lookup + suffix, base));
|
|
258320
|
+
return fileURLToPath6(moduleResolve(lookup + suffix, base, conditions));
|
|
257975
258321
|
} catch (err) {
|
|
257976
258322
|
if (!resolveError) {
|
|
257977
258323
|
resolveError = err;
|
|
@@ -258038,7 +258384,7 @@ function getId(raw = "", prefix2 = "") {
|
|
|
258038
258384
|
return relative2 || absolute ? raw : [prefix2, raw].filter(String).join("-");
|
|
258039
258385
|
}
|
|
258040
258386
|
function resolveConfig(raw, context = {}) {
|
|
258041
|
-
const resolve5 = context.resolve ||
|
|
258387
|
+
const resolve5 = context.resolve || resolveId;
|
|
258042
258388
|
const id = getId(raw, context.prefix);
|
|
258043
258389
|
let resolved;
|
|
258044
258390
|
try {
|
|
@@ -258050,16 +258396,6 @@ function resolveConfig(raw, context = {}) {
|
|
|
258050
258396
|
}
|
|
258051
258397
|
return resolved;
|
|
258052
258398
|
}
|
|
258053
|
-
function tryResolveId(id, context) {
|
|
258054
|
-
const cwd = context.cwd || process.cwd();
|
|
258055
|
-
for (const suffix of ["", ".js", ".json", "/index.js", "/index.json"]) {
|
|
258056
|
-
try {
|
|
258057
|
-
return fileURLToPath6(moduleResolve(id + suffix, pathToFileURL2(path6.join(cwd, id))));
|
|
258058
|
-
} catch (_a2) {
|
|
258059
|
-
}
|
|
258060
|
-
}
|
|
258061
|
-
return resolveId(id, context);
|
|
258062
|
-
}
|
|
258063
258399
|
function resolveId(specifier, context = {}) {
|
|
258064
258400
|
const cwd = context.cwd || process.cwd();
|
|
258065
258401
|
const localPath = resolveFromSilent(specifier, cwd);
|
|
@@ -258139,6 +258475,7 @@ function TypeScriptLoader(options) {
|
|
|
258139
258475
|
|
|
258140
258476
|
// node_modules/@commitlint/load/lib/utils/load-config.js
|
|
258141
258477
|
var moduleName = "commitlint";
|
|
258478
|
+
var searchStrategy = "global";
|
|
258142
258479
|
async function loadConfig(cwd, configPath) {
|
|
258143
258480
|
let tsLoaderInstance;
|
|
258144
258481
|
const tsLoader = (...args) => {
|
|
@@ -258149,10 +258486,12 @@ async function loadConfig(cwd, configPath) {
|
|
|
258149
258486
|
};
|
|
258150
258487
|
const loaders = isDynamicAwaitSupported() || isEsmModule(cwd) ? import_cosmiconfig.defaultLoaders : import_cosmiconfig.defaultLoadersSync;
|
|
258151
258488
|
const explorer = (0, import_cosmiconfig.cosmiconfig)(moduleName, {
|
|
258489
|
+
searchStrategy,
|
|
258152
258490
|
searchPlaces: [
|
|
258153
258491
|
// cosmiconfig overrides default searchPlaces if any new search place is added (For e.g. `*.ts` files),
|
|
258154
258492
|
// we need to manually merge default searchPlaces from https://github.com/davidtheclark/cosmiconfig#searchplaces
|
|
258155
258493
|
"package.json",
|
|
258494
|
+
"package.yaml",
|
|
258156
258495
|
`.${moduleName}rc`,
|
|
258157
258496
|
`.${moduleName}rc.json`,
|
|
258158
258497
|
`.${moduleName}rc.yaml`,
|
|
@@ -258190,13 +258529,12 @@ var isDynamicAwaitSupported = () => {
|
|
|
258190
258529
|
return major >= 20 && minor >= 8;
|
|
258191
258530
|
};
|
|
258192
258531
|
var isEsmModule = (cwd) => {
|
|
258193
|
-
var _a2;
|
|
258194
258532
|
const packagePath = path7.join(cwd, "package.json");
|
|
258195
258533
|
if (!existsSync(packagePath)) {
|
|
258196
258534
|
return false;
|
|
258197
258535
|
}
|
|
258198
258536
|
const packageJSON = readFileSync2(packagePath, { encoding: "utf-8" });
|
|
258199
|
-
return
|
|
258537
|
+
return JSON.parse(packageJSON)?.type === "module";
|
|
258200
258538
|
};
|
|
258201
258539
|
|
|
258202
258540
|
// node_modules/@commitlint/load/lib/utils/load-parser-opts.js
|
|
@@ -258227,11 +258565,17 @@ async function loadParserOpts(pendingParser) {
|
|
|
258227
258565
|
if (isParserOptsFunction(parser2) && typeof parser2.name === "string" && parser2.name.startsWith("conventional-changelog-")) {
|
|
258228
258566
|
return new Promise((resolve5) => {
|
|
258229
258567
|
const result = parser2.parserOpts((_, opts) => {
|
|
258230
|
-
resolve5(
|
|
258568
|
+
resolve5({
|
|
258569
|
+
...parser2,
|
|
258570
|
+
parserOpts: opts?.parserOpts
|
|
258571
|
+
});
|
|
258231
258572
|
});
|
|
258232
258573
|
if (result) {
|
|
258233
258574
|
Promise.resolve(result).then((opts) => {
|
|
258234
|
-
resolve5(
|
|
258575
|
+
resolve5({
|
|
258576
|
+
...parser2,
|
|
258577
|
+
parserOpts: opts?.parserOpts
|
|
258578
|
+
});
|
|
258235
258579
|
});
|
|
258236
258580
|
}
|
|
258237
258581
|
return;
|
|
@@ -258777,20 +259121,21 @@ function getShorthandName(fullname) {
|
|
|
258777
259121
|
|
|
258778
259122
|
// node_modules/@commitlint/load/lib/utils/plugin-errors.js
|
|
258779
259123
|
var WhitespacePluginError = class _WhitespacePluginError extends Error {
|
|
259124
|
+
__proto__ = Error;
|
|
259125
|
+
messageTemplate = "whitespace-found";
|
|
259126
|
+
messageData = {};
|
|
258780
259127
|
constructor(pluginName, data = {}) {
|
|
258781
259128
|
super(`Whitespace found in plugin name '${pluginName}'`);
|
|
258782
|
-
this.__proto__ = Error;
|
|
258783
|
-
this.messageTemplate = "whitespace-found";
|
|
258784
|
-
this.messageData = {};
|
|
258785
259129
|
this.messageData = data;
|
|
258786
259130
|
Object.setPrototypeOf(this, _WhitespacePluginError.prototype);
|
|
258787
259131
|
}
|
|
258788
259132
|
};
|
|
258789
259133
|
var MissingPluginError = class _MissingPluginError extends Error {
|
|
259134
|
+
__proto__ = Error;
|
|
259135
|
+
messageTemplate = "plugin-missing";
|
|
259136
|
+
messageData;
|
|
258790
259137
|
constructor(pluginName, errorMessage = "", data = {}) {
|
|
258791
259138
|
super(`Failed to load plugin ${pluginName}: ${errorMessage}`);
|
|
258792
|
-
this.__proto__ = Error;
|
|
258793
|
-
this.messageTemplate = "plugin-missing";
|
|
258794
259139
|
this.messageData = data;
|
|
258795
259140
|
Object.setPrototypeOf(this, _MissingPluginError.prototype);
|
|
258796
259141
|
}
|
|
@@ -258821,7 +259166,7 @@ async function loadPlugin(plugins, pluginName, debug = false) {
|
|
|
258821
259166
|
require3.resolve(longName);
|
|
258822
259167
|
} catch (error) {
|
|
258823
259168
|
console.error(source_default.red(`Failed to load plugin ${longName}.`));
|
|
258824
|
-
const message2 =
|
|
259169
|
+
const message2 = error?.message || "Unknown error occurred";
|
|
258825
259170
|
throw new MissingPluginError(pluginName, message2, {
|
|
258826
259171
|
pluginName: longName,
|
|
258827
259172
|
commitlintPath: path9.resolve(__dirname2, "../..")
|
|
@@ -258855,8 +259200,8 @@ var resolveFormatter = (formatter, parent) => {
|
|
|
258855
259200
|
async function load2(seed = {}, options = {}) {
|
|
258856
259201
|
const cwd = typeof options.cwd === "undefined" ? process.cwd() : options.cwd;
|
|
258857
259202
|
const loaded = await loadConfig(cwd, options.file);
|
|
258858
|
-
const baseDirectory =
|
|
258859
|
-
const configFilePath = loaded
|
|
259203
|
+
const baseDirectory = loaded?.filepath ? path10.dirname(loaded.filepath) : cwd;
|
|
259204
|
+
const configFilePath = loaded?.filepath;
|
|
258860
259205
|
let config = {};
|
|
258861
259206
|
if (loaded) {
|
|
258862
259207
|
validateConfig(loaded.filepath || "", loaded.config);
|
|
@@ -258869,7 +259214,10 @@ async function load2(seed = {}, options = {}) {
|
|
|
258869
259214
|
}, config, seed);
|
|
258870
259215
|
if (typeof config.parserPreset === "string") {
|
|
258871
259216
|
const resolvedParserPreset = resolveFrom(config.parserPreset, configFilePath);
|
|
258872
|
-
config.parserPreset =
|
|
259217
|
+
config.parserPreset = {
|
|
259218
|
+
name: config.parserPreset,
|
|
259219
|
+
...await loadParserPreset(resolvedParserPreset)
|
|
259220
|
+
};
|
|
258873
259221
|
}
|
|
258874
259222
|
const extended = await resolveExtends(config, {
|
|
258875
259223
|
prefix: "commitlint-config",
|
|
@@ -259204,16 +259552,25 @@ async function getEditCommit(cwd, edit) {
|
|
|
259204
259552
|
|
|
259205
259553
|
// node_modules/@commitlint/read/lib/read.js
|
|
259206
259554
|
async function getCommitMessages(settings) {
|
|
259207
|
-
const { cwd, from, to, edit, gitLogArgs } = settings;
|
|
259555
|
+
const { cwd, from, to, last, edit, gitLogArgs } = settings;
|
|
259208
259556
|
if (edit) {
|
|
259209
259557
|
return getEditCommit(cwd, edit);
|
|
259210
259558
|
}
|
|
259559
|
+
if (last) {
|
|
259560
|
+
const executeGitCommand = await execa("git", [
|
|
259561
|
+
"log",
|
|
259562
|
+
"-1",
|
|
259563
|
+
'--pretty=format:"%B"'
|
|
259564
|
+
]);
|
|
259565
|
+
return [executeGitCommand.stdout];
|
|
259566
|
+
}
|
|
259211
259567
|
let gitOptions = { from, to };
|
|
259212
259568
|
if (gitLogArgs) {
|
|
259213
|
-
gitOptions =
|
|
259569
|
+
gitOptions = {
|
|
259570
|
+
...(0, import_minimist.default)(gitLogArgs.split(" ")),
|
|
259214
259571
|
from,
|
|
259215
259572
|
to
|
|
259216
|
-
}
|
|
259573
|
+
};
|
|
259217
259574
|
}
|
|
259218
259575
|
return getHistoryCommits(gitOptions, { cwd });
|
|
259219
259576
|
}
|
|
@@ -264049,9 +264406,11 @@ var yargs_default = Yargs;
|
|
|
264049
264406
|
|
|
264050
264407
|
// node_modules/@commitlint/cli/lib/cli-error.js
|
|
264051
264408
|
var CliError = class _CliError extends Error {
|
|
264409
|
+
__proto__ = Error;
|
|
264410
|
+
type;
|
|
264411
|
+
error_code;
|
|
264052
264412
|
constructor(message2, type, error_code = 1) {
|
|
264053
264413
|
super(message2);
|
|
264054
|
-
this.__proto__ = Error;
|
|
264055
264414
|
this.type = type;
|
|
264056
264415
|
this.error_code = error_code;
|
|
264057
264416
|
Object.setPrototypeOf(this, _CliError.prototype);
|
|
@@ -264059,26 +264418,6 @@ var CliError = class _CliError extends Error {
|
|
|
264059
264418
|
};
|
|
264060
264419
|
|
|
264061
264420
|
// node_modules/@commitlint/cli/lib/cli.js
|
|
264062
|
-
var __asyncValues = function(o) {
|
|
264063
|
-
if (!Symbol.asyncIterator)
|
|
264064
|
-
throw new TypeError("Symbol.asyncIterator is not defined.");
|
|
264065
|
-
var m = o[Symbol.asyncIterator], i;
|
|
264066
|
-
return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function() {
|
|
264067
|
-
return this;
|
|
264068
|
-
}, i);
|
|
264069
|
-
function verb(n) {
|
|
264070
|
-
i[n] = o[n] && function(v) {
|
|
264071
|
-
return new Promise(function(resolve5, reject) {
|
|
264072
|
-
v = o[n](v), settle(resolve5, reject, v.done, v.value);
|
|
264073
|
-
});
|
|
264074
|
-
};
|
|
264075
|
-
}
|
|
264076
|
-
function settle(resolve5, reject, d, v) {
|
|
264077
|
-
Promise.resolve(v).then(function(v2) {
|
|
264078
|
-
resolve5({ value: v2, done: d });
|
|
264079
|
-
}, reject);
|
|
264080
|
-
}
|
|
264081
|
-
};
|
|
264082
264421
|
var require4 = createRequire3(import.meta.url);
|
|
264083
264422
|
var __dirname4 = path15.resolve(fileURLToPath11(import.meta.url), "..");
|
|
264084
264423
|
var dynamicImport3 = async (id) => {
|
|
@@ -264140,6 +264479,11 @@ var cli = yargs_default(process.argv.slice(2)).options({
|
|
|
264140
264479
|
description: "additional git log arguments as space separated string, example '--first-parent --cherry-pick'",
|
|
264141
264480
|
type: "string"
|
|
264142
264481
|
},
|
|
264482
|
+
last: {
|
|
264483
|
+
alias: "l",
|
|
264484
|
+
description: "just analyze the last commit; applies if edit=false",
|
|
264485
|
+
type: "boolean"
|
|
264486
|
+
},
|
|
264143
264487
|
format: {
|
|
264144
264488
|
alias: "o",
|
|
264145
264489
|
description: "output format of the results",
|
|
@@ -264183,29 +264527,13 @@ main(cli.argv).catch((err) => {
|
|
|
264183
264527
|
}, 0);
|
|
264184
264528
|
});
|
|
264185
264529
|
async function stdin() {
|
|
264186
|
-
var _a2, e_1, _b2, _c2;
|
|
264187
264530
|
let result = "";
|
|
264188
264531
|
if (process.stdin.isTTY) {
|
|
264189
264532
|
return result;
|
|
264190
264533
|
}
|
|
264191
264534
|
process.stdin.setEncoding("utf8");
|
|
264192
|
-
|
|
264193
|
-
|
|
264194
|
-
_c2 = _f.value;
|
|
264195
|
-
_d = false;
|
|
264196
|
-
const chunk = _c2;
|
|
264197
|
-
result += chunk;
|
|
264198
|
-
}
|
|
264199
|
-
} catch (e_1_1) {
|
|
264200
|
-
e_1 = { error: e_1_1 };
|
|
264201
|
-
} finally {
|
|
264202
|
-
try {
|
|
264203
|
-
if (!_d && !_a2 && (_b2 = _e.return))
|
|
264204
|
-
await _b2.call(_e);
|
|
264205
|
-
} finally {
|
|
264206
|
-
if (e_1)
|
|
264207
|
-
throw e_1.error;
|
|
264208
|
-
}
|
|
264535
|
+
for await (const chunk of process.stdin) {
|
|
264536
|
+
result += chunk;
|
|
264209
264537
|
}
|
|
264210
264538
|
return result;
|
|
264211
264539
|
}
|
|
@@ -264213,7 +264541,6 @@ async function resolveArgs(args) {
|
|
|
264213
264541
|
return typeof args.then === "function" ? await args : args;
|
|
264214
264542
|
}
|
|
264215
264543
|
async function main(args) {
|
|
264216
|
-
var _a2;
|
|
264217
264544
|
const options = await resolveArgs(args);
|
|
264218
264545
|
if (typeof options.edit === "undefined") {
|
|
264219
264546
|
options.edit = false;
|
|
@@ -264236,16 +264563,23 @@ async function main(args) {
|
|
|
264236
264563
|
}
|
|
264237
264564
|
}
|
|
264238
264565
|
const fromStdin = checkFromStdin(raw, flags);
|
|
264566
|
+
if (Object.hasOwn(flags, "last") && (Object.hasOwn(flags, "from") || Object.hasOwn(flags, "to") || flags.edit)) {
|
|
264567
|
+
const err = new CliError("Please use the --last flag alone. The --last flag should not be used with --to or --from or --edit.", pkg.name);
|
|
264568
|
+
cli.showHelp("log");
|
|
264569
|
+
console.log(err.message);
|
|
264570
|
+
throw err;
|
|
264571
|
+
}
|
|
264239
264572
|
const input = await (fromStdin ? stdin() : getCommitMessages({
|
|
264240
264573
|
to: flags.to,
|
|
264241
264574
|
from: flags.from,
|
|
264575
|
+
last: flags.last,
|
|
264242
264576
|
edit: flags.edit,
|
|
264243
264577
|
cwd: flags.cwd,
|
|
264244
264578
|
gitLogArgs: flags["git-log-args"]
|
|
264245
264579
|
}));
|
|
264246
264580
|
const messages2 = (Array.isArray(input) ? input : [input]).filter((message2) => typeof message2 === "string").filter((message2) => message2.trim() !== "").filter(Boolean);
|
|
264247
264581
|
if (messages2.length === 0 && !checkFromRepository(flags)) {
|
|
264248
|
-
const err = new CliError("[input] is required: supply via stdin, or --env or --edit or --from and --to", pkg.name);
|
|
264582
|
+
const err = new CliError("[input] is required: supply via stdin, or --env or --edit or --last or --from and --to", pkg.name);
|
|
264249
264583
|
cli.showHelp("log");
|
|
264250
264584
|
console.log(err.message);
|
|
264251
264585
|
throw err;
|
|
@@ -264322,7 +264656,7 @@ async function main(args) {
|
|
|
264322
264656
|
warningCount: 0,
|
|
264323
264657
|
results: []
|
|
264324
264658
|
});
|
|
264325
|
-
const helpUrl =
|
|
264659
|
+
const helpUrl = flags["help-url"]?.trim() || loaded.helpUrl;
|
|
264326
264660
|
const output = format4(report, {
|
|
264327
264661
|
color: flags.color,
|
|
264328
264662
|
verbose: flags.verbose,
|
|
@@ -264353,11 +264687,14 @@ function checkFromEdit(flags) {
|
|
|
264353
264687
|
return Boolean(flags.edit) || Boolean(flags.env);
|
|
264354
264688
|
}
|
|
264355
264689
|
function checkFromHistory(flags) {
|
|
264356
|
-
return typeof flags.from === "string" || typeof flags.to === "string";
|
|
264690
|
+
return typeof flags.from === "string" || typeof flags.to === "string" || typeof flags.last === "boolean";
|
|
264357
264691
|
}
|
|
264358
264692
|
function normalizeFlags(flags) {
|
|
264359
264693
|
const edit = getEditValue(flags);
|
|
264360
|
-
return
|
|
264694
|
+
return {
|
|
264695
|
+
...flags,
|
|
264696
|
+
edit
|
|
264697
|
+
};
|
|
264361
264698
|
}
|
|
264362
264699
|
function getEditValue(flags) {
|
|
264363
264700
|
if (flags.env) {
|
|
@@ -264417,12 +264754,6 @@ process.on("unhandledRejection", (reason, promise) => {
|
|
|
264417
264754
|
uri-js/dist/es5/uri.all.js:
|
|
264418
264755
|
(** @license URI.js v4.4.1 (c) 2011 Gary Court. License: http://github.com/garycourt/uri-js *)
|
|
264419
264756
|
|
|
264420
|
-
cosmiconfig/dist/util.js:
|
|
264421
|
-
(* istanbul ignore if -- @preserve *)
|
|
264422
|
-
|
|
264423
|
-
cosmiconfig/dist/ExplorerBase.js:
|
|
264424
|
-
(* istanbul ignore next -- @preserve *)
|
|
264425
|
-
|
|
264426
264757
|
typescript/lib/typescript.js:
|
|
264427
264758
|
(*! *****************************************************************************
|
|
264428
264759
|
Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -264442,6 +264773,13 @@ typescript/lib/typescript.js:
|
|
|
264442
264773
|
cosmiconfig/dist/loaders.js:
|
|
264443
264774
|
(* istanbul ignore next -- @preserve *)
|
|
264444
264775
|
|
|
264776
|
+
cosmiconfig/dist/util.js:
|
|
264777
|
+
(* istanbul ignore next -- @preserve *)
|
|
264778
|
+
|
|
264779
|
+
cosmiconfig/dist/ExplorerBase.js:
|
|
264780
|
+
(* istanbul ignore if -- @preserve *)
|
|
264781
|
+
(* istanbul ignore next -- @preserve *)
|
|
264782
|
+
|
|
264445
264783
|
cosmiconfig/dist/Explorer.js:
|
|
264446
264784
|
(* istanbul ignore if -- @preserve *)
|
|
264447
264785
|
|