@db-ux/agent-cli 4.5.2-agent-cli-pnpm-compatibility-ebd2994 → 4.5.2

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/CHANGELOG.md CHANGED
@@ -1,10 +1,14 @@
1
1
  # @db-ux/agent-cli
2
2
 
3
- ## 4.5.1
3
+ ## 4.5.2
4
4
 
5
5
  _version bump_
6
6
 
7
7
 
8
+ ## 4.5.1
9
+
10
+ _version bump_
11
+
8
12
  ## 4.5.0
9
13
 
10
14
  _version bump_
package/README.md CHANGED
@@ -17,16 +17,8 @@ Use this command in your repository:
17
17
  npx @db-ux/agent-cli
18
18
  ```
19
19
 
20
- Or with pnpm:
21
-
22
- ```shell
23
- pnpm exec @db-ux/agent-cli
24
- ```
25
-
26
20
  The DB UX Design System documentation will be added to (or replaced in subsequent runs, e.g. after a DB UX Design System update) in the file `.github/copilot-instructions.md` (if this file does not yet exist in your codebase, it will be created).
27
21
 
28
- **Note:** The tool works with all package managers (npm, yarn, pnpm) and correctly handles symlinked packages in pnpm's node_modules structure.
29
-
30
22
  ### Advanced Usage
31
23
 
32
24
  You can also change the root path where the tool should check for `node_modules`:
package/build/index.js CHANGED
@@ -14,36 +14,32 @@ import path2 from "node:path";
14
14
  // src/utils/index.ts
15
15
  import fs from "node:fs";
16
16
  import path from "node:path";
17
- function findAllNodeModulesDirectories(directory, found = /* @__PURE__ */ new Set()) {
17
+ function findAllNodeModulesDirectories(directory, found = []) {
18
18
  if (!fs.existsSync(directory)) {
19
19
  return found;
20
20
  }
21
21
  const entries = fs.readdirSync(directory, { withFileTypes: true }).sort((a, b) => a.name.localeCompare(b.name, "en"));
22
22
  for (const entry of entries) {
23
- const fullPath = path.resolve(directory, entry.name);
24
- let isDirectory = false;
25
- try {
26
- const stats = fs.statSync(fullPath);
27
- isDirectory = stats.isDirectory();
28
- } catch {
29
- continue;
30
- }
31
- if (isDirectory) {
23
+ if (entry.isDirectory()) {
32
24
  if (entry.name === "node_modules") {
33
- found.add(fs.realpathSync(fullPath));
25
+ found.push(path.join(directory, entry.name));
34
26
  } else if (!entry.name.startsWith(".")) {
35
- findAllNodeModulesDirectories(fullPath, found);
27
+ findAllNodeModulesDirectories(
28
+ path.join(directory, entry.name),
29
+ found
30
+ );
36
31
  }
37
32
  }
38
33
  }
39
34
  return found;
40
35
  }
41
36
  var getInstructions = (rootPath) => {
37
+ let copilotInstructionsContent = "";
42
38
  const nodeModulesDirectories = findAllNodeModulesDirectories(rootPath);
43
- if (nodeModulesDirectories.size === 0) {
44
- return "No node_modules folders found.";
39
+ if (nodeModulesDirectories.length === 0) {
40
+ console.error("No node_modules folders found.");
41
+ return "";
45
42
  }
46
- let copilotInstructionsContent = "";
47
43
  for (const nodeModulesPath of nodeModulesDirectories) {
48
44
  const databaseUxPaths = [
49
45
  path.join(nodeModulesPath, "@db-ux/"),
@@ -57,27 +53,10 @@ var getInstructions = (rootPath) => {
57
53
  withFileTypes: true
58
54
  });
59
55
  for (const package_ of packages) {
60
- let packagePath = path.resolve(databaseUxPath, package_.name);
61
- let isDirectory = false;
62
- try {
63
- const stats = fs.statSync(packagePath);
64
- isDirectory = stats.isDirectory();
65
- if (!isDirectory && stats.isFile()) {
66
- const content = fs.readFileSync(packagePath, "utf8").trim();
67
- if (!content.includes("\n")) {
68
- const targetPath = path.resolve(path.dirname(packagePath), content);
69
- if (fs.existsSync(targetPath) && fs.statSync(targetPath).isDirectory()) {
70
- isDirectory = true;
71
- packagePath = targetPath;
72
- }
73
- }
74
- }
75
- } catch {
76
- continue;
77
- }
78
- if (isDirectory) {
56
+ if (package_.isDirectory()) {
79
57
  const instructionsPath = path.join(
80
- packagePath,
58
+ databaseUxPath,
59
+ package_.name,
81
60
  "agent",
82
61
  "_instructions.md"
83
62
  );
@@ -85,7 +64,7 @@ var getInstructions = (rootPath) => {
85
64
  let content = fs.readFileSync(instructionsPath, "utf8");
86
65
  const relativePath = path.relative(
87
66
  rootPath,
88
- packagePath
67
+ path.join(databaseUxPath, package_.name)
89
68
  );
90
69
  content = content.replaceAll(
91
70
  "__agent-path__",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@db-ux/agent-cli",
3
- "version": "4.5.2-agent-cli-pnpm-compatibility-ebd2994",
3
+ "version": "4.5.2",
4
4
  "type": "module",
5
5
  "description": "CLI for DB UX Design System generate AI agent instructions",
6
6
  "repository": {