palabra 1.4.0 → 1.6.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.
package/ChangeLog CHANGED
@@ -1,3 +1,14 @@
1
+ 2026.04.07, v1.6.0
2
+
3
+ feature:
4
+ - 76ed3a4 palabra: rust: add
5
+
6
+ 2026.04.07, v1.5.0
7
+
8
+ feature:
9
+ - a0585cc palabra: add go
10
+ - 79be9ef letras: go: add
11
+
1
12
  2026.04.07, v1.4.0
2
13
 
3
14
  feature:
package/letras/bun.json CHANGED
@@ -2,6 +2,6 @@
2
2
  "name": "bun",
3
3
  "url": "https://bun.sh/install",
4
4
  "env": {
5
- "BUN_INSTALL": "{{ camino }}"
5
+ "BUN_INSTALL": "{{ camino }}/bun"
6
6
  }
7
7
  }
package/letras/deno.json CHANGED
@@ -2,6 +2,6 @@
2
2
  "name": "deno",
3
3
  "url": "https://deno.land/install.sh",
4
4
  "env": {
5
- "DENO_DIR": "{{ camino }}"
5
+ "DENO_DIR": "{{ camino }}/deno"
6
6
  }
7
7
  }
package/letras/go.json ADDED
@@ -0,0 +1,9 @@
1
+ {
2
+ "name": "go",
3
+ "version": "1.21.2",
4
+ "bin": {
5
+ "go": "bin/go",
6
+ "gofmt": "bin/gofmt"
7
+ },
8
+ "url": "https://go.dev/dl/go${{ version }}.linux-amd64.tar.gz"
9
+ }
@@ -0,0 +1,9 @@
1
+ {
2
+ "name": "rust",
3
+ "url": "https://sh.rustup.rs",
4
+ "confirmar": false,
5
+ "env": {
6
+ "RUSTUP_HOME": "{{ camino }}/rustup",
7
+ "CARGO_HOME": "{{ camino }}/cargo"
8
+ }
9
+ }
package/lib/buscar.js CHANGED
@@ -14,6 +14,7 @@ export const buscar = async (name, values = {}) => {
14
14
 
15
15
  return {
16
16
  encontro: true,
17
+ confirmar: true,
17
18
  ...data,
18
19
  version,
19
20
  camino,
package/lib/hablar.js CHANGED
@@ -12,8 +12,6 @@ export const hablar = (silabas) => {
12
12
  }
13
13
 
14
14
  commands.push(...parse(letra));
15
-
16
- return commands;
17
15
  }
18
16
 
19
17
  return commands;
@@ -5,18 +5,22 @@ const {entries} = Object;
5
5
  export const execute = (letra) => {
6
6
  const commands = [];
7
7
  const {
8
+
8
9
  url,
9
10
  env = {},
11
+ confirmar,
10
12
  } = letra;
11
13
 
12
14
  const envLine = [];
13
15
 
14
16
  for (const [name, value] of entries(env)) {
15
17
  const envValue = rendy(value, letra);
18
+
16
19
  envLine.push(`${name}=${envValue}`);
17
20
  }
18
21
 
19
- const curl = `bash -c "$(curl -fsSL ${url})"`;
22
+ const arg = confirmar ? '' : ' -- -y';
23
+ const curl = `bash -c "$(curl -fsSL ${url})"${arg}`;
20
24
 
21
25
  if (!envLine.length) {
22
26
  commands.push(curl);
@@ -2,7 +2,19 @@ import {extname, join} from 'node:path';
2
2
  import {unpack} from './unpack.js';
3
3
  import {execute} from './execute.js';
4
4
 
5
+ const {entries} = Object;
6
+
7
+ const isString = (a) => typeof a === 'string';
8
+
9
+ const addDefaults = (letra) => ({
10
+ confirmar: true,
11
+ camino: '~/.local/src',
12
+ ...letra,
13
+ });
14
+
5
15
  export const parse = (letra) => {
16
+ letra = addDefaults(letra);
17
+
6
18
  const commands = [];
7
19
  const {
8
20
  url,
@@ -11,18 +23,42 @@ export const parse = (letra) => {
11
23
  camino,
12
24
  } = letra;
13
25
 
14
- const binTo = join(camino, '..', `bin/${name}`);
26
+ const ext = extname(new URL(url).pathname);
15
27
 
16
- const ext = extname(url);
17
-
18
- if (ext === '.tgz')
28
+ if (ext === '.tgz' || ext === '.gz')
19
29
  commands.push(...unpack(letra));
20
30
 
21
31
  if (!ext || ext === '.sh')
22
32
  commands.push(...execute(letra));
23
33
 
24
- const binFrom = join(camino, name, bin);
25
- commands.push(`ln -fs ${binFrom} ${binTo}`);
34
+ commands.push(...createSymlinks({
35
+ camino,
36
+ name,
37
+ bin,
38
+ }));
26
39
 
27
40
  return commands;
28
41
  };
42
+
43
+ function createSymlinks({camino, name, bin}) {
44
+ const commands = [];
45
+ const parsedBin = parseBin(name, bin);
46
+
47
+ for (const [name, from] of entries(parsedBin)) {
48
+ const binFrom = join(camino, from);
49
+ const binTo = join(camino, '..', `bin/${name}`);
50
+
51
+ commands.push(`ln -fs ${binFrom} ${binTo}`);
52
+ }
53
+
54
+ return commands;
55
+ }
56
+
57
+ function parseBin(name, bin) {
58
+ if (isString(bin))
59
+ return {
60
+ [name]: `${name}/${bin}`,
61
+ };
62
+
63
+ return bin;
64
+ }
@@ -13,11 +13,10 @@ export const unpack = (letra) => {
13
13
  const filename = basename(renderedurl);
14
14
 
15
15
  commands.push(`wget ${renderedurl}`);
16
- commands.push(`tar zxf ${filename}`);
17
- commands.push(`rm ${filename}`);
18
- commands.push(`mkdir -p ${camino}`);
19
16
  commands.push(`rm -rf ${camino}/${name}`);
20
- commands.push(`mv -f ${name} ${camino}/${name}`);
17
+ commands.push(`mkdir -p ${camino}/${name}`);
18
+ commands.push(`tar zxf ${filename} -C ${camino}/${name}`);
19
+ commands.push(`rm ${filename}`);
21
20
 
22
21
  return commands;
23
22
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "palabra",
3
- "version": "1.4.0",
3
+ "version": "1.6.0",
4
4
  "type": "module",
5
5
  "author": "coderaiser <mnemonic.enemy@gmail.com> (https://github.com/coderaiser)",
6
6
  "description": "Palabra software installer",