mirror of
https://github.com/astral-sh/setup-uv.git
synced 2026-01-27 14:12:47 +00:00
Review
This commit is contained in:
99
dist/update-known-versions/index.js
generated
vendored
99
dist/update-known-versions/index.js
generated
vendored
@@ -27471,42 +27471,19 @@ async function fetchVersionData() {
|
||||
if (!response.ok) {
|
||||
throw new Error(`Failed to fetch version data: ${response.status} ${response.statusText}`);
|
||||
}
|
||||
const body = await response.text();
|
||||
const versions = [];
|
||||
if (!response.body) {
|
||||
throw new Error("Response body is null");
|
||||
}
|
||||
// Stream and parse NDJSON line by line
|
||||
const decoder = new TextDecoder();
|
||||
let buffer = "";
|
||||
for await (const chunk of response.body) {
|
||||
buffer += decoder.decode(chunk, { stream: true });
|
||||
// Process complete lines
|
||||
const lines = buffer.split("\n");
|
||||
// Keep the last potentially incomplete line in buffer
|
||||
buffer = lines.pop() ?? "";
|
||||
for (const line of lines) {
|
||||
const trimmed = line.trim();
|
||||
if (trimmed === "") {
|
||||
continue;
|
||||
}
|
||||
try {
|
||||
const version = JSON.parse(trimmed);
|
||||
versions.push(version);
|
||||
}
|
||||
catch {
|
||||
core.debug(`Failed to parse NDJSON line: ${trimmed}`);
|
||||
}
|
||||
for (const line of body.split("\n")) {
|
||||
const trimmed = line.trim();
|
||||
if (trimmed === "") {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
// Process any remaining content in buffer
|
||||
const remaining = buffer.trim();
|
||||
if (remaining !== "") {
|
||||
try {
|
||||
const version = JSON.parse(remaining);
|
||||
const version = JSON.parse(trimmed);
|
||||
versions.push(version);
|
||||
}
|
||||
catch {
|
||||
core.debug(`Failed to parse NDJSON line: ${remaining}`);
|
||||
core.debug(`Failed to parse NDJSON line: ${trimmed}`);
|
||||
}
|
||||
}
|
||||
if (versions.length === 0) {
|
||||
@@ -27595,6 +27572,7 @@ var __importStar = (this && this.__importStar) || (function () {
|
||||
};
|
||||
})();
|
||||
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
||||
const node_fs_1 = __nccwpck_require__(3024);
|
||||
const core = __importStar(__nccwpck_require__(7484));
|
||||
const semver = __importStar(__nccwpck_require__(9318));
|
||||
const update_known_checksums_1 = __nccwpck_require__(6182);
|
||||
@@ -27655,7 +27633,6 @@ async function run() {
|
||||
core.setOutput("latest-version", latestVersion);
|
||||
}
|
||||
async function updateVersionManifestFromEntries(filePath, entries) {
|
||||
const { promises: fs } = await Promise.resolve(/* import() */).then(__nccwpck_require__.t.bind(__nccwpck_require__, 3024, 23));
|
||||
const manifest = entries.map((entry) => ({
|
||||
arch: entry.arch,
|
||||
artifactName: entry.artifactName,
|
||||
@@ -27664,7 +27641,7 @@ async function updateVersionManifestFromEntries(filePath, entries) {
|
||||
version: entry.version,
|
||||
}));
|
||||
core.debug(`Updating manifest-file: ${JSON.stringify(manifest)}`);
|
||||
await fs.writeFile(filePath, JSON.stringify(manifest));
|
||||
await node_fs_1.promises.writeFile(filePath, JSON.stringify(manifest));
|
||||
}
|
||||
run();
|
||||
|
||||
@@ -29639,64 +29616,6 @@ module.exports = parseParams
|
||||
/******/ }
|
||||
/******/
|
||||
/************************************************************************/
|
||||
/******/ /* webpack/runtime/create fake namespace object */
|
||||
/******/ (() => {
|
||||
/******/ var getProto = Object.getPrototypeOf ? (obj) => (Object.getPrototypeOf(obj)) : (obj) => (obj.__proto__);
|
||||
/******/ var leafPrototypes;
|
||||
/******/ // create a fake namespace object
|
||||
/******/ // mode & 1: value is a module id, require it
|
||||
/******/ // mode & 2: merge all properties of value into the ns
|
||||
/******/ // mode & 4: return value when already ns object
|
||||
/******/ // mode & 16: return value when it's Promise-like
|
||||
/******/ // mode & 8|1: behave like require
|
||||
/******/ __nccwpck_require__.t = function(value, mode) {
|
||||
/******/ if(mode & 1) value = this(value);
|
||||
/******/ if(mode & 8) return value;
|
||||
/******/ if(typeof value === 'object' && value) {
|
||||
/******/ if((mode & 4) && value.__esModule) return value;
|
||||
/******/ if((mode & 16) && typeof value.then === 'function') return value;
|
||||
/******/ }
|
||||
/******/ var ns = Object.create(null);
|
||||
/******/ __nccwpck_require__.r(ns);
|
||||
/******/ var def = {};
|
||||
/******/ leafPrototypes = leafPrototypes || [null, getProto({}), getProto([]), getProto(getProto)];
|
||||
/******/ for(var current = mode & 2 && value; typeof current == 'object' && !~leafPrototypes.indexOf(current); current = getProto(current)) {
|
||||
/******/ Object.getOwnPropertyNames(current).forEach((key) => (def[key] = () => (value[key])));
|
||||
/******/ }
|
||||
/******/ def['default'] = () => (value);
|
||||
/******/ __nccwpck_require__.d(ns, def);
|
||||
/******/ return ns;
|
||||
/******/ };
|
||||
/******/ })();
|
||||
/******/
|
||||
/******/ /* webpack/runtime/define property getters */
|
||||
/******/ (() => {
|
||||
/******/ // define getter functions for harmony exports
|
||||
/******/ __nccwpck_require__.d = (exports, definition) => {
|
||||
/******/ for(var key in definition) {
|
||||
/******/ if(__nccwpck_require__.o(definition, key) && !__nccwpck_require__.o(exports, key)) {
|
||||
/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
|
||||
/******/ }
|
||||
/******/ }
|
||||
/******/ };
|
||||
/******/ })();
|
||||
/******/
|
||||
/******/ /* webpack/runtime/hasOwnProperty shorthand */
|
||||
/******/ (() => {
|
||||
/******/ __nccwpck_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
|
||||
/******/ })();
|
||||
/******/
|
||||
/******/ /* webpack/runtime/make namespace object */
|
||||
/******/ (() => {
|
||||
/******/ // define __esModule on exports
|
||||
/******/ __nccwpck_require__.r = (exports) => {
|
||||
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
|
||||
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
||||
/******/ }
|
||||
/******/ Object.defineProperty(exports, '__esModule', { value: true });
|
||||
/******/ };
|
||||
/******/ })();
|
||||
/******/
|
||||
/******/ /* webpack/runtime/compat */
|
||||
/******/
|
||||
/******/ if (typeof __nccwpck_require__ !== 'undefined') __nccwpck_require__.ab = __dirname + "/";
|
||||
|
||||
Reference in New Issue
Block a user