palabra 2.4.3 → 2.4.5

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/ChangeLog CHANGED
@@ -1,3 +1,13 @@
1
+ 2026.04.14, v2.4.5
2
+
3
+ feature:
4
+ - b5149ab parse: letra -> tinta
5
+
6
+ 2026.04.14, v2.4.4
7
+
8
+ feature:
9
+ - b6a4437 palabra: parser: prepare
10
+
1
11
  2026.04.14, v2.4.3
2
12
 
3
13
  feature:
package/README.md CHANGED
@@ -9,7 +9,9 @@
9
9
  [CoverageURL]: https://coveralls.io/github/coderaiser/palabra?branch=master
10
10
  [CoverageIMGURL]: https://coveralls.io/repos/coderaiser/palabra/badge.svg?branch=master&service=github
11
11
 
12
- Install software easier then ever before.
12
+ Install packages easier than ever before.
13
+ Palabra install packages named letras, each letra is a set of commands, written in declarative form,
14
+ and compiled during install to bash script.
13
15
 
14
16
  <img width="546" height="405" alt="image" src="https://github.com/user-attachments/assets/272fb625-a51e-488f-9d58-89268f810efb" />
15
17
 
@@ -40,12 +42,12 @@ Then run:
40
42
  palabra
41
43
  ```
42
44
 
43
- ### `i`
45
+ ### `(i)nstall`
44
46
 
45
47
  You can also use interactive mode:
46
48
 
47
49
  ```
