Compare commits
1 commit
| Author | SHA1 | Date | |
|---|---|---|---|
| 21adefaf0c |
42 changed files with 96 additions and 1195 deletions
2
.env
Normal file
2
.env
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
PORTA = '5020'
|
||||
PREFIXO = '/estaticos'
|
||||
|
|
@ -1 +0,0 @@
|
|||
*.tgz
|
||||
|
|
@ -1,12 +0,0 @@
|
|||
import { defineBuildConfig } from 'unbuild'
|
||||
|
||||
// pnpm exec unbuild
|
||||
|
||||
export default defineBuildConfig({
|
||||
entries: ['src/index'],
|
||||
clean: true,
|
||||
declaration: true,
|
||||
rollup: {
|
||||
emitCJS: true,
|
||||
},
|
||||
})
|
||||
|
|
@ -43,7 +43,6 @@ var operadores = /* @__PURE__ */ ((operadores2) => {
|
|||
operadores2["<="] = "<=";
|
||||
operadores2["like"] = "like";
|
||||
operadores2["in"] = "in";
|
||||
operadores2["isNull"] = "isNull";
|
||||
return operadores2;
|
||||
})(operadores || {});
|
||||
const zOperadores = import_zod.default.enum([
|
||||
|
|
@ -54,8 +53,7 @@ const zOperadores = import_zod.default.enum([
|
|||
"<",
|
||||
"<=",
|
||||
"like",
|
||||
"in",
|
||||
"isNull"
|
||||
"in"
|
||||
]);
|
||||
const zFiltro = import_zod.default.object({
|
||||
coluna: import_zod.default.string(),
|
||||
|
|
@ -28,20 +28,19 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
||||
var dayjs_exports = {};
|
||||
__export(dayjs_exports, {
|
||||
dayjsbr: () => dayjsbr
|
||||
dayjsbr: () => import_dayjs.default
|
||||
});
|
||||
module.exports = __toCommonJS(dayjs_exports);
|
||||
var import_dayjs = __toESM(require("dayjs"));
|
||||
var import_duration = __toESM(require("dayjs/plugin/duration.js"));
|
||||
var import_isSameOrAfter = __toESM(require("dayjs/plugin/isSameOrAfter.js"));
|
||||
var import_isSameOrBefore = __toESM(require("dayjs/plugin/isSameOrBefore.js"));
|
||||
var import_minMax = __toESM(require("dayjs/plugin/minMax.js"));
|
||||
var import_relativeTime = __toESM(require("dayjs/plugin/relativeTime.js"));
|
||||
var import_timezone = __toESM(require("dayjs/plugin/timezone.js"));
|
||||
var import_utc = __toESM(require("dayjs/plugin/utc.js"));
|
||||
var import_weekOfYear = __toESM(require("dayjs/plugin/weekOfYear.js"));
|
||||
var import_pt_br = require("dayjs/locale/pt-br.js");
|
||||
import_dayjs.default.locale("pt-br");
|
||||
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);
|
||||
|
|
@ -50,7 +49,7 @@ 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);
|
||||
const dayjsbr = import_dayjs.default;
|
||||
import_dayjs.default.locale("pt-br");
|
||||
// Annotate the CommonJS export names for ESM import in node:
|
||||
0 && (module.exports = {
|
||||
dayjsbr
|
||||
|
|
@ -16,17 +16,22 @@ var __copyProps = (to, from, except, desc) => {
|
|||
return to;
|
||||
};
|
||||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
||||
var produtos_exports = {};
|
||||
__export(produtos_exports, {
|
||||
Produtos: () => Produtos
|
||||
var graficosPilao_exports = {};
|
||||
__export(graficosPilao_exports, {
|
||||
graficos_pilao: () => graficos_pilao
|
||||
});
|
||||
module.exports = __toCommonJS(produtos_exports);
|
||||
var Produtos = /* @__PURE__ */ ((Produtos2) => {
|
||||
Produtos2["e-licencie"] = "e-licencie";
|
||||
Produtos2["gov.e-licencie"] = "gov.e-licencie";
|
||||
return Produtos2;
|
||||
})(Produtos || {});
|
||||
module.exports = __toCommonJS(graficosPilao_exports);
|
||||
const graficos_pilao = {
|
||||
Condicionantes: {
|
||||
grafico: "condicionantes-criadas",
|
||||
titulo: "Condicionantes Criadas"
|
||||
},
|
||||
Licen\u00E7as: {
|
||||
grafico: "licencas-criadas",
|
||||
titulo: "Licen\xE7as Criadas"
|
||||
}
|
||||
};
|
||||
// Annotate the CommonJS export names for ESM import in node:
|
||||
0 && (module.exports = {
|
||||
Produtos
|
||||
graficos_pilao
|
||||
});
|
||||
|
|
@ -22,16 +22,13 @@ __reExport(index_exports, require("./consulta"), module.exports);
|
|||
__reExport(index_exports, require("./dayjs"), module.exports);
|
||||
__reExport(index_exports, require("./ecosistema"), module.exports);
|
||||
__reExport(index_exports, require("./extensoes"), module.exports);
|
||||
__reExport(index_exports, require("./extensoes"), module.exports);
|
||||
__reExport(index_exports, require("./graficosPilao"), module.exports);
|
||||
__reExport(index_exports, require("./local"), module.exports);
|
||||
__reExport(index_exports, require("./logger"), module.exports);
|
||||
__reExport(index_exports, require("./logger"), module.exports);
|
||||
__reExport(index_exports, require("./postgres"), module.exports);
|
||||
__reExport(index_exports, require("./produtos"), module.exports);
|
||||
__reExport(index_exports, require("./testes-de-variaveis"), module.exports);
|
||||
__reExport(index_exports, require("./texto_busca"), module.exports);
|
||||
__reExport(index_exports, require("./tipagemRotas"), module.exports);
|
||||
__reExport(index_exports, require("./tipagemRotas"), module.exports);
|
||||
__reExport(index_exports, require("./unidades_medida"), module.exports);
|
||||
__reExport(index_exports, require("./uuid"), module.exports);
|
||||
__reExport(index_exports, require("./variaveisComuns"), module.exports);
|
||||
|
|
@ -44,16 +41,13 @@ __reExport(index_exports, require("./variaveisComuns"), module.exports);
|
|||
...require("./dayjs"),
|
||||
...require("./ecosistema"),
|
||||
...require("./extensoes"),
|
||||
...require("./extensoes"),
|
||||
...require("./graficosPilao"),
|
||||
...require("./local"),
|
||||
...require("./logger"),
|
||||
...require("./logger"),
|
||||
...require("./postgres"),
|
||||
...require("./produtos"),
|
||||
...require("./testes-de-variaveis"),
|
||||
...require("./texto_busca"),
|
||||
...require("./tipagemRotas"),
|
||||
...require("./tipagemRotas"),
|
||||
...require("./unidades_medida"),
|
||||
...require("./uuid"),
|
||||
...require("./variaveisComuns")
|
||||
|
|
@ -1,6 +1,5 @@
|
|||
import z from 'zod';
|
||||
import dayjs from 'dayjs';
|
||||
export { Dayjs, ManipulateType } from 'dayjs';
|
||||
export { ManipulateType, default as dayjsbr } from 'dayjs';
|
||||
import { v4 } from 'uuid';
|
||||
|
||||
declare const aleatorio: (tamanho?: number) => string;
|
||||
|
|
@ -46,8 +45,7 @@ declare enum operadores {
|
|||
"<" = "<",
|
||||
"<=" = "<=",
|
||||
like = "like",
|
||||
in = "in",
|
||||
isNull = "isNull"
|
||||
in = "in"
|
||||
}
|
||||
type tipoFiltro = {
|
||||
coluna: string;
|
||||
|
|
@ -74,7 +72,6 @@ declare const zOperadores: z.ZodEnum<{
|
|||
"<=": "<=";
|
||||
like: "like";
|
||||
in: "in";
|
||||
isNull: "isNull";
|
||||
}>;
|
||||
declare const zFiltro: z.ZodObject<{
|
||||
coluna: z.ZodString;
|
||||
|
|
@ -88,13 +85,10 @@ declare const zFiltro: z.ZodObject<{
|
|||
"<=": "<=";
|
||||
like: "like";
|
||||
in: "in";
|
||||
isNull: "isNull";
|
||||
}>;
|
||||
ou: z.ZodOptional<z.ZodBoolean>;
|
||||
}, z.core.$strip>;
|
||||
|
||||
declare const dayjsbr: typeof dayjs;
|
||||
|
||||
declare const cdn_carro_de_boi = "https://carro-de-boi-idz-one.b-cdn.net";
|
||||
|
||||
type tiposArquivo = "imagem" | "documento" | "vídeo" | "outros";
|
||||
|
|
@ -110,6 +104,13 @@ declare const extensoes: {
|
|||
*/
|
||||
declare const tipoArquivo: (nomeArquivo: string | null | undefined) => tiposArquivo;
|
||||
|
||||
declare const graficos_pilao: {
|
||||
[k: string]: {
|
||||
grafico: string;
|
||||
titulo: string;
|
||||
};
|
||||
};
|
||||
|
||||
/**
|
||||
* LocalStorage Tipado
|
||||
* Lê ou grava um valor no localStorage, mantendo o tipo genérico <T>.
|
||||
|
|
@ -177,11 +178,6 @@ declare const objetoPg: (entrada: {
|
|||
[k: string]: string | boolean | null | undefined | number;
|
||||
};
|
||||
|
||||
declare enum Produtos {
|
||||
"e-licencie" = "e-licencie",
|
||||
"gov.e-licencie" = "gov.e-licencie"
|
||||
}
|
||||
|
||||
declare const umaFuncao: () => string;
|
||||
|
||||
declare const umaVariavel = "Ol\u00E1 Mundo! (vari\u00E1vel)";
|
||||
|
|
@ -312,4 +308,4 @@ declare const nomeVariavel: (v: {
|
|||
[key: string]: any;
|
||||
}) => string;
|
||||
|
||||
export { Produtos, TipagemRotas, type TipoLoggerSessao, aleatorio, cacheM, cacheMFixo, cacheMemoria, camposComuns, cdn_carro_de_boi, dayjsbr, defineCwd, erUuid, esperar, extensoes, 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
18
package.json
18
package.json
|
|
@ -1,23 +1,22 @@
|
|||
{
|
||||
"name": "p-comuns",
|
||||
"version": "0.296.0",
|
||||
"version": "0.247.0",
|
||||
"description": "",
|
||||
"main": "./dist-front/index.mjs",
|
||||
"main": "./dist-back/index.js",
|
||||
"module": "./dist-front/index.mjs",
|
||||
"types": "./dist-front/index.d.mts",
|
||||
"exports": {
|
||||
".": {
|
||||
"types": "./dist-front/index.d.mts",
|
||||
"import": "./dist-front/index.mjs",
|
||||
"require": "./dist-back/index.js"
|
||||
"require": "./dist-back/index.cjs"
|
||||
}
|
||||
},
|
||||
"scripts": {
|
||||
"biome": "pnpm exec biome check --write",
|
||||
"check": "pnpm run biome && npx tsc --noEmit",
|
||||
"build": "npm --no-git-tag-version version minor && pnpm run biome && tsup --config ./tsup/tsup.config.ts && pnpm run pacote",
|
||||
"teste": "npx vitest run src/testes/TipagemRotas.test.ts",
|
||||
"pacote": "npm pack && npm pack && mv $(npm pack --silent) pacote.tgz"
|
||||
"build": "npm --no-git-tag-version version minor && pnpm run biome && tsup --config ./tsup/tsup.config.ts",
|
||||
"teste": "npx vitest run src/testes/TipagemRotas.test.ts"
|
||||
},
|
||||
"author": {
|
||||
"name": "AZTECA SOFTWARE LTDA",
|
||||
|
|
@ -36,13 +35,6 @@
|
|||
"@types/node": "^20.19.22",
|
||||
"tsup": "8.5.0",
|
||||
"typescript": "~5.9.3",
|
||||
"unbuild": "^3.6.1",
|
||||
"vitest": "^3.2.4"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"cross-fetch": "4.1.0",
|
||||
"dayjs": "^1.11.18",
|
||||
"uuid": "^11.1.0",
|
||||
"zod": "4.1.4"
|
||||
}
|
||||
}
|
||||
|
|
|
|||
BIN
pacote.tgz
BIN
pacote.tgz
Binary file not shown.
1079
pnpm-lock.yaml
generated
1079
pnpm-lock.yaml
generated
File diff suppressed because it is too large
Load diff
|
|
@ -9,7 +9,6 @@ export enum operadores {
|
|||
"<=" = "<=",
|
||||
like = "like",
|
||||
in = "in",
|
||||
isNull = "isNull",
|
||||
}
|
||||
|
||||
export type tipoFiltro = {
|
||||
|
|
@ -39,7 +38,6 @@ export const zOperadores = z.enum([
|
|||
"<=",
|
||||
"like",
|
||||
"in",
|
||||
"isNull",
|
||||
])
|
||||
|
||||
export const zFiltro = z.object({
|
||||
|
|
|
|||
43
src/dayjs.ts
43
src/dayjs.ts
|
|
@ -1,27 +1,24 @@
|
|||
import dayjs, { type Dayjs } from "dayjs"
|
||||
import dayjsbr from "dayjs"
|
||||
|
||||
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"
|
||||
|
||||
import duration from "dayjs/plugin/duration.js"
|
||||
import isSameOrAfter from "dayjs/plugin/isSameOrAfter.js"
|
||||
import isSameOrBefore from "dayjs/plugin/isSameOrBefore.js"
|
||||
import minMax from "dayjs/plugin/minMax.js"
|
||||
import relativeTime from "dayjs/plugin/relativeTime.js"
|
||||
import timezone from "dayjs/plugin/timezone.js"
|
||||
import utc from "dayjs/plugin/utc.js"
|
||||
import weekOfYear from "dayjs/plugin/weekOfYear.js"
|
||||
import "dayjs/locale/pt-br.js"
|
||||
dayjs.locale("pt-br")
|
||||
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")
|
||||
|
||||
dayjs.extend(utc)
|
||||
dayjs.extend(timezone)
|
||||
dayjs.extend(weekOfYear)
|
||||
dayjs.extend(isSameOrBefore)
|
||||
dayjs.extend(isSameOrAfter)
|
||||
dayjs.extend(minMax)
|
||||
dayjs.extend(relativeTime)
|
||||
dayjs.extend(duration)
|
||||
|
||||
export const dayjsbr = dayjs
|
||||
|
||||
export type { Dayjs }
|
||||
export { dayjsbr }
|
||||
|
|
|
|||
12
src/graficosPilao.ts
Normal file
12
src/graficosPilao.ts
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
export const graficos_pilao: {
|
||||
[k: string]: { grafico: string; titulo: string }
|
||||
} = {
|
||||
Condicionantes: {
|
||||
grafico: "condicionantes-criadas",
|
||||
titulo: "Condicionantes Criadas",
|
||||
},
|
||||
Licenças: {
|
||||
grafico: "licencas-criadas",
|
||||
titulo: "Licenças Criadas",
|
||||
},
|
||||
}
|
||||
|
|
@ -5,16 +5,13 @@ export * from "./consulta"
|
|||
export * from "./dayjs"
|
||||
export * from "./ecosistema"
|
||||
export * from "./extensoes"
|
||||
export * from "./extensoes"
|
||||
export * from "./graficosPilao"
|
||||
export * from "./local"
|
||||
export * from "./logger"
|
||||
export * from "./logger"
|
||||
export * from "./postgres"
|
||||
export * from "./produtos"
|
||||
export * from "./testes-de-variaveis"
|
||||
export * from "./texto_busca"
|
||||
export * from "./tipagemRotas"
|
||||
export * from "./tipagemRotas"
|
||||
export * from "./unidades_medida"
|
||||
export * from "./uuid"
|
||||
export * from "./variaveisComuns"
|
||||
|
|
|
|||
|
|
@ -1,4 +0,0 @@
|
|||
export enum Produtos {
|
||||
"e-licencie" = "e-licencie",
|
||||
"gov.e-licencie" = "gov.e-licencie",
|
||||
}
|
||||
|
|
@ -1,8 +1,5 @@
|
|||
{
|
||||
"compilerOptions": {
|
||||
"esModuleInterop": true,
|
||||
"allowSyntheticDefaultImports": true,
|
||||
|
||||
/* Linguagem e Ambiente */
|
||||
"target": "ES2020" /* Define a versão do JavaScript para o código emitido. */,
|
||||
"lib": [
|
||||
|
|
@ -19,6 +16,7 @@
|
|||
"declaration": true /* Gera arquivos .d.ts para os arquivos TypeScript. */,
|
||||
|
||||
/* Interoperabilidade de Módulos */
|
||||
"esModuleInterop": true /* Habilita a compatibilidade com módulos CommonJS ao importar. */,
|
||||
"forceConsistentCasingInFileNames": true /* Garante consistência na diferenciação entre maiúsculas e minúsculas em nomes de arquivos. */,
|
||||
|
||||
/* Verificação de Tipos */
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@ export const tsup_config_back: Options = {
|
|||
sourcemap: false,
|
||||
minify: false, // Geralmente não minificamos o código do backend em produção, mas você pode mudar
|
||||
platform: "node",
|
||||
outExtension: () => ({ js: ".js" }),
|
||||
outExtension: () => ({ js: ".cjs" }),
|
||||
}
|
||||
|
||||
// Exporta a configuração padrão usando defineConfig
|
||||
|
|
|
|||
|
|
@ -1,10 +0,0 @@
|
|||
// tsup.config.ts (Configuração Ajustada para Back-end)
|
||||
import { defineConfig, type Options } from "tsup"
|
||||
import { tsup_config_front } from "./tsup.config.front"
|
||||
|
||||
tsup_config_front. noExternal= [/./]
|
||||
|
||||
export {tsup_config_front}
|
||||
|
||||
// Exporta a configuração padrão usando defineConfig
|
||||
export default defineConfig(tsup_config_front)
|
||||
|
|
@ -16,9 +16,7 @@ export const tsup_config_front: Options = {
|
|||
sourcemap: false,
|
||||
minify: true, // Recomendado para builds de produção
|
||||
platform: "browser",
|
||||
external: ['dayjs'],
|
||||
outExtension: () => ({ js: ".mjs" }),
|
||||
shims: false,
|
||||
}
|
||||
|
||||
// Exporta a configuração padrão usando defineConfig
|
||||
|
|
|
|||
|
|
@ -1,7 +0,0 @@
|
|||
// tsup.config.ts (Configuração Ajustada para Back-end)
|
||||
import { defineConfig } from "tsup"
|
||||
import { tsup_config_back } from "./tsup.config.back"
|
||||
import { tsup_config_front } from "./tsup.config.front.interno"
|
||||
|
||||
// Exporta a configuração padrão usando defineConfig
|
||||
export default defineConfig([tsup_config_back, tsup_config_front])
|
||||
Loading…
Add table
Add a link
Reference in a new issue