palabra 1.3.0 → 1.5.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,15 @@
1
+ 2026.04.07, v1.5.0
2
+
3
+ feature:
4
+ - a0585cc palabra: add go
5
+ - 79be9ef letras: go: add
6
+
7
+ 2026.04.07, v1.4.0
8
+
9
+ feature:
10
+ - d621d90 palabra: |bash -> bash -c
11
+ - dc6726a bun: add
12
+
1
13
  2026.04.06, v1.3.0
2
14
 
3
15
  feature:
@@ -0,0 +1,7 @@
1
+ {
2
+ "name": "bun",
3
+ "url": "https://bun.sh/install",
4
+ "env": {
5
+ "BUN_INSTALL": "{{ camino }}"
6
+ }
7
+ }
package/letras/deno.json CHANGED
@@ -1,7 +1,6 @@
1
1
  {
2
2
  "name": "deno",
3
- "link": "https://deno.land/install.sh",
4
- "bin": "bin/deno",
3
+ "url": "https://deno.land/install.sh",
5
4
  "env": {
6
5
  "DENO_DIR": "{{ camino }}"
7
6
  }
package/letras/fasm.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "fasm",
3
3
  "version": "1.73.32",
4
- "link": "https://flatassembler.net/fasm-{{ version }}.tgz",
4
+ "url": "https://flatassembler.net/fasm-{{ version }}.tgz",
5
5
  "dir": "fasm",
6
6
  "bin": "fasm.x64"
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
+ }
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,7 +5,7 @@ const {entries} = Object;
5
5
  export const execute = (letra) => {
6
6
  const commands = [];
7
7
  const {
8
- link,
8
+ url,
9
9
  env = {},
10
10
  } = letra;
11
11
 
@@ -16,12 +16,14 @@ export const execute = (letra) => {
16
16
  envLine.push(`${name}=${envValue}`);
17
17
  }
18
18
 
19
+ const curl = `bash -c "$(curl -fsSL ${url})"`;
20
+
19
21
  if (!envLine.length) {
20
- commands.push(`curl -fsSL ${link} | sh`);
22
+ commands.push(curl);
21
23
  return commands;
22
24
  }
23
25
 
24
- commands.push(`${envLine.join(' ')} curl -fsSL ${link} | sh`);
26
+ commands.push(`${envLine.join(' ')} ${curl}`);
25
27
 
26
28
  return commands;
27
29
  };
@@ -1,25 +1,56 @@
1
- import {normalize} from 'node:path';
1
+ 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
+
5
9
  export const parse = (letra) => {
6
10
  const commands = [];
7
11
  const {
8
- link,
12
+ url,
9
13
  name,
10
- bin,
14
+ bin = `/bin/${name}`,
11
15
  camino,
12
16
  } = letra;
13
17
 
14
- const dirBin = normalize(`${camino}/../bin/${name}`);
18
+ const ext = extname(url);
15
19
 
16
- if (link.endsWith('tgz'))
20
+ if (ext === '.tgz' || ext === '.gz')
17
21
  commands.push(...unpack(letra));
18
22
 
19
- if (link.endsWith('sh'))
23
+ if (!ext || ext === '.sh')
20
24
  commands.push(...execute(letra));
21
25
 
22
- commands.push(`ln -fs ${camino}/${name}/${bin} ${dirBin}`);
26
+ commands.push(...createSymlinks({
27
+ camino,
28
+ name,
29
+ bin,
30
+ }));
23
31
 
24
32
  return commands;
25
33
  };
34
+
35
+ function createSymlinks({camino, name, bin}) {
36
+ const commands = [];
37
+ const parsedBin = parseBin(name, bin);
38
+
39
+ for (const [name, from] of entries(parsedBin)) {
40
+ const binFrom = join(camino, from);
41
+ const binTo = join(camino, '..', `bin/${name}`);
42
+
43
+ commands.push(`ln -fs ${binFrom} ${binTo}`);
44
+ }
45
+
46
+ return commands;
47
+ }
48
+
49
+ function parseBin(name, bin) {
50
+ if (isString(bin))
51
+ return {
52
+ [name]: `${name}/${bin}`,
53
+ };
54
+
55
+ return bin;
56
+ }
@@ -5,19 +5,18 @@ export const unpack = (letra) => {
5
5
  const commands = [];
6
6
  const {
7
7
  name,
8
- link,
8
+ url,
9
9
  camino,
10
10
  } = letra;
11
11
 
12
- const renderedLink = rendy(link, letra);
13
- const filename = basename(renderedLink);
12
+ const renderedurl = rendy(url, letra);
13
+ const filename = basename(renderedurl);
14
14
 
15
- commands.push(`wget ${renderedLink}`);
16
- commands.push(`tar zxf ${filename}`);
17
- commands.push(`rm ${filename}`);
18
- commands.push(`mkdir -p ${camino}`);
15
+ commands.push(`wget ${renderedurl}`);
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.3.0",
3
+ "version": "1.5.0",
4
4
  "type": "module",
5
5
  "author": "coderaiser <mnemonic.enemy@gmail.com> (https://github.com/coderaiser)",
6
6
  "description": "Palabra software installer",