spec-up-t 1.3.0 → 1.4.0

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 (150) hide show
  1. package/.github/copilot-instructions.md +13 -0
  2. package/assets/compiled/body.js +18 -12
  3. package/assets/compiled/head.css +8 -6
  4. package/assets/css/collapse-definitions.css +0 -1
  5. package/assets/css/counter.css +10 -22
  6. package/assets/css/create-pdf.css +4 -2
  7. package/assets/css/create-term-filter.css +4 -4
  8. package/assets/css/definition-buttons-container.css +60 -0
  9. package/assets/css/{pdf-download.css → download-pdf-docx.css} +9 -5
  10. package/assets/css/insert-trefs.css +7 -0
  11. package/assets/css/sidebar-toc.css +2 -1
  12. package/assets/css/terms-and-definitions.css +73 -22
  13. package/assets/js/add-href-to-snapshot-link.js +16 -9
  14. package/assets/js/addAnchorsToTerms.js +2 -2
  15. package/assets/js/charts.js +10 -0
  16. package/assets/js/collapse-definitions.js +13 -2
  17. package/assets/js/collapse-meta-info.js +11 -9
  18. package/assets/js/definition-button-container-utils.js +82 -0
  19. package/assets/js/download-pdf-docx.js +68 -0
  20. package/assets/js/edit-term-buttons.js +77 -20
  21. package/assets/js/github-issues.js +35 -0
  22. package/assets/js/github-repo-info.js +144 -0
  23. package/assets/js/highlight-heading-plus-sibling-nodes.test.js +18 -0
  24. package/assets/js/insert-trefs.js +62 -13
  25. package/assets/js/mermaid-diagrams.js +11 -0
  26. package/assets/js/terminology-section-utility-container/README.md +107 -0
  27. package/assets/js/terminology-section-utility-container/create-alphabet-index.js +17 -0
  28. package/assets/js/{create-term-filter.js → terminology-section-utility-container/create-term-filter.js} +11 -44
  29. package/assets/js/terminology-section-utility-container/hide-show-utility-container.js +21 -0
  30. package/assets/js/terminology-section-utility-container/search.js +203 -0
  31. package/assets/js/terminology-section-utility-container.js +203 -0
  32. package/assets/js/tooltips.js +283 -0
  33. package/config/asset-map.json +26 -18
  34. package/index.js +57 -390
  35. package/package.json +5 -2
  36. package/src/add-remove-xref-source.js +20 -21
  37. package/src/collect-external-references.js +8 -337
  38. package/src/collect-external-references.test.js +440 -33
  39. package/src/configure.js +8 -109
  40. package/src/create-docx.js +7 -6
  41. package/src/create-pdf.js +15 -14
  42. package/src/freeze-spec-data.js +46 -0
  43. package/src/git-info.test.js +76 -0
  44. package/src/health-check/destination-gitignore-checker.js +5 -3
  45. package/src/health-check/external-specs-checker.js +5 -4
  46. package/src/health-check/specs-configuration-checker.js +2 -1
  47. package/src/health-check/term-references-checker.js +5 -3
  48. package/src/health-check/terms-intro-checker.js +2 -1
  49. package/src/health-check/tref-term-checker.js +8 -7
  50. package/src/health-check.js +8 -7
  51. package/src/init.js +3 -2
  52. package/src/install-from-boilerplate/add-gitignore-entries.js +3 -2
  53. package/src/install-from-boilerplate/add-scripts-keys.js +5 -4
  54. package/src/install-from-boilerplate/boilerplate/.github/workflows/menu.yml +74 -97
  55. package/src/install-from-boilerplate/boilerplate/README.md +1 -1
  56. package/src/install-from-boilerplate/boilerplate/spec/example-markup-in-markdown.md +1 -1
  57. package/src/install-from-boilerplate/boilerplate/spec/spec-head.md +2 -2
  58. package/src/install-from-boilerplate/boilerplate/spec/terms-definitions/composability.md +3 -0
  59. package/src/install-from-boilerplate/boilerplate/spec/terms-definitions/compost.md +3 -0
  60. package/src/install-from-boilerplate/boilerplate/spec/terms-definitions/fertilizer.md +3 -0
  61. package/src/install-from-boilerplate/boilerplate/spec/terms-definitions/mulch.md +3 -0
  62. package/src/install-from-boilerplate/boilerplate/spec/terms-definitions/pruning.md +3 -0
  63. package/src/install-from-boilerplate/boilerplate/spec/terms-definitions/seedling.md +3 -0
  64. package/src/install-from-boilerplate/boilerplate/spec/terms-definitions/soil.md +11 -0
  65. package/src/install-from-boilerplate/boilerplate/spec/terms-definitions/watering.md +3 -0
  66. package/src/install-from-boilerplate/boilerplate/specs.json +24 -10
  67. package/src/install-from-boilerplate/config-scripts-keys.js +3 -3
  68. package/src/install-from-boilerplate/config-system-files.js +0 -1
  69. package/src/install-from-boilerplate/copy-boilerplate.js +2 -1
  70. package/src/install-from-boilerplate/copy-system-files.js +4 -3
  71. package/src/install-from-boilerplate/custom-update.js +12 -1
  72. package/src/install-from-boilerplate/help.txt +1 -1
  73. package/src/install-from-boilerplate/menu.sh +6 -6
  74. package/src/json-key-validator.js +17 -11
  75. package/src/markdown-it/README.md +207 -0
  76. package/src/markdown-it/definition-lists.js +397 -0
  77. package/src/markdown-it/index.js +83 -0
  78. package/src/markdown-it/link-enhancement.js +98 -0
  79. package/src/markdown-it/plugins.js +118 -0
  80. package/src/markdown-it/table-enhancement.js +97 -0
  81. package/src/markdown-it/template-tag-syntax.js +152 -0
  82. package/src/parsers/index.js +16 -0
  83. package/src/parsers/spec-parser.js +152 -0
  84. package/src/parsers/spec-parser.test.js +109 -0
  85. package/src/parsers/template-tag-parser.js +277 -0
  86. package/src/parsers/template-tag-parser.test.js +107 -0
  87. package/src/pipeline/configuration/configure-starterpack.js +200 -0
  88. package/src/{create-external-specs-list.js → pipeline/configuration/create-external-specs-list.js} +13 -12
  89. package/src/{create-term-index.js → pipeline/configuration/create-term-index.js} +19 -18
  90. package/src/{create-versions-index.js → pipeline/configuration/create-versions-index.js} +4 -3
  91. package/src/{insert-term-index.js → pipeline/configuration/insert-term-index.js} +2 -2
  92. package/src/pipeline/configuration/prepare-spec-configuration.js +70 -0
  93. package/src/pipeline/parsing/apply-markdown-it-extensions.js +35 -0
  94. package/src/pipeline/parsing/create-markdown-parser.js +94 -0
  95. package/src/pipeline/parsing/create-markdown-parser.test.js +49 -0
  96. package/src/{html-dom-processor.js → pipeline/postprocessing/definition-list-postprocessor.js} +69 -10
  97. package/src/{escape-handler.js → pipeline/preprocessing/escape-processor.js} +3 -1
  98. package/src/{fix-markdown-files.js → pipeline/preprocessing/normalize-terminology-markdown.js} +41 -31
  99. package/src/pipeline/references/collect-external-references.js +307 -0
  100. package/src/pipeline/references/external-references-service.js +231 -0
  101. package/src/pipeline/references/fetch-terms-from-index.js +198 -0
  102. package/src/pipeline/references/match-term.js +34 -0
  103. package/src/{collectExternalReferences/matchTerm.test.js → pipeline/references/match-term.test.js} +8 -2
  104. package/src/pipeline/references/process-xtrefs-data.js +94 -0
  105. package/src/pipeline/references/xtref-utils.js +166 -0
  106. package/src/pipeline/rendering/render-spec-document.js +146 -0
  107. package/src/pipeline/rendering/render-utils.js +154 -0
  108. package/src/utils/LOGGER.md +81 -0
  109. package/src/utils/{doesUrlExist.js → does-url-exist.js} +4 -3
  110. package/src/utils/fetch.js +5 -4
  111. package/src/utils/file-opener.js +3 -2
  112. package/src/utils/git-info.js +77 -0
  113. package/src/utils/logger.js +74 -0
  114. package/src/utils/regex-patterns.js +471 -0
  115. package/src/utils/regex-patterns.test.js +281 -0
  116. package/templates/template.html +56 -21
  117. package/assets/js/create-alphabet-index.js +0 -60
  118. package/assets/js/hide-show-utility-container.js +0 -16
  119. package/assets/js/index.js +0 -87
  120. package/assets/js/pdf-download.js +0 -46
  121. package/assets/js/search.js +0 -365
  122. package/src/collectExternalReferences/fetchTermsFromIndex.js +0 -284
  123. package/src/collectExternalReferences/matchTerm.js +0 -32
  124. package/src/collectExternalReferences/processXTrefsData.js +0 -108
  125. package/src/freeze.js +0 -90
  126. package/src/install-from-boilerplate/boilerplate/.github/workflows/fetch-and-push-xrefs.yml.old +0 -42
  127. package/src/install-from-boilerplate/boilerplate/.github/workflows/render-specs.yml +0 -47
  128. package/src/install-from-boilerplate/boilerplate/spec/terms-definitions/term-1.md +0 -13
  129. package/src/install-from-boilerplate/boilerplate/spec/terms-definitions/term-2.md +0 -3
  130. package/src/install-from-boilerplate/boilerplate/spec/terms-definitions/term-3.md +0 -3
  131. package/src/install-from-boilerplate/boilerplate/spec/terms-definitions/term-4.md +0 -3
  132. package/src/markdown-it-extensions.js +0 -395
  133. package/src/references.js +0 -114
  134. /package/assets/css/{bootstrap.min.css → embedded-libraries/bootstrap.min.css} +0 -0
  135. /package/assets/css/{prism.css → embedded-libraries/prism.css} +0 -0
  136. /package/assets/css/{prism.dark.css → embedded-libraries/prism.dark.css} +0 -0
  137. /package/assets/css/{prism.default.css → embedded-libraries/prism.default.css} +0 -0
  138. /package/assets/js/{bootstrap.bundle.min.js → embedded-libraries/bootstrap.bundle.min.js} +0 -0
  139. /package/assets/js/{chart.js → embedded-libraries/chart.js} +0 -0
  140. /package/assets/js/{diff.min.js → embedded-libraries/diff.min.js} +0 -0
  141. /package/assets/js/{font-awesome.js → embedded-libraries/font-awesome.js} +0 -0
  142. /package/assets/js/{mermaid.js → embedded-libraries/mermaid.js} +0 -0
  143. /package/assets/js/{notyf.js → embedded-libraries/notyf.js} +0 -0
  144. /package/assets/js/{popper.js → embedded-libraries/popper.js} +0 -0
  145. /package/assets/js/{prism.dark.js → embedded-libraries/prism.dark.js} +0 -0
  146. /package/assets/js/{prism.default.js → embedded-libraries/prism.default.js} +0 -0
  147. /package/assets/js/{prism.js → embedded-libraries/prism.js} +0 -0
  148. /package/assets/js/{tippy.js → embedded-libraries/tippy.js} +0 -0
  149. /package/src/{escape-mechanism.js → pipeline/preprocessing/escape-placeholder-utils.js} +0 -0
  150. /package/src/utils/{isLineWithDefinition.js → is-line-with-definition.js} +0 -0
package/src/init.js CHANGED
@@ -1,5 +1,6 @@
1
1
  const fs = require('fs-extra');
2
2
  const path = require('path');
3
+ const Logger = require('./utils/logger');
3
4
  const outputDir = path.join(process.cwd(), '.cache');
4
5
  const initFlagPath = path.join(outputDir, 'init.flag');
5
6
 
@@ -20,9 +21,9 @@ async function initialize() {
20
21
  // Create the init flag file
21
22
  await fs.writeFile(initFlagPath, 'Initialization completed.');
22
23
 
23
- console.log('Initialization complete.');
24
+ Logger.success('Initialization complete.');
24
25
  } catch (error) {
25
- console.error(`Initialization failed: ${error.message}`);
26
+ Logger.error(`Initialization failed: ${error.message}`);
26
27
  }
27
28
  }
28
29
 
@@ -1,4 +1,5 @@
1
1
  const fs = require('fs').promises;
2
+ const Logger = require('../utils/logger');
2
3
 
3
4
  /**
4
5
  * Reads the content of a file or returns an empty string if the file does not exist.
@@ -42,9 +43,9 @@ async function updateGitignore(gitignorePath, filesToAdd) {
42
43
  // Write the updated content back to the .gitignore file
43
44
  await fs.writeFile(gitignorePath, updatedGitignoreContent, 'utf8');
44
45
 
45
- console.log('Updated .gitignore file');
46
+ Logger.success('Updated .gitignore file');
46
47
  } catch (error) {
47
- console.error('Error updating .gitignore:', error.message);
48
+ Logger.error('Error updating .gitignore:', error.message);
48
49
  }
49
50
  }
50
51
 
@@ -1,5 +1,6 @@
1
1
  const fs = require('fs');
2
2
  const path = require('path');
3
+ const Logger = require('../utils/logger');
3
4
 
4
5
  /**
5
6
  * Adds scripts to the package.json file.
@@ -15,7 +16,7 @@ function addScriptsKeys(scriptKeys, overwriteKeys = {}) {
15
16
  // Read the package.json file
16
17
  fs.readFile(packageJsonPath, 'utf8', (err, data) => {
17
18
  if (err) {
18
- console.error('Error reading package.json:', err);
19
+ Logger.error('Error reading package.json:', err);
19
20
  return;
20
21
  }
21
22
 
@@ -38,13 +39,13 @@ function addScriptsKeys(scriptKeys, overwriteKeys = {}) {
38
39
  // Write the updated package.json back to disk
39
40
  fs.writeFile(packageJsonPath, JSON.stringify(packageJson, null, 2), 'utf8', (err) => {
40
41
  if (err) {
41
- console.error('Error writing package.json:', err);
42
+ Logger.error('Error writing package.json:', err);
42
43
  } else {
43
- console.log('Scripts added to package.json successfully!');
44
+ Logger.success('Scripts added to package.json successfully!');
44
45
  }
45
46
  });
46
47
  } catch (parseError) {
47
- console.error('Error parsing package.json:', parseError);
48
+ Logger.error('Error parsing package.json:', parseError);
48
49
  }
49
50
  });
50
51
  }
@@ -3,23 +3,27 @@ name: Run Menu
3
3
  on:
4
4
  workflow_dispatch:
5
5
  inputs:
6
- script:
7
- description: 'Select the script to run'
8
- type: choice
6
+ action_type:
7
+ description: 'Action to perform'
9
8
  required: true
10
- default: 'Render specification'
9
+ default: 'render'
10
+ type: choice
11
11
  options:
12
- - Add content
13
- - Render specification
14
- - Export to PDF
15
- - Export to DOCX
16
- - Collect external references
17
- - Add, remove or view xref source
18
- - Configure
19
- - Run health check
20
- - Open documentation website
21
- - Freeze specification
22
- - Custom update
12
+ - render
13
+ - topdf
14
+ - todocx
15
+ - freeze
16
+ - custom-update
17
+ - collectExternalReferences
18
+ repository:
19
+ description: 'Repository'
20
+ required: false
21
+ branch:
22
+ description: 'Branch'
23
+ required: false
24
+ triggered_by:
25
+ description: 'Triggered by'
26
+ required: false
23
27
 
24
28
  jobs:
25
29
  build-and-deploy-spec:
@@ -58,106 +62,79 @@ jobs:
58
62
  env:
59
63
  MY_PAT: ${{ secrets.MY_PAT }} # Make the secret available as an env var
60
64
  run: |
61
- case "${{ github.event.inputs.script }}" in
62
- "Add content")
63
- echo "You can start adding your content to the markdown files in the 'spec' directory."
64
- echo "You can do this by editing local files in an editor or by going to your repository on GitHub."
65
- echo "More info: https://blockchainbird.github.io/spec-up-t-website/docs/various-roles/content-authors-guide/introduction"
65
+ case "${{ github.event.inputs.action_type }}" in
66
+ render)
67
+ npm run render
66
68
  ;;
67
- "Render specification")
68
- node --no-warnings -e "require('spec-up-t/index.js')({ nowatch: true })"
69
- git config --global user.email "actions@github.com"
70
- git config --global user.name "GitHub Actions"
71
- git add .
72
- git commit -m "Render specification: Update files" || echo "No changes to commit"
73
- git push https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}.git HEAD:main
69
+ topdf)
70
+ npm run topdf
74
71
  ;;
75
- # ...existing code...
76
- "Export to DOCX")
77
- node -e "require('spec-up-t/src/create-docx.js')"
78
- git config --global user.email "actions@github.com"
79
- git config --global user.name "GitHub Actions"
80
- git add .
81
- git commit -m "Export to DOCX" || echo "No changes to commit"
82
- git push https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}.git HEAD:main
72
+ todocx)
73
+ npm run todocx
83
74
  ;;
84
- "Collect external references")
85
- node --no-warnings -e "require('spec-up-t/src/collect-external-references.js').collectExternalReferences({ pat: process.env.MY_PAT })"
86
- git config --global user.email "actions@github.com"
87
- git config --global user.name "GitHub Actions"
88
- git add .
89
- git commit -m "Collect external references" || echo "No changes to commit"
90
- git push https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}.git HEAD:main
75
+ freeze)
76
+ npm run freeze
91
77
  ;;
92
- "Export to PDF")
93
- node -e "require('spec-up-t/src/create-pdf.js')"
94
- git config --global user.email "actions@github.com"
95
- git config --global user.name "GitHub Actions"
96
- git add .
97
- git commit -m "Export to PDF" || echo "No changes to commit"
98
- git push https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}.git HEAD:main
78
+ custom-update)
79
+ npm run custom-update
99
80
  ;;
100
- "Freeze specification")
101
- node -e "require('spec-up-t/src/freeze.js')"
102
- git config --global user.email "actions@github.com"
103
- git config --global user.name "GitHub Actions"
104
- git add .
105
- git commit -m "Freeze specification" || echo "No changes to commit"
106
- git push https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}.git HEAD:main
81
+ collectExternalReferences)
82
+ npm run collectExternalReferences
83
+ ;;
84
+ *)
85
+ echo "Unknown action_type: ${{ github.event.inputs.action_type }}"
86
+ exit 1
87
+ ;;
88
+ esac
89
+
90
+ - name: Commit and push changes
91
+ if: success()
92
+ run: |
93
+ git config --global user.email "actions@github.com"
94
+ git config --global user.name "GitHub Actions"
95
+
96
+ # Add all changes
97
+ git add .
98
+
99
+ # Commit with appropriate message
100
+ case "${{ github.event.inputs.action_type }}" in
101
+ render)
102
+ git commit -m "Render specification: Update files" || echo "No changes to commit"
107
103
  ;;
108
- "Add, remove or view xref source")
109
- node --no-warnings -e "require('spec-up-t/src/add-remove-xref-source.js')"
110
- git config --global user.email "actions@github.com"
111
- git config --global user.name "GitHub Actions"
112
- git add .
113
- git commit -m "Add, remove or view xref source" || echo "No changes to commit"
114
- git push https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}.git HEAD:main
104
+ topdf)
105
+ git commit -m "Export to PDF" || echo "No changes to commit"
115
106
  ;;
116
- "Configure")
117
- node --no-warnings -e "require('spec-up-t/src/configure.js')"
118
- git config --global user.email "actions@github.com"
119
- git config --global user.name "GitHub Actions"
120
- git add .
121
- git commit -m "Configure" || echo "No changes to commit"
122
- git push https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}.git HEAD:main
107
+ todocx)
108
+ git commit -m "Export to DOCX" || echo "No changes to commit"
123
109
  ;;
124
- "Run health check")
125
- node --no-warnings -e "require('spec-up-t/src/health-check.js')"
126
- git config --global user.email "actions@github.com"
127
- git config --global user.name "GitHub Actions"
128
- git add .
129
- git commit -m "Run health check" || echo "No changes to commit"
130
- git push https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}.git HEAD:main
110
+ collectExternalReferences)
111
+ git commit -m "Collect external references" || echo "No changes to commit"
131
112
  ;;
132
- "Open documentation website")
133
- echo "Opening documentation website: https://blockchainbird.github.io/spec-up-t-website/"
134
- echo "Please visit the URL manually: https://blockchainbird.github.io/spec-up-t-website/"
113
+ freeze)
114
+ git commit -m "Freeze specification" || echo "No changes to commit"
135
115
  ;;
136
- "Custom update")
137
- npm update && node -e "require('spec-up-t/src/install-from-boilerplate/custom-update.js')"
138
- git config --global user.email "actions@github.com"
139
- git config --global user.name "GitHub Actions"
140
- git add .
116
+ custom-update)
141
117
  git commit -m "Custom update: Copy files from spec-up-t" || echo "No changes to commit"
142
- git push https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}.git HEAD:main
143
118
  ;;
144
119
  *)
145
- echo "Unknown script: ${{ github.event.inputs.script }}"
146
- exit 1
120
+ git commit -m "Update files: ${{ github.event.inputs.action_type }}" || echo "No changes to commit"
147
121
  ;;
148
122
  esac
123
+
124
+ # Push changes
125
+ git push https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}.git HEAD:main
149
126
 
150
- - name: Deploy to GitHub Pages
151
- if: success() && github.event.inputs.script != 'Add content' && github.event.inputs.script != 'Open documentation website' && github.event.inputs.script != 'Configure' && github.event.inputs.script != 'Run health check'
152
- uses: peaceiris/actions-gh-pages@v3.7.3
153
- with:
154
- github_token: ${{ secrets.GITHUB_TOKEN }}
155
- publish_dir: ${{ env.OUTPUT_PATH }}
156
- allow_empty_commit: true
157
- force_orphan: true
127
+ - name: Commit output files
128
+ if: success()
129
+ run: |
130
+ git config --global user.email "actions@github.com"
131
+ git config --global user.name "GitHub Actions"
132
+ git add "$OUTPUT_PATH"
133
+ git commit -m "Update output files in $OUTPUT_PATH" || echo "No changes to commit in output directory"
134
+ git push https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}.git HEAD:main
158
135
 
159
136
  - name: Clean up
160
137
  if: always()
161
138
  run: |
162
139
  echo "Cleaning up..."
163
- rm -rf node_modules
140
+ rm -rf node_modules
@@ -1,5 +1,5 @@
1
1
  # Documentation
2
2
 
3
- Read more about Spec-Up-T in the [documentation](https://blockchainbird.github.io/spec-up-t-website/).
3
+ Read more about Spec-Up-T in the [documentation](https://trustoverip.github.io/spec-up-t-website/).
4
4
 
5
5
  Written: 2025-02-27T15:38
@@ -245,7 +245,7 @@ graph TD
245
245
  ```
246
246
  </pre>
247
247
 
248
- ```js
248
+ ```chart
249
249
  {
250
250
  "type": "pie",
251
251
  "data": {
@@ -2,6 +2,6 @@
2
2
 
3
3
  ## Intro
4
4
 
5
- This is a default Spec-Up-T installation. Find information on the [Spec-Up-T documentation website](https://blockchainbird.github.io/spec-up-t-website/).
5
+ This is a default Spec-Up-T installation. Find information on the [Spec-Up-T documentation website](https://trustoverip.github.io/spec-up-t-website/).
6
6
 
7
- Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
7
+ This is a demo site for Spec-Up-T. The subject matter gardening and related terms is used purely as an example to demonstrate how the system works. You can replace these demo terms and definitions with your own content to suit your documentation needs.
@@ -0,0 +1,3 @@
1
+ [[tref: KERISuite, composability ]]
2
+
3
+ ~ Note: composability is not the same as compostability.
@@ -0,0 +1,3 @@
1
+ [[def: compost, composting, Compost]]
2
+
3
+ ~ Compost is a mixture of decayed organic matter used to fertilize soil. It is created through the process of composting, where materials like leaves, food scraps, and grass clippings break down over time. Compost improves soil structure and provides nutrients for plants. See also [[ref: Mulch]], [[ref: Soil]], [[ref: Fertilizer]], [[ref: Seedling]], [[ref: Watering]].
@@ -0,0 +1,3 @@
1
+ [[def: fertilizer, fertilizing, Fertilizer]]
2
+
3
+ ~ Fertilizer is a substance added to soil or plants to supply essential nutrients and promote growth. Fertilizers can be organic, like compost, or synthetic. Proper fertilizing ensures healthy plant development. See also [[ref: Compost]], [[ref: Mulch]], [[ref: Soil]], [[ref: Watering]], [[ref: Seedling]].
@@ -0,0 +1,3 @@
1
+ [[def: mulch, mulching, Mulch]]
2
+
3
+ ~ Mulch is a layer of material, such as wood chips or straw, spread on the surface of soil to retain moisture, suppress weeds, and regulate temperature. Mulching helps improve plant health and soil quality. Related terms: [[ref: Compost]], [[ref: Soil]], [[ref: Fertilizer]].
@@ -0,0 +1,3 @@
1
+ [[def: pruning, Pruning]]
2
+
3
+ ~ Pruning is the practice of trimming plants by cutting away dead or overgrown branches or stems. Pruning encourages healthy growth and improves the shape of plants. See also [[ref: Seedling]], [[ref: Watering]].
@@ -0,0 +1,3 @@
1
+ [[def: seedling, seedlings, Seedling]]
2
+
3
+ ~ A seedling is a young plant that has recently sprouted from a seed. Seedlings are delicate and require proper soil, water, and light to grow into mature plants. See also [[ref: Soil]], [[ref: Compost]], [[ref: Watering]].
@@ -0,0 +1,11 @@
1
+ [[def: soil, soils, Soil]]
2
+
3
+ ~ Soil is the upper layer of earth in which plants grow. It consists of a mixture of organic matter, minerals, gases, liquids, and organisms that together support life. Healthy soil is essential for gardening and agriculture.
4
+
5
+ ~ Refs examples: [[ref: Compost]], [[ref: Mulch]], [[ref: Fertilizer]].
6
+
7
+ ~ Xref example: [[xref: KERISuite, composability ]]
8
+
9
+ ~ This Xref example does not work: [[xref: does-not-exist, Foo]]
10
+
11
+ ~ Soil quality affects water retention, nutrient availability, and plant health. Amending soil with compost or mulch can improve its structure and fertility. Fertilizer may be added to supplement nutrients as needed.
@@ -0,0 +1,3 @@
1
+ [[def: watering, Watering]]
2
+
3
+ ~ Watering is the act of supplying water to plants to help them grow. Proper watering is essential for healthy roots and overall plant development. Overwatering or underwatering can harm plants. See also [[ref: Soil]], [[ref: Seedling]], [[ref: Mulch]].
@@ -19,23 +19,37 @@
19
19
  "source": {
20
20
  "host": "github",
21
21
  "account": "trustoverip",
22
- "repo": "spec-up-t-starter-pack"
22
+ "repo": "spec-up-t-starter-pack",
23
+ "branch": "main"
23
24
  },
24
25
  "external_specs": [
25
26
  {
26
- "external_spec": "test-1",
27
- "gh_page": "https://blockchainbird.github.io/spec-up-xref-test-1/",
28
- "url": "https://github.com/blockchainbird/spec-up-xref-test-1",
29
- "terms_dir": "spec/term-definitions"
27
+ "external_spec": "vLEI",
28
+ "gh_page": "https://henkvancann.github.io/vlei-glossary/",
29
+ "url": "https://github.com/henkvancann/vlei-glossary",
30
+ "terms_dir": "spec/terms-definitions"
30
31
  },
31
32
  {
32
- "external_spec": "test-2",
33
- "gh_page": "https://blockchainbird.github.io/spec-up-xref-test-2/",
34
- "url": "https://github.com/blockchainbird/spec-up-xref-test-2",
35
- "terms_dir": "spec/term-definitions"
33
+ "external_spec": "KERISuite",
34
+ "gh_page": "https://weboftrust.github.io/kerisuite-glossary/",
35
+ "url": "https://github.com/weboftrust/kerisuite-glossary",
36
+ "terms_dir": "spec/terms-definitions"
37
+ },
38
+ {
39
+ "external_spec": "ToIP",
40
+ "gh_page": "https://glossary.trustoverip.org/",
41
+ "url": "https://github.com/trustoverip/ctwg-main-glossary",
42
+ "terms_dir": "spec/terms-definitions"
43
+ },
44
+ {
45
+ "external_spec": "GenIT",
46
+ "gh_page": "https://trustoverip.github.io/ctwg-general-glossary/",
47
+ "url": "https://github.com/trustoverip/ctwg-general-glossary",
48
+ "terms_dir": "spec/terms-definitions"
36
49
  }
37
50
  ],
38
- "katex": false
51
+ "katex": false,
52
+ "anchor_symbol": "§"
39
53
  }
40
54
  ]
41
55
  }
@@ -2,11 +2,11 @@ const configScriptsKeys = {
2
2
  "edit": "node -e \"require('spec-up-t')()\"",
3
3
  "render": "node --no-warnings -e \"require('spec-up-t/index.js')({ nowatch: true })\"",
4
4
  "dev": "node -e \"require('spec-up-t')({ dev: true })\"",
5
- "collectExternalReferences": "node --no-warnings -e \"require('spec-up-t/src/collect-external-references.js').collectExternalReferences()\"",
5
+ "collectExternalReferences": "node --no-warnings -e \"require('spec-up-t/src/pipeline/references/collect-external-references.js').collectExternalReferences()\"",
6
6
  "topdf": "node -e \"require('spec-up-t/src/create-pdf.js')\"",
7
7
  "todocx": "node -e \"require('spec-up-t/src/create-docx.js')\"",
8
- "freeze": "node -e \"require('spec-up-t/src/freeze.js')\"",
9
- "references": "node -e \"require('spec-up-t/src/references.js')\"",
8
+ "freeze": "node -e \"require('spec-up-t/src/freeze-spec-data.js')\"",
9
+ "references": "node -e \"require('spec-up-t/src/pipeline/references/external-references-service.js')\"",
10
10
  "help": "cat ./node_modules/spec-up-t/src/install-from-boilerplate/help.txt",
11
11
  "menu": "bash ./node_modules/spec-up-t/src/install-from-boilerplate/menu.sh",
12
12
  "addremovexrefsource": "node --no-warnings -e \"require('spec-up-t/src/add-remove-xref-source.js')\"",
@@ -2,7 +2,6 @@ const systemFiles = [
2
2
  'README.md',
3
3
  '.env.example',
4
4
  '.github/workflows/menu.yml',
5
- '.github/workflows/render-specs.yml',
6
5
  '.github/workflows/set-gh-pages.yml',
7
6
  'assets/test.json',
8
7
  'assets/test.text',
@@ -1,5 +1,6 @@
1
1
  const fs = require('fs-extra');
2
2
  const path = require('path');
3
+ const Logger = require('../utils/logger');
3
4
 
4
5
  function copyBoilerplate() {
5
6
  const sourceDir = path.join(__dirname, './', 'boilerplate');
@@ -16,7 +17,7 @@ function copyBoilerplate() {
16
17
  const gitignoreDestPath = path.join(__dirname, '../../../../', '.gitignore');
17
18
  fs.renameSync(gitignorePath, gitignoreDestPath);
18
19
 
19
- console.log('Copied spec-up-t-boilerplate to current directory');
20
+ Logger.success('Copied spec-up-t-boilerplate to current directory');
20
21
  }
21
22
 
22
23
  module.exports = copyBoilerplate;
@@ -1,6 +1,7 @@
1
1
  const fs = require('fs-extra');
2
2
  const path = require('path');
3
3
  const { systemFiles } = require('./config-system-files.js');
4
+ const Logger = require('../utils/logger');
4
5
 
5
6
  /**
6
7
  * Copies system files from the boilerplate directory to the root of the project.
@@ -18,13 +19,13 @@ function copySystemFiles() {
18
19
 
19
20
  try {
20
21
  fs.cpSync(srcPath, destPath, { recursive: true });
21
- console.log(`✅ Copied ${item} to ${destPath}`);
22
+ Logger.success(`Copied ${item} to ${destPath}`);
22
23
  } catch (error) {
23
- console.error(`❌ Failed to copy ${item} to ${destPath}:`, error);
24
+ Logger.error(`Failed to copy ${item} to ${destPath}:`, error);
24
25
  }
25
26
  });
26
27
 
27
- console.log('Copied system files to current directory');
28
+ Logger.success('Copied system files to current directory');
28
29
  }
29
30
 
30
31
  module.exports = copySystemFiles;
@@ -10,4 +10,15 @@ addScriptsKeys(configScriptsKeys, configOverwriteScriptsKeys);
10
10
  copySystemFiles();
11
11
  updateGitignore(gitIgnoreEntries.gitignorePath, gitIgnoreEntries.filesToAdd);
12
12
 
13
- console.log("✅ Custom update done");
13
+ const Logger = require('../utils/logger');
14
+
15
+ // We can use this file to do any custom updates during post-install.
16
+ const customUpdate = () => {
17
+ // Custom logic here
18
+ // ...
19
+ }
20
+
21
+ // Call custom update
22
+ customUpdate();
23
+
24
+ Logger.success("Custom update done");
@@ -1,6 +1,6 @@
1
1
  ===
2
2
 
3
- For help go to: https://blockchainbird.github.io/spec-up-t-website
3
+ For help go to: https://trustoverip.github.io/spec-up-t-website
4
4
 
5
5
  ===
6
6
 
@@ -21,7 +21,7 @@ function handle_choice() {
21
21
  echo " ${options[index]}"
22
22
  echo -e " ************************************\n\n"
23
23
  show_progress
24
- ${options[index + 1]}
24
+ "${options[index + 1]}"
25
25
  else
26
26
  clear
27
27
  echo -e "\n\n ************************************"
@@ -69,7 +69,7 @@ function prompt_input() {
69
69
 
70
70
  function do_add_content() {
71
71
  clear
72
- echo -e "\n\n\n ********************\n\n\n You can start adding your content to the markdown files in the "spec" directory.\n\n You can do this by editing local files in an editor or by going to your repository on GitHub.\n\n More info: https://blockchainbird.github.io/spec-up-t-website/docs/various-roles/content-authors-guide/introduction\n\n\n ********************"
72
+ echo -e "\n\n\n ********************\n\n\n You can start adding your content to the markdown files in the "spec" directory.\n\n You can do this by editing local files in an editor or by going to your repository on GitHub.\n\n More info: https://trustoverip.github.io/spec-up-t-website/docs/various-roles/content-authors-guide/introduction\n\n\n ********************"
73
73
  }
74
74
 
75
75
  function do_render() { clear; npm run render; }
@@ -83,14 +83,14 @@ function do_freeze() { clear; npm run freeze; }
83
83
 
84
84
  function do_help() {
85
85
  clear
86
- echo -e "\n\n\n You will be redirected to the documentation website\n\n (https://blockchainbird.github.io/spec-up-t-website/)."
86
+ echo -e "\n\n\n You will be redirected to the documentation website\n\n (https://trustoverip.github.io/spec-up-t-website/)."
87
87
  sleep 2
88
88
  if [[ "$OSTYPE" == "darwin"* ]]; then
89
- open "https://blockchainbird.github.io/spec-up-t-website/"
89
+ open "https://trustoverip.github.io/spec-up-t-website/"
90
90
  elif [[ "$OSTYPE" == "linux-gnu"* ]]; then
91
- xdg-open "https://blockchainbird.github.io/spec-up-t-website/"
91
+ xdg-open "https://trustoverip.github.io/spec-up-t-website/"
92
92
  elif [[ "$OSTYPE" == "cygwin" || "$OSTYPE" == "msys" || "$OSTYPE" == "win32" ]]; then
93
- start "https://blockchainbird.github.io/spec-up-t-website/"
93
+ start "https://trustoverip.github.io/spec-up-t-website/"
94
94
  else
95
95
  echo "Unsupported OS."
96
96
  fi
@@ -10,6 +10,7 @@
10
10
 
11
11
  const fs = require('fs');
12
12
  const readlineSync = require('readline-sync');
13
+ const Logger = require('./utils/logger');
13
14
 
14
15
  let errorFound = false;
15
16
 
@@ -25,6 +26,11 @@ function loadData() {
25
26
 
26
27
  // This function recursively checks if the required keys are present in the object
27
28
  function checkKeysSync(object, expectedKeys, parentKey = '') {
29
+ // Guard against undefined or non-iterable expected key definitions so the validator fails gracefully instead of throwing.
30
+ if (!Array.isArray(expectedKeys)) {
31
+ return;
32
+ }
33
+
28
34
  for (let key of expectedKeys) {
29
35
  if (Array.isArray(object)) {
30
36
  // If the object is an array, check each item within the array
@@ -34,7 +40,7 @@ function checkKeysSync(object, expectedKeys, parentKey = '') {
34
40
  } else if (typeof object === 'object') {
35
41
  // If the key is missing from the object, log an error
36
42
  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`);
43
+ Logger.error(`Error: Missing key '${key}'\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
44
  errorFound = true;
39
45
  pauseForEnterSync(); // Pause synchronously to allow user to acknowledge the error
40
46
  }
@@ -61,7 +67,7 @@ function runJsonKeyValidatorSync() {
61
67
  "logo",
62
68
  "logo_link",
63
69
  "source",
64
- "external_specs"
70
+ // "external_specs"
65
71
  // "assets" // Commented out: We no longer check for 'assets' in the specs object
66
72
  ],
67
73
  source: [
@@ -69,12 +75,12 @@ function runJsonKeyValidatorSync() {
69
75
  "account",
70
76
  "repo"
71
77
  ],
72
- external_specs: [
73
- "gh_page",
74
- "external_spec",
75
- "url",
76
- "terms_dir"
77
- ],
78
+ // external_specs: [
79
+ // "gh_page",
80
+ // "external_spec",
81
+ // "url",
82
+ // "terms_dir"
83
+ // ],
78
84
  // Removed the 'assets' block entirely, as it's no longer part of the required keys:
79
85
  // assets: [
80
86
  // "path",
@@ -85,7 +91,7 @@ function runJsonKeyValidatorSync() {
85
91
 
86
92
  // Iterate over each spec entry in the specs array from the JSON file
87
93
  for (let [index, spec] of data.specs.entries()) {
88
- console.log(`ℹ️ Checking spec #${index + 1}`);
94
+ Logger.info(`Checking spec #${index + 1}`);
89
95
 
90
96
  // Check for keys defined in expectedKeys.specs
91
97
  checkKeysSync(spec, expectedKeys.specs, `specs[${index}]`);
@@ -96,7 +102,7 @@ function runJsonKeyValidatorSync() {
96
102
  }
97
103
 
98
104
  // Check for keys inside the 'external_specs' array, if present
99
- if (spec.external_specs) {
105
+ if (spec.external_specs && Array.isArray(expectedKeys.external_specs)) {
100
106
  checkKeysSync(spec.external_specs, expectedKeys.external_specs, `specs[${index}].external_specs`);
101
107
  }
102
108
 
@@ -108,7 +114,7 @@ function runJsonKeyValidatorSync() {
108
114
 
109
115
  // If no errors were found, print a success message
110
116
  if (!errorFound) {
111
- console.log('All keys are present. No errors found. Continuing…');
117
+ Logger.success('All keys are present. No errors found. Continuing…');
112
118
  }
113
119
  }
114
120