spec-up-t 1.1.11 → 1.1.12

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 SPEC-UP-T: 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(`\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");
104
104
 
105
105
  // Call the debounced error function
106
106
  debouncedError();
107
107
  return true;
108
108
  } else {
109
- console.log(`\n SPEC-UP-T: 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(`\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");
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(`\n SPEC-UP-T: 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.` + "\n");
178
178
 
179
179
  debouncedError();
180
180
  return true;
181
181
  } else {
182
- console.log(`\n SPEC-UP-T: 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.` + "\n");
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 SPEC-UP-T: Rendering: ' + spec.title + "\n");
249
+ console.log('\nℹ️ Rendering: ' + spec.title + "\n");
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 SPEC-UP-T: " + e + "\n");
317
+ console.error("\n " + e + "\n");
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.11",
3
+ "version": "1.1.12",
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": {
@@ -20,22 +20,22 @@ function collectExternalReferences(options = {}) {
20
20
  const GITHUB_API_TOKEN = process.env.GITHUB_API_TOKEN;
21
21
 
22
22
  const explanationPAT =
23
- `\n SPEC-UP-T: No GitHub Personal Access Token (PAT) was found.
23
+ `❌ No GitHub Personal Access Token (PAT) was found.
24
24
 
25
- GitHub requires you to set up a PAT to retrieve external references.
25
+ GitHub requires you to set up a PAT to retrieve external references.
26
26
 
27
- There is no point in continuing without a PAT, so we stop here.
27
+ There is no point in continuing without a PAT, so we stop here.
28
28
 
29
- Find instructions on how to get a PAT at https://trustoverip.github.io/spec-up-t-website/docs/getting-started/github-token
29
+ Find instructions on how to get a PAT at https://trustoverip.github.io/spec-up-t-website/docs/getting-started/github-token
30
30
 
31
31
  `;
32
32
 
33
33
  const explanationNoExternalReferences =
34
- `\n SPEC-UP-T: No external references were found in the specs.json file.
34
+ `\n No external references were found in the specs.json file.
35
35
 
36
- There is no point in continuing without external references, so we stop here.
36
+ There is no point in continuing without external references, so we stop here.
37
37
 
38
- Please add external references to the specs.json file that you will find at the root of your project.
38
+ Please add external references to the specs.json file that you will find at the root of your project.
39
39
 
40
40
  `;
41
41
 
@@ -45,11 +45,11 @@ Please add external references to the specs.json file that you will find at the
45
45
  // Do not run the script if the GitHub API token is not set
46
46
  if (!GITHUB_API_TOKEN) {
47
47
  console.log(explanationPAT);
48
- const userInput = readlineSync.question('Press any key');
48
+ const userInput = readlineSync.question('ℹ️ Press any key');
49
49
 
50
50
  // React to user pressing any key
51
51
  if (userInput.trim() !== '') {
52
- console.log('Stopping...');
52
+ console.log('ℹ️ Stopping...');
53
53
  return;
54
54
  }
55
55
  }
@@ -61,7 +61,7 @@ Please add external references to the specs.json file that you will find at the
61
61
 
62
62
  // React to user pressing any key
63
63
  if (userInput.trim() !== '') {
64
- console.log('Stopping...');
64
+ console.log('ℹ️ Stopping...');
65
65
  return;
66
66
  }
67
67
  } else {
@@ -77,7 +77,8 @@ Please add external references to the specs.json file that you will find at the
77
77
  doesUrlExist(repo.url).then(exists => {
78
78
  if (!exists) {
79
79
  const userInput = readlineSync.question(
80
- ` SPEC-UP-T: This external reference is not a valid URL:
80
+ `❌ This external reference is not a valid URL:
81
+
81
82
  Repository: ${repo.url},
82
83
 
83
84
  Terms directory: ${repo.terms_dir}
@@ -86,12 +87,12 @@ Please add external references to the specs.json file that you will find at the
86
87
 
87
88
  Do you want to stop? (yes/no): `);
88
89
  if (userInput.toLowerCase() === 'yes' || userInput.toLowerCase() === 'y') {
89
- console.log('Stopping...');
90
+ console.log('ℹ️ Stopping...');
90
91
  process.exit(1);
91
92
  }
92
93
  }
93
94
  }).catch(error => {
94
- console.error('\n SPEC-UP-T:Error checking URL existence:', error);
95
+ console.error('Error checking URL existence:', error);
95
96
  });
96
97
  });
97
98
 
@@ -118,7 +119,7 @@ Please add external references to the specs.json file that you will find at the
118
119
  // Function to extend xtref objects with additional information, such as repository URL and directory information.
