palabra 1.8.0 → 1.8.1
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 +6 -1
- package/README.md +3 -3
- package/bin/palabra.js +1 -1
- package/letras/bun/bun.json +1 -1
- package/letras/deno/deno.json +1 -1
- package/letras/rust/rust.json +2 -2
- package/lib/buscar.js +2 -2
- package/lib/cli/parse-args.js +12 -0
- package/lib/escuchar.js +2 -2
- package/lib/parser/parser.js +6 -6
- package/lib/parser/unpack.js +4 -4
- package/package.json +1 -1
- package/lib/parse-args.js +0 -14
package/ChangeLog
CHANGED
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
2026.04.08, v1.8.1
|
|
2
|
+
|
|
3
|
+
feature:
|
|
4
|
+
- 2fd25ef palabra: camino -> directorio
|
|
5
|
+
|
|
1
6
|
2026.04.08, v1.8.0
|
|
2
7
|
|
|
3
8
|
feature:
|
|
@@ -38,7 +43,7 @@ feature:
|
|
|
38
43
|
2026.04.06, v1.2.0
|
|
39
44
|
|
|
40
45
|
feature:
|
|
41
|
-
- b14dbe6 palabra:
|
|
46
|
+
- b14dbe6 palabra: directorio: add
|
|
42
47
|
|
|
43
48
|
2026.04.06, v1.1.0
|
|
44
49
|
|
package/README.md
CHANGED
|
@@ -28,7 +28,7 @@ First thing you should do is:
|
|
|
28
28
|
|
|
29
29
|
```json
|
|
30
30
|
{
|
|
31
|
-
"
|
|
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`
|
|
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,7 +3,7 @@
|
|
|
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
8
|
|
|
9
9
|
const argv = process.argv.slice(2);
|
package/letras/bun/bun.json
CHANGED
package/letras/deno/deno.json
CHANGED
package/letras/rust/rust.json
CHANGED
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 {
|
|
13
|
+
const {directorio} = values;
|
|
14
14
|
|
|
15
15
|
return {
|
|
16
16
|
encontro: true,
|
|
17
17
|
confirmar: true,
|
|
18
18
|
...data,
|
|
19
19
|
version,
|
|
20
|
-
|
|
20
|
+
directorio,
|
|
21
21
|
};
|
|
22
22
|
};
|
|
23
23
|
|
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
|
-
|
|
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
|
-
|
|
15
|
+
directorio,
|
|
16
16
|
}));
|
|
17
17
|
}
|
|
18
18
|
|
package/lib/parser/parser.js
CHANGED
|
@@ -8,7 +8,7 @@ const isString = (a) => typeof a === 'string';
|
|
|
8
8
|
|
|
9
9
|
const addDefaults = (letra) => ({
|
|
10
10
|
confirmar: true,
|
|
11
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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({
|
|
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(
|
|
49
|
-
const binTo = join(
|
|
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
|
}
|
package/lib/parser/unpack.js
CHANGED
|
@@ -6,16 +6,16 @@ export const unpack = (letra) => {
|
|
|
6
6
|
const {
|
|
7
7
|
name,
|
|
8
8
|
url,
|
|
9
|
-
|
|
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 ${
|
|
17
|
-
commands.push(`mkdir -p ${
|
|
18
|
-
commands.push(`tar zxf ${filename} -C ${
|
|
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
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
|
-
};
|