astro-indexnow 2.3.3 → 2.3.4
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/README.MD +20 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +5 -2
- package/package.json +1 -1
package/README.MD
CHANGED
|
@@ -6,7 +6,7 @@ to **IndexNow** after each build.
|
|
|
6
6
|
This package is designed for **modern CI/CD pipelines**, **Docker-based deployments**, and
|
|
7
7
|
**large static sites**, while remaining fully deterministic and explicit.
|
|
8
8
|
|
|
9
|
-
> **Current release:** v2.3.
|
|
9
|
+
> **Current release:** v2.3.4
|
|
10
10
|
> **Stateful by design. `changed` by default, `all` available. Batch-safe. CI-aware.**
|
|
11
11
|
|
|
12
12
|
---
|
|
@@ -30,6 +30,7 @@ Instead of waiting for crawlers, your site tells search engines exactly which UR
|
|
|
30
30
|
- 🔀 Optional `submissionMode` lets you choose `changed` or `all`
|
|
31
31
|
- 🧪 Optional `dryRun` plans submissions without sending requests
|
|
32
32
|
- 🗣 Optional `logMode` controls verbosity with `quiet`, `normal`, and `verbose`
|
|
33
|
+
- 📦 Optional `batchSize` lets you lower the submit batch size for testing
|
|
33
34
|
- 🧪 Fully **CI/CD and Docker safe**
|
|
34
35
|
- 🔒 No secrets prompted, stored, or mutated
|
|
35
36
|
- 🧩 No client-side or runtime code added
|
|
@@ -287,6 +288,24 @@ indexnow({
|
|
|
287
288
|
|
|
288
289
|
---
|
|
289
290
|
|
|
291
|
+
### `batchSize` (optional)
|
|
292
|
+
|
|
293
|
+
Type: `number`
|
|
294
|
+
Default: `10000`
|
|
295
|
+
|
|
296
|
+
Controls how many URLs are submitted per IndexNow request.
|
|
297
|
+
|
|
298
|
+
- The default matches IndexNow’s documented limit
|
|
299
|
+
- Lower values are useful for testing or constrained environments
|
|
300
|
+
|
|
301
|
+
```js
|
|
302
|
+
indexnow({
|
|
303
|
+
batchSize: 100,
|
|
304
|
+
})
|
|
305
|
+
```
|
|
306
|
+
|
|
307
|
+
---
|
|
308
|
+
|
|
290
309
|
## IndexNow Limits & Batching
|
|
291
310
|
|
|
292
311
|
- IndexNow allows **up to 10,000 URLs per request**
|
package/dist/index.d.ts
CHANGED
|
@@ -7,6 +7,7 @@ export interface IndexNowOptions {
|
|
|
7
7
|
dryRun?: boolean;
|
|
8
8
|
logMode?: "quiet" | "normal" | "verbose";
|
|
9
9
|
submissionMode?: "changed" | "all";
|
|
10
|
+
batchSize?: number;
|
|
10
11
|
}
|
|
11
12
|
export default function indexNow(options?: IndexNowOptions): AstroIntegration;
|
|
12
13
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,OAAO,CAAC;AAM9C,MAAM,WAAW,eAAe;IAC9B,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,OAAO,CAAC,EAAE,OAAO,GAAG,QAAQ,GAAG,SAAS,CAAC;IACzC,cAAc,CAAC,EAAE,SAAS,GAAG,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,OAAO,CAAC;AAM9C,MAAM,WAAW,eAAe;IAC9B,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,OAAO,CAAC,EAAE,OAAO,GAAG,QAAQ,GAAG,SAAS,CAAC;IACzC,cAAc,CAAC,EAAE,SAAS,GAAG,KAAK,CAAC;IACnC,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,CAAC,OAAO,UAAU,QAAQ,CAC9B,OAAO,GAAE,eAAoB,GAC5B,gBAAgB,CA0PlB"}
|
package/dist/index.js
CHANGED
|
@@ -11,6 +11,9 @@ export default function indexNow(options = {}) {
|
|
|
11
11
|
: path.join(projectRoot, CACHE_FILENAME);
|
|
12
12
|
const INDEXNOW_ENDPOINT = "https://api.indexnow.org/indexnow";
|
|
13
13
|
const INDEXNOW_BATCH_SIZE = 10_000;
|
|
14
|
+
const batchSize = typeof options.batchSize === "number" && options.batchSize > 0
|
|
15
|
+
? Math.floor(options.batchSize)
|
|
16
|
+
: INDEXNOW_BATCH_SIZE;
|
|
14
17
|
/* =========================================================
|
|
15
18
|
Helpers
|
|
16
19
|
========================================================= */
|
|
@@ -144,8 +147,8 @@ export default function indexNow(options = {}) {
|
|
|
144
147
|
saveCache(logger, nextCache);
|
|
145
148
|
return;
|
|
146
149
|
}
|
|
147
|
-
const batches = chunk(urlsToSubmit,
|
|
148
|
-
logInfo(logger, `submitting ${urlsToSubmit.length} URL(s) in ${batches.length} batch(es) [mode=${options.submissionMode ?? "changed"}]`);
|
|
150
|
+
const batches = chunk(urlsToSubmit, batchSize);
|
|
151
|
+
logInfo(logger, `submitting ${urlsToSubmit.length} URL(s) in ${batches.length} batch(es) [mode=${options.submissionMode ?? "changed"}, batchSize=${batchSize}]`);
|
|
149
152
|
if (isVerbose()) {
|
|
150
153
|
logVerbose(logger, "planned URL list:");
|
|
151
154
|
for (const url of urlsToSubmit) {
|