spec-up-t 1.1.12 → 1.1.13

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.
@@ -100,13 +100,13 @@ function fetchCommitHashes() {
100
100
  .then(response => {
101
101
  if (response.status === 403 && response.headers.get('X-RateLimit-Remaining') === '0') {
102
102
  const resetTime = new Date(response.headers.get('X-RateLimit-Reset') * 1000);
103
- console.error(`\n❌ Github API rate limit exceeded. Try again after ${resetTime}. See https://trustoverip.github.io/spec-up-t-website/docs/getting-started/github-token for more info.` + "\n");
103
+ console.error(`❌ Github API rate limit exceeded. Try again after ${resetTime}. See https://trustoverip.github.io/spec-up-t-website/docs/getting-started/github-token for more info.`);
104
104
 
105
105
  // Call the debounced error function
106
106
  debouncedError();
107
107
  return true;
108
108
  } else {
109
- console.log(`\nℹ️ Github API rate limit: ${response.headers.get('X-RateLimit-Remaining')} requests remaining. See https://trustoverip.github.io/spec-up-t-website/docs/getting-started/github-token for more info.` + "\n");
109
+ console.log(`ℹ️ Github API rate limit: ${response.headers.get('X-RateLimit-Remaining')} requests remaining. See https://trustoverip.github.io/spec-up-t-website/docs/getting-started/github-token for more info.`);
110
110
  }
111
111
 
112
112
  return response.json();
@@ -174,12 +174,12 @@ function fetchCommitHashes() {
174
174
 
175
175
  if (response.status === 403 && response.headers.get('X-RateLimit-Remaining') === '0') {
176
176
  const resetTime = new Date(response.headers.get('X-RateLimit-Reset') * 1000);
177
- console.error(`❌ Github API rate limit exceeded. Try again after ${resetTime}. See https://trustoverip.github.io/spec-up-t-website/docs/getting-started/github-token for more info.` + "\n");
177
+ console.error(`❌ Github API rate limit exceeded. Try again after ${resetTime}. See https://trustoverip.github.io/spec-up-t-website/docs/getting-started/github-token for more info.`);
178
178
 
179
179
  debouncedError();
180
180
  return true;
181
181
  } else {
182
- console.log(`ℹ️ Github API rate limit: ${response.headers.get('X-RateLimit-Remaining')} requests remaining. See https://trustoverip.github.io/spec-up-t-website/docs/getting-started/github-token for more info.` + "\n");
182
+ console.log(`ℹ️ Github API rate limit: ${response.headers.get('X-RateLimit-Remaining')} requests remaining. See https://trustoverip.github.io/spec-up-t-website/docs/getting-started/github-token for more info.`);
183
183
  }
184
184
 
185
185
  const data = await response.json();
package/index.js CHANGED
@@ -246,7 +246,7 @@ module.exports = async function (options = {}) {
246
246
  try {
247
247
  noticeTitles = {};
248
248
  specGroups = {};
249
- console.log('\nℹ️ Rendering: ' + spec.title + "\n");
249
+ console.log('ℹ️ Rendering: ' + spec.title);
250
250
 
251
251
  function interpolate(template, variables) {
252
252
  return template.replace(/\${(.*?)}/g, (match, p1) => variables[p1.trim()]);
@@ -314,7 +314,7 @@ module.exports = async function (options = {}) {
314
314
  });
315
315
  }
316
316
  catch (e) {
317
- console.error("\n❌ " + e + "\n");
317
+ console.error("❌ " + e);
318
318
  }
319
319
  }
320
320
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "spec-up-t",
3
- "version": "1.1.12",
3
+ "version": "1.1.13",
4
4
  "description": "Technical specification drafting tool that generates rich specification documents from markdown. Forked from https://github.com/decentralized-identity/spec-up by Daniel Buchner (https://github.com/csuwildcat)",
5
5
  "main": "./index",
6
6
  "repository": {
@@ -84,7 +84,7 @@ function askRemoveEntry() {
84
84
  // Function to show current external references
85
85
  function showReferences() {
86
86
  const data = JSON.parse(fs.readFileSync(JSON_FILE, 'utf8'));
87
- console.log('\nCurrent external references (xref):\n\n');
87
+ console.log('Current external references (xref):');
88
88
 
89
89
  data.specs[0].external_specs.forEach(spec => {
90
90
  console.log('--- External Reference: ---');
@@ -119,7 +119,7 @@ function collectExternalReferences(options = {}) {
119
119
  // Function to extend xtref objects with additional information, such as repository URL and directory information.
120
120
  function extendXTrefs(config, xtrefs) {
121
121
  if (config.specs[0].external_specs_repos) {
122
- console.log("ℹ️ PLEASE NOTE: Your specs.json file is outdated (not your fault, we changed something). Use this one: https://github.com/trustoverip/spec-up-t-starter-pack/blob/main/spec-up-t-boilerplate/specs.json or e-mail kor@dwarshuis.com for help. \n");
122
+ console.log("ℹ️ PLEASE NOTE: Your specs.json file is outdated (not your fault, we changed something). Use this one: https://github.com/trustoverip/spec-up-t-starter-pack/blob/main/spec-up-t-boilerplate/specs.json or e-mail kor@dwarshuis.com for help.");
123
123
  return;
124
124
  }
125
125
 
@@ -5,12 +5,12 @@ function checkRateLimit(response) {
5
5
 
6
6
  if (response.status === 403 && remaining === '0') {
7
7
  const resetTime = new Date(reset * 1000);
8
- console.error(`❌ Github API rate limit exceeded. Try again after ${resetTime}. See https://trustoverip.github.io/spec-up-t-website/docs/getting-started/github-token for more info.\n`);
8
+ console.error(`❌ Github API rate limit exceeded. Try again after ${resetTime}. See https://trustoverip.github.io/spec-up-t-website/docs/getting-started/github-token for more info.`);
9
9
  return true;
10
10
  } else if (remaining !== null) {
11
- console.log(`ℹ️ Github API rate limit: ${remaining} requests remaining. See https://trustoverip.github.io/spec-up-t-website/docs/getting-started/github-token for more info.\n`);
11
+ console.log(`ℹ️ Github API rate limit: ${remaining} requests remaining. See https://trustoverip.github.io/spec-up-t-website/docs/getting-started/github-token for more info.`);
12
12
  } else {
13
- console.warn(`ℹ️ Unable to determine rate limit status. Check your GitHub API token and network connection.\n`);
13
+ console.warn(`ℹ️ Unable to determine rate limit status. Check your GitHub API token and network connection.`);
14
14
  }
15
15
  return false;
16
16
  }
@@ -6,7 +6,7 @@ function setupFetchHeaders(GITHUB_API_TOKEN) {
6
6
  if (GITHUB_API_TOKEN) {
7
7
  fetchHeaders['Authorization'] = `token ${GITHUB_API_TOKEN}`;
8
8
  } else {
9
- console.log('ℹ️ There is no GitHub token set up. Therefore, you are more likely to be at your limit of GitHub API requests. If you run into the limit, create a token and search the documentation on this topic.\n');
9
+ console.log('ℹ️ There is no GitHub token set up. Therefore, you are more likely to be at your limit of GitHub API requests. If you run into the limit, create a token and search the documentation on this topic.');
10
10
  }
11
11
 
12
12
  return fetchHeaders;
package/src/create-pdf.js CHANGED
@@ -197,8 +197,8 @@ const pdfLib = require('pdf-lib');
197
197
  const optimizedPdfBytes = await pdfDoc.save();
198
198
  fs.writeFileSync('docs/index.pdf', optimizedPdfBytes);
199
199
 
200
- console.log('✅ PDF generated successfully! Find the PDF in the same directory as the index.html file.' + "\n");
200
+ console.log('✅ PDF generated successfully! Find the PDF in the same directory as the index.html file.');
201
201
  } catch (error) {
202
- console.error('❌ Error generating PDF:', error + "\n");
202
+ console.error('❌ Error generating PDF:', error);
203
203
  }
204
204
  })();
@@ -33,7 +33,7 @@ function createTermIndex() {
33
33
 
34
34
  fs.writeJsonSync(outputPathJSON, filePaths, { spaces: 2 });
35
35
 
36
- console.log(`✅ The new terms were added. All done.` + "\n");
36
+ console.log(`✅ The new terms were added. All done.`);
37
37
  }
38
38
 
39
39
  module.exports = {
@@ -71,9 +71,9 @@ function createVersionsIndex(outputPath) {
71
71
  const indexPath = path.join(versionsDir, 'index.html');
72
72
  fs.writeFile(indexPath, htmlContent, (err) => {
73
73
  if (err) {
74
- console.error(`❌ Error writing index file: ${err}\n`);
74
+ console.error(`❌ Error writing index file: ${err}`);
75
75
  } else {
76
- console.log(`✅ Index file created at ${indexPath}\n`);
76
+ console.log(`✅ Index file created at ${indexPath}`);
77
77
  }
78
78
  });
79
79
  }
@@ -77,12 +77,12 @@ function fixMarkdownFiles(directory) {
77
77
  fs.writeFileSync(itemPath, data, 'utf8');
78
78
  }
79
79
  } catch (err) {
80
- console.error(`❌ Error while trying to fix the markdown in file ${item.name}: ${err}` + "\n");
80
+ console.error(`❌ Error while trying to fix the markdown in file ${item.name}: ${err}`);
81
81
  }
82
82
  }
83
83
  });
84
84
  } catch (err) {
85
- console.error(`❌ Error reading directory: ${err}` + "\n");
85
+ console.error(`❌ Error reading directory: ${err}`);
86
86
  }
87
87
  }
88
88
 
package/src/freeze.js CHANGED
@@ -87,4 +87,4 @@ const destFile = path.join(newVersionDir, 'index.html');
87
87
  fs.copyFileSync(sourceFile, destFile);
88
88
 
89
89
  // Log a message indicating the file has been copied
90
- console.log(`✅ Created a freezed specification version in ${destFile}\n`);
90
+ console.log(`✅ Created a freezed specification version in ${destFile}`);
@@ -34,7 +34,7 @@ function checkKeysSync(object, expectedKeys, parentKey = '') {
34
34
  } else if (typeof object === 'object') {
35
35
  // If the key is missing from the object, log an error
36
36
  if (!(key in object)) {
37
- console.error(`❌ Error: Missing key '${key}' in ${parentKey}\n We cannot guarantee that Spec-Up-T will work properly.\n Here is an example specs.json file:\n https://github.com/trustoverip/spec-up-t-starter-pack/blob/main/spec-up-t-boilerplate/specs.json` + "\n");
37
+ console.error(`❌ Error: Missing key '${key}' in ${parentKey}\n We cannot guarantee that Spec-Up-T will work properly.\n Here is an example specs.json file:\n https://github.com/trustoverip/spec-up-t-starter-pack/blob/main/spec-up-t-boilerplate/specs.json`);
38
38
  errorFound = true;
39
39
  pauseForEnterSync(); // Pause synchronously to allow user to acknowledge the error
40
40
  }
@@ -85,7 +85,7 @@ function runJsonKeyValidatorSync() {
85
85
 
86
86
  // Iterate over each spec entry in the specs array from the JSON file
87
87
  for (let [index, spec] of data.specs.entries()) {
88
- console.log(`ℹ️ Checking spec #${index + 1}` + "\n");
88
+ console.log(`ℹ️ Checking spec #${index + 1}`);
89
89
 
90
90
  // Check for keys defined in expectedKeys.specs
91
91
  checkKeysSync(spec, expectedKeys.specs, `specs[${index}]`);
@@ -108,7 +108,7 @@ function runJsonKeyValidatorSync() {
108
108
 
109
109
  // If no errors were found, print a success message
110
110
  if (!errorFound) {
111
- console.log('✅ All keys are present. No errors found. Continuing…' + "\n");
111
+ console.log('✅ All keys are present. No errors found. Continuing…');
112
112
  }
113
113
  }
114
114
 
@@ -111,12 +111,12 @@ ${localXTrefContent.content}
111
111
  }
112
112
  } catch (err) {
113
113
  fs.writeFileSync(itemPath, match[0] + '\n\n' + '<!-- This is a copy of the saved remote text. Remove it if you like. It is automatically (re)generated -->\n\nNothing found, so nothing to show.', 'utf8');
114
- // console.error(`❌ Error reading or writing file ${item.name}: ${err}` + "\n");
114
+ // console.error(`❌ Error reading or writing file ${item.name}: ${err}`);
115
115
  }
116
116
  }
117
117
  });
118
118
  } catch (err) {
119
- console.error(`❌ Error reading directory: ${err}` + "\n");
119
+ console.error(`❌ Error reading directory: ${err}`);
120
120
  }
121
121
  }
122
122
 
package/src/references.js CHANGED
@@ -16,7 +16,7 @@ function validateReferences(references, definitions, render) {
16
16
  }
17
17
  );
18
18
  if (unresolvedRefs.length > 0 ) {
19
- console.log('ℹ️ Unresolved References: ', unresolvedRefs + "\n")
19
+ console.log('ℹ️ Unresolved References: ', unresolvedRefs)
20
20
  }
21
21
 
22
22
  const danglingDefs = [];
@@ -27,7 +27,7 @@ function validateReferences(references, definitions, render) {
27
27
  }
28
28
  })
29
29
  if(danglingDefs.length > 0) {
30
- console.log('ℹ️ Dangling Definitions: ', danglingDefs + "\n")
30
+ console.log('ℹ️ Dangling Definitions: ', danglingDefs)
31
31
  }
32
32
  }
33
33
 
@@ -65,7 +65,7 @@ async function fetchExternalSpecs(spec) {
65
65
  createNewDLWithTerms(Object.keys(r)[0], Object.values(r)[0])
66
66
  );
67
67
  } catch (e) {
68
- console.log("❌ " + e + "\n");
68
+ console.log("❌ " + e);
69
69
  return []; // Return an empty array in case of errors
70
70
  }
71
71
  }