Skip to content

Commit c16e8b3

Browse files
authored
Merge pull request #6 from posit-dev/feature/remove-zmq
Remove ZMQ dependency
2 parents 5c03e85 + 345fd2e commit c16e8b3

File tree

4 files changed

+35
-19
lines changed

4 files changed

+35
-19
lines changed

package-lock.json

Lines changed: 0 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4018,7 +4018,6 @@
40184018
"@vscode/test-electron": "^2.5.2",
40194019
"@vscode/test-web": "^0.0.71",
40204020
"@vscode/vsce": "3.6.0",
4021-
"@vscode/zeromq": "0.2.7",
40224021
"copyfiles": "^2.4.1",
40234022
"csv-parse": "^6.0.0",
40244023
"dotenv": "^17.2.0",

script/postinstall.ts

Lines changed: 23 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,28 @@
33
* Licensed under the MIT License. See License.txt in the project root for license information.
44
*--------------------------------------------------------------------------------------------*/
55

6-
import { downloadZMQ } from '@vscode/zeromq';
6+
// --- Start Positron ---
7+
// zeromq dependency removed - tests that depend on it will be skipped
8+
// import { downloadZMQ } from '@vscode/zeromq';
9+
let downloadZMQ: (() => Promise<void>) | undefined;
10+
try {
11+
// Check if the package exists before trying to require it
12+
const zeromqPath = require.resolve('@vscode/zeromq');
13+
if (zeromqPath) {
14+
downloadZMQ = require('@vscode/zeromq').downloadZMQ;
15+
}
16+
} catch (e) {
17+
// @vscode/zeromq not available, skip ZMQ download
18+
downloadZMQ = undefined;
19+
}
20+
// --- End Positron ---
21+
722
import { spawn } from 'child_process';
823
import * as fs from 'fs';
924
import * as path from 'path';
1025
import { compressTikToken } from './build/compressTikToken';
1126
import { copyStaticAssets } from './build/copyStaticAssets';
1227

13-
// --- Start Positron ---
14-
import { spawn } from 'child_process';
15-
// --- End Positron ---
16-
1728
export interface ITreeSitterGrammar {
1829
name: string;
1930
/**
@@ -157,10 +168,14 @@ async function main() {
157168
'node_modules/@vscode/tree-sitter-wasm/wasm/tree-sitter.wasm',
158169
], 'dist');
159170

160-
// Clone zeromq.js from specific commit
161-
await cloneZeroMQ('1cbebce3e17801bea63a4dcc975b982923cb4592');
162171

163-
await downloadZMQ();
172+
if (downloadZMQ) {
173+
// Clone zeromq.js from specific commit
174+
await cloneZeroMQ('1cbebce3e17801bea63a4dcc975b982923cb4592');
175+
await downloadZMQ();
176+
} else {
177+
console.log('Skipping ZMQ download - zeromq dependency not available (tests requiring zeromq will be skipped)');
178+
}
164179

165180
// Check if the base cache file exists
166181
const baseCachePath = path.join('test', 'simulation', 'cache', 'base.sqlite');

test/simulation/notebookValidator.ts

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,14 @@ import { promises as fs } from 'fs';
1111
import { tmpdir } from 'os';
1212
import { join } from 'path';
1313
import type * as vscode from 'vscode';
14-
import type { Dealer, Push, Socket, Subscriber } from 'zeromq';
14+
// --- Start Positron ---
15+
// import type { Dealer, Push, Socket, Subscriber } from 'zeromq';
16+
// zeromq dependency removed - import types conditionally
17+
type Dealer = any;
18+
type Push = any;
19+
type Socket = any;
20+
type Subscriber = any;
21+
// --- End Positron ---
1522
import { ITestingServicesAccessor } from '../../src/platform/test/node/services';
1623
import { createSha256Hash } from '../../src/util/common/crypto';
1724
import { ExtHostNotebookDocumentData, translateDisplayDataOutput, translateErrorOutput, translateStreamOutput } from '../../src/util/common/test/shims/notebookDocument';
@@ -120,7 +127,10 @@ export function getZeroMQ(): typeof import('zeromq') {
120127
const zmq = require(`${'zeromq'}`);
121128
return zmq;
122129
} catch (e) {
123-
throw e;
130+
// --- Start Positron ---
131+
// throw e;
132+
throw new Error('zeromq dependency is not available. Tests requiring zeromq functionality have been disabled.');
133+
// --- End Positron ---
124134
}
125135
}
126136

0 commit comments

Comments
 (0)