@topogram/cli 0.3.77 → 0.3.78

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 (51) hide show
  1. package/package.json +1 -1
  2. package/src/import/core/shared/files.js +21 -2
  3. package/src/import/core/shared.js +2 -1
  4. package/src/import/enrichers/django-rest.js +4 -4
  5. package/src/import/enrichers/rails-controllers.js +3 -3
  6. package/src/import/enrichers/rails-models.js +3 -3
  7. package/src/import/extractors/api/aspnet-core.js +5 -5
  8. package/src/import/extractors/api/django-routes.js +5 -5
  9. package/src/import/extractors/api/express.js +4 -4
  10. package/src/import/extractors/api/fastify.js +7 -7
  11. package/src/import/extractors/api/flutter-dio.js +4 -4
  12. package/src/import/extractors/api/generic-route-fallback.js +2 -2
  13. package/src/import/extractors/api/graphql-code-first.js +3 -3
  14. package/src/import/extractors/api/graphql-sdl.js +5 -5
  15. package/src/import/extractors/api/jaxrs.js +3 -3
  16. package/src/import/extractors/api/micronaut.js +3 -3
  17. package/src/import/extractors/api/openapi-code.js +4 -4
  18. package/src/import/extractors/api/openapi.js +3 -3
  19. package/src/import/extractors/api/rails-routes.js +3 -3
  20. package/src/import/extractors/api/react-native-repository.js +3 -3
  21. package/src/import/extractors/api/retrofit.js +3 -3
  22. package/src/import/extractors/api/spring-web.js +3 -3
  23. package/src/import/extractors/api/swift-webapi.js +3 -3
  24. package/src/import/extractors/api/trpc.js +4 -4
  25. package/src/import/extractors/cli/generic.js +3 -3
  26. package/src/import/extractors/db/django-models.js +4 -4
  27. package/src/import/extractors/db/dotnet-models.js +4 -4
  28. package/src/import/extractors/db/drizzle.js +9 -7
  29. package/src/import/extractors/db/ef-core.js +5 -5
  30. package/src/import/extractors/db/flutter-entities.js +3 -3
  31. package/src/import/extractors/db/jpa.js +3 -3
  32. package/src/import/extractors/db/liquibase.js +3 -3
  33. package/src/import/extractors/db/maintained-seams.js +4 -4
  34. package/src/import/extractors/db/mybatis-xml.js +4 -4
  35. package/src/import/extractors/db/prisma.js +3 -3
  36. package/src/import/extractors/db/rails-schema.js +3 -3
  37. package/src/import/extractors/db/react-native-entities.js +3 -3
  38. package/src/import/extractors/db/room.js +5 -5
  39. package/src/import/extractors/db/snapshot.js +3 -3
  40. package/src/import/extractors/db/sql.js +3 -3
  41. package/src/import/extractors/db/swiftdata.js +3 -3
  42. package/src/import/extractors/ui/android-compose.js +4 -4
  43. package/src/import/extractors/ui/backend-only.js +3 -3
  44. package/src/import/extractors/ui/blazor.js +3 -3
  45. package/src/import/extractors/ui/flutter-screens.js +3 -3
  46. package/src/import/extractors/ui/maui-xaml.js +4 -4
  47. package/src/import/extractors/ui/next-pages-router.js +3 -3
  48. package/src/import/extractors/ui/razor-pages.js +3 -3
  49. package/src/import/extractors/ui/react-native-screens.js +4 -4
  50. package/src/import/extractors/ui/swiftui.js +3 -3
  51. package/src/import/extractors/ui/uikit.js +3 -3
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  canonicalCandidateTerm,
3
3
  dedupeCandidateRecords,
4
- findImportFiles,
4
+ findPrimaryImportFiles,
5
5
  idHintify,
6
6
  makeCandidateRecord,
7
7
  relativeTo,
