Skip to content

Commit 47887ae

Browse files
committed
fix(lsp-client): pin minimatch for vsce
1 parent 0846422 commit 47887ae

4 files changed

Lines changed: 651 additions & 492 deletions

File tree

packages/lsp-client/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -334,7 +334,7 @@
334334
},
335335
"scripts": {
336336
"vscode:prepublish": "npm run build",
337-
"build": "vitest run scripts/update-input-schema.spec.mts scripts/make-word-pattern.spec.mts && node scripts/make-word-pattern.js && tsup",
337+
"build": "vitest run scripts/update-input-schema.spec.mts scripts/make-word-pattern.spec.mts scripts/vsce-minimatch-compat.spec.mts && node scripts/make-word-pattern.js && tsup",
338338
"typecheck": "tsc --noEmit true",
339339
"test-compile": "tsc -p ./ && npm run copy:asset",
340340
"copy:asset": "cp src/queries/*.scm out/queries",
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
import path from 'node:path';
2+
import { createRequire } from 'node:module';
3+
import { expect, it } from 'vitest';
4+
5+
function importDefault<T>(mod: T): { default: T } | T {
6+
return mod && typeof mod === 'object' && '__esModule' in mod
7+
? mod
8+
: { default: mod };
9+
}
10+
11+
it('vsce should resolve a callable default export from minimatch', () => {
12+
const require = createRequire(import.meta.url);
13+
const vsceEntry = require.resolve('@vscode/vsce');
14+
const vscePackageDir = path.resolve(path.dirname(vsceEntry), '..');
15+
const minimatchEntry = require.resolve('minimatch', { paths: [vscePackageDir] });
16+
const minimatch = require(minimatchEntry);
17+
const imported = importDefault(minimatch);
18+
19+
expect(typeof imported.default).toBe('function');
20+
});

0 commit comments

Comments
 (0)