@toon-protocol/rig 2.13.0 → 2.13.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/dist/cli/rig.js +15 -3
- package/dist/cli/rig.js.map +1 -1
- package/package.json +1 -1
package/dist/cli/rig.js
CHANGED
|
@@ -46,6 +46,7 @@ import {
|
|
|
46
46
|
minaPresetForChain
|
|
47
47
|
} from "../chunk-ACTH6ISJ.js";
|
|
48
48
|
import {
|
|
49
|
+
ARWEAVE_GATEWAYS,
|
|
49
50
|
COMMENT_KIND,
|
|
50
51
|
authorizedStatusAuthors,
|
|
51
52
|
buildComment,
|
|
@@ -560,6 +561,8 @@ var DEFAULT_RIG_WEB_BUNDLE = {
|
|
|
560
561
|
var RIG_WEB_TX_ENV = "RIG_WEB_TX";
|
|
561
562
|
var RIG_WEB_ENTRY_JS_ENV = "RIG_WEB_ENTRY_JS";
|
|
562
563
|
var RIG_WEB_ENTRY_CSS_ENV = "RIG_WEB_ENTRY_CSS";
|
|
564
|
+
var DEFAULT_RIG_WEB_GATEWAY = "https://arweave.net";
|
|
565
|
+
var RIG_WEB_GATEWAY_ENV = "RIG_WEB_GATEWAY";
|
|
563
566
|
var DEFAULT_RIG_WEB_URL = "https://toon-protocol.github.io/toon-client";
|
|
564
567
|
var RIG_WEB_URL_ENV = "RIG_WEB_URL";
|
|
565
568
|
function repoHashRoute(options) {
|
|
@@ -1215,11 +1218,14 @@ function parsePushArgs(args) {
|
|
|
1215
1218
|
return flags;
|
|
1216
1219
|
}
|
|
1217
1220
|
function pointerGateway(env) {
|
|
1218
|
-
return (env["RIG_ARWEAVE_GATEWAY"] ?? "https://
|
|
1221
|
+
return (env["RIG_ARWEAVE_GATEWAY"] ?? "https://ar-io.dev").replace(
|
|
1219
1222
|
/\/+$/,
|
|
1220
1223
|
""
|
|
1221
1224
|
);
|
|
1222
1225
|
}
|
|
1226
|
+
function mirrorGateway(primary) {
|
|
1227
|
+
return ARWEAVE_GATEWAYS.find((g) => g !== primary);
|
|
1228
|
+
}
|
|
1223
1229
|
function planRigPointer(args) {
|
|
1224
1230
|
const html = generateRigPointerHtml({
|
|
1225
1231
|
bundle: {
|
|
@@ -1227,7 +1233,7 @@ function planRigPointer(args) {
|
|
|
1227
1233
|
entryJs: args.env[RIG_WEB_ENTRY_JS_ENV] ?? DEFAULT_RIG_WEB_BUNDLE.entryJs,
|
|
1228
1234
|
entryCss: args.env[RIG_WEB_ENTRY_CSS_ENV] ?? DEFAULT_RIG_WEB_BUNDLE.entryCss
|
|
1229
1235
|
},
|
|
1230
|
-
gateway:
|
|
1236
|
+
gateway: (args.env[RIG_WEB_GATEWAY_ENV] ?? DEFAULT_RIG_WEB_GATEWAY).replace(/\/+$/, ""),
|
|
1231
1237
|
rigWebUrl: args.env[RIG_WEB_URL_ENV] ?? DEFAULT_RIG_WEB_URL,
|
|
1232
1238
|
relay: args.relay,
|
|
1233
1239
|
ownerNpub: hexToNpub(args.ownerPubkey),
|
|
@@ -1428,6 +1434,12 @@ async function runPush(args, deps) {
|
|
|
1428
1434
|
io2.out(
|
|
1429
1435
|
`Rig page: ${rigPage2.url}` + (rigPage2.status === "published" ? ` paid ${rigPage2.feePaid}` : "") + " (renders this repo from Arweave)"
|
|
1430
1436
|
);
|
|
1437
|
+
const mirror = rigPage2.txId ? mirrorGateway(gateway) : void 0;
|
|
1438
|
+
if (mirror) {
|
|
1439
|
+
io2.out(
|
|
1440
|
+
` also: ${mirror}/${rigPage2.txId} (same page; gateways index fresh uploads at different speeds)`
|
|
1441
|
+
);
|
|
1442
|
+
}
|
|
1431
1443
|
} else if (rigPage2.detail) {
|
|
1432
1444
|
io2.err(`rig page: ${rigPage2.detail}`);
|
|
1433
1445
|
}
|
|
@@ -7035,7 +7047,7 @@ function writeSiteRecord(env, record) {
|
|
|
7035
7047
|
|
|
7036
7048
|
// src/cli/site.ts
|
|
7037
7049
|
var MANIFEST_CONTENT_TYPE = "application/x.arweave-manifest+json";
|
|
7038
|
-
var DEFAULT_GATEWAY = "https://
|
|
7050
|
+
var DEFAULT_GATEWAY = "https://ar-io.dev";
|
|
7039
7051
|
var SITE_USAGE = `Usage: rig site <publish|url> [ref] [options]
|
|
7040
7052
|
|
|
7041
7053
|
Serve a pushed repo as a permanent, path-routed website. \`rig push\` already
|