@pagebridge/cli 0.1.1 → 0.1.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/commands/sync.d.ts.map +1 -1
- package/dist/commands/sync.js +40 -7
- package/package.json +3 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sync.d.ts","sourceRoot":"","sources":["../../src/commands/sync.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAkCpC,eAAO,MAAM,WAAW,
|
|
1
|
+
{"version":3,"file":"sync.d.ts","sourceRoot":"","sources":["../../src/commands/sync.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAkCpC,eAAO,MAAM,WAAW,SAyapB,CAAC"}
|
package/dist/commands/sync.js
CHANGED
|
@@ -54,12 +54,42 @@ export const syncCommand = new Command("sync")
|
|
|
54
54
|
const sanityToken = resolve(options.sanityToken, "SANITY_TOKEN");
|
|
55
55
|
const siteUrl = resolve(options.siteUrl, "SITE_URL");
|
|
56
56
|
requireConfig([
|
|
57
|
-
{
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
57
|
+
{
|
|
58
|
+
name: "GOOGLE_SERVICE_ACCOUNT",
|
|
59
|
+
flag: "--google-service-account <json>",
|
|
60
|
+
envVar: "GOOGLE_SERVICE_ACCOUNT",
|
|
61
|
+
value: googleServiceAccount,
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
name: "DATABASE_URL",
|
|
65
|
+
flag: "--db-url <url>",
|
|
66
|
+
envVar: "DATABASE_URL",
|
|
67
|
+
value: dbUrl,
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
name: "SANITY_PROJECT_ID",
|
|
71
|
+
flag: "--sanity-project-id <id>",
|
|
72
|
+
envVar: "SANITY_PROJECT_ID",
|
|
73
|
+
value: sanityProjectId,
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
name: "SANITY_DATASET",
|
|
77
|
+
flag: "--sanity-dataset <name>",
|
|
78
|
+
envVar: "SANITY_DATASET",
|
|
79
|
+
value: sanityDataset,
|
|
80
|
+
},
|
|
81
|
+
{
|
|
82
|
+
name: "SANITY_TOKEN",
|
|
83
|
+
flag: "--sanity-token <token>",
|
|
84
|
+
envVar: "SANITY_TOKEN",
|
|
85
|
+
value: sanityToken,
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
name: "SITE_URL",
|
|
89
|
+
flag: "--site-url <url>",
|
|
90
|
+
envVar: "SITE_URL",
|
|
91
|
+
value: siteUrl,
|
|
92
|
+
},
|
|
63
93
|
]);
|
|
64
94
|
// Run migrations if requested
|
|
65
95
|
await migrateIfRequested(!!options.migrate, dbUrl);
|
|
@@ -325,7 +355,7 @@ export const syncCommand = new Command("sync")
|
|
|
325
355
|
log.info(`Updated Sanity snapshots`);
|
|
326
356
|
}
|
|
327
357
|
timer.end("Total sync", syncStartTime);
|
|
328
|
-
log.info(
|
|
358
|
+
log.info(`Sync complete!`);
|
|
329
359
|
}
|
|
330
360
|
catch (error) {
|
|
331
361
|
const message = error instanceof Error ? error.message : String(error);
|
|
@@ -336,6 +366,9 @@ export const syncCommand = new Command("sync")
|
|
|
336
366
|
await close();
|
|
337
367
|
process.removeListener("SIGTERM", shutdown);
|
|
338
368
|
process.removeListener("SIGINT", shutdown);
|
|
369
|
+
// Sanity client and GSC client keep HTTP connections alive with no close() API.
|
|
370
|
+
// Force exit so the process doesn't hang indefinitely.
|
|
371
|
+
process.exit(process.exitCode ?? 0);
|
|
339
372
|
}
|
|
340
373
|
});
|
|
341
374
|
async function getPublishedDates(sanity, matches) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pagebridge/cli",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.2",
|
|
4
4
|
"description": "CLI for PageBridge — sync Google Search Console data, detect content decay, and generate refresh tasks",
|
|
5
5
|
"private": false,
|
|
6
6
|
"license": "MIT",
|
|
@@ -35,8 +35,8 @@
|
|
|
35
35
|
"@types/node": "^22.15.3",
|
|
36
36
|
"eslint": "^9.39.1",
|
|
37
37
|
"typescript": "^5.9.3",
|
|
38
|
-
"@pagebridge/
|
|
39
|
-
"@pagebridge/
|
|
38
|
+
"@pagebridge/typescript-config": "^0.0.0",
|
|
39
|
+
"@pagebridge/eslint-config": "^0.0.0"
|
|
40
40
|
},
|
|
41
41
|
"scripts": {
|
|
42
42
|
"build": "tsc",
|