This commit is contained in:
Luiz Silva 2025-07-18 14:10:49 -03:00
parent 41b1ebb60c
commit bd9a168636
10 changed files with 663 additions and 1350 deletions

View file

@ -1,8 +1,6 @@
var __create = Object.create;
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __getProtoOf = Object.getPrototypeOf;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
for (var name in all)
@ -16,34 +14,26 @@ var __copyProps = (to, from, except, desc) => {
}
return to;
};
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
// If the importer is in node compatibility mode or this is not an ESM
// file that has been converted to a CommonJS file using a Babel-
// compatible transform (i.e. "__esModule" has not been set), then set
// "default" to the CommonJS "module.exports" for node compatibility.
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
mod
));
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
var mapear_pasta_exports = {};
__export(mapear_pasta_exports, {
mapearPasta: () => mapearPasta
});
module.exports = __toCommonJS(mapear_pasta_exports);
var import_node_fs = __toESM(require("node:fs"));
var import_node_path = __toESM(require("node:path"));
var import_glob = require("glob");
const mapearPasta = ({
prefixos,
pasta,
arquivoDestino,
variavel
variavel,
globSync,
fs,
path
}) => {
const pasta_estaticos = pasta.endsWith("/") ? pasta : `${pasta}/`;
if (!import_node_fs.default.existsSync(pasta_estaticos))
if (!fs.existsSync(pasta_estaticos))
throw new Error(`Pasta ${pasta_estaticos} n\xE3o existe`);
const _gerar = (async () => {
const files = (0, import_glob.globSync)(`${pasta_estaticos}**/*`, { nodir: true });
const files = globSync(`${pasta_estaticos}**/*`, { nodir: true });
const arquivo_ts = `
@ -79,11 +69,11 @@ const mapearPasta = ({
})()};
};
`;
const pastaDestino = import_node_path.default.dirname(arquivoDestino);
if (!import_node_fs.default.existsSync(pastaDestino)) {
import_node_fs.default.mkdirSync(pastaDestino, { recursive: true });
const pastaDestino = path.dirname(arquivoDestino);
if (!fs.existsSync(pastaDestino)) {
fs.mkdirSync(pastaDestino, { recursive: true });
}
import_node_fs.default.writeFileSync(arquivoDestino, arquivo_ts);
fs.writeFileSync(arquivoDestino, arquivo_ts);
})();
};
// Annotate the CommonJS export names for ESM import in node: