@simpleapps-com/augur-config 2.2.1 → 2.2.3
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/bin/augur-doctor.mjs +95 -0
- package/package.json +1 -1
package/bin/augur-doctor.mjs
CHANGED
|
@@ -648,6 +648,100 @@ if (lefthookFile) {
|
|
|
648
648
|
);
|
|
649
649
|
}
|
|
650
650
|
|
|
651
|
+
// ---------------------------------------------------------------------------
|
|
652
|
+
// 20-22. Proxy adoption checks
|
|
653
|
+
// ---------------------------------------------------------------------------
|
|
654
|
+
|
|
655
|
+
// 20. Local hooks that could be replaced by createServerQueryProxy
|
|
656
|
+
const localHooksFile = findFile(
|
|
657
|
+
"lib/augur.ts",
|
|
658
|
+
"src/lib/augur.ts",
|
|
659
|
+
"hooks/augur.ts"
|
|
660
|
+
);
|
|
661
|
+
if (localHooksFile) {
|
|
662
|
+
const hooksContent = readFile(localHooksFile);
|
|
663
|
+
const hasUseQuery =
|
|
664
|
+
hooksContent &&
|
|
665
|
+
(hooksContent.includes("useQuery") || hooksContent.includes("useInfiniteQuery"));
|
|
666
|
+
const hasServerAction =
|
|
667
|
+
hooksContent &&
|
|
668
|
+
(hooksContent.includes("unwrap(") || hooksContent.includes("serverAction") ||
|
|
669
|
+
hooksContent.includes("augur-server/actions"));
|
|
670
|
+
|
|
671
|
+
if (hasUseQuery && hasServerAction) {
|
|
672
|
+
suggest(
|
|
673
|
+
"proxy-local-hooks",
|
|
674
|
+
"Local hooks wrapping server actions -- replace with createServerQueryProxy",
|
|
675
|
+
`${localHooksFile} -- see wiki/guide-migration-runbook#proxy-migration`
|
|
676
|
+
);
|
|
677
|
+
} else if (hasUseQuery) {
|
|
678
|
+
suggest(
|
|
679
|
+
"proxy-local-hooks",
|
|
680
|
+
"Local hooks found -- check if createServerQueryProxy can replace them",
|
|
681
|
+
localHooksFile
|
|
682
|
+
);
|
|
683
|
+
} else {
|
|
684
|
+
pass("proxy-local-hooks", "No local hook wrappers detected", "");
|
|
685
|
+
}
|
|
686
|
+
} else {
|
|
687
|
+
pass("proxy-local-hooks", "No local hook wrappers detected", "");
|
|
688
|
+
}
|
|
689
|
+
|
|
690
|
+
// 21. createServerQueryProxy usage
|
|
691
|
+
const allSrcFiles = [
|
|
692
|
+
"lib/augur-query.ts",
|
|
693
|
+
"src/lib/augur-query.ts",
|
|
694
|
+
"lib/augur.ts",
|
|
695
|
+
"src/lib/augur.ts",
|
|
696
|
+
"app/providers.tsx",
|
|
697
|
+
"src/app/providers.tsx",
|
|
698
|
+
];
|
|
699
|
+
const usesServerProxy = allSrcFiles.some(
|
|
700
|
+
(f) => fileExists(f) && fileContains(f, "createServerQueryProxy")
|
|
701
|
+
);
|
|
702
|
+
const usesAugurOptions = allSrcFiles.some(
|
|
703
|
+
(f) => fileExists(f) && fileContains(f, "useAugurOptions")
|
|
704
|
+
);
|
|
705
|
+
if (usesServerProxy) {
|
|
706
|
+
pass("proxy-server-query", "Uses createServerQueryProxy for data fetching", "");
|
|
707
|
+
} else if (usesAugurOptions) {
|
|
708
|
+
pass("proxy-server-query", "Uses useAugurOptions for data fetching", "");
|
|
709
|
+
} else {
|
|
710
|
+
suggest(
|
|
711
|
+
"proxy-server-query",
|
|
712
|
+
"No proxy-based data fetching detected",
|
|
713
|
+
"Consider createServerQueryProxy (augur-server/hooks) or useAugurOptions (augur-hooks)"
|
|
714
|
+
);
|
|
715
|
+
}
|
|
716
|
+
|
|
717
|
+
// 22. augur-api version
|
|
718
|
+
if (pkg) {
|
|
719
|
+
const allDeps = { ...pkg.dependencies, ...pkg.devDependencies };
|
|
720
|
+
const apiVersion = allDeps["@simpleapps-com/augur-api"] || "";
|
|
721
|
+
if (
|
|
722
|
+
apiVersion.includes("2026.3.4") ||
|
|
723
|
+
apiVersion.includes("2026.3.5") ||
|
|
724
|
+
apiVersion.includes("2026.4") ||
|
|
725
|
+
apiVersion.includes("2027")
|
|
726
|
+
) {
|
|
727
|
+
pass("api-version", "augur-api SDK version supports typed proxies", apiVersion);
|
|
728
|
+
} else if (apiVersion.includes("2026.3")) {
|
|
729
|
+
warn(
|
|
730
|
+
"api-version",
|
|
731
|
+
"augur-api SDK may lack typed proxy support",
|
|
732
|
+
`${apiVersion} -- upgrade to >= 2026.3.4 for typed responses`
|
|
733
|
+
);
|
|
734
|
+
} else if (apiVersion) {
|
|
735
|
+
fail(
|
|
736
|
+
"api-version",
|
|
737
|
+
"augur-api SDK version",
|
|
738
|
+
`${apiVersion} -- upgrade to >= 2026.3.4`
|
|
739
|
+
);
|
|
740
|
+
} else {
|
|
741
|
+
warn("api-version", "No augur-api dependency found", "");
|
|
742
|
+
}
|
|
743
|
+
}
|
|
744
|
+
|
|
651
745
|
// ── Output ───────────────────────────────────────────────────────────────────
|
|
652
746
|
|
|
653
747
|
const ICONS = {
|
|
@@ -680,6 +774,7 @@ const groups = {
|
|
|
680
774
|
"next-strict",
|
|
681
775
|
],
|
|
682
776
|
"Testing & Quality": ["contract-tests", "quality-script", "pre-commit"],
|
|
777
|
+
"Proxy Adoption": ["proxy-local-hooks", "proxy-server-query", "api-version"],
|
|
683
778
|
"Patterns": ["no-wrapper", "auth", "image-loader"],
|
|
684
779
|
};
|
|
685
780
|
|