4
4
*--------------------------------------------------------------------------------------------*/
5
5
6
6
import { downloadZMQ } from '@vscode/zeromq' ;
7
+ import { execSync } from 'child_process' ;
7
8
import * as fs from 'fs' ;
8
9
import * as path from 'path' ;
9
10
import { compressTikToken } from './build/compressTikToken' ;
@@ -62,6 +63,22 @@ const treeSitterGrammars: ITreeSitterGrammar[] = [
62
63
63
64
const REPO_ROOT = path . join ( __dirname , '..' ) ;
64
65
66
+ /**
67
+ * Clones the zeromq.js repository from a specific commit into node_modules/zeromq
68
+ * @param commit The git commit hash to checkout
69
+ */
70
+ function cloneZeroMQ ( commit : string ) {
71
+ const zeromqPath = path . join ( REPO_ROOT , 'node_modules' , 'zeromq' ) ;
72
+
73
+ // Remove existing zeromq directory if it exists
74
+ if ( fs . existsSync ( zeromqPath ) ) {
75
+ fs . rmSync ( zeromqPath , { recursive : true , force : true } ) ;
76
+ }
77
+
78
+ execSync ( `git clone https://github.com/rebornix/zeromq.js.git ${ zeromqPath } ` , { stdio : 'inherit' , cwd : REPO_ROOT } ) ;
79
+ execSync ( `git checkout ${ commit } ` , { stdio : 'inherit' , cwd : zeromqPath } ) ;
80
+ }
81
+
65
82
async function main ( ) {
66
83
await fs . promises . mkdir ( path . join ( REPO_ROOT , '.build' ) , { recursive : true } ) ;
67
84
@@ -77,6 +94,9 @@ async function main() {
77
94
'node_modules/@vscode/tree-sitter-wasm/wasm/tree-sitter.wasm' ,
78
95
] , 'dist' ) ;
79
96
97
+ // Clone zeromq.js from specific commit
98
+ cloneZeroMQ ( '1cbebce3e17801bea63a4dcc975b982923cb4592' ) ;
99
+
80
100
await downloadZMQ ( ) ;
81
101
82
102
// Check if the base cache file exists
0 commit comments