@hurshb50/setup-ubuntu 1.2.2 → 1.4.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.
@@ -1,15 +1,18 @@
1
1
  # Formatting
2
2
 
3
- - Sentences: 8 words or fewer
4
- - Paragraphs: 2 sentences or fewer
5
- - Sections: 3 paragraphs or fewer
3
+ - Sentences: 10 words or fewer
4
+ - Paragraphs: 3 sentences or fewer
5
+ - Sections: 4 paragraphs or fewer
6
6
  - Lists: 4 words per item
7
7
  - Tables: 3 columns or fewer, 3 words or fewer per cell
8
8
  - Diagrams: 6 nodes, one per level
9
+ - Code Examples: Show relevant lines
10
+ - File references: Show brief inline code examples instead
9
11
 
10
12
  # Explanation
11
13
 
12
14
  - Simple
13
15
  - Straightforward
14
16
  - Minimal
17
+ - Coherent
15
18
  - Avoid verbosity
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: teach
3
- description: Teach me a concept from the ground up, assuming no prior knowledge and no context.
3
+ description: Teach me a concept from the ground up.
4
4
  disable-model-invocation: true
5
5
  ---
6
6
 
@@ -12,6 +12,5 @@ Assume no prior knowledge and no context.
12
12
 
13
13
  ## The lesson
14
14
 
15
- - Define every term before use, even basic ones
16
15
  - Each section depends on the ones before
17
- - Open with an example, then a definition
16
+ - Define every term before use, even basic ones
@@ -11,13 +11,16 @@ import util from "util";
11
11
  import childProcess from "child_process";
12
12
  //#region package.json
13
13
  var name = "@hurshb50/setup-ubuntu";
14
- var version = "1.2.1";
14
+ var version = "1.3.0";
15
15
  //#endregion
16
16
  //#region source/modules/logger/logger.ts
17
17
  var Logger = class Logger {
18
18
  status;
19
19
  tasks;
20
20
  tick;
21
+ cursorHidden;
22
+ onExit;
23
+ onSignal;
21
24
  static check = "✔";
22
25
  static dots = [
23
26
  "⠋",
@@ -36,6 +39,12 @@ var Logger = class Logger {
36
39
  this.status = "idle";
37
40
  this.tasks = [];
38
41
  this.tick = 0;
42
+ this.cursorHidden = false;
43
+ this.onExit = () => this.restore();
44
+ this.onSignal = (signal) => {
45
+ this.restore();
46
+ process.kill(process.pid, signal);
47
+ };
39
48
  }
40
49
  add(task) {
41
50
  this.tasks.push(task);
@@ -43,6 +52,9 @@ var Logger = class Logger {
43
52
  start() {
44
53
  if (this.status !== "idle") throw new Error(`Cannot start task logger when status is '${this.status}'.`);
45
54
  this.status = "in-progress";
55
+ process.once("exit", this.onExit);
56
+ process.once("SIGINT", this.onSignal);
57
+ process.once("SIGTERM", this.onSignal);
46
58
  this.loop();
47
59
  }
48
60
  stop() {
@@ -51,6 +63,8 @@ var Logger = class Logger {
51
63
  }
52
64
  async loop() {
53
65
  const minimumIntervalMilliSeconds = 80;
66
+ this.log(escapes.cursorHide);
67
+ this.cursorHidden = true;
54
68
  this.newline();
55
69
  this.banner("Ubuntu Setup");
56
70
  this.newline();
@@ -63,7 +77,16 @@ var Logger = class Logger {
63
77
  }
64
78
  this.write();
65
79
  this.newline(this.tasks.length + 1);
80
+ this.restore();
81
+ }
82
+ restore() {
83
+ if (!this.cursorHidden) return;
66
84
  this.log(styles.reset.close);
85
+ this.log(escapes.cursorShow);
86
+ this.cursorHidden = false;
87
+ process.off("exit", this.onExit);
88
+ process.off("SIGINT", this.onSignal);
89
+ process.off("SIGTERM", this.onSignal);
67
90
  }
68
91
  write() {
69
92
  if (this.status === "idle") throw new Error("Cannot write to stdout if status is 'idle'.");
@@ -364,6 +387,25 @@ var Browser = class {
364
387
  }
365
388
  };
366
389
  //#endregion
390
+ //#region source/modules/clipboard/clipboard.ts
391
+ var Clipboard = class {
392
+ async install(context) {
393
+ const task = new Task("Clipboard");
394
+ context.logger.add(task);
395
+ task.start();
396
+ const dependencies = ["wl-clipboard", "xclip"];
397
+ if (await context.dependencyManager.isInstalled(dependencies)) {
398
+ task.finish();
399
+ return;
400
+ }
401
+ task.continue("Update package manager");
402
+ await context.dependencyManager.update(task);
403
+ task.continue(`Installing dependencies: ${dependencies.join(", ")}`);
404
+ await context.dependencyManager.install(dependencies, task);
405
+ task.finish();
406
+ }
407
+ };
408
+ //#endregion
367
409
  //#region source/modules/code-editor/code-editor.ts
368
410
  var CodeEditor = class {
369
411
  async install(context) {
@@ -603,7 +645,11 @@ var VersionControlSystem = class {
603
645
  const task = new Task("Version Control System");
604
646
  context.logger.add(task);
605
647
  task.start();
606
- const dependencies = ["git", "build-essential"];
648
+ const dependencies = [
649
+ "git",
650
+ "git-lfs",
651
+ "build-essential"
652
+ ];
607
653
  if (!await context.dependencyManager.isInstalled(dependencies)) {
608
654
  task.continue("Update package manager");
609
655
  await context.dependencyManager.update(task);
@@ -655,6 +701,7 @@ program.name(name).version(version).description("Sets up a fresh Ubuntu machine
655
701
  new AgentSkills(),
656
702
  new AutoSuggestion(),
657
703
  new Browser(),
704
+ new Clipboard(),
658
705
  new CodeEditor(),
659
706
  new CodeHost(),
660
707
  new ContainerEngine(),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hurshb50/setup-ubuntu",
3
- "version": "1.2.2",
3
+ "version": "1.4.0",
4
4
  "type": "module",
5
5
  "files": [
6
6
  "distribution"