UEA-Prodem

This commit is contained in:
2026-06-10 12:38:42 -03:00
parent 3f33154e16
commit c41625e542
9352 changed files with 1128292 additions and 14752 deletions
@@ -0,0 +1,12 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = readInputSourceMapFile;
function readInputSourceMapFile() {
throw new Error("Reading input source map files is not supported in browsers");
}
0 && 0;
//# sourceMappingURL=read-input-source-map-file-browser.js.map
@@ -0,0 +1 @@
{"version":3,"names":["readInputSourceMapFile","Error"],"sources":["../../src/transformation/read-input-source-map-file-browser.ts"],"sourcesContent":["export default function readInputSourceMapFile(): never {\n throw new Error(\n \"Reading input source map files is not supported in browsers\",\n );\n}\n"],"mappings":";;;;;;AAAe,SAASA,sBAAsBA,CAAA,EAAU;EACtD,MAAM,IAAIC,KAAK,CACb,6DACF,CAAC;AACH;AAAC","ignoreList":[]}
@@ -0,0 +1,88 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = readInputSourceMapFile;
function _fs() {
const data = require("fs");
_fs = function () {
return data;
};
return data;
}
function _path() {
const data = require("path");
_path = function () {
return data;
};
return data;
}
function _debug() {
const data = require("debug");
_debug = function () {
return data;
};
return data;
}
function _convertSourceMap() {
const data = require("convert-source-map");
_convertSourceMap = function () {
return data;
};
return data;
}
const debug = _debug()("babel:transform:file");
function findUpSync(name, {
cwd,
stopAt
} = {}) {
let directory = _path().resolve(cwd || "");
const {
root
} = _path().parse(directory);
stopAt = _path().resolve(directory, stopAt || root);
const isAbsoluteName = _path().isAbsolute(name);
while (directory) {
const filePath = isAbsoluteName ? name : _path().join(directory, name);
try {
const stats = _fs().statSync(filePath);
if (stats.isFile()) {
return filePath;
}
} catch (_) {}
if (directory === stopAt || directory === root) {
break;
}
directory = _path().dirname(directory);
}
}
function getInputMapPath(filename, root, inputMapURL) {
const inputFileDir = _path().dirname(filename);
const inputMapPath = _path().resolve(inputFileDir, inputMapURL);
const relativeToInputFileDir = _path().relative(inputFileDir, inputMapPath);
if (relativeToInputFileDir.startsWith("..") || _path().isAbsolute(relativeToInputFileDir)) {
const inputPackageJSONPath = findUpSync("package.json", {
cwd: inputFileDir,
stopAt: root
});
const inputFileRoot = inputPackageJSONPath ? _path().dirname(inputPackageJSONPath) : root;
const relativeInputMapPath = _path().relative(inputFileRoot, inputMapPath);
if (relativeInputMapPath.startsWith("..") || _path().isAbsolute(relativeInputMapPath)) {
debug(`discarding input sourcemap "${inputMapPath}" outside of package root "${inputFileRoot}"`);
return null;
}
}
return inputMapPath;
}
function readInputSourceMapFile(filename, root, inputMapURL) {
const inputMapPath = getInputMapPath(filename, root, inputMapURL);
if (inputMapPath) {
const inputMapContent = _fs().readFileSync(inputMapPath, "utf8");
return _convertSourceMap().fromJSON(inputMapContent);
}
return null;
}
0 && 0;
//# sourceMappingURL=read-input-source-map-file.js.map
File diff suppressed because one or more lines are too long
@@ -0,0 +1,5 @@
export default function readInputSourceMapFile(): never {
throw new Error(
"Reading input source map files is not supported in browsers",
);
}
@@ -0,0 +1,89 @@
import fs from "node:fs";
import path from "node:path";
import buildDebug from "debug";
import convertSourceMap from "convert-source-map";
import type { SourceMapConverter } from "convert-source-map";
const debug = buildDebug("babel:transform:file");
// Revised from https://github.com/sindresorhus/find-up-simple/blob/f10133c55dcbf36f84a246c6f1bbfed178dcb774/index.js#L36
// for Node.js 6 compatibility
function findUpSync(
name: string,
{
cwd,
stopAt,
}: {
cwd?: string;
stopAt?: string;
} = {},
) {
let directory = path.resolve(cwd || "");
const { root } = path.parse(directory);
stopAt = path.resolve(directory, stopAt || root);
const isAbsoluteName = path.isAbsolute(name);
while (directory) {
const filePath = isAbsoluteName ? name : path.join(directory, name);
try {
const stats = fs.statSync(filePath);
if (stats.isFile()) {
return filePath;
}
} catch (_) {}
if (directory === stopAt || directory === root) {
break;
}
directory = path.dirname(directory);
}
}
function getInputMapPath(
filename: string,
root: string,
inputMapURL: string,
): string | null {
const inputFileDir = path.dirname(filename);
const inputMapPath = path.resolve(inputFileDir, inputMapURL);
const relativeToInputFileDir = path.relative(inputFileDir, inputMapPath);
if (
relativeToInputFileDir.startsWith("..") ||
path.isAbsolute(relativeToInputFileDir)
) {
const inputPackageJSONPath = findUpSync("package.json", {
cwd: inputFileDir,
stopAt: root,
});
const inputFileRoot = inputPackageJSONPath
? path.dirname(inputPackageJSONPath)
: root;
const relativeInputMapPath = path.relative(inputFileRoot, inputMapPath);
if (
relativeInputMapPath.startsWith("..") ||
path.isAbsolute(relativeInputMapPath)
) {
debug(
`discarding input sourcemap "${inputMapPath}" outside of package root "${inputFileRoot}"`,
);
return null;
}
}
return inputMapPath;
}
export default function readInputSourceMapFile(
filename: string,
root: string,
inputMapURL: string,
): SourceMapConverter | null {
const inputMapPath = getInputMapPath(filename, root, inputMapURL);
if (inputMapPath) {
const inputMapContent = fs.readFileSync(inputMapPath, "utf8");
return convertSourceMap.fromJSON(inputMapContent);
}
return null;
}