palabra 1.2.0 → 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.
package/ChangeLog CHANGED
@@ -1,3 +1,14 @@
1
+ 2026.04.07, v1.4.0
2
+
3
+ feature:
4
+ - d621d90 palabra: |bash -> bash -c
5
+ - dc6726a bun: add
6
+
7
+ 2026.04.06, v1.3.0
8
+
9
+ feature:
10
+ - f0b2ce6 palabra: env: add
11
+
1
12
  2026.04.06, v1.2.0
2
13
 
3
14
  feature:
@@ -0,0 +1,7 @@
1
+ {
2
+ "name": "bun",
3
+ "url": "https://bun.sh/install",
4
+ "env": {
5
+ "BUN_INSTALL": "{{ camino }}"
6
+ }
7
+ }
@@ -0,0 +1,7 @@
1
+ {
2
+ "name": "deno",
3
+ "url": "https://deno.land/install.sh",
4
+ "env": {
5
+ "DENO_DIR": "{{ camino }}"
6
+ }
7
+ }
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
  }
@@ -0,0 +1,29 @@
1
+ import {rendy} from 'rendy';
2
+
3
+ const {entries} = Object;
4
+
5
+ export const execute = (letra) => {
6
+ const commands = [];
7
+ const {
8
+ url,
9
+ env = {},
10
+ } = letra;
11
+
12
+ const envLine = [];
13
+
14
+ for (const [name, value] of entries(env)) {
15
+ const envValue = rendy(value, letra);
16
+ envLine.push(`${name}=${envValue}`);
17
+ }
18
+
19
+ const curl = `bash -c "$(curl -fsSL ${url})"`;
20
+
21
+ if (!envLine.length) {
22
+ commands.push(curl);
23
+ return commands;
24
+ }
25
+
26
+ commands.push(`${envLine.join(' ')} ${curl}`);
27
+
28
+ return commands;
29
+ };
@@ -1,26 +1,28 @@
1
- import {basename, normalize} from 'node:path';
2
- import {rendy} from 'rendy';
1
+ import {extname, join} from 'node:path';
2
+ import {unpack} from './unpack.js';
3
+ import {execute} from './execute.js';
3
4
 
4
5
  export const parse = (letra) => {
5
6
  const commands = [];
6
7
  const {
7
- link,
8
+ url,
8
9
  name,
9
- bin,
10
+ bin = `/bin/${name}`,
10
11
  camino,
11
12
  } = letra;
12
13
 
13
- const renderedLink = rendy(link, letra);
14
- const filename = basename(renderedLink);
15
- const dirBin = normalize(`${camino}/../bin/${name}`);
14
+ const binTo = join(camino, '..', `bin/${name}`);
16
15
 
17
- commands.push(`wget ${renderedLink}`);
18
- commands.push(`tar zxf ${filename}`);
19
- commands.push(`rm ${filename}`);
20
- commands.push(`mkdir -p ${camino}`);
21
- commands.push(`rm -rf ${camino}/${name}`);
22
- commands.push(`mv -f ${name} ${camino}/${name}`);
23
- commands.push(`ln -fs ${camino}/${name}/${bin} ${dirBin}`);
16
+ const ext = extname(url);
17
+
18
+ if (ext === '.tgz')
19
+ commands.push(...unpack(letra));
20
+
21
+ if (!ext || ext === '.sh')
22
+ commands.push(...execute(letra));
23
+
24
+ const binFrom = join(camino, name, bin);
25
+ commands.push(`ln -fs ${binFrom} ${binTo}`);
24
26
 
25
27
  return commands;
26
28
  };
@@ -0,0 +1,23 @@
1
+ import {basename} from 'node:path';
2
+ import {rendy} from 'rendy';
3
+
4
+ export const unpack = (letra) => {
5
+ const commands = [];
6
+ const {
7
+ name,
8
+ url,
9
+ camino,
10
+ } = letra;
11
+
12
+ const renderedurl = rendy(url, letra);
13
+ const filename = basename(renderedurl);
14
+
15
+ commands.push(`wget ${renderedurl}`);
16
+ commands.push(`tar zxf ${filename}`);
17
+ commands.push(`rm ${filename}`);
18
+ commands.push(`mkdir -p ${camino}`);
19
+ commands.push(`rm -rf ${camino}/${name}`);
20
+ commands.push(`mv -f ${name} ${camino}/${name}`);
21
+
22
+ return commands;
23
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "palabra",
3
- "version": "1.2.0",
3
+ "version": "1.4.0",
4
4
  "type": "module",
5
5
  "author": "coderaiser <mnemonic.enemy@gmail.com> (https://github.com/coderaiser)",
6
6
  "description": "Palabra software installer",