From 2629d26cca3643a2246bc8fcd4cfd7d4b6430db0 Mon Sep 17 00:00:00 2001 From: Pierre-Anthony Lemieux Date: Thu, 26 Nov 2026 10:43:54 -0800 Subject: [PATCH 1/3] Fix Engineering Report processing --- doc/main.html | 2 +- js/common.mjs | 6 +++--- scripts/build.mjs | 2 +- smpte.js | 15 ++++++------- .../validation/eg-no-pubStage-invalid.html | 20 ++++++++++++++++++ .../er-no-pubStage-draft-valid.html | 20 ++++++++++++++++++ .../validation/er-no-pubStage-pub-valid.html | 21 +++++++++++++++++++ 7 files changed, 74 insertions(+), 12 deletions(-) create mode 100644 test/resources/html/validation/eg-no-pubStage-invalid.html create mode 100644 test/resources/html/validation/er-no-pubStage-draft-valid.html create mode 100644 test/resources/html/validation/er-no-pubStage-pub-valid.html diff --git a/doc/main.html b/doc/main.html index b5b96fb..debeb1e 100644 --- a/doc/main.html +++ b/doc/main.html @@ -558,7 +558,7 @@

Introduction section

The heading shall not be present.

-

When pubType is ST, RP, EG, ER or +

When pubType is ST, RP, EG or RDD, a statement that the clause is entirely informative is generated automatically at the start of the clause. This statement shall not be supplied by the author.

