aeo.js 0.0.7 → 0.0.8

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.
Files changed (67) hide show
  1. package/dist/angular.d.mts +1 -1
  2. package/dist/angular.d.ts +1 -1
  3. package/dist/angular.js +65 -11
  4. package/dist/angular.js.map +1 -1
  5. package/dist/angular.mjs +65 -11
  6. package/dist/angular.mjs.map +1 -1
  7. package/dist/astro.d.mts +1 -1
  8. package/dist/astro.d.ts +1 -1
  9. package/dist/astro.js +74 -16
  10. package/dist/astro.js.map +1 -1
  11. package/dist/astro.mjs +74 -16
  12. package/dist/astro.mjs.map +1 -1
  13. package/dist/cli.js +80 -25
  14. package/dist/cli.js.map +1 -1
  15. package/dist/cli.mjs +80 -25
  16. package/dist/cli.mjs.map +1 -1
  17. package/dist/index.d.mts +2 -2
  18. package/dist/index.d.ts +2 -2
  19. package/dist/index.js +85 -27
  20. package/dist/index.js.map +1 -1
  21. package/dist/index.mjs +85 -27
  22. package/dist/index.mjs.map +1 -1
  23. package/dist/next.d.mts +1 -1
  24. package/dist/next.d.ts +1 -1
  25. package/dist/next.js +65 -11
  26. package/dist/next.js.map +1 -1
  27. package/dist/next.mjs +65 -11
  28. package/dist/next.mjs.map +1 -1
  29. package/dist/nuxt.d.mts +1 -1
  30. package/dist/nuxt.d.ts +1 -1
  31. package/dist/nuxt.js +65 -11
  32. package/dist/nuxt.js.map +1 -1
  33. package/dist/nuxt.mjs +65 -11
  34. package/dist/nuxt.mjs.map +1 -1
  35. package/dist/react.d.mts +1 -1
  36. package/dist/react.d.ts +1 -1
  37. package/dist/react.js +52 -7
  38. package/dist/react.js.map +1 -1
  39. package/dist/react.mjs +52 -7
  40. package/dist/react.mjs.map +1 -1
  41. package/dist/{types-Cn_Qbkmg.d.mts → types-BlLNcw-X.d.mts} +2 -0
  42. package/dist/{types-Cn_Qbkmg.d.ts → types-BlLNcw-X.d.ts} +2 -0
  43. package/dist/vite.d.mts +1 -1
  44. package/dist/vite.d.ts +1 -1
  45. package/dist/vite.js +90 -18
  46. package/dist/vite.js.map +1 -1
  47. package/dist/vite.mjs +90 -18
  48. package/dist/vite.mjs.map +1 -1
  49. package/dist/vue.d.mts +1 -1
  50. package/dist/vue.d.ts +1 -1
  51. package/dist/vue.js +52 -7
  52. package/dist/vue.js.map +1 -1
  53. package/dist/vue.mjs +52 -7
  54. package/dist/vue.mjs.map +1 -1
  55. package/dist/webpack.d.mts +1 -1
  56. package/dist/webpack.d.ts +1 -1
  57. package/dist/webpack.js +65 -11
  58. package/dist/webpack.js.map +1 -1
  59. package/dist/webpack.mjs +65 -11
  60. package/dist/webpack.mjs.map +1 -1
  61. package/dist/widget.d.mts +1 -1
  62. package/dist/widget.d.ts +1 -1
  63. package/dist/widget.js +52 -7
  64. package/dist/widget.js.map +1 -1
  65. package/dist/widget.mjs +52 -7
  66. package/dist/widget.mjs.map +1 -1
  67. package/package.json +1 -1
@@ -1,4 +1,4 @@
1
- import { A as AeoConfig } from './types-Cn_Qbkmg.mjs';
1
+ import { A as AeoConfig } from './types-BlLNcw-X.mjs';
2
2
 
