@semos-labs/create-glyph 0.1.76 → 0.1.77

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.
Files changed (2) hide show
  1. package/dist/index.js +19 -3
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -3,11 +3,13 @@
3
3
  // src/index.ts
4
4
  import fs from "fs";
5
5
  import path from "path";
6
+ import { execSync } from "child_process";
6
7
  var bold = (s) => `\x1B[1m${s}\x1B[22m`;
7
8
  var dim = (s) => `\x1B[2m${s}\x1B[22m`;
8
9
  var cyan = (s) => `\x1B[36m${s}\x1B[39m`;
9
10
  var green = (s) => `\x1B[32m${s}\x1B[39m`;
10
11
  var red = (s) => `\x1B[31m${s}\x1B[39m`;
12
+ var yellow = (s) => `\x1B[33m${s}\x1B[39m`;
11
13
  function detectPackageManager() {
12
14
  const ua = process.env.npm_config_user_agent ?? "";
13
15
  if (ua.startsWith("bun")) return "bun";
@@ -326,12 +328,26 @@ function main() {
326
328
  console.log(` ${dim("\u251C")} ${green("+")} ${filePath}`);
327
329
  }
328
330
  console.log();
329
- console.log(` ${green("\u2713")} Project created!`);
331
+ console.log(` ${cyan("\u25C6")} ${bold("Installing dependencies")}${dim("...")}`);
330
332
  console.log();
331
- console.log(` ${bold("Next steps:")}`);
333
+ try {
334
+ execSync(getInstallCommand(pm), {
335
+ cwd: targetDir,
336
+ stdio: "inherit"
337
+ });
338
+ console.log();
339
+ console.log(` ${green("\u2713")} Dependencies installed!`);
340
+ } catch {
341
+ console.log();
342
+ console.log(` ${yellow("\u26A0")} Install failed. You can run it manually:`);
343
+ console.log(` ${cyan("cd")} ${dirName} && ${cyan(getInstallCommand(pm))}`);
344
+ }
345
+ console.log();
346
+ console.log(` ${green("\u2713")} ${bold(dirName)} is ready!`);
347
+ console.log();
348
+ console.log(` ${bold("Get started:")}`);
332
349
  console.log();
333
350
  console.log(` ${cyan("cd")} ${dirName}`);
334
- console.log(` ${cyan(getInstallCommand(pm))}`);
335
351
  console.log(` ${cyan(getRunCommand(pm))}`);
336
352
  console.log();
337
353
  console.log(` ${dim("Happy hacking! \u2726")}`);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@semos-labs/create-glyph",
3
- "version": "0.1.76",
3
+ "version": "0.1.77",
4
4
  "description": "Scaffold a new Glyph terminal UI app",
5
5
  "type": "module",
6
6
  "bin": {