zion 4.3.2 → 5.0.0

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 (3) hide show
  1. package/README.md +10 -10
  2. package/dist/cli.js +37 -37
  3. package/package.json +2 -2
package/README.md CHANGED
@@ -1,19 +1,19 @@
1
1
  ### zion
2
2
 
3
- my site, dotfiles, agent skills and more, in your terminal
3
+ my site, dev setup, agent skills and more, in your terminal
4
4
 
5
5
  run `npx zion` to see what it can do
6
6
 
7
7
  #### commands
8
8
 
9
- | command | what it does |
10
- | ------------------- | ------------------------------------------------------------------------------ |
11
- | `npx zion` | list commands |
12
- | `npx zion tui` | open the terminal version of zzzzion.com |
13
- | `npx zion dotfiles` | set up [my dotfiles](https://github.com/zion-off/dotfiles) |
14
- | `npx zion skills` | install my agent skills |
15
- | `npx zion card` | let's see paul allen's card |
16
- | `npx zion now` | see what I'm listening to, reading and coding |
17
- | `npx zion help` | list commands; `npx zion help <command>` or `npx zion <command> help` for more |
9
+ | command | what it does |
10
+ | ----------------- | ------------------------------------------------------------------------------ |
11
+ | `npx zion` | list commands |
12
+ | `npx zion tui` | open the terminal version of zzzzion.com |
13
+ | `npx zion dot` | set up [my dot setup](https://github.com/zion-off/dot) |
14
+ | `npx zion skills` | install my agent skills |
15
+ | `npx zion card` | let's see paul allen's card |
16
+ | `npx zion now` | see what I'm listening to, reading and coding |
17
+ | `npx zion help` | list commands; `npx zion help <command>` or `npx zion <command> help` for more |
18
18
 
19
19
  Global flags: `--no-color` (or `NO_COLOR`), `--no-input` (never prompt), `-h/--help`, `-v/--version`.
package/dist/cli.js CHANGED
@@ -8,7 +8,7 @@ import os3 from "os";
8
8
  import path17 from "path";
9
9
 
10
10
  // package.json
11
- var version = "4.3.2";
11
+ var version = "5.0.0";
12
12
 
13
13
  // src/lib/theme.ts
14
14
  import { Chalk, supportsColor, supportsColorStderr } from "chalk";
@@ -315,7 +315,7 @@ var HelpPrinter = class {
315
315
  home(ctx) {
316
316
  const paint = ctx.paint.stdout;
317
317
  return render([
318
- header(paint, ctx, "my site, dotfiles, agent skills and more, in your terminal"),
318
+ header(paint, ctx, "my site, dev setup, agent skills and more, in your terminal"),
319
319
  ...this.commandBlocks(paint),
320
320
  [indent(`Run ${paint.accent(`${ctx.bin} help <command>`)} for details on a command.`)]
321
321
  ]);
@@ -585,7 +585,7 @@ var CardCommand = class {
585
585
  }
586
586
  };
587
587
 
588
- // src/commands/dotfiles/DotfilesCommand.ts
588
+ // src/commands/dot/DotCommand.ts
589
589
  import path4 from "path";
590
590
 
591
591
  // src/lib/format.ts
@@ -1140,7 +1140,7 @@ function stateHome(env) {
1140
1140
  return base && path2.isAbsolute(base) ? base : path2.join(os2.homedir(), ".local", "state");
1141
1141
  }
1142
1142
 
1143
- // src/commands/dotfiles/DotfilesRepository.ts
1143
+ // src/commands/dot/DotRepository.ts
1144
1144
  import { constants } from "fs";
1145
1145
  import fs from "fs/promises";
1146
1146
  import path3 from "path";
@@ -1153,7 +1153,7 @@ var NotACloneError = class extends CliError {
1153
1153
  this.name = "NotACloneError";
1154
1154
  }
1155
1155
  };
1156
- var DotfilesRepository = class {
1156
+ var DotRepository = class {
1157
1157
  constructor(git2, source) {
1158
1158
  this.git = git2;
1159
1159
  this.source = source;
@@ -1244,9 +1244,14 @@ var DotfilesRepository = class {
1244
1244
  }
1245
1245
  };
1246
1246
 
1247
- // src/commands/dotfiles/actions.ts
1247
+ // src/commands/dot/actions.ts
1248
1248
  var ask = { label: "Ask before each step", hint: "confirm every change", flags: [] };
1249
- var yes = { label: "Yes to everything", hint: "no questions asked", flags: ["-y"], assumeYes: true };
1249
+ var yes = {
1250
+ label: "Yes to everything",
1251
+ hint: "no prompts; skips GitHub login and shell change",
1252
+ flags: ["-y"],
1253
+ assumeYes: true
1254
+ };
1250
1255
  var dryRun = { label: "Dry run", hint: "preview only, change nothing", flags: ["-n"], dryRun: true };
1251
1256
  var apply = { label: "Create the links", hint: "back up anything in the way", flags: [] };
1252
1257
  var DOT_ACTIONS = [
@@ -1280,9 +1285,9 @@ var DOT_ACTIONS = [
1280
1285
  label: "Uninstall",
1281
1286
  hint: "remove symlinks and restore backups",
1282
1287
  modes: [],
1283
- confirm: "Remove the dotfile symlinks and restore your backups?",
1288
+ confirm: "Remove the dot symlinks and restore your backups?",
1284
1289
  done: {
1285
- message: "Dotfiles unlinked and backups restored.",
1290
+ message: "Dot unlinked and backups restored.",
1286
1291
  lines: ["The source line in ~/.zshrc and ~/.gitconfig.local were left in place."]
1287
1292
  }
1288
1293
  }
@@ -1305,10 +1310,10 @@ function modeFromFlags(action, flags) {
1305
1310
  return void 0;
1306
1311
  }
1307
1312
 
1308
- // src/commands/dotfiles/options.ts
1313
+ // src/commands/dot/options.ts
1309
1314
  import { parseArgs as parseArgs3 } from "util";
1310
- function parseDotfilesOptions(args, bin) {
1311
- const usageHint = `run ${bin} dotfiles --help for usage`;
1315
+ function parseDotOptions(args, bin) {
1316
+ const usageHint = `run ${bin} dot --help for usage`;
1312
1317
  let parsed;
1313
1318
  try {
1314
1319
  parsed = parseArgs3({
@@ -1347,11 +1352,11 @@ function parseDotfilesOptions(args, bin) {
1347
1352
  };
1348
1353
  }
1349
1354
 
1350
- // src/commands/dotfiles/DotfilesCommand.ts
1351
- var DIR_ENV = "ZION_DOTFILES_DIR";
1352
- var defaultDir = (env) => tildify(path4.join(stateHome(env), "zion", "dotfiles"));
1355
+ // src/commands/dot/DotCommand.ts
1356
+ var DIR_ENV = "ZION_DOT_DIR";
1357
+ var defaultDir = (env) => tildify(path4.join(stateHome(env), "zion", "dot"));
1353
1358
  var SUPPORTED_PLATFORMS = { darwin: "macOS", linux: "Linux" };
1354
- var DotfilesCommand = class {
1359
+ var DotCommand = class {
1355
1360
  constructor(deps) {
1356
1361
  this.deps = deps;
1357
1362
  const { slug } = deps.repository.source;
@@ -1360,31 +1365,26 @@ var DotfilesCommand = class {
1360
1365
  description: `Clones github.com/${slug} (or updates an existing clone) and runs its dot installer. Without an action, you choose one interactively. The clone lives in --dir, $${DIR_ENV}, the clone an earlier install was made from, or ${defaultDir(this.deps.env)}, in that order.`,
1361
1366
  arguments: { title: "Actions", rows: DOT_ACTIONS.map((action) => [action.id, action.hint]) },
1362
1367
  options: [
1363
- ["-d, --dir <path>", `where the dotfiles live (default: ${defaultDir(this.deps.env)})`],
1368
+ ["-d, --dir <path>", `where dot lives (default: ${defaultDir(this.deps.env)})`],
1364
1369
  ["-y, --yes", "answer yes to every prompt, including uninstall"],
1365
1370
  ["-n, --dry-run", "show what would happen, change nothing"],
1366
1371
  ["--no-update", "use an existing clone as is, without pulling"]
1367
1372
  ],
1368
- environment: [[DIR_ENV, "where the dotfiles live, if --dir is not given"]],
1369
- examples: [
1370
- "dotfiles",
1371
- "dotfiles install --yes",
1372
- "dotfiles doctor",
1373
- "dotfiles link --dry-run --dir ~/src/dotfiles"
1374
- ]
1373
+ environment: [[DIR_ENV, "where dot lives, if --dir is not given"]],
1374
+ examples: ["dot", "dot install --yes", "dot doctor", "dot link --dry-run --dir ~/src/dot"]
1375
1375
  };
1376
1376
  }
1377
1377
  deps;
1378
- name = "dotfiles";
1379
- summary = "set up my dotfiles on this machine";
1378
+ name = "dot";
1379
+ summary = "set up my dot setup on this machine";
1380
1380
  group = "work";
1381
1381
  help;
1382
1382
  async run(args, ctx) {
1383
- const options = parseDotfilesOptions(args, ctx.bin);
1383
+ const options = parseDotOptions(args, ctx.bin);
1384
1384
  const ui = this.deps.createPrompter(ctx);
1385
1385
  return runSession(ui, async () => {
1386
1386
  const { repository, runner: runner2 } = this.deps;
1387
- ui.intro("dotfiles", `github.com/${repository.source.slug}`);
1387
+ ui.intro("dot", `github.com/${repository.source.slug}`);
1388
1388
  await this.checkSystem(ui);
1389
1389
  const location = await this.chooseLocation(ui, options, ctx);
1390
1390
  const action = options.action ?? await this.chooseAction(ui, options, ctx);
@@ -1411,7 +1411,7 @@ var DotfilesCommand = class {
1411
1411
  "Checking your system",
1412
1412
  async (signal) => {
1413
1413
  const os4 = SUPPORTED_PLATFORMS[platform];
1414
- if (!os4) throw new CliError(`${platform} isn't supported`, "these dotfiles support macOS and Linux");
1414
+ if (!os4) throw new CliError(`${platform} isn't supported`, "dot supports macOS and Linux");
1415
1415
  const version3 = await git2.version(signal);
1416
1416
  if (!version3) {
1417
1417
  throw new CliError(
@@ -1441,7 +1441,7 @@ var DotfilesCommand = class {
1441
1441
  }
1442
1442
  let checked;
1443
1443
  const answer = await ui.text({
1444
- message: "Where should your dotfiles live?",
1444
+ message: "Where should dot live?",
1445
1445
  defaultValue: defaultDir(env),
1446
1446
  validate: async (value) => {
1447
1447
  checked = await repository.inspect(expandHome(value));
@@ -1465,7 +1465,7 @@ var DotfilesCommand = class {
1465
1465
  return ui.select({
1466
1466
  message: "What would you like to do?",
1467
1467
  options: actions.map((action) => ({ value: action, label: action.label, hint: action.hint })),
1468
- nonInteractiveHint: `pass an action, e.g. ${ctx.bin} dotfiles install (one of: ${actionIds(actions)})`
1468
+ nonInteractiveHint: `pass an action, e.g. ${ctx.bin} dot install (one of: ${actionIds(actions)})`
1469
1469
  });
1470
1470
  }
1471
1471
  /** Flags win; otherwise ask only if the action was picked interactively and has a real choice. */
@@ -1483,7 +1483,7 @@ var DotfilesCommand = class {
1483
1483
  return ui.confirm({
1484
1484
  message: action.confirm,
1485
1485
  defaultValue: false,
1486
- nonInteractiveHint: `pass --yes to confirm: ${ctx.bin} dotfiles ${action.id} --yes`
1486
+ nonInteractiveHint: `pass --yes to confirm: ${ctx.bin} dot ${action.id} --yes`
1487
1487
  });
1488
1488
  }
1489
1489
  finish(ui, ctx, action, mode, code) {
@@ -1493,7 +1493,7 @@ var DotfilesCommand = class {
1493
1493
  else {
1494
1494
  ui.outro(action.failed ?? `dot ${action.id} didn't finish cleanly (exit code ${code})`, {
1495
1495
  tone: "error",
1496
- lines: [`Apply the fixes above, then run ${ctx.bin} dotfiles ${action.id} again.`]
1496
+ lines: [`Apply the fixes above, then run ${ctx.bin} dot ${action.id} again.`]
1497
1497
  });
1498
1498
  }
1499
1499
  }
@@ -23003,10 +23003,10 @@ for (const stream of [process.stdout, process.stderr]) {
23003
23003
  var runner = new NodeProcessRunner();
23004
23004
  var git = new CliGit(runner, process.env);
23005
23005
  var registry2 = new CommandRegistry().register(
23006
- new DotfilesCommand({
23007
- repository: new DotfilesRepository(git, {
23008
- slug: "zion-off/dotfiles",
23009
- url: "https://github.com/zion-off/dotfiles.git",
23006
+ new DotCommand({
23007
+ repository: new DotRepository(git, {
23008
+ slug: "zion-off/dot",
23009
+ url: "https://github.com/zion-off/dot.git",
23010
23010
  installer: "bin/dot",
23011
23011
  installerLink: path17.join(os3.homedir(), ".local", "bin", "dot")
23012
23012
  }),
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "zion",
3
- "version": "4.3.2",
4
- "description": "my site, dotfiles, agent skills and more, in your terminal",
3
+ "version": "5.0.0",
4
+ "description": "my site, dev setup, agent skills and more, in your terminal",
5
5
  "license": "MIT",
6
6
  "repository": {
7
7
  "type": "git",