astro-indexnow 2.2.0 → 2.3.0

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 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
- > **Version:** v2.2.0
9
+ > **Current release:** v2.3.0
10
10
  > **Stateful by design. Changed-only submissions. Batch-safe. CI-aware.**
11
11
 
12
12
  ---
package/dist/index.d.ts CHANGED
@@ -4,6 +4,7 @@ export interface IndexNowOptions {
4
4
  siteUrl?: string;
5
5
  enabled?: boolean;
6
6
  cacheDir?: string;
7
+ submissionMode?: "changed" | "all";
7
8
  }
8
9
  export default function indexNow(options?: IndexNowOptions): AstroIntegration;
9
10
  //# sourceMappingURL=index.d.ts.map
@@ -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;CACnB;AAED,MAAM,CAAC,OAAO,UAAU,QAAQ,CAC9B,OAAO,GAAE,eAAoB,GAC5B,gBAAgB,CAyMlB"}
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,cAAc,CAAC,EAAE,SAAS,GAAG,KAAK,CAAC;CACpC;AAED,MAAM,CAAC,OAAO,UAAU,QAAQ,CAC9B,OAAO,GAAE,eAAoB,GAC5B,gBAAgB,CA8MlB"}
package/dist/index.js CHANGED
@@ -116,13 +116,16 @@ export default function indexNow(options = {}) {
116
116
  : "new/changed";
117
117
  logger.debug(` - ${url} (${state})`);
118
118
  }
119
- if (changedUrls.length === 0) {
119
+ const urlsToSubmit = options.submissionMode === "all"
120
+ ? Object.keys(nextCache)
121
+ : changedUrls;
122
+ if (urlsToSubmit.length === 0) {
120
123
  logger.info("[astro-indexnow] no changed URLs detected, skipping submission");
121
124
  saveCache(logger, nextCache);
122
125
  return;
123
126
  }
124
- const batches = chunk(changedUrls, INDEXNOW_BATCH_SIZE);
125
- logger.info(`[astro-indexnow] submitting ${changedUrls.length} changed URLs in ${batches.length} batch(es)`);
127
+ const batches = chunk(urlsToSubmit, INDEXNOW_BATCH_SIZE);
128
+ logger.info(`[astro-indexnow] submitting ${urlsToSubmit.length} URL(s) in ${batches.length} batch(es) [mode=${options.submissionMode ?? "changed"}]`);
126
129
  for (let i = 0; i < batches.length; i++) {
127
130
  const batch = batches[i];
128
131
  logger.debug(`[astro-indexnow] submitting batch ${i + 1}/${batches.length} (${batch.length} URLs)`);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "astro-indexnow",
3
- "version": "2.2.0",
3
+ "version": "2.3.0",
4
4
  "description": "Astro integration to submit pages to IndexNow automatically after build",
5
5
  "type": "module",
6
6
  "exports": {