@darkrymit/crunes-cli 0.11.0 → 0.11.2
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/dist/chunks/{add-IT3IHBPO.js → add-A3LBMDLN.js} +2 -1
- package/dist/chunks/{browse-PHMBDREQ.js → browse-OJVZOMJ7.js} +2 -1
- package/dist/chunks/{chunk-YVN3VDRE.js → chunk-AWQ3C7MQ.js} +10 -2
- package/dist/chunks/chunk-M66PQTTU.js +2925 -0
- package/dist/chunks/{chunk-NJVPLN5D.js → chunk-MYYP3AVF.js} +20 -12
- package/dist/chunks/{install-3G7U5ZIO.js → install-QV6BNZZE.js} +3 -2
- package/dist/chunks/{list-U4EMHQZT.js → list-JUGL5ZKG.js} +2 -1
- package/dist/chunks/{remove-BCFTF23J.js → remove-AG7ELQUM.js} +2 -1
- package/dist/chunks/{search-B7IM7JRJ.js → search-P2MEUBIM.js} +2 -1
- package/dist/chunks/{uninstall-J7JUYETA.js → uninstall-FZ6NHXUL.js} +2 -1
- package/dist/chunks/{update-WXT7CHYA.js → update-CK3SSL7M.js} +2 -1
- package/dist/chunks/{update-ZJRLDCUT.js → update-X7QN4KAQ.js} +3 -2
- package/dist/chunks/{version-IDG3M56C.js → version-VOGJQFLH.js} +1 -1
- package/dist/cli.js +11 -11
- package/package.json +1 -1
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
import {
|
|
2
|
+
fo
|
|
3
|
+
} from "./chunk-M66PQTTU.js";
|
|
1
4
|
import {
|
|
2
5
|
ensureStoreDirs,
|
|
3
6
|
getMarketplaceCacheDir,
|
|
@@ -71,7 +74,7 @@ async function downloadMarketplaceJson(classified) {
|
|
|
71
74
|
if (!tarball) throw new Error(`npm pack produced no tarball for ${classified.resolved}`);
|
|
72
75
|
const extractDir = path.join(tmp, "extracted");
|
|
73
76
|
await fs.mkdir(extractDir, { recursive: true });
|
|
74
|
-
await
|
|
77
|
+
await fo({ file: path.join(tmp, tarball), cwd: extractDir, strip: 1 });
|
|
75
78
|
const raw = await fs.readFile(path.join(extractDir, ".crunes-plugin", "marketplace.json"), "utf8");
|
|
76
79
|
return JSON.parse(raw);
|
|
77
80
|
} finally {
|
|
@@ -102,7 +105,8 @@ async function fetchMarketplace(name, entry) {
|
|
|
102
105
|
const cacheDir = getMarketplaceCacheDir(name);
|
|
103
106
|
try {
|
|
104
107
|
const data = JSON.parse(await fs.readFile(path.join(cacheDir, "marketplace.json"), "utf8"));
|
|
105
|
-
|
|
108
|
+
const resolvedPath = classified.type === "github" ? `github:${classified.resolved}` : cacheDir;
|
|
109
|
+
return { data, resolvedPath };
|
|
106
110
|
} catch (err) {
|
|
107
111
|
if (err.code === "ENOENT") throw new Error(`Marketplace "${name}" not cached. Run: crunes marketplace update ${name}`);
|
|
108
112
|
throw err;
|
|
@@ -209,6 +213,10 @@ async function resolveFromMarketplace(marketplaceName, pluginName) {
|
|
|
209
213
|
}
|
|
210
214
|
function resolvePluginSource(source, marketplaceResolvedPath) {
|
|
211
215
|
if (!isLocalPath(source)) return source;
|
|
216
|
+
if (marketplaceResolvedPath.startsWith("github:")) {
|
|
217
|
+
const subpath = source.replace(/^\.?[\\/]+/, "").replace(/\\/g, "/");
|
|
218
|
+
return subpath ? `${marketplaceResolvedPath}#${subpath}` : marketplaceResolvedPath;
|
|
219
|
+
}
|
|
212
220
|
if (marketplaceResolvedPath.startsWith("http://") || marketplaceResolvedPath.startsWith("https://")) {
|
|
213
221
|
return new URL(source, marketplaceResolvedPath).href;
|
|
214
222
|
}
|