implementado typescript 7

This commit is contained in:
Luiz Silva 2026-08-03 16:48:50 -03:00
parent cd4ea4d36b
commit e9a323f18c
80 changed files with 5711 additions and 2455 deletions

View file

@ -1,63 +1,56 @@
"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 __copyProps = (to, from, except, desc) => {
if (from && typeof from === "object" || typeof from === "function") {
for (let key of __getOwnPropNames(from))
if (!__hasOwnProp.call(to, key) && key !== except)
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
}
return to;
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
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 import_node_fs = __toESM(require("node:fs"));
var import_node_path = __toESM(require("node:path"));
Object.defineProperty(exports, "__esModule", { value: true });
const node_fs_1 = __importDefault(require("node:fs"));
const node_path_1 = __importDefault(require("node:path"));
/**
* Mescla objetos recursivamente.
* - Adiciona chaves novas
* - Sobrescreve valores primitivos
* - Mescla objetos aninhados
*/
const mesclar = (entrada, novo) => {
const saida = { ...entrada || {} };
for (const [k, v] of Object.entries(novo)) {
if (v && typeof v === "object" && !Array.isArray(v)) {
saida[k] = mesclar(saida[k], v);
} else {
saida[k] = v;
const saida = { ...(entrada || {}) };
for (const [k, v] of Object.entries(novo)) {
if (v && typeof v === "object" && !Array.isArray(v)) {
saida[k] = mesclar(saida[k], v);
}
else {
saida[k] = v;
}
}
}
return saida;
return saida;
};
/** Lê JSON ou retorna objeto vazio */
const abrirJson = (caminho) => {
try {
return JSON.parse(import_node_fs.default.readFileSync(caminho, "utf-8"));
} catch {
return {};
}
try {
return JSON.parse(node_fs_1.default.readFileSync(caminho, "utf-8"));
}
catch {
return {};
}
};
const settings_json = {
"editor.defaultFormatter": "biomejs.biome",
"[javascript]": { "editor.defaultFormatter": "biomejs.biome" },
"[javascriptreact]": { "editor.defaultFormatter": "biomejs.biome" },
"[typescript]": { "editor.defaultFormatter": "biomejs.biome" },
"[typescriptreact]": { "editor.defaultFormatter": "biomejs.biome" },
"[json]": { "editor.defaultFormatter": "biomejs.biome" },
"[jsonc]": { "editor.defaultFormatter": "biomejs.biome" },
"[vue]": { "editor.defaultFormatter": "esbenp.prettier-vscode" },
"editor.codeActionsOnSave": {
"source.organizeImports.biome": "always",
"source.fixAll.biome": "always"
}
"editor.defaultFormatter": "biomejs.biome",
"[javascript]": { "editor.defaultFormatter": "biomejs.biome" },
"[javascriptreact]": { "editor.defaultFormatter": "biomejs.biome" },
"[typescript]": { "editor.defaultFormatter": "biomejs.biome" },
"[typescriptreact]": { "editor.defaultFormatter": "biomejs.biome" },
"[json]": { "editor.defaultFormatter": "biomejs.biome" },
"[jsonc]": { "editor.defaultFormatter": "biomejs.biome" },
"[vue]": { "editor.defaultFormatter": "esbenp.prettier-vscode" },
"editor.codeActionsOnSave": {
"source.organizeImports.biome": "always",
"source.fixAll.biome": "always",
},
};
const caminhoSeting = import_node_path.default.join(process.cwd(), ".vscode/settings.json");
import_node_fs.default.mkdirSync(import_node_path.default.dirname(caminhoSeting), { recursive: true });
const caminhoSeting = node_path_1.default.join(process.cwd(), ".vscode/settings.json");
// Garante a pasta .vscode
node_fs_1.default.mkdirSync(node_path_1.default.dirname(caminhoSeting), { recursive: true });
// Mescla e grava
const atual = abrirJson(caminhoSeting);
const final = mesclar(atual, settings_json);
import_node_fs.default.writeFileSync(caminhoSeting, JSON.stringify(final, null, 2), "utf8");
console.log(`\u2705 Configura\xE7\xF5es salvas em ${caminhoSeting}`);
node_fs_1.default.writeFileSync(caminhoSeting, JSON.stringify(final, null, 2), "utf8");
console.log(`✅ Configurações salvas em ${caminhoSeting}`);