internalização de libs

This commit is contained in:
Luiz Silva 2025-10-26 21:28:59 -03:00
parent 2cac8492fa
commit 42d5e978c9
7 changed files with 78 additions and 105 deletions

View file

@ -1,7 +1,9 @@
"use strict"; "use strict";
var __create = Object.create;
var __defProp = Object.defineProperty; var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor; var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames; var __getOwnPropNames = Object.getOwnPropertyNames;
var __getProtoOf = Object.getPrototypeOf;
var __hasOwnProp = Object.prototype.hasOwnProperty; var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => { var __export = (target, all) => {
for (var name in all) for (var name in all)
@ -15,25 +17,40 @@ var __copyProps = (to, from, except, desc) => {
} }
return to; 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 __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
var dayjs_exports = {}; var dayjs_exports = {};
__export(dayjs_exports, { __export(dayjs_exports, {
criarDayjsbr: () => criarDayjsbr dayjsbr: () => import_dayjs.default
}); });
module.exports = __toCommonJS(dayjs_exports); module.exports = __toCommonJS(dayjs_exports);
const criarDayjsbr = (edayjs, op) => { var import_dayjs = __toESM(require("dayjs"));
edayjs.extend(op.utc); var import_pt_br = require("dayjs/locale/pt-br");
edayjs.extend(op.timezone); var import_duration = __toESM(require("dayjs/plugin/duration"));
edayjs.extend(op.weekOfYear); var import_isSameOrAfter = __toESM(require("dayjs/plugin/isSameOrAfter"));
edayjs.extend(op.isSameOrBefore); var import_isSameOrBefore = __toESM(require("dayjs/plugin/isSameOrBefore"));
edayjs.extend(op.isSameOrAfter); var import_minMax = __toESM(require("dayjs/plugin/minMax"));
edayjs.extend(op.minMax); var import_relativeTime = __toESM(require("dayjs/plugin/relativeTime"));
edayjs.extend(op.relativeTime); var import_timezone = __toESM(require("dayjs/plugin/timezone"));
edayjs.extend(op.duration); var import_utc = __toESM(require("dayjs/plugin/utc"));
edayjs.locale("pt-br"); var import_weekOfYear = __toESM(require("dayjs/plugin/weekOfYear"));
return edayjs; import_dayjs.default.extend(import_utc.default);
}; import_dayjs.default.extend(import_timezone.default);
import_dayjs.default.extend(import_weekOfYear.default);
import_dayjs.default.extend(import_isSameOrBefore.default);
import_dayjs.default.extend(import_isSameOrAfter.default);
import_dayjs.default.extend(import_minMax.default);
import_dayjs.default.extend(import_relativeTime.default);
import_dayjs.default.extend(import_duration.default);
import_dayjs.default.locale("pt-br");
// Annotate the CommonJS export names for ESM import in node: // Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = { 0 && (module.exports = {
criarDayjsbr dayjsbr
}); });

View file

@ -1,13 +1,5 @@
import z from 'zod'; import z from 'zod';
import dayjs from 'dayjs'; export { ManipulateType, default as dayjsbr } from 'dayjs';
import duration from 'dayjs/plugin/duration';
import isSameOrAfter from 'dayjs/plugin/isSameOrAfter';
import isSameOrBefore from 'dayjs/plugin/isSameOrBefore';
import minMax from 'dayjs/plugin/minMax';
import relativeTime from 'dayjs/plugin/relativeTime';
import timezone from 'dayjs/plugin/timezone';
import utc from 'dayjs/plugin/utc';
import weekOfYear from 'dayjs/plugin/weekOfYear';
import { v4 } from 'uuid'; import { v4 } from 'uuid';
declare const aleatorio: (tamanho?: number) => string; declare const aleatorio: (tamanho?: number) => string;
@ -97,33 +89,6 @@ declare const zFiltro: z.ZodObject<{
ou: z.ZodOptional<z.ZodBoolean>; ou: z.ZodOptional<z.ZodBoolean>;
}, z.core.$strip>; }, z.core.$strip>;
/**
*
* dayjsbr.ts
*import dayjs from "dayjs"
*import "dayjs/locale/pt-br"
*import duration from "dayjs/plugin/duration"
*import isSameOrAfter from "dayjs/plugin/isSameOrAfter"
*import isSameOrBefore from "dayjs/plugin/isSameOrBefore"
*import minMax from "dayjs/plugin/minMax"
*import relativeTime from "dayjs/plugin/relativeTime"
*import timezone from "dayjs/plugin/timezone"
*import utc from "dayjs/plugin/utc"
*import weekOfYear from "dayjs/plugin/weekOfYear"
*/
declare const criarDayjsbr: (edayjs: typeof dayjs, op: {
duration: typeof duration;
isSameOrAfter: typeof isSameOrAfter;
isSameOrBefore: typeof isSameOrBefore;
minMax: typeof minMax;
relativeTime: typeof relativeTime;
timezone: typeof timezone;
utc: typeof utc;
weekOfYear: typeof weekOfYear;
}) => typeof dayjs;
declare const cdn_carro_de_boi = "https://carro-de-boi-idz-one.b-cdn.net"; declare const cdn_carro_de_boi = "https://carro-de-boi-idz-one.b-cdn.net";
type tiposArquivo = "imagem" | "documento" | "vídeo" | "outros"; type tiposArquivo = "imagem" | "documento" | "vídeo" | "outros";
@ -343,4 +308,4 @@ declare const nomeVariavel: (v: {
[key: string]: any; [key: string]: any;
}) => string; }) => string;
export { TipagemRotas, type TipoLoggerSessao, aleatorio, cacheM, cacheMFixo, cacheMemoria, camposComuns, cdn_carro_de_boi, criarDayjsbr, defineCwd, erUuid, esperar, extensoes, graficos_pilao, type interfaceConsulta, localValor, logger, nomeVariavel, objetoPg, operadores, paraObjetoRegistroPg, pgObjeto, postLogger, siglas_unidades_medida, texto_busca, tipoArquivo, type tipoFiltro, type tipoLogger, type tipoLoggerLog, type tipoLokiObjeto, tipoUsuarioResiduos, tx, umaFuncao, umaVariavel, unidades_medida, uuid, uuidV3, uuidV4, uuid_null, validarUuid, verCacheM, zFiltro, zOperadores }; export { TipagemRotas, type TipoLoggerSessao, aleatorio, cacheM, cacheMFixo, cacheMemoria, camposComuns, cdn_carro_de_boi, defineCwd, erUuid, esperar, extensoes, graficos_pilao, type interfaceConsulta, localValor, logger, nomeVariavel, objetoPg, operadores, paraObjetoRegistroPg, pgObjeto, postLogger, siglas_unidades_medida, texto_busca, tipoArquivo, type tipoFiltro, type tipoLogger, type tipoLoggerLog, type tipoLokiObjeto, tipoUsuarioResiduos, tx, umaFuncao, umaVariavel, unidades_medida, uuid, uuidV3, uuidV4, uuid_null, validarUuid, verCacheM, zFiltro, zOperadores };

