palabra 1.8.0 → 1.8.2

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.08, v1.8.2
2
+
3
+ feature:
4
+ - dd5c303 palabra: -v
5
+
6
+ 2026.04.08, v1.8.1
7
+
8
+ feature:
9
+ - 2fd25ef palabra: camino -> directorio
10
+
1
11
  2026.04.08, v1.8.0
2
12
 
3
13
  feature:
@@ -38,7 +48,7 @@ feature:
38
48
  2026.04.06, v1.2.0
39
49
 
40
50
  feature:
41
- - b14dbe6 palabra: camino: add
51
+ - b14dbe6 palabra: directorio: add
42
52
 
43
53
  2026.04.06, v1.1.0
44
54
 
package/README.md CHANGED
@@ -28,7 +28,7 @@ First thing you should do is:
28
28
 
29
29
  ```json
30
30
  {
31
- "camino": "~/.local/src",
31
+ "directorio": "~/.local/src",
32
32
  "letras": {
33
33
  "fasm": "*"
34
34
  }
@@ -41,12 +41,12 @@ Then run:
41
41
  palabra
42
42
  ```
43
43
 
44
- ### `i`nstall
44
+ ### `i`
45
45
 
46
46
  You can also use interactive mode:
47
47
 
48
48
  ```
49
- palabra i bun node deno rust go nvim fasm
49
+ palabra i bun node deno rust go nvim fasm -d /usr/local/src
50
50
  ```
51
51
 
52
52
  That's it!
package/bin/palabra.js CHANGED
@@ -3,12 +3,20 @@
3
3
  import process from 'node:process';
4
4
  import {execa} from 'execa';
5
5
  import {tryToCatch} from 'try-to-catch';
6
- import {parseArgs} from '../lib/parse-args.js';
6
+ import {parseArgs} from '../lib/cli/parse-args.js';
7
7
  import {instalar} from '../lib/cli/instalar.js';
8
+ import info from '../package.json' with {
9
+ type: 'json',
10
+ };
8
11
 
9
12
  const argv = process.argv.slice(2);
10
13
  const args = parseArgs(argv);
11
14
 
15
+ if (args.version) {
16
+ console.log(`v${info.version}`);
17
+ process.exit();
18
+ }
19
+
12
20
  const instrucciones = args._.shift();
13
21
 
14
22
  let cmd = '';
@@ -2,6 +2,6 @@
2
2
  "name": "bun",
3
3
  "url": "https://bun.sh/install",
4
4
  "env": {
5
- "BUN_INSTALL": "{{ camino }}/bun"
5
+ "BUN_INSTALL": "{{ directorio }}/bun"
6
6
  }
7
7
  }
@@ -2,6 +2,6 @@
2
2
  "name": "deno",
3
3
  "url": "https://deno.land/install.sh",
4
4
  "env": {
5
- "DENO_DIR": "{{ camino }}/deno"
5
+ "DENO_DIR": "{{ directorio }}/deno"
6
6
  }
7
7
  }
@@ -3,7 +3,7 @@
3
3
  "url": "https://sh.rustup.rs",
4
4
  "confirmar": false,
5
5
  "env": {
6
- "RUSTUP_HOME": "{{ camino }}/rustup",
7
- "CARGO_HOME": "{{ camino }}/cargo"
6
+ "RUSTUP_HOME": "{{ directorio }}/rustup",
7
+ "CARGO_HOME": "{{ directorio }}/cargo"
8
8
  }
9
9
  }
package/lib/buscar.js CHANGED
@@ -10,14 +10,14 @@ export const buscar = async (name, values = {}) => {
10
10
  };
11
11
 
12
12
  const version = values.version || data.version;
13
- const {camino} = values;
13
+ const {directorio} = values;
14
14
 
15
15
  return {
16
16
  encontro: true,
17
17
  confirmar: true,
18
18
  ...data,
19
19
  version,
20
- camino,
20
+ directorio,
21
21
  };
22
22
  };
23
23
 
