wogiflow 1.0.8 → 1.0.10
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/package.json +1 -1
- package/scripts/postinstall.js +26 -13
package/package.json
CHANGED
package/scripts/postinstall.js
CHANGED
|
@@ -79,28 +79,41 @@ async function main() {
|
|
|
79
79
|
return;
|
|
80
80
|
}
|
|
81
81
|
|
|
82
|
+
// Try to write directly to terminal (bypasses npm output capture)
|
|
83
|
+
let output = process.stderr; // Default fallback
|
|
84
|
+
try {
|
|
85
|
+
// Check if /dev/tty exists and is writable
|
|
86
|
+
fs.accessSync('/dev/tty', fs.constants.W_OK);
|
|
87
|
+
const fd = fs.openSync('/dev/tty', 'w');
|
|
88
|
+
output = { write: (msg) => fs.writeSync(fd, msg) };
|
|
89
|
+
} catch {
|
|
90
|
+
// Fallback to stderr if /dev/tty not available (Windows, CI, non-interactive)
|
|
91
|
+
}
|
|
92
|
+
|
|
82
93
|
// Already initialized - short message
|
|
83
94
|
if (isAlreadyInitialized()) {
|
|
84
|
-
|
|
95
|
+
output.write('\x1b[36mWogiFlow:\x1b[0m Already initialized. Run \x1b[33mnpx flow status\x1b[0m to see project state.\n');
|
|
85
96
|
return;
|
|
86
97
|
}
|
|
87
98
|
|
|
88
|
-
// Show setup instructions
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
+
// Show setup instructions
|
|
100
|
+
const msg = `
|
|
101
|
+
\x1b[36m╔════════════════════════════════════════════════════════════╗\x1b[0m
|
|
102
|
+
\x1b[36m║\x1b[0m \x1b[1mWogiFlow installed successfully!\x1b[0m \x1b[36m║\x1b[0m
|
|
103
|
+
\x1b[36m╚════════════════════════════════════════════════════════════╝\x1b[0m
|
|
104
|
+
|
|
105
|
+
\x1b[33mNext step:\x1b[0m Run the setup wizard:
|
|
106
|
+
|
|
107
|
+
\x1b[36mnpx flow onboard\x1b[0m \x1b[2m# For existing projects (recommended)\x1b[0m
|
|
108
|
+
\x1b[36mnpx flow init\x1b[0m \x1b[2m# For new projects\x1b[0m
|
|
109
|
+
|
|
110
|
+
`;
|
|
111
|
+
output.write(msg);
|
|
99
112
|
}
|
|
100
113
|
|
|
101
114
|
// Run
|
|
102
115
|
main().catch((err) => {
|
|
103
116
|
// Don't fail npm install on postinstall errors
|
|
104
|
-
|
|
117
|
+
process.stderr.write(`\x1b[33mWogiFlow postinstall warning:\x1b[0m ${err.message}\n`);
|
|
105
118
|
createMinimalStructure();
|
|
106
119
|
});
|