rebuild hrm

This commit is contained in:
2026-04-13 09:30:59 +08:00
parent 44a98495ab
commit cd31c74da8
12034 changed files with 548007 additions and 451275 deletions

147
node_modules/browserslist/node.js generated vendored
View File

@@ -11,6 +11,9 @@ var SCOPED_CONFIG__PATTERN = /@[^/]+(?:\/[^/]+)?\/browserslist-config(?:-|$|\/)/
var FORMAT =
'Browserslist config should be a string or an array ' +
'of strings with browser queries'
var PATHTYPE_UNKNOWN = 'unknown'
var PATHTYPE_DIR = 'directory'
var PATHTYPE_FILE = 'file'
var dataTimeChecked = false
var statCache = {}
@@ -36,11 +39,34 @@ function checkExtend(name) {
}
}
function isFile(file) {
return fs.existsSync(file) && fs.statSync(file).isFile()
function getPathType(filepath) {
var stats
try {
stats = fs.existsSync(filepath) && fs.statSync(filepath)
} catch (err) {
/* c8 ignore start */
if (
err.code !== 'ENOENT' &&
err.code !== 'EACCES' &&
err.code !== 'ERR_ACCESS_DENIED'
) {
throw err
}
/* c8 ignore end */
}
if (stats && stats.isDirectory()) return PATHTYPE_DIR
if (stats && stats.isFile()) return PATHTYPE_FILE
return PATHTYPE_UNKNOWN
}
function isFile(file) {
return getPathType(file) === PATHTYPE_FILE
}
function isDirectory(dir) {
return fs.existsSync(dir) && fs.statSync(dir).isDirectory()
return getPathType(dir) === PATHTYPE_DIR
}
function eachParent(file, callback, cache) {
@@ -51,23 +77,23 @@ function eachParent(file, callback, cache) {
if (!pathInRoot(loc)) {
break
}
if (cache && (loc in cache)) {
if (cache && loc in cache) {
result = cache[loc]
break
}
pathsForCacheResult.push(loc)
if (!isDirectory(loc)) {
continue
}
var locResult = callback(loc)
if (typeof locResult !== 'undefined') {
result = locResult
break
}
} while (loc !== (loc = path.dirname(loc)))
if (cache && !process.env.BROWSERSLIST_DISABLE_CACHE) {
pathsForCacheResult.forEach(function (cachePath) {
cache[cachePath] = result
@@ -152,10 +178,10 @@ function parsePackageOrReadConfig(file) {
if (file in parseConfigCache) {
return parseConfigCache[file]
}
var isPackage = path.basename(file) === 'package.json'
var result = isPackage ? parsePackage(file) : module.exports.readConfig(file)
if (!process.env.BROWSERSLIST_DISABLE_CACHE) {
parseConfigCache[file] = result
}
@@ -229,6 +255,9 @@ module.exports = {
checkExtend(name)
}
var queries = require(require.resolve(name, { paths: ['.', ctx.path] }))
if (typeof queries === 'object' && queries !== null && queries.__esModule) {
queries = queries.default
}
if (queries) {
if (Array.isArray(queries)) {
return queries
@@ -249,10 +278,12 @@ module.exports = {
if (!ctx.dangerousExtend && !process.env.BROWSERSLIST_DANGEROUS_EXTEND) {
checkExtend(name)
}
var stats = require(require.resolve(
path.join(name, 'browserslist-stats.json'),
{ paths: ['.'] }
))
var stats = require(
// Use forward slashes for module paths, also on Windows.
require.resolve(path.posix.join(name, 'browserslist-stats.json'), {
paths: ['.']
})
)
return normalizeStats(data, stats)
},
@@ -263,10 +294,14 @@ module.exports = {
} else if (process.env.BROWSERSLIST_STATS) {
stats = process.env.BROWSERSLIST_STATS
} else if (opts.path && path.resolve && fs.existsSync) {
stats = eachParent(opts.path, function (dir) {
var file = path.join(dir, 'browserslist-stats.json')
return isFile(file) ? file : undefined
}, statCache)
stats = eachParent(
opts.path,
function (dir) {
var file = path.join(dir, 'browserslist-stats.json')
return isFile(file) ? file : undefined
},
statCache
)
}
if (typeof stats === 'string') {
try {
@@ -374,43 +409,48 @@ module.exports = {
},
findConfigFile: function findConfigFile(from) {
return eachParent(from, function (dir) {
var config = path.join(dir, 'browserslist')
var pkg = path.join(dir, 'package.json')
var rc = path.join(dir, '.browserslistrc')
return eachParent(
from,
function (dir) {
var config = path.join(dir, 'browserslist')
var pkg = path.join(dir, 'package.json')
var rc = path.join(dir, '.browserslistrc')
var pkgBrowserslist
if (isFile(pkg)) {
try {
pkgBrowserslist = parsePackage(pkg)
} catch (e) {
if (e.name === 'BrowserslistError') throw e
console.warn(
'[Browserslist] Could not parse ' + pkg + '. Ignoring it.'
)
var pkgBrowserslist
if (isFile(pkg)) {
try {
pkgBrowserslist = parsePackage(pkg)
} catch (e) {
if (e.name === 'BrowserslistError') throw e
console.warn(
'[Browserslist] Could not parse ' + pkg + '. Ignoring it.'
)
}
}
}
if (isFile(config) && pkgBrowserslist) {
throw new BrowserslistError(
dir + ' contains both browserslist and package.json with browsers'
)
} else if (isFile(rc) && pkgBrowserslist) {
throw new BrowserslistError(
dir + ' contains both .browserslistrc and package.json with browsers'
)
} else if (isFile(config) && isFile(rc)) {
throw new BrowserslistError(
dir + ' contains both .browserslistrc and browserslist'
)
} else if (isFile(config)) {
return config
} else if (isFile(rc)) {
return rc
} else if (pkgBrowserslist) {
return pkg
}
}, configPathCache)
if (isFile(config) && pkgBrowserslist) {
throw new BrowserslistError(
dir + ' contains both browserslist and package.json with browsers'
)
} else if (isFile(rc) && pkgBrowserslist) {
throw new BrowserslistError(
dir +
' contains both .browserslistrc and package.json with browsers'
)
} else if (isFile(config) && isFile(rc)) {
throw new BrowserslistError(
dir + ' contains both .browserslistrc and browserslist'
)
} else if (isFile(config)) {
return config
} else if (isFile(rc)) {
return rc
} else if (pkgBrowserslist) {
return pkg
}
},
configPathCache
)
},
findConfig: function findConfig(from) {
@@ -437,6 +477,11 @@ module.exports = {
var monthsPassed = getMonthsPassed(latest)
if (latest !== 0 && monthsPassed >= 6) {
if (process.env.BROWSERSLIST_TRACE_WARNING) {
console.info('Last browser release in DB: ' + String(new Date(latest)))
console.trace()
}
var months = monthsPassed + ' ' + (monthsPassed > 1 ? 'months' : 'month')
console.warn(
'Browserslist: browsers data (caniuse-lite) is ' +