rulesync 5.5.0 → 5.5.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.
package/README.md CHANGED
@@ -42,44 +42,39 @@ Download pre-built binaries from the [latest release](https://github.com/dyoshik
42
42
  #### Linux (x64)
43
43
 
44
44
  ```bash
45
- curl -L https://github.com/dyoshikawa/rulesync/releases/latest/download/rulesync-linux-x64 -o rulesync
46
- chmod +x rulesync
47
- # Place the binary wherever set PATH
48
- sudo mv rulesync /usr/local/bin/
45
+ curl -L https://github.com/dyoshikawa/rulesync/releases/latest/download/rulesync-linux-x64 -o rulesync && \
46
+ chmod +x rulesync && \
47
+ sudo mv rulesync /usr/local/bin/
49
48
  ```
50
49
 
51
50
  #### Linux (ARM64)
52
51
 
53
52
  ```bash
54
- curl -L https://github.com/dyoshikawa/rulesync/releases/latest/download/rulesync-linux-arm64 -o rulesync
55
- chmod +x rulesync
56
- # Place the binary wherever set PATH
57
- sudo mv rulesync /usr/local/bin/
53
+ curl -L https://github.com/dyoshikawa/rulesync/releases/latest/download/rulesync-linux-arm64 -o rulesync && \
54
+ chmod +x rulesync && \
55
+ sudo mv rulesync /usr/local/bin/
58
56
  ```
59
57
 
60
58
  #### macOS (Apple Silicon)
61
59
 
62
60
  ```bash
63
- curl -L https://github.com/dyoshikawa/rulesync/releases/latest/download/rulesync-darwin-arm64 -o rulesync
64
- chmod +x rulesync
65
- # Place the binary wherever set PATH
66
- sudo mv rulesync /usr/local/bin/
61
+ curl -L https://github.com/dyoshikawa/rulesync/releases/latest/download/rulesync-darwin-arm64 -o rulesync && \
62
+ chmod +x rulesync && \
63
+ sudo mv rulesync /usr/local/bin/
67
64
  ```
68
65
 
69
66
  #### Windows (x64)
70
67
 
71
68
  ```powershell
72
- # PowerShell
73
- Invoke-WebRequest -Uri "https://github.com/dyoshikawa/rulesync/releases/latest/download/rulesync-windows-x64.exe" -OutFile "rulesync.exe"
74
- # Add to PATH or place in a directory already in PATH
75
- Move-Item rulesync.exe C:\Windows\System32\
69
+ Invoke-WebRequest -Uri "https://github.com/dyoshikawa/rulesync/releases/latest/download/rulesync-windows-x64.exe" -OutFile "rulesync.exe"; `
70
+ Move-Item rulesync.exe C:\Windows\System32\
76
71
  ```
77
72
 
78
73
  Or using curl (if available):
79
74
 
80
75
  ```bash
81
- curl -L https://github.com/dyoshikawa/rulesync/releases/latest/download/rulesync-windows-x64.exe -o rulesync.exe
82
- # Place the binary wherever set PATH
76
+ curl -L https://github.com/dyoshikawa/rulesync/releases/latest/download/rulesync-windows-x64.exe -o rulesync.exe && \
77
+ mv rulesync.exe /path/to/your/bin/
83
78
  ```
84
79
 
85
80
  #### Verify checksums
package/dist/index.cjs CHANGED
@@ -110,7 +110,7 @@ var import_node_path2 = require("path");
110
110
 
111
111
  // src/utils/file.ts
112
112
  var import_es_toolkit = require("es-toolkit");
113
- var import_node_fs = require("fs");
113
+ var import_globby = require("globby");
114
114
  var import_promises = require("fs/promises");
115
115
  var import_node_os = __toESM(require("os"), 1);
116
116
  var import_node_path = require("path");
@@ -193,17 +193,10 @@ async function listDirectoryFiles(dir) {
193
193
  }
194
194
  async function findFilesByGlobs(globs, options = {}) {
195
195
  const { type = "all" } = options;
196
- const items = (0, import_node_fs.globSync)(globs, { withFileTypes: true });
197
- switch (type) {
198
- case "file":
199
- return items.filter((item) => item.isFile()).map((item) => (0, import_node_path.join)(item.parentPath, item.name));
200
- case "dir":
201
- return items.filter((item) => item.isDirectory()).map((item) => (0, import_node_path.join)(item.parentPath, item.name));
202
- case "all":
203
- return items.map((item) => (0, import_node_path.join)(item.parentPath, item.name));
204
- default:
205
- throw new Error(`Invalid type: ${type}`);
206
- }
196
+ const globbyOptions = type === "file" ? { onlyFiles: true, onlyDirectories: false } : type === "dir" ? { onlyFiles: false, onlyDirectories: true } : { onlyFiles: false, onlyDirectories: false };
197
+ const normalizedGlobs = Array.isArray(globs) ? globs.map((g) => g.replaceAll("\\", "/")) : globs.replaceAll("\\", "/");
198
+ const results = (0, import_globby.globbySync)(normalizedGlobs, { absolute: true, ...globbyOptions });
199
+ return results.toSorted();
207
200
  }
208
201
  async function removeDirectory(dirPath) {
209
202
  const dangerousPaths = [".", "/", "~", "src", "node_modules"];
@@ -13717,7 +13710,7 @@ async function mcpCommand({ version }) {
13717
13710
  }
13718
13711
 
13719
13712
  // src/cli/index.ts
13720
- var getVersion = () => "5.5.0";
13713
+ var getVersion = () => "5.5.1";
13721
13714
  var main = async () => {
13722
13715
  const program = new import_commander.Command();
13723
13716
  const version = getVersion();
package/dist/index.js CHANGED
@@ -87,7 +87,7 @@ import { resolve as resolve2 } from "path";
87
87
 
88
88
  // src/utils/file.ts
89
89
  import { kebabCase } from "es-toolkit";
90
- import { globSync } from "fs";
90
+ import { globbySync } from "globby";
91
91
  import { mkdir, readdir, readFile, rm, stat, writeFile } from "fs/promises";
92
92
  import os from "os";
93
93
  import { dirname, join, relative, resolve } from "path";
@@ -170,17 +170,10 @@ async function listDirectoryFiles(dir) {
170
170
  }
171
171
  async function findFilesByGlobs(globs, options = {}) {
172
172
  const { type = "all" } = options;
173
- const items = globSync(globs, { withFileTypes: true });
174
- switch (type) {
175
- case "file":
176
- return items.filter((item) => item.isFile()).map((item) => join(item.parentPath, item.name));
177
- case "dir":
178
- return items.filter((item) => item.isDirectory()).map((item) => join(item.parentPath, item.name));
179
- case "all":
180
- return items.map((item) => join(item.parentPath, item.name));
181
- default:
182
- throw new Error(`Invalid type: ${type}`);
183
- }
173
+ const globbyOptions = type === "file" ? { onlyFiles: true, onlyDirectories: false } : type === "dir" ? { onlyFiles: false, onlyDirectories: true } : { onlyFiles: false, onlyDirectories: false };
174
+ const normalizedGlobs = Array.isArray(globs) ? globs.map((g) => g.replaceAll("\\", "/")) : globs.replaceAll("\\", "/");
175
+ const results = globbySync(normalizedGlobs, { absolute: true, ...globbyOptions });
176
+ return results.toSorted();
184
177
  }
185
178
  async function removeDirectory(dirPath) {
186
179
  const dangerousPaths = [".", "/", "~", "src", "node_modules"];
@@ -13694,7 +13687,7 @@ async function mcpCommand({ version }) {
13694
13687
  }
13695
13688
 
13696
13689
  // src/cli/index.ts
13697
- var getVersion = () => "5.5.0";
13690
+ var getVersion = () => "5.5.1";
13698
13691
  var main = async () => {
13699
13692
  const program = new Command();
13700
13693
  const version = getVersion();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rulesync",
3
- "version": "5.5.0",
3
+ "version": "5.5.1",
4
4
  "description": "Unified AI rules management CLI tool that generates configuration files for various AI development tools",
5
5
  "keywords": [
6
6
  "ai",
@@ -44,6 +44,7 @@
44
44
  "effect": "3.19.14",
45
45
  "es-toolkit": "1.44.0",
46
46
  "fastmcp": "3.27.0",
47
+ "globby": "16.1.0",
47
48
  "gray-matter": "4.0.3",
48
49
  "js-yaml": "4.1.1",
49
50
  "jsonc-parser": "3.3.1",