diff --git a/js/common.mjs b/js/common.mjs index f76fec0..4c568c9 100644 --- a/js/common.mjs +++ b/js/common.mjs @@ -35,8 +35,8 @@ export const RDD_PUBTYPE = "RDD"; export const PUB_TYPES = new Set([AG_PUBTYPE, OM_PUBTYPE, ST_PUBTYPE, RP_PUBTYPE, EG_PUBTYPE, ER_PUBTYPE, RDD_PUBTYPE]); export const LONG_PUB_TYPE = new Map([ - [AG_PUBTYPE, "Administrative Guideline"], - [OM_PUBTYPE, "Operations Manual"], + [AG_PUBTYPE, "SMPTE Administrative Guideline"], + [OM_PUBTYPE, "SMPTE Operations Manual"], [ST_PUBTYPE, "SMPTE Standard"], [RP_PUBTYPE, "SMPTE Recommended Practice"], [EG_PUBTYPE, "SMPTE Engineering Guideline"], @@ -44,7 +44,7 @@ export const LONG_PUB_TYPE = new Map([ [RDD_PUBTYPE, "SMPTE Registered Disclosure Document"] ]) -export const ENGDOC_PUBTYPES = new Set([ST_PUBTYPE, RP_PUBTYPE, EG_PUBTYPE, ER_PUBTYPE, RDD_PUBTYPE]); +export const ENGDOC_PUBTYPES = new Set([ST_PUBTYPE, RP_PUBTYPE, EG_PUBTYPE, RDD_PUBTYPE]); /* document types whose Foreword carries the patent rights statement, and hence support pubIPRClaimed */ diff --git a/scripts/build.mjs b/scripts/build.mjs index 1095a70..992e339 100644 --- a/scripts/build.mjs +++ b/scripts/build.mjs @@ -739,7 +739,7 @@ async function main() { generatedFiles.elements.push({ title: element.title.replace(/\s+/g, " "), file: { - path: href, + path: decodeURIComponent(href), mediaType: guessContentTypeFromExtension(href) } }); diff --git a/smpte.js b/smpte.js index cf802a4..ad0726c 100644 --- a/smpte.js +++ b/smpte.js @@ -190,12 +190,12 @@ function insertFrontMatter(docMetadata) { switch (docMetadata.pubType) { case smpte.AG_PUBTYPE: + case smpte.ER_PUBTYPE: case smpte.OM_PUBTYPE: break; case smpte.ST_PUBTYPE: case smpte.RP_PUBTYPE: case smpte.EG_PUBTYPE: - case smpte.ER_PUBTYPE: case smpte.RDD_PUBTYPE: if (docMetadata.pubPart !== null) actualPubNumber += `-${docMetadata.pubPart}`; @@ -230,13 +230,13 @@ function insertFrontMatter(docMetadata) { break; } - const draftWarning = docMetadata.pubStage === smpte.PUB_STAGE_PUB ? "" : SMPTE_DRAFT_WARNING; + const draftWarning = docMetadata.pubStage === smpte.PUB_STAGE_PUB ? "" : smpteDraftWarning(longDocType); let boilerplate; if (docMetadata.pubState === smpte.PUB_STATE_PUB && docMetadata.pubType === smpte.OM_PUBTYPE) boilerplate = SMPTE_PUB_OM_FRONT_MATTER_BOILERPLATE; - else if (docMetadata.pubState === smpte.PUB_STATE_PUB && docMetadata.pubType === smpte.AG_PUBTYPE) + else if (docMetadata.pubState === smpte.PUB_STATE_PUB && (docMetadata.pubType === smpte.AG_PUBTYPE || docMetadata.pubType === smpte.ER_PUBTYPE)) boilerplate = SMPTE_PUB_AG_FRONT_MATTER_BOILERPLATE; else boilerplate = SMPTE_FRONT_MATTER_BOILERPLATE; @@ -919,15 +919,16 @@ const SMPTE_DOC_FOREWORD_BOILERPLATE = `${SMPTE_GEN_FOREWORD_BOILERPLATE} {{authorProse}} ` -const SMPTE_DRAFT_WARNING = ` +function smpteDraftWarning(longDocType) { + return `
Warning: This document is an unpublished work under development and shall not be referred -to as a SMPTE Standard, -Recommended Practice, or Engineering Guideline. It is distributed for review and comment; distribution does not constitute +to as a ${longDocType}. It is distributed for review and comment; distribution does not constitute publication. Recipients of this document are strongly encouraged to submit, with their comments, notification of any relevant patent rights of which they are aware and to provide supporting documentation.
-` +`; +} function insertForeword(docMetadata) { let sec = document.getElementById(SMPTE_FOREWORD_ID); diff --git a/test/resources/html/validation/eg-no-pubStage-invalid.html b/test/resources/html/validation/eg-no-pubStage-invalid.html new file mode 100644 index 0000000..e1f4694 --- /dev/null +++ b/test/resources/html/validation/eg-no-pubStage-invalid.html @@ -0,0 +1,20 @@ + + + + + + + + + + + + + Title of the document + + +
+

This is the scope of the document.

+
+ + diff --git a/test/resources/html/validation/er-no-pubStage-draft-valid.html b/test/resources/html/validation/er-no-pubStage-draft-valid.html new file mode 100644 index 0000000..b1ff647 --- /dev/null +++ b/test/resources/html/validation/er-no-pubStage-draft-valid.html @@ -0,0 +1,20 @@ + + + + + + + + + + + + + Title of the document + + +
+

This is the scope of the document.

+
+ + diff --git a/test/resources/html/validation/er-no-pubStage-pub-valid.html b/test/resources/html/validation/er-no-pubStage-pub-valid.html new file mode 100644 index 0000000..7e99aa3 --- /dev/null +++ b/test/resources/html/validation/er-no-pubStage-pub-valid.html @@ -0,0 +1,21 @@ + + + + + + + + + + + + + + Title of the document + + +
+

This is the scope of the document.

+
+ + From 43933ede82a95be186247f1105aaf13e87144e28 Mon Sep 17 00:00:00 2001 From: Pierre-Anthony Lemieux Date: Thu, 26 Nov 2026 10:48:43 -0800 Subject: [PATCH 2/3] Element link text should show the file name without URI encoding --- smpte.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/smpte.js b/smpte.js index ad0726c..fa9ae8c 100644 --- a/smpte.js +++ b/smpte.js @@ -714,7 +714,12 @@ function insertElementsAnnex(docMetadata) { if (isAbsoluteLink) { e.innerText = href; } else { - e.innerText = href.split('\\').pop().split('/').pop(); + const fileName = href.split('\\').pop().split('/').pop(); + try { + e.innerText = decodeURIComponent(fileName); + } catch { + e.innerText = fileName; + } } e.parentElement.insertBefore( From af24269266a92178c670f712ecb6630ced9f2e43 Mon Sep 17 00:00:00 2001 From: Pierre-Anthony Lemieux Date: Thu, 26 Nov 2026 11:07:50 -0800 Subject: [PATCH 3/3] Fix S3 upload bug --- scripts/build.mjs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/build.mjs b/scripts/build.mjs index 992e339..75c91a8 100644 --- a/scripts/build.mjs +++ b/scripts/build.mjs @@ -138,14 +138,14 @@ function mirrorDirExcludeTooling(srcDir, targetDir, relParentPath) { if (srcStat.isDirectory()) { - s3SyncDir(srcPath, s3Client, bucket, dstKey + "/"); + await s3SyncDir(srcPath, s3Client, bucket, dstKey + "/"); } else if (srcStat.isFile()) { const contentType = guessContentTypeFromExtension(srcPath); const cmd = new PutObjectCommand({ - Body: fs.createReadStream(srcPath), + Body: fs.readFileSync(srcPath), Bucket: bucket, Key: dstKey, ContentType: contentType @@ -315,7 +315,7 @@ async function s3Upload(buildPaths, versionKey, generatedFiles) { pubLinks.libraryZip = `${deployPrefix}${s3PubKeyPrefix}${encodeURIComponent(generatedFiles.libraryZip)}`; } - s3SyncDir(buildPaths.pubDirPath, s3Client, s3Bucket, s3PubKeyPrefix); + await s3SyncDir(buildPaths.pubDirPath, s3Client, s3Bucket, s3PubKeyPrefix); return pubLinks; }