@shanyucoder/flowgrid 0.1.3 → 0.1.5

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
@@ -91,16 +91,19 @@ pnpm 10+ cần `--allow-build` khi cài **từ GitHub** (build TypeScript lúc c
91
91
  | --- | --- |
92
92
  | **Linux / macOS** | Chạy `pnpm setup` nếu shell báo thiếu bin; thường là `~/.local/share/pnpm`. |
93
93
  | **WSL** | Giống Linux — dùng Node/pnpm **trong WSL**, không trộn với Node cài trên Windows host trừ khi cố ý. |
94
- | **Windows (PowerShell, CMD, Windows Terminal)** | Chạy **`pnpm setup`** một lần (ghi PATH user), **đóng và mở lại** terminal; kiểm tra: `where.exe flowgrid` · `flowgrid --version` (hoặc `flowgrid version`). Cần **Node ≥ 24** — nếu im lặng, chạy `node -v` rồi `pnpm add -g @shanyucoder/flowgrid@latest` sau bản **≥ 0.1.3** (fix CLI Windows). |
94
+ | **Windows (PowerShell, CMD, Windows Terminal)** | **`pnpm setup`** → terminal mới → `pnpm add -g @shanyucoder/flowgrid@0.1.4` (hoặc `@latest` sau publish). **Node ≥ 24** bắt buộc (`node -v`). `flowgrid --version` — bản **≤ 0.1.2** có thể im lặng trên Windows. |
95
95
 
96
96
  **WSL / Git Bash** có thể dùng lệnh pnpm ở trên; **không** bắt buộc `install.sh` nếu đã cài global qua pnpm.
97
97
 
98
98
  **npx (không cài global):**
99
99
 
100
100
  ```text
101
+ cd your-project
101
102
  npx -p @shanyucoder/flowgrid flowgrid init
102
103
  ```
103
104
 
105
+ Luôn có từ **`flowgrid`** trước `init` — `npx @shanyucoder/flowgrid` (thiếu bin) không phải quy trình khuyến nghị. Global: `npm install -g @shanyucoder/flowgrid` → `cd your-project` → `flowgrid init`.
106
+
104
107
  Thay `init` bằng `doctor`, `harness sync`, … GitHub: `npx -p github:ShanYuCoder/flowgrid flowgrid init`.
105
108
 
106
109
  **npm (global):**
package/bin/flowgrid.mjs CHANGED
@@ -25,23 +25,6 @@ function packageRootFromMeta(metaUrl) {
25
25
  return path.resolve(path.dirname(fileURLToPath(metaUrl)), '..');
26
26
  }
27
27
 
28
- /** pnpm/npm global shims on Windows may differ in path casing from import.meta.url */
29
- function isCliEntry(metaUrl) {
30
- const invoked = process.argv[1];
31
- if (!invoked) return false;
32
- const entry = path.resolve(fileURLToPath(metaUrl));
33
- const script = path.resolve(invoked);
34
- if (script === entry) return true;
35
- if (process.platform === 'win32' && script.toLowerCase() === entry.toLowerCase()) return true;
36
- if (process.platform === 'win32') {
37
- return (
38
- path.basename(script).toLowerCase() === 'flowgrid.mjs' &&
39
- path.basename(entry).toLowerCase() === 'flowgrid.mjs'
40
- );
41
- }
42
- return false;
43
- }
44
-
45
28
  function assertNodeVersion() {
46
29
  const major = Number(process.versions.node.split('.')[0]);
47
30
  if (!Number.isFinite(major) || major < 24) {
@@ -52,6 +35,27 @@ function assertNodeVersion() {
52
35
  }
53
36
  }
54
37
 
38
+ function printDefaultHelp() {
39
+ const lines = [
40
+ 'FlowGrid CLI — chạy trong thư mục repo đích (cd project trước khi init).',
41
+ '',
42
+ 'Cài một lần (global):',
43
+ ' npm install -g @shanyucoder/flowgrid',
44
+ ' pnpm add -g @shanyucoder/flowgrid',
45
+ '',
46
+ 'Khởi tạo repo đích:',
47
+ ' flowgrid init',
48
+ '',
49
+ 'Khác:',
50
+ ' flowgrid doctor · flowgrid update · flowgrid harness sync · flowgrid audit',
51
+ '',
52
+ 'npx (không cài global) — phải gọi bin flowgrid:',
53
+ ' npx -p @shanyucoder/flowgrid flowgrid init',
54
+ ' (không dùng: npx @shanyucoder/flowgrid — sẽ không truyền lệnh init)',
55
+ ];
56
+ console.log(lines.join('\n'));
57
+ }
58
+
55
59
  export async function main() {
56
60
  assertNodeVersion();
57
61
  const args = process.argv.slice(2);
@@ -421,7 +425,12 @@ export async function main() {
421
425
  process.exit(1);
422
426
  }
423
427
 
424
- if (command && command !== 'init') {
428
+ if (!command) {
429
+ printDefaultHelp();
430
+ return;
431
+ }
432
+
433
+ if (command !== 'init') {
425
434
  console.error(pc.red(`Lệnh không hợp lệ: ${command}`));
426
435
  console.log(`Chạy 'flowgrid init', 'flowgrid doctor', 'flowgrid update', 'flowgrid harness sync', hoặc 'flowgrid audit'.`);
427
436
  process.exit(1);
@@ -938,7 +947,7 @@ export async function main() {
938
947
  outro(pc.green("Success! FlowGrid is initialized for your project."));
939
948
  }
940
949
 
941
- if (isCliEntry(import.meta.url)) {
950
+ if (import.meta.main) {
942
951
  main().catch((err) => {
943
952
  console.error(pc.red(err.message));
944
953
  process.exit(1);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shanyucoder/flowgrid",
3
- "version": "0.1.3",
3
+ "version": "0.1.5",
4
4
  "description": "Unified Local MCP Toolkit (Graph, DNA, Docs, Test, Codegen)",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -89,10 +89,5 @@
89
89
  "vitepress-mermaid-renderer": "^1.1.28",
90
90
  "vitepress-plugin-mermaid": "^2.0.17",
91
91
  "vue": "^3.4.21"
92
- },
93
- "pnpm": {
94
- "onlyBuiltDependencies": [
95
- "esbuild"
96
- ]
97
92
  }
98
93
  }