@@ -0,0 +1,13 @@
1
+ import yargsParse from 'yargs-parser';
2
+
3
+ export const parseArgs = (args) => {
4
+ return yargsParse(args, {
5
+ alias: {
6
+ q: 'quiet',
7
+ h: 'help',
8
+ d: 'directorio',
9
+ v: 'version',
10
+ },
11
+ boolean: ['quiet', 'help', 'dry-run', 'directorio', 'version'],
12
+ });
13
+ };
package/lib/escuchar.js CHANGED
@@ -5,14 +5,14 @@ const {entries} = Object;
5
5
  export const escuchar = async (palabras) => {
6
6
  const silabas = [];
7
7
  const {
8
- camino = '~/.local/src',
8
+ directorio = '~/.local/src',
9
9
  letras = [],
10
10
  } = palabras;
11
11
 
12
12
  for (const [name, version] of entries(letras)) {
13
13
  silabas.push(buscar(name, {
14
14
  version,
15
- camino,
15
+ directorio,
16
16
  }));
17
17
  }
18
18
 
@@ -8,7 +8,7 @@ const isString = (a) => typeof a === 'string';
8
8
 
9
9
  const addDefaults = (letra) => ({
10
10
  confirmar: true,
11
- camino: '~/.local/src',
11
+ directorio: '~/.local/src',
12
12
  ...letra,
13
13
  });
14
14
 
@@ -20,7 +20,7 @@ export const parse = (letra) => {
20
20
  url,
21
21
  name,
22
22
  bin = `/bin/${name}`,
23
- camino,
23
+ directorio,
24
24
  } = letra;
25
25
 
26
26
  const ext = extname(new URL(url).pathname);
@@ -32,7 +32,7 @@ export const parse = (letra) => {
32
32
  commands.push(...execute(letra));
33
33
 
34
34
  commands.push(...createSymlinks({
35
- camino,
35
+ directorio,
36
36
  name,
37
37
  bin,
38
38
  }));
@@ -40,13 +40,13 @@ export const parse = (letra) => {
40
40
  return commands;
41
41
  };
42
42
 
43
- function createSymlinks({camino, name, bin}) {
43
+ function createSymlinks({directorio, name, bin}) {
44
44
  const commands = [];
45
45
  const parsedBin = parseBin(name, bin);
46
46
 
47
47
  for (const [name, from] of entries(parsedBin)) {
48
- const binFrom = join(camino, from);
49
- const binTo = join(camino, '..', `bin/${name}`);
48
+ const binFrom = join(directorio, from);
49
+ const binTo = join(directorio, '..', `bin/${name}`);
50
50
 
51
51
  commands.push(`ln -fs ${binFrom} ${binTo}`);
52
52
  }
@@ -6,16 +6,16 @@ export const unpack = (letra) => {
6
6
  const {
7
7
  name,
8
8
  url,
9
- camino,
9
+ directorio,
10
10
  } = letra;
11
11
 
12
12
  const renderedurl = rendy(url, letra);
13
13
  const filename = basename(renderedurl);
14
14
 
15
15
  commands.push(`wget ${renderedurl}`);
16
- commands.push(`rm -rf ${camino}/${name}`);
17
- commands.push(`mkdir -p ${camino}/${name}`);
18
- commands.push(`tar zxf ${filename} -C ${camino}/${name}`);
16
+ commands.push(`rm -rf ${directorio}/${name}`);
17
+ commands.push(`mkdir -p ${directorio}/${name}`);
18
+ commands.push(`tar zxf ${filename} -C ${directorio}/${name}`);
19
19
  commands.push(`rm ${filename}`);
20
20
 
21
21
  return commands;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "palabra",
3
- "version": "1.8.0",
3
+ "version": "1.8.2",
4
4
  "type": "module",
5
5
  "author": "coderaiser <mnemonic.enemy@gmail.com> (https://github.com/coderaiser)",
6
6
  "description": "Palabra software installer",
package/lib/parse-args.js DELETED
@@ -1,14 +0,0 @@
1
- import yargsParse from 'yargs-parser';
2
-
3
- export const parseArgs = (args) => {
4
- return yargsParse(args, {
5
- alias: {
6
- 'install': 'i',
7
- 'instalar': 'install',
8
- 'quiet': 'q',
9
- 'help': 'h',
10
- 'dry-run': 'd',
11
- },
12
- boolean: ['install', 'quiet', 'help', 'dry-run'],
13
- });
14
- };