@@ -54,7 +54,7 @@ export const mauiXamlUiExtractor = {
54
54
  id: "ui.maui-xaml",
55
55
  track: "ui",
56
56
  detect(context) {
57
- const xamlFiles = findImportFiles(context.paths, (filePath) => /\.xaml$/i.test(filePath));
57
+ const xamlFiles = findPrimaryImportFiles(context.paths, (filePath) => /\.xaml$/i.test(filePath));
58
58
  const score = xamlFiles.some((filePath) => /ContentPage|Shell/.test(context.helpers.readTextIfExists(filePath) || "")) ? 82 : 0;
59
59
  return {
60
60
  score,
@@ -62,8 +62,8 @@ export const mauiXamlUiExtractor = {
62
62
  };
63
63
  },
64
64
  extract(context) {
65
- const shellFiles = findImportFiles(context.paths, (filePath) => /AppShell\.xaml$/i.test(filePath));
66
- const viewFiles = findImportFiles(context.paths, (filePath) => /\/Views\/.+\.xaml$/i.test(filePath));
65
+ const shellFiles = findPrimaryImportFiles(context.paths, (filePath) => /AppShell\.xaml$/i.test(filePath));
66
+ const viewFiles = findPrimaryImportFiles(context.paths, (filePath) => /\/Views\/.+\.xaml$/i.test(filePath));
67
67
  const findings = [];
68
68
  const candidates = { screens: [], routes: [], actions: [], stacks: [] };
69
69
  const shellEntries = shellFiles.flatMap((filePath) => parseShellContent(context.helpers.readTextIfExists(filePath) || ""));
@@ -2,7 +2,7 @@ import path from "node:path";
2
2
 
3
3
  import {
4
4
  dedupeCandidateRecords,
5
- findImportFiles,
5
+ findPrimaryImportFiles,
6
6
  inferNonResourceUiFlow,
7
7
  makeCandidateRecord,
8
8
  proposedUiContractAdditionsForFlow,
@@ -61,7 +61,7 @@ export const nextPagesRouterUiExtractor = {
61
61
  id: "ui.next-pages-router",
62
62
  track: "ui",
63
63
  detect(context) {
64
- const pageFiles = findImportFiles(context.paths, (filePath) => /src\/pages\/.+\.(tsx|ts|jsx|js|mdx)$/i.test(filePath))
64
+ const pageFiles = findPrimaryImportFiles(context.paths, (filePath) => /src\/pages\/.+\.(tsx|ts|jsx|js|mdx)$/i.test(filePath))
65
65
  .filter((filePath) => !/\/api\//.test(filePath) && !/\/_(app|document|error)\./.test(filePath) && !/\/404\./.test(filePath));
66
66
  return {
67
67
  score: pageFiles.length > 0 ? 85 : 0,
@@ -70,7 +70,7 @@ export const nextPagesRouterUiExtractor = {
70
70
  },
71
71
  extract(context) {
72
72
  const pagesRoot = path.join(context.paths.workspaceRoot, "src", "pages");
73
- const pageFiles = findImportFiles(context.paths, (filePath) => /src\/pages\/.+\.(tsx|ts|jsx|js|mdx)$/i.test(filePath))
73
+ const pageFiles = findPrimaryImportFiles(context.paths, (filePath) => /src\/pages\/.+\.(tsx|ts|jsx|js|mdx)$/i.test(filePath))
74
74
  .filter((filePath) => !/\/api\//.test(filePath) && !/\/_(app|document|error)\./.test(filePath) && !/\/404\./.test(filePath));
75
75
  const findings = [];
76
76
  const candidates = { screens: [], routes: [], actions: [], flows: [], stacks: [] };
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  canonicalCandidateTerm,
3
3
  dedupeCandidateRecords,
4
- findImportFiles,
4
+ findPrimaryImportFiles,
5
5
  idHintify,
6
6
  makeCandidateRecord,
7
7
  relativeTo,
@@ -81,7 +81,7 @@ export const razorPagesUiExtractor = {
81
81
  id: "ui.razor-pages",
82
82
  track: "ui",
83
83
  detect(context) {
84
- const files = findImportFiles(context.paths, (filePath) => /\.cshtml$/i.test(filePath))
84
+ const files = findPrimaryImportFiles(context.paths, (filePath) => /\.cshtml$/i.test(filePath))
85
85
  .filter((filePath) => !shouldIgnoreFile(filePath));
86
86
  const score = files.length > 0 ? 84 : 0;
87
87
  return {
@@ -90,7 +90,7 @@ export const razorPagesUiExtractor = {
90
90
  };
91
91
  },
92
92
  extract(context) {
93
- const files = findImportFiles(context.paths, (filePath) => /\.cshtml$/i.test(filePath))
93
+ const files = findPrimaryImportFiles(context.paths, (filePath) => /\.cshtml$/i.test(filePath))
94
94
  .filter((filePath) => !shouldIgnoreFile(filePath));
95
95
  const findings = [];
96
96
  const candidates = { screens: [], routes: [], actions: [], stacks: [] };
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  canonicalCandidateTerm,
3
3
  dedupeCandidateRecords,
4
- findImportFiles,
4
+ findPrimaryImportFiles,
5
5
  idHintify,
6
6
  makeCandidateRecord,
7
7
  relativeTo,
@@ -119,7 +119,7 @@ export const reactNativeScreensExtractor = {
119
119
  id: "ui.react-native-screens",
120
120
  track: "ui",
121
121
  detect(context) {
122
- const files = findImportFiles(
122
+ const files = findPrimaryImportFiles(
123
123
  context.paths,
124
124
  (filePath) => /\/src\/.+\/presentation\/screens\/.+Screen\.tsx$/i.test(filePath)
125
125
  );
@@ -130,11 +130,11 @@ export const reactNativeScreensExtractor = {
130
130
  };
131
131
  },
132
132
  extract(context) {
133
- const screenFiles = findImportFiles(
133
+ const screenFiles = findPrimaryImportFiles(
134
134
  context.paths,
135
135
  (filePath) => /\/src\/.+\/presentation\/screens\/.+Screen\.tsx$/i.test(filePath)
136
136
  );
137
- const navigatorFile = findImportFiles(
137
+ const navigatorFile = findPrimaryImportFiles(
138
138
  context.paths,
139
139
  (filePath) => /\/src\/core\/presentation\/navigation\/RootNavigator\.tsx$/i.test(filePath)
140
140
  )[0];
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  canonicalCandidateTerm,
3
3
  dedupeCandidateRecords,
4
- findImportFiles,
4
+ findPrimaryImportFiles,
5
5
  idHintify,
6
6
  isPrimaryImportSource,
7
7
  makeCandidateRecord,
@@ -118,7 +118,7 @@ export const swiftUiExtractor = {
118
118
  id: "ui.swiftui",
119
119
  track: "ui",
120
120
  detect(context) {
121
- const files = findImportFiles(context.paths, (filePath) => /\.swift$/i.test(filePath) && isPrimaryImportSource(context.paths, filePath))
121
+ const files = findPrimaryImportFiles(context.paths, (filePath) => /\.swift$/i.test(filePath) && isPrimaryImportSource(context.paths, filePath))
122
122
  .filter((filePath) => /:\s*View\b/.test(context.helpers.readTextIfExists(filePath) || ""));
123
123
  return {
124
124
  score: files.length > 0 ? 84 : 0,
@@ -126,7 +126,7 @@ export const swiftUiExtractor = {
126
126
  };
127
127
  },
128
128
  extract(context) {
129
- const files = findImportFiles(context.paths, (filePath) => /\.swift$/i.test(filePath) && isPrimaryImportSource(context.paths, filePath))
129
+ const files = findPrimaryImportFiles(context.paths, (filePath) => /\.swift$/i.test(filePath) && isPrimaryImportSource(context.paths, filePath))
130
130
  .filter((filePath) => /:\s*View\b/.test(context.helpers.readTextIfExists(filePath) || ""));
131
131
  const findings = [];
132
132
  const candidates = { screens: [], routes: [], actions: [], stacks: [] };
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  canonicalCandidateTerm,
3
3
  dedupeCandidateRecords,
4
- findImportFiles,
4
+ findPrimaryImportFiles,
5
5
  idHintify,
6
6
  makeCandidateRecord,
7
7
  relativeTo,
@@ -64,7 +64,7 @@ export const uiKitExtractor = {
64
64
  id: "ui.uikit",
65
65
  track: "ui",
66
66
  detect(context) {
67
- const controllerFiles = findImportFiles(context.paths, (filePath) => /\.swift$/i.test(filePath))
67
+ const controllerFiles = findPrimaryImportFiles(context.paths, (filePath) => /\.swift$/i.test(filePath))
68
68
  .filter((filePath) => !shouldIgnoreFile(filePath))
69
69
  .filter((filePath) => /(UIViewController|UITableViewController|UICollectionViewController)/.test(context.helpers.readTextIfExists(filePath) || ""));
70
70
  return {
@@ -73,7 +73,7 @@ export const uiKitExtractor = {
73
73
  };
74
74
  },
75
75
  extract(context) {
76
- const controllerFiles = findImportFiles(context.paths, (filePath) => /\.swift$/i.test(filePath))
76
+ const controllerFiles = findPrimaryImportFiles(context.paths, (filePath) => /\.swift$/i.test(filePath))
77
77
  .filter((filePath) => !shouldIgnoreFile(filePath))
78
78
  .filter((filePath) => /(UIViewController|UITableViewController|UICollectionViewController)/.test(context.helpers.readTextIfExists(filePath) || ""));
79
79
  const findings = [];