specsmd 0.1.66 → 0.1.69

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.
@@ -0,0 +1,38 @@
1
+ #!/usr/bin/env node
2
+
3
+ const fs = require('fs');
4
+ const path = require('path');
5
+ const crypto = require('crypto');
6
+
7
+ const packageRoot = path.resolve(__dirname, '..');
8
+ const repoRoot = path.resolve(packageRoot, '..');
9
+ const extensionBundle = path.join(repoRoot, 'vs-code-extension', 'dist', 'webview', 'bundle.js');
10
+ const packagedBundle = path.join(packageRoot, 'lib', 'dashboard', 'web', 'public', 'webview-bundle.js');
11
+
12
+ function hashFile(filePath) {
13
+ return crypto.createHash('sha256').update(fs.readFileSync(filePath)).digest('hex');
14
+ }
15
+
16
+ if (!fs.existsSync(extensionBundle)) {
17
+ console.error(`Missing VS Code webview bundle: ${extensionBundle}`);
18
+ console.error('Run `npm run compile:webview` in vs-code-extension first.');
19
+ process.exit(1);
20
+ }
21
+
22
+ if (!fs.existsSync(packagedBundle)) {
23
+ console.error(`Missing packaged dashboard web bundle: ${packagedBundle}`);
24
+ process.exit(1);
25
+ }
26
+
27
+ const extensionHash = hashFile(extensionBundle);
28
+ const packagedHash = hashFile(packagedBundle);
29
+
30
+ if (extensionHash !== packagedHash) {
31
+ console.error('Dashboard web bundle is out of sync with the VS Code webview bundle.');
32
+ console.error(`extension: ${extensionHash}`);
33
+ console.error(`packaged: ${packagedHash}`);
34
+ console.error('Run `npm run sync:webview-bundle` from src/.');
35
+ process.exit(1);
36
+ }
37
+
38
+ console.log('Dashboard web bundle is synced with the VS Code webview bundle.');
@@ -0,0 +1,19 @@
1
+ #!/usr/bin/env node
2
+
3
+ const fs = require('fs');
4
+ const path = require('path');
5
+
6
+ const packageRoot = path.resolve(__dirname, '..');
7
+ const repoRoot = path.resolve(packageRoot, '..');
8
+ const extensionBundle = path.join(repoRoot, 'vs-code-extension', 'dist', 'webview', 'bundle.js');
9
+ const packagedBundle = path.join(packageRoot, 'lib', 'dashboard', 'web', 'public', 'webview-bundle.js');
10
+
11
+ if (!fs.existsSync(extensionBundle)) {
12
+ console.error(`Missing VS Code webview bundle: ${extensionBundle}`);
13
+ console.error('Run `npm run compile:webview` in vs-code-extension first.');
14
+ process.exit(1);
15
+ }
16
+
17
+ fs.mkdirSync(path.dirname(packagedBundle), { recursive: true });
18
+ fs.copyFileSync(extensionBundle, packagedBundle);
19
+ console.log(`Synced ${path.relative(repoRoot, packagedBundle)} from ${path.relative(repoRoot, extensionBundle)}.`);