@pixelated-tech/components 3.9.6 → 3.9.7
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/components/admin/site-health/site-health-axe-core.js +2 -0
- package/dist/components/sitebuilder/config/ConfigBuilder.js +6 -2
- package/dist/components/sitebuilder/form/formfieldvalidations.js +1 -1
- package/dist/components/utilities/functions.js +3 -1
- package/dist/components/utilities/gemini-api.client.js +4 -1
- package/dist/components/utilities/gemini-api.server.js +10 -4
- package/dist/test/run-analyzeGitHealth.js +2 -2
- package/dist/types/components/admin/site-health/site-health-axe-core.d.ts.map +1 -1
- package/dist/types/components/sitebuilder/config/ConfigBuilder.d.ts.map +1 -1
- package/dist/types/components/utilities/functions.d.ts.map +1 -1
- package/dist/types/components/utilities/gemini-api.client.d.ts.map +1 -1
- package/dist/types/components/utilities/gemini-api.server.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -4,6 +4,8 @@ import React from 'react';
|
|
|
4
4
|
import PropTypes from 'prop-types';
|
|
5
5
|
import { SiteHealthTemplate } from './site-health-template';
|
|
6
6
|
import { getImpactIndicator, getIncompleteIndicator, getPassingIndicator } from './site-health-indicators';
|
|
7
|
+
// Debug logging: set to `true` temporarily when investigating issues locally. Keep `false` in production.
|
|
8
|
+
const debug = false;
|
|
7
9
|
SiteHealthAxeCore.propTypes = {
|
|
8
10
|
siteName: PropTypes.string.isRequired,
|
|
9
11
|
};
|
|
@@ -15,6 +15,8 @@ import routesForm from './routes-form.json';
|
|
|
15
15
|
import servicesForm from './services-form.json';
|
|
16
16
|
import defaultConfigData from '../../../data/routes.json';
|
|
17
17
|
import './ConfigBuilder.css';
|
|
18
|
+
// Debug logging: set to true to surface verbose AI/debug actions locally
|
|
19
|
+
const debug = false;
|
|
18
20
|
const RoutePropTypes = {
|
|
19
21
|
name: PropTypes.string,
|
|
20
22
|
path: PropTypes.string.isRequired,
|
|
@@ -413,7 +415,8 @@ export function ConfigBuilder(props) {
|
|
|
413
415
|
onSave?.(getProcessedConfig(config));
|
|
414
416
|
};
|
|
415
417
|
const handleAiRecommendations = async (routeIndex) => {
|
|
416
|
-
|
|
418
|
+
if (debug)
|
|
419
|
+
console.log('handleAiRecommendations called with routeIndex:', routeIndex);
|
|
417
420
|
setCurrentRouteIndex(routeIndex);
|
|
418
421
|
setAiLoading(true);
|
|
419
422
|
setAiModalOpen(true);
|
|
@@ -506,7 +509,8 @@ export function ConfigBuilder(props) {
|
|
|
506
509
|
};
|
|
507
510
|
return _jsx(Component, { ...fieldProps }, fieldProps.id);
|
|
508
511
|
}), _jsxs("div", { className: "route-buttons", children: [_jsxs("button", { onClick: () => {
|
|
509
|
-
|
|
512
|
+
if (debug)
|
|
513
|
+
console.log('AI Recommend button clicked for route:', index);
|
|
510
514
|
handleAiRecommendations(index);
|
|
511
515
|
}, className: "route-button ai-recommend", children: [_jsx("span", { className: "ai-icon", children: "\u2728" }), " Recommend"] }), _jsx("button", { onClick: () => removeRoute(index), className: "route-button remove", children: "Remove" })] })] }, index))) }), _jsx("button", { onClick: addRoute, children: "Add Route" })] }) }))
|
|
512
516
|
},
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
'use client';
|
|
2
|
+
// Debug logging: set to true to inspect AI model responses locally
|
|
3
|
+
const debug = false;
|
|
2
4
|
/**
|
|
3
5
|
* Service for integrating with Google Gemini API for SEO recommendations
|
|
4
6
|
*/
|
|
@@ -59,7 +61,8 @@ export class GeminiApiService {
|
|
|
59
61
|
throw new Error(`Failed to list models: ${response.status} ${response.statusText}`);
|
|
60
62
|
}
|
|
61
63
|
const data = await response.json();
|
|
62
|
-
|
|
64
|
+
if (debug)
|
|
65
|
+
console.log('Available models:', data);
|
|
63
66
|
return data;
|
|
64
67
|
}
|
|
65
68
|
catch (error) {
|
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
"use server";
|
|
2
|
+
// Debug logging: set to true to inspect raw Gemini API responses locally
|
|
3
|
+
const debug = false;
|
|
2
4
|
/**
|
|
3
5
|
* Parse the response from Google Gemini API
|
|
4
6
|
*/
|
|
5
7
|
function parseGeminiResponse(data) {
|
|
6
8
|
try {
|
|
7
|
-
|
|
9
|
+
if (debug)
|
|
10
|
+
console.log('Gemini API raw response:', JSON.stringify(data, null, 2));
|
|
8
11
|
// Check if we have candidates
|
|
9
12
|
if (!data.candidates || !Array.isArray(data.candidates) || data.candidates.length === 0) {
|
|
10
13
|
throw new Error('No candidates in Gemini API response');
|
|
@@ -18,7 +21,8 @@ function parseGeminiResponse(data) {
|
|
|
18
21
|
throw new Error('No content parts in Gemini API response');
|
|
19
22
|
}
|
|
20
23
|
const text = candidate.content.parts[0].text;
|
|
21
|
-
|
|
24
|
+
if (debug)
|
|
25
|
+
console.log('Gemini API response text:', text);
|
|
22
26
|
if (!text) {
|
|
23
27
|
throw new Error('No text content in Gemini API response');
|
|
24
28
|
}
|
|
@@ -30,10 +34,12 @@ function parseGeminiResponse(data) {
|
|
|
30
34
|
else if (jsonText.startsWith('```')) {
|
|
31
35
|
jsonText = jsonText.replace(/^```\s*/, '').replace(/\s*```$/, '');
|
|
32
36
|
}
|
|
33
|
-
|
|
37
|
+
if (debug)
|
|
38
|
+
console.log('Cleaned JSON text:', jsonText);
|
|
34
39
|
// The text should be JSON, try to parse it
|
|
35
40
|
const parsedResponse = JSON.parse(jsonText);
|
|
36
|
-
|
|
41
|
+
if (debug)
|
|
42
|
+
console.log('Parsed JSON response:', parsedResponse);
|
|
37
43
|
// Validate the expected structure
|
|
38
44
|
if (typeof parsedResponse !== 'object' || parsedResponse === null) {
|
|
39
45
|
throw new Error('Parsed response is not a valid object');
|
|
@@ -23,7 +23,7 @@ async function runWithSite(siteName, startDate, endDate) {
|
|
|
23
23
|
}
|
|
24
24
|
// Use real fetch for this run
|
|
25
25
|
const res = await analyzeGitHealth(site, startDate, endDate);
|
|
26
|
-
console.log('Result:', JSON.stringify(res, null, 2));
|
|
26
|
+
// console.log('Result:', JSON.stringify(res, null, 2));
|
|
27
27
|
}
|
|
28
28
|
async function runStubbed() {
|
|
29
29
|
// Provide a global fetch that simulates commits only (no tag pagination)
|
|
@@ -34,7 +34,7 @@ async function runStubbed() {
|
|
|
34
34
|
return { ok: false, status: 404, statusText: 'Not Found', text: async () => 'not found' };
|
|
35
35
|
};
|
|
36
36
|
const res = await analyzeGitHealth({ name: 'foo', remote: 'owner/repo' });
|
|
37
|
-
console.log('Result (stubbed):', JSON.stringify(res, null, 2));
|
|
37
|
+
// console.log('Result (stubbed):', JSON.stringify(res, null, 2));
|
|
38
38
|
}
|
|
39
39
|
(async () => {
|
|
40
40
|
const [, , siteName, startDate, endDate] = process.argv;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"site-health-axe-core.d.ts","sourceRoot":"","sources":["../../../../../src/components/admin/site-health/site-health-axe-core.tsx"],"names":[],"mappings":"AAGA,OAAO,SAAS,EAAE,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"site-health-axe-core.d.ts","sourceRoot":"","sources":["../../../../../src/components/admin/site-health/site-health-axe-core.tsx"],"names":[],"mappings":"AAGA,OAAO,SAAS,EAAE,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAWnD,MAAM,MAAM,qBAAqB,GAAG,UAAU,CAAC,OAAO,iBAAiB,CAAC,SAAS,CAAC,CAAC;AACnF,wBAAgB,iBAAiB,CAAC,EAAE,QAAQ,EAAE,EAAE,qBAAqB,2CAiSpE;yBAjSe,iBAAiB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ConfigBuilder.d.ts","sourceRoot":"","sources":["../../../../../src/components/sitebuilder/config/ConfigBuilder.tsx"],"names":[],"mappings":"AAGA,OAAO,SAAS,EAAE,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAanD,OAAO,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"ConfigBuilder.d.ts","sourceRoot":"","sources":["../../../../../src/components/sitebuilder/config/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UAQnC,CAAC;AAEF,eAAO,MAAM,wBAAwB,UAOpC,CAAC;AAGF;;GAEG;AACH,eAAO,MAAM,oBAAoB,UAoBhC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gemini-api.client.d.ts","sourceRoot":"","sources":["../../../../src/components/utilities/gemini-api.client.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,qCAAqC,CAAC;
|
|
1
|
+
{"version":3,"file":"gemini-api.client.d.ts","sourceRoot":"","sources":["../../../../src/components/utilities/gemini-api.client.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,qCAAqC,CAAC;AAM9E,MAAM,WAAW,2BAA2B;IAC1C,KAAK,EAAE,SAAS,CAAC;IACjB,QAAQ,EAAE,YAAY,CAAC;IACvB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,4BAA4B;IAC3C,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;IACpB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,iBAAiB;IAChC,OAAO,EAAE,OAAO,CAAC;IACjB,IAAI,CAAC,EAAE,4BAA4B,CAAC;IACpC,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED;;GAEG;AACH,qBAAa,gBAAgB;IAC5B,OAAO,CAAC,MAAM,CAAS;IACvB,OAAO,CAAC,OAAO,CAAS;gBAEZ,MAAM,EAAE,MAAM,EAAE,OAAO,SAA8C;IAKjF;;KAEI;IACE,4BAA4B,CAAC,OAAO,EAAE,2BAA2B,GAAG,OAAO,CAAC,iBAAiB,CAAC;IAqCpG;;KAEI;IACE,UAAU,IAAI,OAAO,CAAC,GAAG,CAAC;CAqBhC;AAED;;GAEG;AACH,wBAAgB,sBAAsB,CAAC,MAAM,EAAE,MAAM,GAAG,gBAAgB,CAEvE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gemini-api.server.d.ts","sourceRoot":"","sources":["../../../../src/components/utilities/gemini-api.server.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,qCAAqC,CAAC;
|
|
1
|
+
{"version":3,"file":"gemini-api.server.d.ts","sourceRoot":"","sources":["../../../../src/components/utilities/gemini-api.server.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,qCAAqC,CAAC;AAM9E,MAAM,WAAW,2BAA2B;IAC1C,KAAK,EAAE,SAAS,CAAC;IACjB,QAAQ,EAAE,YAAY,CAAC;IACvB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,4BAA4B;IAC3C,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;IACpB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AA+ID;;GAEG;AACH,wBAAsB,yBAAyB,CAC9C,OAAO,EAAE,2BAA2B,EACpC,MAAM,EAAE,MAAM,GACZ,OAAO,CAAC,4BAA4B,CAAC,CA2DvC"}
|