catylst 1.0.6 → 1.0.9
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/postinstall.js +20 -20
package/package.json
CHANGED
package/postinstall.js
CHANGED
|
@@ -70,7 +70,7 @@ function startTips() {
|
|
|
70
70
|
const msg = msgs[tipIndex % msgs.length];
|
|
71
71
|
const kind = msg.startsWith("joke") ? purple("joke ") : cyan("tip ");
|
|
72
72
|
const text = msg.replace(/^(tip|joke)\s+/, "");
|
|
73
|
-
process.
|
|
73
|
+
process.stderr.write(`\r ${kind} ${dim(text)}${" ".repeat(10)}`);
|
|
74
74
|
tipIndex++;
|
|
75
75
|
tipTimer = setTimeout(showNext, 3000);
|
|
76
76
|
}
|
|
@@ -80,15 +80,15 @@ function startTips() {
|
|
|
80
80
|
|
|
81
81
|
function stopTips(finalLine) {
|
|
82
82
|
if (tipTimer) { clearTimeout(tipTimer); tipTimer = null; }
|
|
83
|
-
process.
|
|
83
|
+
process.stderr.write(`\r${finalLine}${" ".repeat(30)}\n`);
|
|
84
84
|
}
|
|
85
85
|
|
|
86
86
|
// ── Header ───────────────────────────────────────────────────────────────────
|
|
87
87
|
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
88
|
+
process.stderr.write("" + "\n");
|
|
89
|
+
process.stderr.write(bold(" Catylst KMP Project Generator") + "\n");
|
|
90
|
+
process.stderr.write(dim(" ────────────────────────────────────────") + "\n");
|
|
91
|
+
process.stderr.write("" + "\n");
|
|
92
92
|
|
|
93
93
|
// ── 1. Check Java ────────────────────────────────────────────────────────────
|
|
94
94
|
|
|
@@ -107,7 +107,7 @@ function checkJava() {
|
|
|
107
107
|
);
|
|
108
108
|
process.exit(1);
|
|
109
109
|
}
|
|
110
|
-
|
|
110
|
+
process.stderr.write(green(` ✓ Java ${major}`) + "\n");
|
|
111
111
|
}
|
|
112
112
|
|
|
113
113
|
// ── 2. Clone / update template ───────────────────────────────────────────────
|
|
@@ -129,7 +129,7 @@ function setupTemplate() {
|
|
|
129
129
|
stopTips(yellow(" ⚠ Could not update template (offline?). Using existing."));
|
|
130
130
|
}
|
|
131
131
|
} else {
|
|
132
|
-
|
|
132
|
+
process.stderr.write(dim(" ↓ Cloning template — hang tight...\n"));
|
|
133
133
|
startTips();
|
|
134
134
|
fs.rmSync(TEMPLATE_DIR, { recursive: true, force: true });
|
|
135
135
|
const result = spawnSync(
|
|
@@ -170,12 +170,12 @@ function downloadJar() {
|
|
|
170
170
|
);
|
|
171
171
|
if (fs.existsSync(localJar)) {
|
|
172
172
|
fs.copyFileSync(localJar, JAR_PATH);
|
|
173
|
-
|
|
173
|
+
process.stderr.write(green(" ✓ Using local build") + "\n");
|
|
174
174
|
return Promise.resolve();
|
|
175
175
|
}
|
|
176
176
|
|
|
177
177
|
return new Promise((resolve, reject) => {
|
|
178
|
-
|
|
178
|
+
process.stderr.write(dim(" ↓ Downloading CLI — almost there...\n"));
|
|
179
179
|
startTips();
|
|
180
180
|
|
|
181
181
|
// Write to a temp file first — atomic rename prevents race conditions
|
|
@@ -220,7 +220,7 @@ function downloadJar() {
|
|
|
220
220
|
|
|
221
221
|
const digest = hash.digest("hex");
|
|
222
222
|
stopTips(green(" ✓ CLI ready"));
|
|
223
|
-
|
|
223
|
+
process.stderr.write(dim(` SHA-256: ${digest}`) + "\n");
|
|
224
224
|
resolve();
|
|
225
225
|
});
|
|
226
226
|
});
|
|
@@ -249,13 +249,13 @@ function downloadJar() {
|
|
|
249
249
|
setupTemplate();
|
|
250
250
|
await downloadJar();
|
|
251
251
|
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
252
|
+
process.stderr.write("" + "\n");
|
|
253
|
+
process.stderr.write(dim(" ────────────────────────────────────────") + "\n");
|
|
254
|
+
process.stderr.write(" " + green(bold("All done!")) + " Start your project:" + "\n");
|
|
255
|
+
process.stderr.write("" + "\n");
|
|
256
|
+
process.stderr.write(" " + cyan("catylst --interactive") + "\n");
|
|
257
|
+
process.stderr.write("" + "\n");
|
|
258
|
+
process.stderr.write(" " + dim("Or non-interactive:") + "\n");
|
|
259
|
+
process.stderr.write(" " + dim("catylst --package com.example.app --name MyApp") + "\n");
|
|
260
|
+
process.stderr.write("" + "\n");
|
|
261
261
|
})();
|