48
- palabra i bun node deno rust go nvim fasm -d /usr/local/src
50
+ palabra install bun node deno rust go nvim fasm -d /usr/local/src
49
51
  ```
50
52
 
51
53
  You can also pass version:
@@ -56,7 +58,7 @@ palabra i nvim@0.11
56
58
 
57
59
  Default installation directory is `~/.local/src`.
58
60
 
59
- ### `l`
61
+ ### `list`
60
62
 
61
63
  To list all packages that can be installed use `l`:
62
64
 
@@ -76,6 +78,35 @@ Use `PALABRA_DIR` or [`XDG_DATA_HOME`](https://specifications.freedesktop.org/ba
76
78
 
77
79
  That's it!
78
80
 
81
+ ## Types of letras
82
+
83
+ There is a different types of letras. Each author release in one of next ways.
84
+
85
+ ### Single binary
86
+
87
+ Provided url to executable, that should be downloaded and set `chmod +x`, and
88
+ then copy to directory `$PALABRA_DIR` and make symlinks.
89
+
90
+ ### Single Binary archive
91
+
92
+ Provided url to archive with single executable, that should be downloaded, and
93
+ then copy to directory `$PALABRA_DIR` and made symlinks.
94
+
95
+ ### Nested archive
96
+
97
+ Provided url to archive with nested directory structure, that should be downloaded,
98
+ extracted and then copied to directory `$PALABRA_DIR` and made symlinks.
99
+
100
+ ### Root archive
101
+
102
+ Provided url to archive with all files located on top level, that should be downloaded,
103
+ extracted and then copied to directory `$PALABRA_DIR` and made symlinks.
104
+
105
+ ### Script
106
+
107
+ Provided url to script that should be downloaded and executed
108
+
109
+
79
110
  ## License
80
111
 
81
112
  MIT
@@ -2,6 +2,6 @@
2
2
  "name": "oxker",
3
3
  "version": "0.13.1",
4
4
  "url": "https://github.com/mrjackwills/oxker/releases/download/v{{ version }}/oxker_linux_x86_64.tar.gz",
5
- "bin": "",
6
- "test": "oxker --version"
5
+ "test": "oxker --version",
6
+ "type": "root-archive"
7
7
  }
@@ -6,6 +6,7 @@ import {execute, isExecute} from './execute.js';
6
6
  import {parseEnv} from './parse-env.js';
7
7
  import {run} from './run.js';
8
8
  import {download} from './download.js';
9
+ import {prepare} from './prepare.js';
9
10
 
10
11
  const {isArray} = Array;
11
12
  const maybeArray = (a) => isArray(a) ? a : [a];
@@ -16,17 +17,10 @@ const {entries} = Object;
16
17
 
17
18
  const isString = (a) => typeof a === 'string';
18
19
 
19
- const addDefaults = (letra) => ({
20
- confirmar: true,
21
- directorio: '~/.local/share',
22
- ...letra,
23
- });
24
-
25
20
  export const parse = (letra) => {
26
- letra = addDefaults(letra);
27
- const envLine = parseEnv(letra);
28
-
21
+ const tinta = prepare(letra);
29
22
  const commands = [];
23
+
30
24
  const {
31
25
  url,
32
26
  beforeInstall,
@@ -34,61 +28,55 @@ export const parse = (letra) => {
34
28
  test,
35
29
  name,
36
30
  bin = `/bin/${name}`,
37
- hogar = name,
38
31
  directorio,
39
- executable,
40
- } = letra;
32
+ } = tinta;
33
+
34
+ const envLine = parseEnv(tinta);
41
35
 
42
36
  if (beforeInstall)
43
37
  commands.push(...run({
44
- letra,
38
+ letra: tinta,
45
39
  commands: beforeInstall,
46
40
  envLine,
47
41
  }));
48
42
 
49
- if (letra.preparado)
50
- commands.push(...download(letra));
51
- else if (isArchive(letra))
52
- commands.push(...extract(letra));
53
- else if (isExecute(letra))
54
- commands.push(...execute(letra));
43
+ if (tinta.preparado)
44
+ commands.push(...download(tinta));
45
+ else if (isArchive(tinta))
46
+ commands.push(...extract(tinta));
47
+ else if (isExecute(tinta))
48
+ commands.push(...execute(tinta));
55
49
 
56
- if (isBool(letra.execute) && !letra.execute) {
57
- const renderedURL = rendy(url, letra);
50
+ if (isBool(tinta.execute) && !tinta.execute) {
51
+ const renderedURL = rendy(url, tinta);
58
52
  commands.push(`curl -fsSL ${renderedURL}`);
59
53
  }
60
54
 
61
- commands.push(...createSymlinks({
62
- directorio,
63
- hogar,
64
- name,
65
- bin,
66
- executable,
67
- }));
55
+ commands.push(...createSymlinks(tinta));
68
56
 
69
- if (letra.rename)
70
- commands.push(...rename(letra));
57
+ if (tinta.rename)
58
+ commands.push(...rename(tinta));
71
59
 
72
- if (letra.commands)
60
+ if (tinta.commands)
73
61
  commands.push(...run({
74
- letra,
75
- commands: letra.commands,
62
+ letra: tinta,
63
+ commands: tinta.commands,
76
64
  envLine,
77
65
  }));
78
66
 
79
67
  if (afterInstall)
80
68
  commands.push(...run({
81
- letra,
69
+ letra: tinta,
82
70
  commands: afterInstall,
83
71
  envLine,
84
72
  }));
85
73
 
86
- if (letra.executable && isString(bin))
87
- commands.push(`chmod +x ${rendy(join(directorio, name, bin), letra)}`);
74
+ if (tinta.executable && isString(bin))
75
+ commands.push(`chmod +x ${rendy(join(directorio, name, bin), tinta)}`);
88
76
 
89
77
  if (test)
90
78
  for (const testCommand of maybeArray(test)) {
91
- const cmd = rendy(testCommand, letra);
79
+ const cmd = rendy(testCommand, tinta);
92
80
 
93
81
  if (envLine) {
94
82
  commands.push(`${envLine}${cmd}`);
@@ -0,0 +1,27 @@
1
+ const parseBin = ({name, type}) => {
2
+ if (type === 'root-archive')
3
+ return '';
4
+
5
+ return `/bin/${name}`;
6
+ };
7
+
8
+ export const prepare = (letra) => {
9
+ const {
10
+ confirmar = true,
11
+ directorio = '~/.local/share',
12
+ url,
13
+ name,
14
+ bin = parseBin(letra),
15
+ hogar = name,
16
+ } = letra;
17
+
18
+ return {
19
+ confirmar,
20
+ directorio,
21
+ url,
22
+ name,
23
+ bin,
24
+ hogar,
25
+ ...letra,
26
+ };
27
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "palabra",
3
- "version": "2.4.3",
3
+ "version": "2.4.5",
4
4
  "type": "module",
5
5
  "author": "coderaiser <mnemonic.enemy@gmail.com> (https://github.com/coderaiser)",
6
6
  "description": "Palabra software installer",