@futurebrand/dev-tools 2.5.1 → 2.5.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.
Files changed (33) hide show
  1. package/dist/commands/ai/add.js +36 -12
  2. package/dist/commands/ai/docs/index.d.ts +3 -0
  3. package/dist/commands/ai/docs/index.js +60 -0
  4. package/dist/commands/ai/docs/modules/generator/index.d.ts +17 -0
  5. package/dist/commands/ai/docs/modules/generator/index.js +88 -0
  6. package/dist/commands/ai/docs/types.d.ts +11 -0
  7. package/dist/commands/ai/docs/types.js +2 -0
  8. package/dist/commands/ai/generate.js +38 -14
  9. package/dist/commands/ai/modules/figma/index.js +7 -16
  10. package/dist/commands/ai/modules/file-manager/index.d.ts +22 -0
  11. package/dist/commands/ai/modules/file-manager/index.js +156 -0
  12. package/dist/commands/ai/modules/file-manager/types.d.ts +4 -0
  13. package/dist/commands/ai/modules/file-manager/types.js +2 -0
  14. package/dist/commands/ai/modules/generator/index.d.ts +7 -4
  15. package/dist/commands/ai/modules/generator/index.js +55 -73
  16. package/dist/commands/ai/modules/generator/types.d.ts +17 -0
  17. package/dist/commands/ai/modules/generator/types.js +2 -0
  18. package/dist/commands/ai/modules/project-adder/index.d.ts +2 -3
  19. package/dist/commands/ai/modules/project-adder/index.js +6 -58
  20. package/dist/commands/ai/modules/state/index.d.ts +3 -0
  21. package/dist/commands/ai/modules/state/index.js +15 -19
  22. package/dist/commands/ai/modules/state/types.d.ts +2 -3
  23. package/dist/modules/ai-server-module/index.d.ts +15 -0
  24. package/dist/modules/ai-server-module/index.js +86 -0
  25. package/dist/modules/ai-server-module/types.d.ts +4 -0
  26. package/dist/modules/ai-server-module/types.js +2 -0
  27. package/dist/modules/parallel/index.d.ts +1 -6
  28. package/dist/modules/parallel/index.js +11 -29
  29. package/dist/types/project.d.ts +1 -0
  30. package/dist/utils/files.d.ts +2 -0
  31. package/dist/utils/files.js +42 -0
  32. package/dist/utils/project.js +25 -5
  33. package/package.json +1 -1
@@ -5,35 +5,55 @@ const path = require("path");
5
5
  const files_1 = require("./files");
6
6
  const package_manager_1 = require("./package-manager");
7
7
  const project_type_1 = require("./project-type");
8
- const PROJECTS_DIRS = ['', 'backend', 'frontend', 'server', 'scripts'];
9
- async function verifyProjectPath(relativePath) {
8
+ async function getProjectSRCPath(projectPath) {
9
+ const srcPath = path.join(projectPath, 'src');
10
+ if (await (0, files_1.verifyPath)(srcPath)) {
11
+ return srcPath;
12
+ }
13
+ const libPath = path.join(projectPath, 'lib');
14
+ if (await (0, files_1.verifyPath)(libPath)) {
15
+ return libPath;
16
+ }
17
+ return projectPath;
18
+ }
19
+ async function verifyProjectPath(relativePath = '') {
10
20
  const projectPath = (0, files_1.getRootPath)(relativePath);
11
21
  const packageJson = await (0, package_manager_1.loadPackageJson)(projectPath);
12
22
  if (!packageJson) {
13
23
  return null;
14
24
  }
15
25
  const projectType = await (0, project_type_1.getProjectType)(projectPath);
26
+ const srcPath = await getProjectSRCPath(projectPath);
27
+ const name = packageJson.name;
16
28
  if (projectType === 'next.js') {
17
29
  const projectAppFolder = path.join(projectPath, 'app');
18
30
  const isAppProject = await (0, files_1.verifyPath)(projectAppFolder);
19
31
  return {
20
- name: packageJson.name,
32
+ name,
21
33
  relativePath: `./${relativePath}`,
34
+ srcPath,
22
35
  path: projectPath,
23
36
  type: projectType,
24
37
  appDir: isAppProject,
25
38
  };
26
39
  }
27
40
  return {
28
- name: packageJson.name,
41
+ name,
42
+ srcPath,
29
43
  relativePath: `./${relativePath}`,
30
44
  path: projectPath,
31
45
  type: projectType,
32
46
  };
33
47
  }
34
48
  async function getProjects() {
49
+ const rootProject = await verifyProjectPath();
50
+ if (rootProject) {
51
+ return [rootProject];
52
+ }
53
+ const rootPath = (0, files_1.getRootPath)();
35
54
  const projects = [];
36
- for (const relativePath of PROJECTS_DIRS) {
55
+ const folders = await (0, files_1.getDirectoriesInPath)(rootPath);
56
+ for (const relativePath of folders) {
37
57
  const project = await verifyProjectPath(relativePath);
38
58
  if (project) {
39
59
  projects.push(project);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@futurebrand/dev-tools",
3
- "version": "2.5.1",
3
+ "version": "2.5.3",
4
4
  "description": "FutureBrand Dev Tools",
5
5
  "scripts": {
6
6
  "build": "tsc && tsc-alias",