@specatlas/core 0.1.5 → 0.1.7
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.d.ts +1 -0
- package/dist/index.js +12 -4
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -1042,10 +1042,11 @@ function deriveState(input) {
|
|
|
1042
1042
|
}
|
|
1043
1043
|
if (approval.status === "missing" || approval.status === "stale") {
|
|
1044
1044
|
blockedBy.push(approval.status === "stale" ? "la firma de la spec qued\xF3 obsoleta (el archivo cambi\xF3)" : "la spec no est\xE1 aprobada");
|
|
1045
|
+
const presented = change.presentationPath !== void 0;
|
|
1045
1046
|
return {
|
|
1046
1047
|
state: "awaiting_approval",
|
|
1047
1048
|
blockedBy,
|
|
1048
|
-
nextAction: next(`satlas present ${change.slug}`, "Presentar la propuesta y firmar la aprobaci\xF3n (satlas approve)"),
|
|
1049
|
+
nextAction: presented ? next(`satlas approve ${change.slug} --by "<nombre>"`, "Firmar la aprobaci\xF3n (la presentaci\xF3n ya est\xE1 generada)") : next(`satlas present ${change.slug}`, "Presentar la propuesta y firmar la aprobaci\xF3n (satlas approve)"),
|
|
1049
1050
|
progress
|
|
1050
1051
|
};
|
|
1051
1052
|
}
|
|
@@ -1280,6 +1281,8 @@ async function loadChange(root, slug, relDir) {
|
|
|
1280
1281
|
if (await exists(planFile)) change.planPath = planFile;
|
|
1281
1282
|
const reviewFile = path4.join(dir, "review.md");
|
|
1282
1283
|
if (await exists(reviewFile)) change.reviewPath = reviewFile;
|
|
1284
|
+
const presentationFile = path4.join(dir, "presentation", "index.html");
|
|
1285
|
+
if (await exists(presentationFile)) change.presentationPath = presentationFile;
|
|
1283
1286
|
const tasksFile = path4.join(dir, "tasks.md");
|
|
1284
1287
|
const tasksRaw = await readTextIfExists(tasksFile);
|
|
1285
1288
|
if (tasksRaw !== void 0) {
|
|
@@ -3077,6 +3080,8 @@ async function generatePresentation(opts) {
|
|
|
3077
3080
|
const mockupInfo = await copyMockups(root, change, mockupsCopyDir);
|
|
3078
3081
|
const proposalRaw = await readTextIfExists(path12.join(change.dir, "proposal.md"));
|
|
3079
3082
|
const proposalBody = proposalRaw ? parseFrontmatter(proposalRaw).body : "";
|
|
3083
|
+
const approvals = await loadApprovals(path12.join(root, ".sdd"));
|
|
3084
|
+
const approval = verifyApproval(change, approvals.byArtifact, config, deltaContent);
|
|
3080
3085
|
const labels = labelsFor(language);
|
|
3081
3086
|
const html = page({
|
|
3082
3087
|
language,
|
|
@@ -3093,7 +3098,8 @@ async function generatePresentation(opts) {
|
|
|
3093
3098
|
evidence: new Map((change.verify?.evidence ?? []).map((e) => [e.scenario, e.result])),
|
|
3094
3099
|
mockups: mockupInfo.screens,
|
|
3095
3100
|
screenshots: mockupInfo.screenshots,
|
|
3096
|
-
approveHint: `satlas approve ${change.slug} --by "<nombre>" --channel presentation
|
|
3101
|
+
approveHint: `satlas approve ${change.slug} --by "<nombre>" --channel presentation`,
|
|
3102
|
+
...approval.status === "valid" && approval.approvedBy ? { approval: { by: approval.approvedBy, at: approval.approvedAt ?? "" } } : {}
|
|
3097
3103
|
});
|
|
3098
3104
|
const outFile = path12.join(presentationDir, "index.html");
|
|
3099
3105
|
await writeText(outFile, html);
|
|
@@ -3144,6 +3150,7 @@ function labelsFor(language) {
|
|
|
3144
3150
|
mockups: "Mockups",
|
|
3145
3151
|
approve: "Approval",
|
|
3146
3152
|
approveText: "This proposal is approved by signing the spec (hash + author). Any later change invalidates the signature.",
|
|
3153
|
+
approveDone: "Approved by {by} on {at}. Any later change invalidates the signature.",
|
|
3147
3154
|
command: "Command",
|
|
3148
3155
|
hash: "Hash",
|
|
3149
3156
|
generated: "Generated",
|
|
@@ -3165,6 +3172,7 @@ function labelsFor(language) {
|
|
|
3165
3172
|
mockups: "Mockups",
|
|
3166
3173
|
approve: "Aprobaci\xF3n",
|
|
3167
3174
|
approveText: "Esta propuesta se aprueba firmando la spec (hash + autor). Cualquier cambio posterior invalida la firma.",
|
|
3175
|
+
approveDone: "Aprobada por {by} el {at}. Cualquier cambio posterior invalida la firma.",
|
|
3168
3176
|
command: "Comando",
|
|
3169
3177
|
hash: "Hash",
|
|
3170
3178
|
generated: "Generado",
|
|
@@ -3280,8 +3288,8 @@ function page(input) {
|
|
|
3280
3288
|
|
|
3281
3289
|
<section>
|
|
3282
3290
|
<h2>${esc(l.approve)}</h2>
|
|
3283
|
-
|
|
3284
|
-
<p>${esc(l.command)}: <code>${esc(input.approveHint)}</code></p
|
|
3291
|
+
${input.approval ? `<div class="callout" style="border-left-color:#15803d;background:rgba(21,128,61,.12)">\u2714 ${esc(l.approveDone.replace("{by}", input.approval.by).replace("{at}", input.approval.at))}</div>` : `<div class="callout">${esc(l.approveText)}</div>
|
|
3292
|
+
<p>${esc(l.command)}: <code>${esc(input.approveHint)}</code></p>`}
|
|
3285
3293
|
</section>
|
|
3286
3294
|
|
|
3287
3295
|
<footer>SpecAtlas \xB7 ${esc(input.project)} \xB7 ${esc(input.generatedAt)}</footer>
|