create-backlist 9.0.0 → 9.0.1

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 (2) hide show
  1. package/package.json +1 -1
  2. package/src/analyzer.js +39 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-backlist",
3
- "version": "9.0.0",
3
+ "version": "9.0.1",
4
4
  "description": "An advanced, multi-language backend generator based on frontend analysis. Smart Freemium SaaS CLI with Live QA.",
5
5
  "type": "module",
6
6
  "bin": {
package/src/analyzer.js CHANGED
@@ -848,4 +848,43 @@ export async function performPathScan(endpoints) {
848
848
  }
849
849
  }
850
850
  return inconsistencies;
851
+
852
+ }
853
+ // ── performLowCostPathScan (alias for performPathScan) ────────────────────
854
+ export async function performLowCostPathScan(srcDir, endpoints) {
855
+ return performPathScan(endpoints);
856
+ }
857
+
858
+ // ── extractComponentTreeTypes ─────────────────────────────────────────────
859
+ export async function extractComponentTreeTypes(srcDir) {
860
+ if (!fs.existsSync(srcDir)) return [];
861
+
862
+ const files = await glob(
863
+ `${normalizeSlashes(srcDir)}/**/*.{jsx,tsx,ts,js}`,
864
+ { ignore: ['**/node_modules/**', '**/dist/**', '**/build/**'] }
865
+ );
866
+
867
+ const typeMap = {};
868
+
869
+ await withConcurrency(files, async (file) => {
870
+ try {
871
+ const code = await fs.readFile(file, 'utf-8');
872
+ const ast = parser.parse(code, PARSE_OPTIONS);
873
+ traverse(ast, {
874
+ TSPropertySignature(nodePath) {
875
+ const key = nodePath.node.key?.name;
876
+ const ann = nodePath.node.typeAnnotation?.typeAnnotation;
877
+ if (!key || !ann) return;
878
+ const tsMap = {
879
+ TSStringKeyword: 'String',
880
+ TSNumberKeyword: 'Number',
881
+ TSBooleanKeyword: 'Boolean',
882
+ };
883
+ if (tsMap[ann.type]) typeMap[key] = tsMap[ann.type];
884
+ },
885
+ });
886
+ } catch {}
887
+ }, PARALLEL_LIMIT);
888
+
889
+ return Object.entries(typeMap).map(([field, type]) => ({ field, type }));
851
890
  }