coc-vscode-loader 1.2.0 → 1.2.1
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/lib/index.js +20 -5
- package/package.json +1 -1
package/lib/index.js
CHANGED
|
@@ -39,7 +39,7 @@ var require_package = __commonJS({
|
|
|
39
39
|
"package.json"(exports2, module2) {
|
|
40
40
|
module2.exports = {
|
|
41
41
|
name: "coc-vscode-loader",
|
|
42
|
-
version: "1.2.
|
|
42
|
+
version: "1.2.1",
|
|
43
43
|
description: "Run VS Code extensions seamlessly in coc.nvim",
|
|
44
44
|
main: "lib/index.js",
|
|
45
45
|
keywords: [
|
|
@@ -506,7 +506,7 @@ async function convertSource(inputDir, name, info, onProgress) {
|
|
|
506
506
|
if (!fs3.existsSync(path3.join(converterDir, "node_modules", "commander"))) {
|
|
507
507
|
onProgress(2, 5, "Installing converter dependencies...", "");
|
|
508
508
|
const log2 = (chunk) => onProgress(2, 5, chunk.trim(), "");
|
|
509
|
-
await run("npm", ["install", "--legacy-peer-deps", "--
|
|
509
|
+
await run("npm", ["install", "--legacy-peer-deps", "--omit=dev"], converterDir, log2);
|
|
510
510
|
}
|
|
511
511
|
if (!info.convert || !Array.isArray(info.convert) || info.convert.length === 0) {
|
|
512
512
|
throw new Error(`Registry entry "${name}" has no "convert" config. Please update the registry.`);
|
|
@@ -516,9 +516,24 @@ async function convertSource(inputDir, name, info, onProgress) {
|
|
|
516
516
|
fs3.writeFileSync(convertFile, JSON.stringify(info.convert));
|
|
517
517
|
const presetsFile = path3.join(cacheDir(name), "presets-config.json");
|
|
518
518
|
const registryDir = path3.resolve(__dirname, "..", "..", "coc-vscode-registry");
|
|
519
|
-
const
|
|
520
|
-
if (fs3.existsSync(
|
|
521
|
-
fs3.writeFileSync(presetsFile, fs3.readFileSync(
|
|
519
|
+
const localPresets = path3.join(registryDir, "presets.json");
|
|
520
|
+
if (fs3.existsSync(localPresets)) {
|
|
521
|
+
fs3.writeFileSync(presetsFile, fs3.readFileSync(localPresets));
|
|
522
|
+
} else {
|
|
523
|
+
const globalPresetsCache = path3.join(os3.homedir(), ".config", "coc", "converter-cache", "presets.json");
|
|
524
|
+
if (!fs3.existsSync(globalPresetsCache)) {
|
|
525
|
+
try {
|
|
526
|
+
const res = await fetch("https://raw.githubusercontent.com/coc-plugin/coc-vscode-registry/main/presets.json");
|
|
527
|
+
if (res.ok) {
|
|
528
|
+
fs3.mkdirSync(path3.dirname(globalPresetsCache), { recursive: true });
|
|
529
|
+
fs3.writeFileSync(globalPresetsCache, await res.text());
|
|
530
|
+
}
|
|
531
|
+
} catch {
|
|
532
|
+
}
|
|
533
|
+
}
|
|
534
|
+
if (fs3.existsSync(globalPresetsCache)) {
|
|
535
|
+
fs3.writeFileSync(presetsFile, fs3.readFileSync(globalPresetsCache));
|
|
536
|
+
}
|
|
522
537
|
}
|
|
523
538
|
const args = ["tsx", cli, "convert", inputDir, "-o", build, "--convert-file", convertFile];
|
|
524
539
|
if (fs3.existsSync(presetsFile)) args.push("--presets-file", presetsFile);
|