@specatlas/core 0.1.6 → 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.
Files changed (2) hide show
  1. package/dist/index.js +8 -3
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -3080,6 +3080,8 @@ async function generatePresentation(opts) {
3080
3080
  const mockupInfo = await copyMockups(root, change, mockupsCopyDir);
3081
3081
  const proposalRaw = await readTextIfExists(path12.join(change.dir, "proposal.md"));
3082
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);
3083
3085
  const labels = labelsFor(language);
3084
3086
  const html = page({
3085
3087
  language,
@@ -3096,7 +3098,8 @@ async function generatePresentation(opts) {
3096
3098
  evidence: new Map((change.verify?.evidence ?? []).map((e) => [e.scenario, e.result])),
3097
3099
  mockups: mockupInfo.screens,
3098
3100
  screenshots: mockupInfo.screenshots,
3099
- 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 ?? "" } } : {}
3100
3103
  });
3101
3104
  const outFile = path12.join(presentationDir, "index.html");
3102
3105
  await writeText(outFile, html);
@@ -3147,6 +3150,7 @@ function labelsFor(language) {
3147
3150
  mockups: "Mockups",
3148
3151
  approve: "Approval",
3149
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.",
3150
3154
  command: "Command",
3151
3155
  hash: "Hash",
3152
3156
  generated: "Generated",
@@ -3168,6 +3172,7 @@ function labelsFor(language) {
3168
3172
  mockups: "Mockups",
3169
3173
  approve: "Aprobaci\xF3n",
3170
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.",
3171
3176
  command: "Comando",
3172
3177
  hash: "Hash",
3173
3178
  generated: "Generado",
@@ -3283,8 +3288,8 @@ function page(input) {
3283
3288
 
3284
3289
  <section>
3285
3290
  <h2>${esc(l.approve)}</h2>
3286
- <div class="callout">${esc(l.approveText)}</div>
3287
- <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>`}
3288
3293
  </section>
3289
3294
 
3290
3295
  <footer>SpecAtlas \xB7 ${esc(input.project)} \xB7 ${esc(input.generatedAt)}</footer>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@specatlas/core",
3
- "version": "0.1.6",
3
+ "version": "0.1.7",
4
4
  "description": "Kernel determinista de SpecAtlas: parsing, validación, trazabilidad, olas y ciclo de vida",
5
5
  "license": "MIT",
6
6
  "type": "module",