File diff suppressed because one or more lines are too long

View file

@ -1,6 +1,6 @@
{ {
"name": "p-comuns", "name": "p-comuns",
"version": "0.258.0", "version": "0.259.0",
"description": "", "description": "",
"main": "./dist-back/index.js", "main": "./dist-back/index.js",
"module": "./dist-front/index.mjs", "module": "./dist-front/index.mjs",

Binary file not shown.

View file

@ -1,54 +1,24 @@
// dayjsbr.ts import dayjsbr from "dayjs"
import type dayjs from "dayjs"
import type duration from "dayjs/plugin/duration" export type { ManipulateType } from "dayjs"
//import "dayjs/locale/pt-br" import "dayjs/locale/pt-br"
import type isSameOrAfter from "dayjs/plugin/isSameOrAfter" import duration from "dayjs/plugin/duration"
import type isSameOrBefore from "dayjs/plugin/isSameOrBefore" import isSameOrAfter from "dayjs/plugin/isSameOrAfter"
import type minMax from "dayjs/plugin/minMax" import isSameOrBefore from "dayjs/plugin/isSameOrBefore"
import type relativeTime from "dayjs/plugin/relativeTime" import minMax from "dayjs/plugin/minMax"
import type timezone from "dayjs/plugin/timezone" import relativeTime from "dayjs/plugin/relativeTime"
import type utc from "dayjs/plugin/utc" import timezone from "dayjs/plugin/timezone"
import type weekOfYear from "dayjs/plugin/weekOfYear" import utc from "dayjs/plugin/utc"
import weekOfYear from "dayjs/plugin/weekOfYear"
/** dayjsbr.extend(utc)
* dayjsbr.extend(timezone)
* dayjsbr.ts dayjsbr.extend(weekOfYear)
*import dayjs from "dayjs" dayjsbr.extend(isSameOrBefore)
*import "dayjs/locale/pt-br" dayjsbr.extend(isSameOrAfter)
*import duration from "dayjs/plugin/duration" dayjsbr.extend(minMax)
*import isSameOrAfter from "dayjs/plugin/isSameOrAfter" dayjsbr.extend(relativeTime)
*import isSameOrBefore from "dayjs/plugin/isSameOrBefore" dayjsbr.extend(duration)
*import minMax from "dayjs/plugin/minMax" dayjsbr.locale("pt-br")
*import relativeTime from "dayjs/plugin/relativeTime"
*import timezone from "dayjs/plugin/timezone"
*import utc from "dayjs/plugin/utc"
*import weekOfYear from "dayjs/plugin/weekOfYear"
export { dayjsbr }
*/
export const criarDayjsbr = (
edayjs: typeof dayjs,
op: {
duration: typeof duration
isSameOrAfter: typeof isSameOrAfter
isSameOrBefore: typeof isSameOrBefore
minMax: typeof minMax
relativeTime: typeof relativeTime
timezone: typeof timezone
utc: typeof utc
weekOfYear: typeof weekOfYear
},
) => {
edayjs.extend(op.utc)
edayjs.extend(op.timezone)
edayjs.extend(op.weekOfYear)
edayjs.extend(op.isSameOrBefore)
edayjs.extend(op.isSameOrAfter)
edayjs.extend(op.minMax)
edayjs.extend(op.relativeTime)
edayjs.extend(op.duration)
edayjs.locale("pt-br")
return edayjs
}

View file

@ -17,7 +17,7 @@ export const tsup_config_front: Options = {
minify: true, // Recomendado para builds de produção minify: true, // Recomendado para builds de produção
platform: "browser", platform: "browser",
outExtension: () => ({ js: ".mjs" }), outExtension: () => ({ js: ".mjs" }),
external: ["dayjs"], noExternal: [/./]
} }
// Exporta a configuração padrão usando defineConfig // Exporta a configuração padrão usando defineConfig