@shanyucoder/flowgrid 0.1.1 → 0.1.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.
- package/README.md +3 -9
- package/bin/flowgrid.mjs +23 -6
- package/package.json +11 -11
package/README.md
CHANGED
|
@@ -75,15 +75,9 @@ FlowGrid **không** thay IDE hay model. Nó gắn **quy trình**, **định dạ
|
|
|
75
75
|
pnpm add -g @shanyucoder/flowgrid
|
|
76
76
|
```
|
|
77
77
|
|
|
78
|
-
(Gõ trong bash, zsh, **PowerShell**, CMD hoặc Windows Terminal — cùng một lệnh. Tarball npm đã có `dist
|
|
78
|
+
(Gõ trong bash, zsh, **PowerShell**, CMD hoặc Windows Terminal — cùng một lệnh. Tarball npm đã có `dist/`; runtime **không** kéo VitePress/esbuild — `pnpm add` / `pnpm add -g` thường không cần `--allow-build`.)
|
|
79
79
|
|
|
80
|
-
**
|
|
81
|
-
|
|
82
|
-
```text
|
|
83
|
-
pnpm add -g @shanyucoder/flowgrid --allow-build=esbuild
|
|
84
|
-
```
|
|
85
|
-
|
|
86
|
-
Cài dev trong repo: `pnpm add -D @shanyucoder/flowgrid --allow-build=esbuild` · hoặc `pnpm approve-builds` và chọn `esbuild`.
|
|
80
|
+
Cài từ **GitHub** vẫn cần `--allow-build=@shanyucoder/flowgrid` (build TypeScript lúc cài). Hub docs/tests dùng VitePress qua `npx` + `devDependencies` sau `flowgrid init`.
|
|
87
81
|
|
|
88
82
|
**Chưa có bản trên npm** (hoặc cần bản Git cụ thể):
|
|
89
83
|
|
|
@@ -97,7 +91,7 @@ pnpm 10+ cần `--allow-build` khi cài **từ GitHub** (build TypeScript lúc c
|
|
|
97
91
|
| --- | --- |
|
|
98
92
|
| **Linux / macOS** | Chạy `pnpm setup` nếu shell báo thiếu bin; thường là `~/.local/share/pnpm`. |
|
|
99
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ố ý. |
|
|
100
|
-
| **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`
|
|
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). |
|
|
101
95
|
|
|
102
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.
|
|
103
97
|
|
package/bin/flowgrid.mjs
CHANGED
|
@@ -21,6 +21,27 @@ import {
|
|
|
21
21
|
promptHubRoot,
|
|
22
22
|
} from './lib/init-scaffold.mjs';
|
|
23
23
|
|
|
24
|
+
function packageRootFromMeta(metaUrl) {
|
|
25
|
+
return path.resolve(path.dirname(fileURLToPath(metaUrl)), '..');
|
|
26
|
+
}
|
|
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
|
+
|
|
24
45
|
function assertNodeVersion() {
|
|
25
46
|
const major = Number(process.versions.node.split('.')[0]);
|
|
26
47
|
if (!Number.isFinite(major) || major < 24) {
|
|
@@ -35,7 +56,7 @@ export async function main() {
|
|
|
35
56
|
assertNodeVersion();
|
|
36
57
|
const args = process.argv.slice(2);
|
|
37
58
|
if (args.includes('version') || args.includes('-v') || args.includes('--version')) {
|
|
38
|
-
const pkgPath = path.
|
|
59
|
+
const pkgPath = path.join(packageRootFromMeta(import.meta.url), 'package.json');
|
|
39
60
|
const pkg = JSON.parse(fs.readFileSync(pkgPath, 'utf8'));
|
|
40
61
|
console.log(`FlowGrid v${pkg.version}`);
|
|
41
62
|
return;
|
|
@@ -917,11 +938,7 @@ export async function main() {
|
|
|
917
938
|
outro(pc.green("Success! FlowGrid is initialized for your project."));
|
|
918
939
|
}
|
|
919
940
|
|
|
920
|
-
|
|
921
|
-
process.argv[1] &&
|
|
922
|
-
path.resolve(process.argv[1]) === fileURLToPath(import.meta.url);
|
|
923
|
-
|
|
924
|
-
if (isDirectCli) {
|
|
941
|
+
if (isCliEntry(import.meta.url)) {
|
|
925
942
|
main().catch((err) => {
|
|
926
943
|
console.error(pc.red(err.message));
|
|
927
944
|
process.exit(1);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@shanyucoder/flowgrid",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.3",
|
|
4
4
|
"description": "Unified Local MCP Toolkit (Graph, DNA, Docs, Test, Codegen)",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -73,22 +73,22 @@
|
|
|
73
73
|
"zod": "^4.4.3",
|
|
74
74
|
"handlebars": "^4.7.8",
|
|
75
75
|
"ajv": "^8.20.0",
|
|
76
|
+
"ejs": "^3.1.10"
|
|
77
|
+
},
|
|
78
|
+
"devDependencies": {
|
|
79
|
+
"@types/node": "^26.1.1",
|
|
80
|
+
"typescript": "^5.9.0",
|
|
81
|
+
"tsx": "^4.23.1",
|
|
82
|
+
"@braintree/sanitize-url": "^7.1.2",
|
|
76
83
|
"cytoscape": "^3.34.0",
|
|
77
84
|
"cytoscape-cose-bilkent": "^4.1.0",
|
|
78
|
-
"
|
|
85
|
+
"dayjs": "^1.11.21",
|
|
86
|
+
"debug": "^4.4.3",
|
|
79
87
|
"mermaid": "^11.16.0",
|
|
80
88
|
"vitepress": "latest",
|
|
81
89
|
"vitepress-mermaid-renderer": "^1.1.28",
|
|
82
90
|
"vitepress-plugin-mermaid": "^2.0.17",
|
|
83
|
-
"vue": "^3.4.21"
|
|
84
|
-
"@braintree/sanitize-url": "^7.1.2",
|
|
85
|
-
"dayjs": "^1.11.21",
|
|
86
|
-
"debug": "^4.4.3"
|
|
87
|
-
},
|
|
88
|
-
"devDependencies": {
|
|
89
|
-
"@types/node": "^26.1.1",
|
|
90
|
-
"typescript": "^5.9.0",
|
|
91
|
-
"tsx": "^4.23.1"
|
|
91
|
+
"vue": "^3.4.21"
|
|
92
92
|
},
|
|
93
93
|
"pnpm": {
|
|
94
94
|
"onlyBuiltDependencies": [
|