internalização de libs
This commit is contained in:
parent
2cac8492fa
commit
42d5e978c9
7 changed files with 78 additions and 105 deletions
|
|
@ -1,7 +1,9 @@
|
|||
"use strict";
|
||||
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)
|
||||
|
|
@ -15,25 +17,40 @@ 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 dayjs_exports = {};
|
||||
__export(dayjs_exports, {
|
||||
criarDayjsbr: () => criarDayjsbr
|
||||
dayjsbr: () => import_dayjs.default
|
||||
});
|
||||
module.exports = __toCommonJS(dayjs_exports);
|
||||
const criarDayjsbr = (edayjs, op) => {
|
||||
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;
|
||||
};
|
||||
var import_dayjs = __toESM(require("dayjs"));
|
||||
var import_pt_br = require("dayjs/locale/pt-br");
|
||||
var import_duration = __toESM(require("dayjs/plugin/duration"));
|
||||
var import_isSameOrAfter = __toESM(require("dayjs/plugin/isSameOrAfter"));
|
||||
var import_isSameOrBefore = __toESM(require("dayjs/plugin/isSameOrBefore"));
|
||||
var import_minMax = __toESM(require("dayjs/plugin/minMax"));
|
||||
var import_relativeTime = __toESM(require("dayjs/plugin/relativeTime"));
|
||||
var import_timezone = __toESM(require("dayjs/plugin/timezone"));
|
||||
var import_utc = __toESM(require("dayjs/plugin/utc"));
|
||||
var import_weekOfYear = __toESM(require("dayjs/plugin/weekOfYear"));
|
||||
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:
|
||||
0 && (module.exports = {
|
||||
criarDayjsbr
|
||||
dayjsbr
|
||||
});
|
||||
|
|
|
|||
|
|
@ -1,13 +1,5 @@
|
|||
import z from 'zod';
|
||||
import dayjs 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';
|
||||
export { ManipulateType, default as dayjsbr } from 'dayjs';
|
||||
import { v4 } from 'uuid';
|
||||
|
||||
declare const aleatorio: (tamanho?: number) => string;
|
||||
|
|
@ -97,33 +89,6 @@ declare const zFiltro: z.ZodObject<{
|
|||
ou: z.ZodOptional<z.ZodBoolean>;
|
||||
}, 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";
|
||||
|
||||
type tiposArquivo = "imagem" | "documento" | "vídeo" | "outros";
|
||||
|
|
@ -343,4 +308,4 @@ declare const nomeVariavel: (v: {
|
|||
[key: string]: any;
|
||||
}) => 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
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "p-comuns",
|
||||
"version": "0.258.0",
|
||||
"version": "0.259.0",
|
||||
"description": "",
|
||||
"main": "./dist-back/index.js",
|
||||
"module": "./dist-front/index.mjs",
|
||||
|
|
|
|||
BIN
pacote.tgz
BIN
pacote.tgz
Binary file not shown.
72
src/dayjs.ts
72
src/dayjs.ts
|
|
@ -1,54 +1,24 @@
|
|||
// dayjsbr.ts
|
||||
import type dayjs from "dayjs"
|
||||
import dayjsbr from "dayjs"
|
||||
|
||||
import type duration from "dayjs/plugin/duration"
|
||||
//import "dayjs/locale/pt-br"
|
||||
import type isSameOrAfter from "dayjs/plugin/isSameOrAfter"
|
||||
import type isSameOrBefore from "dayjs/plugin/isSameOrBefore"
|
||||
import type minMax from "dayjs/plugin/minMax"
|
||||
import type relativeTime from "dayjs/plugin/relativeTime"
|
||||
import type timezone from "dayjs/plugin/timezone"
|
||||
import type utc from "dayjs/plugin/utc"
|
||||
import type weekOfYear from "dayjs/plugin/weekOfYear"
|
||||
export type { ManipulateType } 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"
|
||||
|
||||
/**
|
||||
*
|
||||
* 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"
|
||||
dayjsbr.extend(utc)
|
||||
dayjsbr.extend(timezone)
|
||||
dayjsbr.extend(weekOfYear)
|
||||
dayjsbr.extend(isSameOrBefore)
|
||||
dayjsbr.extend(isSameOrAfter)
|
||||
dayjsbr.extend(minMax)
|
||||
dayjsbr.extend(relativeTime)
|
||||
dayjsbr.extend(duration)
|
||||
dayjsbr.locale("pt-br")
|
||||
|
||||
|
||||
*/
|
||||
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
|
||||
}
|
||||
export { dayjsbr }
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@ export const tsup_config_front: Options = {
|
|||
minify: true, // Recomendado para builds de produção
|
||||
platform: "browser",
|
||||
outExtension: () => ({ js: ".mjs" }),
|
||||
external: ["dayjs"],
|
||||
noExternal: [/./]
|
||||
}
|
||||
|
||||
// Exporta a configuração padrão usando defineConfig
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue