spec-up-t 1.1.1 → 1.1.3

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "spec-up-t",
3
- "version": "1.1.1",
3
+ "version": "1.1.3",
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": {
@@ -5,7 +5,6 @@ const path = require('path');
5
5
  function addScriptsKeys(scriptKeys) {
6
6
  // Path to the package.json of the project where this script is run
7
7
  const packageJsonPath = path.resolve(__dirname, '../../../../', 'package.json');
8
- // console.log('KORKOR packageJsonPath: ', packageJsonPath);
9
8
 
10
9
  // Read the package.json file
11
10
  fs.readFile(packageJsonPath, 'utf8', (err, data) => {
@@ -7,10 +7,11 @@ const configScriptsKeys = {
7
7
  "topdf": "node -e \"require('spec-up-t/src/create-pdf.js')\"",
8
8
  "freeze": "node -e \"require('spec-up-t/src/freeze.js')\"",
9
9
  "references": "node -e \"require('spec-up-t/src/references.js')\"",
10
- "help": "cat help.txt",
11
- "menu": "bash ./main.sh",
10
+ "help": "cat ./node_modules/spec-up-t/src/install-from-boilerplate/help.txt",
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')\"",
13
- "configure": "node --no-warnings -e \"require('spec-up-t/src/configure.js')\""
13
+ "configure": "node --no-warnings -e \"require('spec-up-t/src/configure.js')\"",
14
+ "custom-update": "npm update && node -e \"require('spec-up-t/src/install-from-boilerplate/custom-update.js')\""
14
15
  };
15
16
 
16
17
  module.exports = { configScriptsKeys };
@@ -0,0 +1,3 @@
1
+ const systemFiles = ['main.sh','README.md','help.txt'];
2
+
3
+ module.exports = { systemFiles };
@@ -0,0 +1,30 @@
1
+ const fs = require('fs-extra');
2
+ const path = require('path');
3
+ const { systemFiles } = require('./config-system-files.js');
4
+
5
+ /**
6
+ * Copies system files from the boilerplate directory to the root of the project.
7
+ * System files are defined in the `config-system-files.js` file.
8
+ * Files are copied recursively and can be safely overwritten.
9
+ */
10
+ function copySystemFiles() {
11
+ const sourceDir = path.join(__dirname, './', 'boilerplate');
12
+
13
+ systemFiles.forEach(item => {
14
+ const srcPath = path.join(sourceDir, item);
15
+
16
+ // Root of the project
17
+ const destPath = path.join(__dirname, '../../../../', item);
18
+
19
+ try {
20
+ fs.cpSync(srcPath, destPath, { recursive: true });
21
+ console.log(`✅ Copied ${item} to ${destPath}`);
22
+ } catch (error) {
23
+ console.error(`❌ Failed to copy ${item} to ${destPath}:`);
24
+ }
25
+ });
26
+
27
+ console.log('✅ Copied system files to current directory.');
28
+ }
29
+
30
+ module.exports = copySystemFiles;
@@ -0,0 +1,9 @@
1
+ const { configScriptsKeys } = require('./config-scripts-keys');
2
+ const addScriptsKeys = require('./add-scripts-keys');
3
+ const copySystemFiles = require('./copy-system-files');
4
+
5
+ addScriptsKeys(configScriptsKeys);
6
+
7
+ copySystemFiles();
8
+
9
+ console.log("✅ custom update done");