create-rubrica 2.1.1 → 2.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +26 -6
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -13,7 +13,7 @@ var __export = (target, all) => {
|
|
|
13
13
|
var define_CORE_MODULES_default;
|
|
14
14
|
var init_define_CORE_MODULES = __esm({
|
|
15
15
|
"<define:__CORE_MODULES__>"() {
|
|
16
|
-
define_CORE_MODULES_default = { users: ["isSetupRequired", "me", "list", "create", "setRole", "remove", "suspend", "reactivate", "resetPassword", "changePassword", "actor", "assignRoleInternal", "clearMustChangePassword", "setupRoot", "findPasswordAccount", "afterPasswordReset", "passwordAccountOf", "afterAdminReset", "resetPasswordInternal"], audit: ["recent", "logFromAction", "hitRateLimit", "cleanup"], site: ["snapshot"], settings: ["get", "plugins", "update", "setPlugin", "init"], texts: ["list", "set", "reset"], media: ["generateUploadUrl", "save", "list", "folders", "get", "update", "remove"], pages: ["blockCatalog", "list", "get", "getByPath", "create", "update", "reorderBlocks", "setBlockVisible", "upsertBlock", "removeBlock", "publish", "unpublish", "remove", "restore", "removePermanently"], posts: ["list", "get", "create", "update", "publish", "unpublish", "reorder", "remove", "restore", "removePermanently"], projects: ["list", "get", "create", "update", "publish", "unpublish", "reorder", "remove", "restore", "removePermanently"], services: ["list", "get", "create", "update", "publish", "unpublish", "reorder", "remove", "restore", "removePermanently"], testimonials: ["list", "get", "create", "update", "publish", "unpublish", "reorder", "remove", "restore", "removePermanently"], faq: ["list", "get", "create", "update", "publish", "unpublish", "reorder", "remove", "restore", "removePermanently"], resume: ["list", "get", "create", "update", "publish", "unpublish", "reorder", "remove", "restore", "removePermanently"], routine: ["list", "get", "create", "update", "publish", "unpublish", "reorder", "remove", "restore", "removePermanently"], plans: ["list", "get", "create", "update", "publish", "unpublish", "reorder", "remove", "restore", "removePermanently"], team: ["list", "get", "create", "update", "publish", "unpublish", "reorder", "remove", "restore", "removePermanently"], contacts: ["list", "get", "unreadCount", "markRead", "markUnread", "archive", "unarchive", "remove", "destinations", "setDestinations", "failedDeliveries", "retryDelivery", "publicConfig", "submit", "deliveryContext", "deliver", "recordAttempt", "cleanup"], testimonialIntake: ["list", "approve", "reject", "submit"], privacy: ["exportData", "erase", "policyStatus", "policyDraft", "generatePolicy"], publish: ["status", "trigger", "begin", "finish", "markPublished"], translation: ["translate", "translateDocument", "applyDocument", "prepare", "apply"], commerce: ["notifyAdmin", "siteOrigins", "access", "recordInvalidWebhook", "exportPersonalData", "erasePersonalData"], proposals: ["list", "get", "versions", "getAcceptance", "create", "update", "resetPassword", "remove", "restore", "removePermanently", "getPublic", "checkSession", "generateSignatureUploadUrl", "getAcceptanceByToken", "createSession", "accept", "invalidateSessions", "cleanupExpiredSessions"], contractTemplates: ["list", "get", "getDefault", "create", "update", "remove", "setDefault", "seedDefault"], checkouts: ["status", "list", "get", "create", "remove", "restore", "removePermanently", "linkPlan", "unlinkPlan", "listLinks", "getByLink", "initiatePayment", "startFromLink", "getById", "claimPayment", "releasePayment", "setCustomerId", "clearCharge", "patchGatewayData", "markPaidByLink", "markRefundedByLink", "expireOldCheckouts", "cleanupPaymentEvents"], asaas: ["createCustomer", "createCharge", "deleteCharge", "listCustomers", "adminCreateCustomer", "adminDeleteCustomer", "listCharges", "getCharge", "adminCreateCharge", "cancelCharge", "listInvoices"], aiResumes: ["list", "get", "generate", "remove", "restore", "removePermanently", "cvSource", "save"], panel: ["validatePage", "mediaUsage", "replaceMedia"], seed: ["status", "apply", "patchSettings"] };
|
|
16
|
+
define_CORE_MODULES_default = { users: ["isSetupRequired", "me", "list", "create", "setRole", "remove", "suspend", "reactivate", "resetPassword", "changePassword", "actor", "assignRoleInternal", "clearMustChangePassword", "setupRoot", "findPasswordAccount", "afterPasswordReset", "passwordAccountOf", "afterAdminReset", "resetPasswordInternal"], audit: ["recent", "logFromAction", "hitRateLimit", "cleanup"], site: ["snapshot"], settings: ["get", "plugins", "update", "setPlugin", "init"], texts: ["list", "set", "reset"], media: ["generateUploadUrl", "save", "list", "folders", "get", "update", "normalizeFolders", "remove"], pages: ["blockCatalog", "list", "get", "getByPath", "create", "update", "reorderBlocks", "setBlockVisible", "upsertBlock", "removeBlock", "publish", "unpublish", "remove", "restore", "removePermanently"], posts: ["list", "get", "create", "update", "publish", "unpublish", "reorder", "remove", "restore", "removePermanently"], projects: ["list", "get", "create", "update", "publish", "unpublish", "reorder", "remove", "restore", "removePermanently"], services: ["list", "get", "create", "update", "publish", "unpublish", "reorder", "remove", "restore", "removePermanently"], testimonials: ["list", "get", "create", "update", "publish", "unpublish", "reorder", "remove", "restore", "removePermanently"], faq: ["list", "get", "create", "update", "publish", "unpublish", "reorder", "remove", "restore", "removePermanently"], resume: ["list", "get", "create", "update", "publish", "unpublish", "reorder", "remove", "restore", "removePermanently"], routine: ["list", "get", "create", "update", "publish", "unpublish", "reorder", "remove", "restore", "removePermanently"], plans: ["list", "get", "create", "update", "publish", "unpublish", "reorder", "remove", "restore", "removePermanently"], team: ["list", "get", "create", "update", "publish", "unpublish", "reorder", "remove", "restore", "removePermanently"], contacts: ["list", "get", "unreadCount", "markRead", "markUnread", "archive", "unarchive", "remove", "destinations", "setDestinations", "failedDeliveries", "retryDelivery", "publicConfig", "submit", "deliveryContext", "deliver", "recordAttempt", "cleanup"], testimonialIntake: ["list", "approve", "reject", "submit"], privacy: ["exportData", "erase", "policyStatus", "policyDraft", "generatePolicy"], publish: ["status", "trigger", "begin", "finish", "markPublished"], translation: ["translate", "translateDocument", "applyDocument", "prepare", "apply"], commerce: ["notifyAdmin", "siteOrigins", "access", "recordInvalidWebhook", "exportPersonalData", "erasePersonalData"], proposals: ["list", "get", "versions", "getAcceptance", "create", "update", "resetPassword", "remove", "restore", "removePermanently", "getPublic", "checkSession", "generateSignatureUploadUrl", "getAcceptanceByToken", "createSession", "accept", "invalidateSessions", "cleanupExpiredSessions"], contractTemplates: ["list", "get", "getDefault", "create", "update", "remove", "setDefault", "seedDefault"], checkouts: ["status", "list", "get", "create", "remove", "restore", "removePermanently", "linkPlan", "unlinkPlan", "listLinks", "getByLink", "initiatePayment", "startFromLink", "getById", "claimPayment", "releasePayment", "setCustomerId", "clearCharge", "patchGatewayData", "markPaidByLink", "markRefundedByLink", "expireOldCheckouts", "cleanupPaymentEvents"], asaas: ["createCustomer", "createCharge", "deleteCharge", "listCustomers", "adminCreateCustomer", "adminDeleteCustomer", "listCharges", "getCharge", "adminCreateCharge", "cancelCharge", "listInvoices"], aiResumes: ["list", "get", "generate", "remove", "restore", "removePermanently", "cvSource", "save"], panel: ["validatePage", "mediaUsage", "replaceMedia"], seed: ["status", "apply", "patchSettings"] };
|
|
17
17
|
}
|
|
18
18
|
});
|
|
19
19
|
|
|
@@ -496,7 +496,7 @@ var init_telemetry = __esm({
|
|
|
496
496
|
TELEMETRY_DOCS = "https://userubrica.vercel.app/docs/guia/telemetria";
|
|
497
497
|
TELEMETRY_TIMEOUT_MS = 2e3;
|
|
498
498
|
FORMAT_VERSION = 1;
|
|
499
|
-
CLI_VERSION = true ? "2.1.
|
|
499
|
+
CLI_VERSION = true ? "2.1.2" : "0.0.0";
|
|
500
500
|
OFF_VALUES = ["0", "false", "nao", "n\xE3o", "off", "desligada", "desligado"];
|
|
501
501
|
isOn = (value) => value !== void 0 && value !== "" && !["0", "false"].includes(value.toLowerCase());
|
|
502
502
|
NOTICE = `O Rubrica manda, sem dados pessoais, as escolhas feitas no CLI (tipo, tema, cores, plugins) para saber o que as pessoas mais usam.
|
|
@@ -934,7 +934,7 @@ var init_package = __esm({
|
|
|
934
934
|
"../core/package.json"() {
|
|
935
935
|
package_default = {
|
|
936
936
|
name: "@rubrica/core",
|
|
937
|
-
version: "2.1.
|
|
937
|
+
version: "2.1.2",
|
|
938
938
|
description: "N\xFAcleo do Rubrica: contrato de blocos e temas, idiomas, integra\xE7\xE3o Astro, backend Convex, painel e MCP.",
|
|
939
939
|
type: "module",
|
|
940
940
|
license: "GPL-3.0-only",
|
|
@@ -3589,7 +3589,7 @@ var init_files = __esm({
|
|
|
3589
3589
|
PEERS = package_default.peerDependencies;
|
|
3590
3590
|
MCP_VERSION = package_default2.version;
|
|
3591
3591
|
defaultDependencySpecs = () => ({ core: `^${CORE_VERSION}`, theme: `^${CORE_VERSION}`, cli: `^${CLI_PACKAGE_VERSION}`, mcp: `^${MCP_VERSION}` });
|
|
3592
|
-
CLI_PACKAGE_VERSION = true ? "2.1.
|
|
3592
|
+
CLI_PACKAGE_VERSION = true ? "2.1.2" : CORE_VERSION;
|
|
3593
3593
|
MARK = {
|
|
3594
3594
|
themeStart: "// rubrica:tema:inicio",
|
|
3595
3595
|
themeEnd: "// rubrica:tema:fim",
|
|
@@ -4659,6 +4659,19 @@ Corrija e rode de novo: npx create-rubrica publicar`);
|
|
|
4659
4659
|
}
|
|
4660
4660
|
if (copied.length) log2.info(`Levei para o site publicado as integra\xE7\xF5es do computador: ${copied.join(", ")}.`);
|
|
4661
4661
|
};
|
|
4662
|
+
const syncBuildNotice = () => {
|
|
4663
|
+
let secret = convexEnvGet(prod, CALLBACK_SECRET);
|
|
4664
|
+
if (!secret) {
|
|
4665
|
+
secret = randomBytes3(32).toString("hex");
|
|
4666
|
+
convexEnvSet(prod, CALLBACK_SECRET, secret);
|
|
4667
|
+
}
|
|
4668
|
+
try {
|
|
4669
|
+
vercel(["env", "add", CALLBACK_SECRET, "production", "--value", secret, "--yes", "--force", "--sensitive"]);
|
|
4670
|
+
} catch (err) {
|
|
4671
|
+
log2.warn(`N\xE3o deu para gravar o ${CALLBACK_SECRET} na Vercel (o painel sai de "publicando" sozinho em alguns minutos):
|
|
4672
|
+
${tail(errorOutput(err))}`);
|
|
4673
|
+
}
|
|
4674
|
+
};
|
|
4662
4675
|
const configurePublishButton = async () => {
|
|
4663
4676
|
if (convexEnvGet(prod, "RUBRICA_DEPLOY_HOOK_URL")) return;
|
|
4664
4677
|
note2(
|
|
@@ -4683,6 +4696,7 @@ Corrija e rode de novo: npx create-rubrica publicar`);
|
|
|
4683
4696
|
if (!await confirm2("Publicar de novo com as mudan\xE7as que voc\xEA fez?", true)) throw new Cancelled(NOTHING);
|
|
4684
4697
|
ensureLogin();
|
|
4685
4698
|
syncIntegrations();
|
|
4699
|
+
syncBuildNotice();
|
|
4686
4700
|
await configurePublishButton();
|
|
4687
4701
|
deploy();
|
|
4688
4702
|
const siteUrl2 = productionUrl();
|
|
@@ -4765,6 +4779,7 @@ ${tail(errorOutput(err))}`);
|
|
|
4765
4779
|
for (const [key, value, sensitive] of vercelEnv) {
|
|
4766
4780
|
vercel(["env", "add", key, "production", "--value", value, "--yes", "--force", ...sensitive ? ["--sensitive"] : []]);
|
|
4767
4781
|
}
|
|
4782
|
+
syncBuildNotice();
|
|
4768
4783
|
updateState(projectDir, { producao: { convexUrl: urls.convexUrl, siteUrl } });
|
|
4769
4784
|
await configurePublishButton();
|
|
4770
4785
|
deploy();
|
|
@@ -4780,7 +4795,7 @@ ${tail(errorOutput(err))}`);
|
|
|
4780
4795
|
].join("\n")
|
|
4781
4796
|
);
|
|
4782
4797
|
}
|
|
4783
|
-
var NOTHING, DEPLOY_KEY_NAME, VERCELIGNORE;
|
|
4798
|
+
var NOTHING, DEPLOY_KEY_NAME, CALLBACK_SECRET, VERCELIGNORE;
|
|
4784
4799
|
var init_publish = __esm({
|
|
4785
4800
|
"src/commands/publish.ts"() {
|
|
4786
4801
|
"use strict";
|
|
@@ -4794,6 +4809,7 @@ var init_publish = __esm({
|
|
|
4794
4809
|
init_setup();
|
|
4795
4810
|
NOTHING = "Nada foi publicado.";
|
|
4796
4811
|
DEPLOY_KEY_NAME = "rubrica-vercel";
|
|
4812
|
+
CALLBACK_SECRET = "RUBRICA_DEPLOY_CALLBACK_SECRET";
|
|
4797
4813
|
VERCELIGNORE = ".env*\n!.env.example\nnode_modules\n.rubrica\n";
|
|
4798
4814
|
}
|
|
4799
4815
|
});
|
|
@@ -7544,6 +7560,10 @@ function toHtml(text2) {
|
|
|
7544
7560
|
const esc = (s) => s.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">");
|
|
7545
7561
|
return text2.split(/\n\s*\n/).map((p) => p.trim()).filter(Boolean).map((p) => `<p>${esc(p).replace(/\n/g, "<br>")}</p>`).join("");
|
|
7546
7562
|
}
|
|
7563
|
+
function mediaFolderPath(path5) {
|
|
7564
|
+
const parts = (typeof path5 === "string" ? path5 : "").split("/").map((p) => p.trim().replace(/[^\p{L}\p{N}_ -]/gu, "-").slice(0, 60).trim()).filter(Boolean).slice(0, 6);
|
|
7565
|
+
return parts.length ? `/${parts.join("/")}` : "/";
|
|
7566
|
+
}
|
|
7547
7567
|
function slugify(text2) {
|
|
7548
7568
|
return text2.normalize("NFD").replace(/[̀-ͯ]/g, "").toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "").slice(0, 80) || "item";
|
|
7549
7569
|
}
|
|
@@ -8146,7 +8166,7 @@ var init_convert = __esm({
|
|
|
8146
8166
|
this.tables = tables;
|
|
8147
8167
|
this.projectTexts = projectTexts;
|
|
8148
8168
|
for (const f of storage) if (typeof f.internalId === "string" && typeof f._id === "string") this.storageByUrlId.set(f.internalId, f._id);
|
|
8149
|
-
for (const f of tables.imageFolders ?? []) this.folders.set(f._id, f.path);
|
|
8169
|
+
for (const f of tables.imageFolders ?? []) this.folders.set(f._id, mediaFolderPath(f.path));
|
|
8150
8170
|
for (const m of tables.imageMetadata ?? []) this.media.set(m._id, m);
|
|
8151
8171
|
for (const t of tables.siteTexts ?? []) this.siteTexts.set(t.key, t);
|
|
8152
8172
|
for (const h of tables.homeContent ?? []) this.home.set(h.key, h.value);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-rubrica",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.2",
|
|
4
4
|
"description": "CLI do Rubrica v2: cria, configura, publica, atualiza e migra sites feitos com @rubrica/core",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
"tsup": "^8.3.0",
|
|
47
47
|
"typescript": "^5.9.0",
|
|
48
48
|
"vitest": "^3.2.4",
|
|
49
|
-
"@rubrica/core": "^2.1.
|
|
49
|
+
"@rubrica/core": "^2.1.2"
|
|
50
50
|
},
|
|
51
51
|
"scripts": {
|
|
52
52
|
"build": "tsup",
|