119
120
  function extendXTrefs(config, xtrefs) {
120
121
  if (config.specs[0].external_specs_repos) {
121
- console.log("\n SPEC-UP-T: 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. \n");
122
123
  return;
123
124
  }
124
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(`\n SPEC-UP-T: 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.\n`);
9
9
  return true;
10
10
  } else if (remaining !== null) {
11
- console.log(`\n SPEC-UP-T: 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.\n`);
12
12
  } else {
13
- console.warn(`\n SPEC-UP-T: 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.\n`);
14
14
  }
15
15
  return false;
16
16
  }
@@ -30,11 +30,11 @@ async function processXTrefsData(allXTrefs, GITHUB_API_TOKEN, outputPathJSON, ou
30
30
  xtref.commitHash = item.sha;
31
31
  xtref.content = item.content;
32
32
  xtref.avatarUrl = item.repository.owner.avatar_url;
33
- console.log(`\n SPEC-UP-T: Match found for term: ${xtref.term} in ${xtref.externalSpec};`);
33
+ console.log(`✅ Match found for term: ${xtref.term} in ${xtref.externalSpec};`);
34
34
  } else {
35
35
  xtref.commitHash = "not found";
36
36
  xtref.content = "This term was not found in the external repository.";
37
- console.log(`\n SPEC-UP-T: No match found for term: ${xtref.term} in ${xtref.externalSpec};`);
37
+ console.log(`ℹ️ No match found for term: ${xtref.term} in ${xtref.externalSpec};`);
38
38
  }
39
39
  }
40
40
 
@@ -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('\n SPEC-UP-T: 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.\n');
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('\n SPEC-UP-T: 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.' + "\n");
201
201
  } catch (error) {
202
- console.error('SPEC-UP-T: Error generating PDF:', error + "\n");
202
+ console.error(' Error generating PDF:', error + "\n");
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(`\n SPEC-UP-T: The new terms were added. All done.` + "\n");
36
+ console.log(`✅ The new terms were added. All done.` + "\n");
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(`\n SPEC-UP-T: Error writing index file: ${err}\n`);
74
+ console.error(`❌ Error writing index file: ${err}\n`);
75
75
  } else {
76
- console.log(`\n SPEC-UP-T: Index file created at ${indexPath}\n`);
76
+ console.log(`✅ Index file created at ${indexPath}\n`);
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(`\n SPEC-UP-T: 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}` + "\n");
81
81
  }
82
82
  }
83
83
  });
84
84
  } catch (err) {
85
- console.error(`\n SPEC-UP-T: Error reading directory: ${err}` + "\n");
85
+ console.error(`❌ Error reading directory: ${err}` + "\n");
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(`\n SPEC-UP-T: Created a freezed specification version in ${destFile}\n`);
90
+ console.log(`✅ Created a freezed specification version in ${destFile}\n`);
@@ -27,7 +27,7 @@ function handle_choice() {
27
27
  echo " Goodbye! You chose to exit."
28
28
  echo -e " ************************************\n\n"
29
29
  fi
30
- echo -e "\n\n\n SPEC-UP-T: Type 'npm run menu' to return to the main menu.\n"
30
+ echo -e "\n\n\nℹ️ Type 'npm run menu' to return to the main menu.\n"
31
31
  }
32
32
 
33
33
  # Function to display the introduction text
@@ -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(`\n SPEC-UP-T: 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` + "\n");
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(`\n SPEC-UP-T: Checking spec #${index + 1}` + "\n");
88
+ console.log(`ℹ️ Checking spec #${index + 1}` + "\n");
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('\n SPEC-UP-T: All keys are present. No errors found. Continuing…' + "\n");
111
+ console.log(' All keys are present. No errors found. Continuing…' + "\n");
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(`\n SPEC-UP-T: Error reading or writing file ${item.name}: ${err}` + "\n");
114
+ // console.error(`❌ Error reading or writing file ${item.name}: ${err}` + "\n");
115
115
  }
116
116
  }
117
117
  });
118
118
  } catch (err) {
119
- console.error(`\n SPEC-UP-T: Error reading directory: ${err}` + "\n");
119
+ console.error(`❌ Error reading directory: ${err}` + "\n");
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('\n SPEC-UP-T: Unresolved References: ', unresolvedRefs + "\n")
19
+ console.log('ℹ️ Unresolved References: ', unresolvedRefs + "\n")
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('\n SPEC-UP-T: Dangling Definitions: ', danglingDefs + "\n")
30
+ console.log('ℹ️ Dangling Definitions: ', danglingDefs + "\n")
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("\n SPEC-UP-T: " + e + "\n");
68
+ console.log(" " + e + "\n");
69
69
  return []; // Return an empty array in case of errors
70
70
  }
71
71
  }