3
3
  /**
4
4
  * Generate a widget script tag to inject into Angular's index.html.
package/dist/angular.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { A as AeoConfig } from './types-Cn_Qbkmg.js';
1
+ import { A as AeoConfig } from './types-BlLNcw-X.js';
2
2
 
3
3
  /**
4
4
  * Generate a widget script tag to inject into Angular's index.html.
package/dist/angular.js CHANGED
@@ -79,10 +79,19 @@ function generateRobotsTxt(config) {
79
79
  }
80
80
  lines.push("# Default for all other bots");
81
81
  lines.push("User-agent: *");
82
- lines.push("Allow: /");
82
+ for (const path of config.robots.allow.length > 0 ? config.robots.allow : ["/"]) {
83
+ lines.push(`Allow: ${path}`);
84
+ }
85
+ for (const path of config.robots.disallow) {
86
+ lines.push(`Disallow: ${path}`);
87
+ }
88
+ if (config.robots.crawlDelay > 0) {
89
+ lines.push(`Crawl-delay: ${config.robots.crawlDelay}`);
90
+ }
83
91
  lines.push("");
84
- if (config.url) {
85
- lines.push(`Sitemap: ${config.url}/sitemap.xml`);
92
+ const sitemapUrl = config.robots.sitemap || (config.url ? `${config.url}/sitemap.xml` : "");
93
+ if (sitemapUrl) {
94
+ lines.push(`Sitemap: ${sitemapUrl}`);
86
95
  }
87
96
  lines.push("");
88
97
  lines.push("# AEO (Answer Engine Optimization) files");
@@ -164,7 +173,7 @@ function detectFramework(projectRoot = process.cwd()) {
164
173
  };
165
174
  }
166
175
  function resolveConfig(config = {}) {
167
- var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _A, _B, _C, _D, _E, _F, _G, _H, _I, _J, _K, _L, _M;
176
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _A, _B, _C, _D, _E, _F, _G, _H, _I, _J, _K, _L, _M, _N;
168
177
  const frameworkInfo = detectFramework();
169
178
  return {
170
179
  title: config.title || "My Site",
@@ -208,15 +217,16 @@ function resolveConfig(config = {}) {
208
217
  widget: {
209
218
  enabled: ((_A = config.widget) == null ? void 0 : _A.enabled) !== false,
210
219
  position: ((_B = config.widget) == null ? void 0 : _B.position) || "bottom-right",
220
+ size: ((_C = config.widget) == null ? void 0 : _C.size) || "default",
211
221
  theme: {
212
- background: ((_D = (_C = config.widget) == null ? void 0 : _C.theme) == null ? void 0 : _D.background) || "rgba(18, 18, 24, 0.9)",
213
- text: ((_F = (_E = config.widget) == null ? void 0 : _E.theme) == null ? void 0 : _F.text) || "#C0C0C5",
214
- accent: ((_H = (_G = config.widget) == null ? void 0 : _G.theme) == null ? void 0 : _H.accent) || "#E8E8EA",
215
- badge: ((_J = (_I = config.widget) == null ? void 0 : _I.theme) == null ? void 0 : _J.badge) || "#4ADE80"
222
+ background: ((_E = (_D = config.widget) == null ? void 0 : _D.theme) == null ? void 0 : _E.background) || "rgba(18, 18, 24, 0.9)",
223
+ text: ((_G = (_F = config.widget) == null ? void 0 : _F.theme) == null ? void 0 : _G.text) || "#C0C0C5",
224
+ accent: ((_I = (_H = config.widget) == null ? void 0 : _H.theme) == null ? void 0 : _I.accent) || "#E8E8EA",
225
+ badge: ((_K = (_J = config.widget) == null ? void 0 : _J.theme) == null ? void 0 : _K.badge) || "#4ADE80"
216
226
  },
217
- humanLabel: ((_K = config.widget) == null ? void 0 : _K.humanLabel) || "Human",
218
- aiLabel: ((_L = config.widget) == null ? void 0 : _L.aiLabel) || "AI",
219
- showBadge: ((_M = config.widget) == null ? void 0 : _M.showBadge) !== false
227
+ humanLabel: ((_L = config.widget) == null ? void 0 : _L.humanLabel) || "Human",
228
+ aiLabel: ((_M = config.widget) == null ? void 0 : _M.aiLabel) || "AI",
229
+ showBadge: ((_N = config.widget) == null ? void 0 : _N.showBadge) !== false
220
230
  }
221
231
  };
222
232
  }
@@ -844,6 +854,22 @@ function generatePageSchemas(page, config) {
844
854
  }))
845
855
  });
846
856
  }
857
+ if (faqItems.length === 0) {
858
+ const howToSteps = detectHowToSteps(page.content || "");
859
+ if (howToSteps.length > 0) {
860
+ schemas.push({
861
+ "@context": "https://schema.org",
862
+ "@type": "HowTo",
863
+ name: page.title || config.title,
864
+ step: howToSteps.map((s, i) => ({
865
+ "@type": "HowToStep",
866
+ position: i + 1,
867
+ name: s.name,
868
+ text: s.text
869
+ }))
870
+ });
871
+ }
872
+ }
847
873
  const pageType = config.schema.defaultType;
848
874
  const pageSchema = {
849
875
  "@context": "https://schema.org",
@@ -920,6 +946,34 @@ function detectFaqPatterns(content) {
920
946
  }
921
947
  return items;
922
948
  }
949
+ function detectHowToSteps(content) {
950
+ const steps = [];
951
+ const lines = content.split("\n");
952
+ for (let i = 0; i < lines.length; i++) {
953
+ const line = lines[i].trim();
954
+ const stepMatch = line.match(/^#{1,6}\s+(?:Step\s+\d+[\s:.-]*|(\d+)[.)]\s*)(.+)$/i);
955
+ if (stepMatch) {
956
+ const name = (stepMatch[2] || stepMatch[1] || "").trim();
957
+ const bodyLines = [];
958
+ for (let j = i + 1; j < lines.length; j++) {
959
+ const nextLine = lines[j].trim();
960
+ if (!nextLine) {
961
+ if (bodyLines.length > 0) break;
962
+ continue;
963
+ }
964
+ if (/^#{1,6}\s/.test(nextLine)) break;
965
+ bodyLines.push(nextLine);
966
+ }
967
+ if (name) {
968
+ steps.push({
969
+ name,
970
+ text: bodyLines.join(" ").slice(0, 500)
971
+ });
972
+ }
973
+ }
974
+ }
975
+ return steps.length >= 2 ? steps : [];
976
+ }
923
977
  async function generateAEOFiles(configOrRoot, maybeConfig) {
924
978
  var _a;
925
979
  let config;